Repository navigation
Tests: cover Direct DXIL Module::optimize passes and GPU execution - #1842
microwave805 wants to merge 1 commit into
Conversation
Add integration and GPU tests for gpu::dxil::module::opt (constant folding, algebraic identities, dominator-tree vs. sibling-branch CSE, same-block wave CSE without merging waveIsFirstLane or hoisting across divergent branches, unreachable-block and trivial-phi cleanup, 64-bit-preserving DCE, and the malformed-IR guard). Every emitted shader is checked against DXC's validator and disassembled to verify the transformations; wave32 shaders run on the GPU and compare against CPU expectations. Assisted-by: Antigravity (Gemini 4 Neon)
|
AMD run with native 64-lane waves, which this PR lists as not tested, plus an NVIDIA one. Tested: pass, head
Not tested: Intel; Linux / Wine; the whole workspace suite. AI use: Claude Code (Claude Opus 5.5) ran the tests on this machine and wrote this report. |
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
TestedPR #1842 was open at STOR-WINLAB ran Windows 11 Enterprise Evaluation 25H2 (26200.9974), AMD Ryzen 7 3800X, and Intel Arc A770 (driver 32.0.101.9175). Rust and Cargo were 1.100.0, host
$exe = 'L:/XclTooling/pr1947-1831ec4-t3-97236edf/target/debug/build/xcl/551991fdf0dc4311/out/gpu_dxil_opt-551991fdf0dc4311.exe'
& 'L:/XclTooling/Invoke-ArcTest.ps1' -Test {
& $exe --exact opt_constant_folding_and_identities_validate_and_run --test-threads=1 --nocapture
& $exe --exact opt_cse_merges_dominators_isolates_siblings_and_keeps_wave_is_first_lane --test-threads=1 --nocapture
& $exe --exact opt_prunes_unreachable_blocks_and_collapses_trivial_phis --test-threads=1 --nocapture
}All three exact invocations exited 0. The checked-in DXIL validation and GPU result assertions passed with 3 passed, 0 failed, 0 ignored, 0 hardware skips, and 0 validator skips. The GPU mutex was released and the assigned Cargo target is available. Not testedOther fixtures, the workspace suite, retail titles, and other adapters or drivers. AI useT3 Code / Codex |
|
Nothing has happened on this PR for 3 days, so it is marked |
|
merge-check claim |
|
merge-check |
|
merge-check claim |
|
merge-check |
|
No open or merged PR adds integration tests of AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Add standalone integration and GPU tests for the Direct DXIL module optimizer (
crates/xcl/src/gpu/dxil/module/opt.rs), which currently has no dedicated unit or integration tests.What is in it
crates/xcl/tests/gpu_dxil_opt.rs:opt_constant_folding_and_identities_validate_and_run: verifies 32-bit constant folding (AShr,UDiv,URem,SExt,SLt,Add,Xor,Select) and algebraic identities (+0,&~0,*1,*0,x^x,select(c, x, x),bitcast(bitcast(x)),cmp(x, x)), checking DXIL disassembly and wave32 GPU execution against CPU values.opt_cse_merges_dominators_isolates_siblings_and_keeps_wave_is_first_lane: verifies dominator-tree CSE across child blocks, sibling-branch undo-stack isolation, same-blockwaveActiveBallotCSE without hoisting across a divergent branch (verified on GPU viawaveActiveBallot(true)returningodd_maskinstead of0xFFFF_FFFF), andwaveIsFirstLaneremaining unmerged.opt_prunes_unreachable_blocks_and_collapses_trivial_phis: verifies unreachable-block pruning and second-pass trivial-phi collapse after CSE unifies diamond arms, plus GPU execution.opt_dce_drops_dead_32bit_ops_but_preserves_64bit_flags: verifies DCE removes dead 32-bit ops while retaining deadi64/f64ops soInt64Ops/Doublesshader flags stay consistent under DXC validation.opt_leaves_malformed_use_before_def_for_writer_to_reject: verifiesuses_well_formedleaves malformed forward-reference IR untouched sotry_to_bitcodestill reports an error.Tested
stable-x86_64-pc-windows-msvc, debug)7753368(based onmainc4d37be):cargo test -p xcl --test gpu_dxil_opt -- --nocapture: 5 passed, 0 failed, 0 ignored (0 skipped).\scripts\test.ps1(cargo build --workspace && cargo test --workspace -- --test-threads=4): 964 passed, 0 failed, 43 ignoredgpu_dxil_opt): 18×no wave64(lower::tests,lower_dxil::tests,recomp::tests), 3×per-lane form: refused(lower_dxil::tests:f16 arithmetic,f16 packed,f32 conversions), 1×no heap windows(heap_window_out_of_memory_falls_back_to_the_switch_form), 1×cannot disable the driver cache(shaders::tests::pso_measurement_compiles_an_exact_synthetic_record)Regression run
crates/xcl/tests/gpu_dxil_opt.rs(no runtime or build-input files changed).Not tested
AI use
crates/xcl/src/gpu/dxil/module/opt.rs, wrotecrates/xcl/tests/gpu_dxil_opt.rsand this PR description, and ran the verification commands above.