Direct DXIL: reject directed f32 rounding on ENC_VINTRP interpolation #2814
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2814
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2814"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@safesearch77 on GitHub · 2026-11-26 14:07 UTC · original
safesearch77:fix/dxil-vintrp-f32-round→main· +101 −3 · 3 files · 1 commits · draftReject 32-bit
ENC_VINTRPencodings ofV_INTERP_P1_F32andV_INTERP_P2_F32when a shader directsMODE[1:0]single-precision rounding in the Direct DXIL backend, matching the existing 64-bitENC_VOP3path.lower_round::f32_round_unsupported(crates/xcl/src/gpu/dxil/lower_round.rs:481-483) lists"v_interp_p1_f32" | "v_interp_p2_f32"so pixel shaders that direct f32 rounding fail Direct DXIL translation ("directed f32 rounding of this instruction") rather than silently emitting nearest-even rasteriser interpolation. Previously, that check lived at the top ofLw::valu(lower_valu.rs:336), which is only reached byENC_VOP*/VOP*encodings (lower.rs:975); standard 32-bitENC_VINTRPencodings dispatched directly fromLw::inst(lower.rs:972) toLw::interp_gfxand bypassed the guard.Part of #1269
What is in it
crates/xcl/src/gpu/dxil/lower.rs,crates/xcl/src/gpu/dxil/lower_valu.rs: hoist theself.f32_rm && super::lower_round::f32_round_unsupported(&name)check intoLw::instright before encoding dispatch and remove the redundant check fromLw::valu(+3 / -3).crates/xcl/src/gpu/dxil/round_tests.rs:direct_f32_round_mode_vintrp_p1_p2_rejected, checkingS_ROUND_MODE(1,2,3),S_SETREG_IMM32_B32(0x0801), andS_SETREG_B32(0x0801) againstV_INTERP_P1_F32andV_INTERP_P2_F32in bothENC_VINTRPandENC_VOP3acrosswave64: falseandwave64: true, plus positive controls (S_ROUND_MODE 0,S_ROUND_MODE 0xCf16/f64 RTZ with default f32 RNE, andV_INTERP_MOV_F32under directedS_ROUND_MODE 1).Tested
x86_64-pc-windows-gnu:cargo check --offline --workspace --testsgave 0 errors (and only the 3 baseline warnings already onb49be183, none ingpu/dxil/).rustc --edition 2021 --testharness overgpu::dxil::round_tests(built fromgit archivewith Windows/GPU/DXC validator plumbing stubbed; no test or lowering code modified):lower.rsandlower_valu.rsfromb49be183:direct_f32_round_mode_vintrp_p1_p2_rejectedfails (8 passed; 1 failed,("S_ROUND_MODE", "V_INTERP_P1_F32", "ENC_VINTRP", false)).9 passed; 0 failedacrossgpu::dxil::round_tests.Regression run
XCL_DIRECT_DXIL=all. Thexcl-smokepair (b49be183and this head) must be added from a Windows retail run before marking ready for review.Not tested
cargo test --workspace -- --test-threads=4GPU suite (including DXCdxcompiler.dllvalidation) and paired Windowsscripts/smoke.ps1retail runs. Prepared on a Linux CPU host without a Windows GPU or retail title.AI use
Lw::insthoist, wrotedirect_f32_round_mode_vintrp_p1_p2_rejectedand the Linux hostrustc --testRED-to-GREEN harness, and wrote this description (bug isolated during upstream triage with Claude Opus 5.5).@ettehn on GitHub · 2026-11-26 14:23 UTC · original
Native Windows A/B on
15e88d74df3ae653a6cda85fa0538acbe2554731(clean) vsb49be1836844fe0b0cdb3211dce3cb7fb4e21ac7(the new regression test copied over, no production edits). Windows 11 build 26200, Ryzen 9 8945HX, RTX 5070 Ti Laptop (12 GB, driver 621.24), Rust 1.97.1 MSVC debug, DXC/DXIL 1.8.2502.11.XCL_ADAPTER=NVIDIA XCL_REQUIRE_GPU=wave64.expected error for ("S_ROUND_MODE", "V_INTERP_P1_F32", "ENC_VINTRP", false). This arm ran only the new test.cargo test --locked --offline -p xcl --lib -j 2 -- gpu::dxil::round_tests:: --test-threads=1 --nocaptureon PR head: 9 passed, 0 failed, 0 ignored, with no reported skips. The new pixel translation rejection and positive controls passed. All five existing GPU arithmetic tests in the module ran on the laptop, including the dynamic/denormal cases.The new pixel cases check translation; the GPU runs cover existing arithmetic cases. Full workspace testing and a retail title were outside this run.
OpenAI Codex assisted with the Windows verification.
@retrope13 on GitHub · 2026-11-26 14:24 UTC · original
Independent Windows/MSVC + NVIDIA GPU (RTX 4060 Laptop 8 GB, DXC
1.9.2602.17) verification and diff review of#2814(15e88d74) againstmain(b49be183): full debug workspace suite + releaseround_testsgreen, 0 failures. No title was run.Tested
32.0.16.2140, wave32), Intel Core i5-14500HX (14C/20T), 24 GB RAM, Windows 11 26H2 (build26300.9818),rustc 1.100.0(stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0DXC1.9.2602.17,XCL_ADAPTER=NVIDIA.gpu::dxil::round_tests:cargo test --locked -p xcl --lib -- gpu::dxil::round_tests --test-threads=4 --nocapture): 9 passed, 0 failed, 0 ignored, 0 skipped (0.49 s; all 5 GPU rounding tests +direct_f32_round_mode_vintrp_p1_p2_rejectedran and passed).cargo test --release --locked -p xcl --lib -- gpu::dxil::round_tests --test-threads=4 --nocapture): 9 passed, 0 failed, 0 ignored, 0 skipped (0.65 s).cargo build --workspace --locked, thencargo test --workspace --locked --no-fail-fast -- --test-threads=4:main(b49be183): 1435 passed, 0 failed, 47 ignored#2814(15e88d74): 1436 passed, 0 failed, 47 ignored (+1 new test, 0 failures)Diff Check (
b49be183..15e88d74)lw.f32_rmis computed upfront over the whole program (kernel.rs:266), so hoistingself.f32_rm && lower_round::f32_round_unsupported(&name)intoLw::inst(lower.rs:965) closes theENC_VINTRP→interp_gfxbypass regardless of block lowering order.f32_round_unsupportedonly matchesv_fma_mix_f32,v_dot2_f32_f16,v_dot2c_f32_f16,v_interp_p1_f32, andv_interp_p2_f32, so hoisting out ofLw::valuintroduces no false positives on non-VALU encodings while keepingV_INTERP_MOV_F32andMODE[1:0] == 0controls unaffected.Not Tested
scripts/smoke.ps1runs, AMD / Intel GPUs, native wave64 hardware, and the 47#[ignore]/SKIPPEDtests.AI disclosure: Antigravity (Gemini 4 Neon, XHigh) ran the builds/tests, checked the diff, and drafted this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.