Repository navigation
DXIL: set DisableMathRefactoring when lowering unfused mad without FMad - #1973
raylitebull wants to merge 1 commit into
Conversation
|
Full-suite run, since this PR has no test report yet. Tested exact head Tested
Not tested
AI use
|
|
Update: Rerun on the new head Passes on an RTX 3060 (Ampere). The new tests fail without the fix. One gap: The cache. This PR changes the emitted containers (entry flags bit 1) for every program with an unfused What this run adds to the RTX 5070 Ti report above:
Hardware: RTX 3060 12 GB, driver 610.88, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC / dxil 1.9.2602.17, debug. Not tested: AMD, a release build, AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report. |
cda8355 to
7dfa64c
Compare
|
Thanks for catching that, @fromthemoonx! Updated Verified with |
7dfa64c to
aaf2c78
Compare
|
Rebased Verified with |
|
Test report for head Tested
Not tested
AI use
|
Sets the DXIL entry-point
DisableMathRefactoringflag (bit1,SFI0 = 0) when the direct DXIL translator lowers unfusedmad_nf(V_MAD_F32/V_MAC_F32), unless the optimized module still emits livedx.op.tertiary.*FMad(opcode46) calls (which DXIL validation forbids combining withDisableMathRefactoring).Part of #1269.
What is in it
crates/xcl/src/gpu/dxil/kernel.rs: bumpTRANSLATOR_VERSION(8->9) so existingXCL_DIRECT_DXILdisk caches invalidate and retranslate withDisableMathRefactoring.crates/xcl/src/gpu/dxil/shader.rs: addFeature::DisableMathRefactoring(metadata_bit = 1,container_bit = 0) andShader::feature_flags()+Shader::uses_fmad()soDisableMathRefactoringis omitted whenever post-optimize()IR still containsdx.op.tertiary.*opcode46(FMad).crates/xcl/src/gpu/dxil/graphics.rs: route entry-point shader flag computation throughself.feature_flags().crates/xcl/src/gpu/dxil/prelude.rs: requireFeature::DisableMathRefactoringinLw::mad_nf, and adddisable_math_refactoring_tests(5 tests covering compute/pixel unfused mad, liveFMadsuppression, plainv_add_f32, and post-DCE deadFMad).Tested
rustc 1.99.1 (58cf8f9c3 2026-10-13), DXCdxcompiler 1.8.2502.11/dxil 1.8.2502.11, rebased cleanly onto656c0e8(aaf2c78).cargo check --workspace --tests: passed.cargo test -p xcl --lib disable_math_refactoring_tests: 5 passed, 0 failed (dxil 1.8.2502.11validated).Regression run
scripts/smoke.ps1pair onaaf2c78vs656c0e8has not been run locally. AMD and NVIDIA reviewers are invited to test onaaf2c78vs656c0e8(includingscripts/smoke.ps1andXCL_DIRECT_DXIL=1) and post results in the comments.Not tested
scripts/smoke.ps1pair onaaf2c78, fullcargo test --workspacesuite, runtime GPU execution across AMD / NVIDIA / Intel hardware, and Linux/Wine/vkd3d-proton.AI use