Repository navigation
Conversation
…ckends Phase 7 of the direct DXIL spec (default-on for covered shaders) needs proof that the direct translator draws what the HLSL + DXC path draws. The GPU tests that translate console VS / PS code now, with XCL_DXIL_DIFF=1, draw a second time with the direct translations of the same code and compare the render targets bit for bit (recomp::diff_graphics): * draw_console_views (and with it draw_console), gpu_graphics_vs_ps_draw and gpu_ps_p0_reads_flat_integer_selectors: VS + PS; * gpu_rect_list_corners: VS + PS around the HLSL rect-list GS, first corner order; * gpu_mesh_mode_two_passes: the mesh-mode first pass, pixels and the part of the records the pass-through mesh shader reads (counts, live vertices and primitives). A stage the direct translator refuses keeps the HLSL container (one stderr line per stage and reason), so the suite runs unchanged in diff mode; a failure of the translator itself (validation, builder error, panic) fails the test. A mismatch fails the test with the number of differing pixels and the first eight as (x, y): HLSL / direct. Unset, check / check_mesh return at once: no translation, no extra draw. Unit tests cover the report (count, first eight, bitwise -0.0 / NaN, size mismatch, dwords), the live-record mask, refusal vs translator failure and the unset path; a synthetic VS / PS pair translates directly (skipped without DXC, whose validator the translator runs), and on a GPU draws the same through both backends.
|
Ran on NVIDIA: RTX 3070 8 GB (split wave64), driver 616.56, Windows 11, debug, That is the case #1940 fixes (an implicit-LOD AI-assisted (Claude Code). Synthetic tests only. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
With
XCL_DXIL_DIFF=1, the GPU tests that translate console VS / PS code (and the mesh-mode first pass) draw a second time with the direct DXIL translations and compare render targets and live mesh records bit for bit. With the variable unset nothing extra is translated or drawn. It uses the same switch as the kernel half but does not depend on it; the two merge cleanly in either order.Draft: the head commit has not been built or tested yet.
What is in it
gpu/recomp/diff_graphics.rs: direct translation of the stages, comparison, report, with testsgpu/recomp/mod.rs: the module linegpu/recomp/tests.rs: onecheck/check_meshcall before each covered draw (12 added lines)Tested
These runs are from before the final rebase, on a combined branch (
376f968, based on main689f2db; it holds this change, the other half of the differential mode, and six direct-translator parity fixes), not on this PR's head commit.cargo testdebug build. Driver, CPU and Rust versions were not recorded.cargo test -p xcl --lib recomp::diff_graphics -- --nocapture --test-threads=1: 10 passed, 0 failed.XCL_DXIL_DIFF=1(withXCL_DXIL_DIFF_TABLE,XCL_DIRECT_DXILunset),cargo test -p xcl --lib recomp:: -- --test-threads=1: 285 tests ran, 279 passed, 6 reported HLSL / direct mismatches. Not all of the 285 run both backends (some only translate). The combined tree had direct-translator fixes that this PR does not, so this PR alone may report differently.gpu_wave64_ps_spill_slotsandgpu_wave64_vs_spill_slots_and_identitywith 256 of 256 pixels different. The direct translator has no upper-lane form for these, the gap Shaders: XCL_DIRECT_DXIL=all ignores split_wave64 / upper_lanes for wave64 VS/PS (poisoning split=1 cache), and XCL_DXIL_NO_OPT bypasses cache_allowed() #1895 describes on the runtime route. This mode calls the translator itself, so a routing fix such as Shaders: guard wave64 graphics direct DXIL #1913 would not by itself clear them: expect those tests to fail in this mode on such GPUs until the translator handles or refuses these programs.Regression run
Not run: there are no
xcl-smokeblocks for this change.Not tested
f5136a6) has not been built or tested: it was rebased on macOS, with no Rust toolchain.cargo test --workspacewas not run for this change on its own.AI use