Repository navigation
Shaders: the fused multiply-add probe binds a sampler heap - #2041
0xkn0wh3r3 wants to merge 2 commits into
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):
cargo test -p victory-shader --lib making_the_host_leaves_no_debug_layer_errors— passed on both RTX 5090 hardware andVICTORY_D3D12_WARP=1cargo clippy -p victory-gpu -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean fix binding a sampler heap for the FMA probe so host initialization produces zero D3D12 debug layer errors. Looks good.
AI-assisted (Gemini 4 Neon).
|
Triage verdict — Keep the binding fix, make debug-layer coverage observable ( Evidence
Checks and limits
Next step
This verification was AI-assisted. |
catminou4
left a comment
There was a problem hiding this comment.
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main 940d32f, cargo test -p victory-shader --locked.
144 passed / 0 failed / 2 ignored. Fused multiply-add probe binds a sampler heap — probe-path fix; mixed gpu+shader, gpu half Windows-only.
Review (Marvisak#2041): `making_the_host_leaves_no_debug_layer_errors` passed without having read the debug layer's messages when the child process had no device or no layer, so a green result did not show the check had run. The child now prints its outcome: `checked` once it has read the layer's messages, or `skipped:` and why. The parent prints a skip as one, fails when the child says neither, and fails a skip when `VICTORY_REQUIRE_DEBUG_LAYER=1` asks for the check to run (for a deliberate debug-layer verification). Checked on an RTX 5070 Ti with the layer installed (checked), and with the layer test forced off (skipped, and failed with the switch set).
|
Thanks @jeremygold02, done in On an RTX 5070 Ti with the layer installed it reports |
|
Automated triage for the maintainers. Needs work: needs the maintainer's decision.
On your reply: agreed with the plan. Once #2922 lands, rebasing to drop CI: passing ( Generated by Claude Code |
Offline measurement on a retail dumpResult: no count change against I merged head e54d51d onto No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right. No shader names or data are included, per the asset policy. AI-assisted (Claude Code). |
Review (Marvisak#2041): `making_the_host_leaves_no_debug_layer_errors` passed without having read the debug layer's messages when the child process had no device or no layer, so a green result did not show the check had run. The child now prints its outcome: `checked` once it has read the layer's messages, or `skipped:` and why. The parent prints a skip as one, fails when the child says neither, and fails a skip when `VICTORY_REQUIRE_DEBUG_LAYER=1` asks for the check to run (for a deliberate debug-layer verification). Checked on an RTX 5070 Ti with the layer installed (checked), and with the layer test forced off (skipped, and failed with the switch set).
e54d51d to
8335ff0
Compare
`emit::host::Host::fuses_fmad` (run once as the host is made, to tell whether the GPU fuses `mad`) records its dispatch with the root signature a translated program gets, which indexes the sampler heap directly, but bound only a view heap. D3D12 requires a sampler heap bound before such a root signature is set; the debug layer reports it on every start (id 1419, "SetDescriptorHeaps must be called to bind a sampler descriptor before setting a root signature with D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED"), the first error of the run, which the debug layer's report of a later failure can lead with. The other probes in the file bind one already. It now binds a one-slot sampler heap with its view heap. Tests can now run under the debug layer: `host::rerun_with_debug_layer` runs a test again in a child process with `VICTORY_D3D12_DEBUG=1` (diagnostics builds; the host is made once per process), and the errors `Host::log_messages` reads are kept for the test. `host::tests::making_the_host_leaves_no_debug_layer_errors` makes the host there and finds no errors; without the fix it fails with the one above.
Review (Marvisak#2041): `making_the_host_leaves_no_debug_layer_errors` passed without having read the debug layer's messages when the child process had no device or no layer, so a green result did not show the check had run. The child now prints its outcome: `checked` once it has read the layer's messages, or `skipped:` and why. The parent prints a skip as one, fails when the child says neither, and fails a skip when `VICTORY_REQUIRE_DEBUG_LAYER=1` asks for the check to run (for a deliberate debug-layer verification). Checked on an RTX 5070 Ti with the layer installed (checked), and with the layer test forced off (skipped, and failed with the switch set).
8335ff0 to
f42add1
Compare
|
Thanks for the triage.
|
The problem
With the D3D12 debug layer on, every start reports an error before any title work runs. It is the first error of the run, so when a later failure happens, the debug layer's report of that failure can lead with this unrelated one.
The cause is
emit::host::Host::fuses_fmad. It runs once as the host is made, to tell whether the GPU fusesmad. It records its dispatch with the root signature a translated program gets, which indexes the sampler heap directly, but it bound only a view heap. D3D12 requires a sampler heap bound before such a root signature is set. The debug layer reports:The other probes in the file bind one already.
How it was found
Running
cargo test -p victory-gpu --features diagnosticswithVICTORY_D3D12_DEBUG=1and printing whatHost::log_messagesreads. The same run also reports barrier errors from a depth twin's copies in a list's prelude (draw::tests::a_depth_texture_written_through_unordered_views_reads_as_depth, second round). #1803 already fixes those, so that part is not here.The fix
host::rerun_with_debug_layerruns a test again in a child process withVICTORY_D3D12_DEBUG=1(diagnostics builds only; the host is made once per process, so it can only get the layer at its start). The errorsHost::log_messagesreads are kept for the test. The child prints its outcome (checkedonce it has read the layer's messages, orskipped:and why); the parent fails if it says neither, and fails a skip whenVICTORY_REQUIRE_DEBUG_LAYER=1is set.Testing
host::tests::making_the_host_leaves_no_debug_layer_errors: makes the host under the debug layer and finds no errors. Without the fix it fails with the error above.cargo test -p victory-gpu --features diagnostics --libon an RTX 5070 Ti (driver 621.24, debug layer installed): the new test passes; it fails onmainwith the error above. All other tests pass exceptdescriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views, which fail the same way onmain(NVIDIA D3D12 (70564ae): stride_tests & synthetic_tests fail due to HEAP_VIEWS (2M > 1M NVIDIA limit) and Stride::Structured with rawBufferLoad #1835). Withoutdiagnostics, the new test is not built.cargo test --release -p victory-shader --lib: 244 passed. The 3 failures (emit::stride_tests::*x2,emit::synthetic_tests::gathers_at_a_level_match_the_hardware) fail the same way onmainon this GPU (NVIDIA D3D12 (70564ae): stride_tests & synthetic_tests fail due to HEAP_VIEWS (2M > 1M NVIDIA limit) and Stride::Structured with rawBufferLoad #1835).cargo clippy -p victory-gpu --all-targetswith and without--features diagnostics, andcargo clippy -p victory-shader --all-targets --features host: clean.Related
#1803 fixes the depth twin's barrier errors seen in the same run.
rerun_with_debug_layerwould give #1803 a regression test the same way.