Repository navigation
Direct DXIL: reject directed f32 rounding on ENC_VINTRP interpolation - #2814
safesearch77 wants to merge 1 commit into
Conversation
lower_round::f32_round_unsupported lists v_interp_p1_f32 and v_interp_p2_f32 so pixel shaders that direct MODE[1:0] fail translation rather than silently emitting nearest-even interpolation. That guard lived at the top of Lw::valu, which only 64-bit ENC_VOP3 encodings reached; standard 32-bit ENC_VINTRP encodings dispatched straight from Lw::inst to Lw::interp_gfx and bypassed it. Hoist the f32_round_unsupported check into Lw::inst before encoding dispatch and drop the redundant check in Lw::valu. Assisted-by: Antigravity (Gemini 4 Carbon)
|
Native Windows A/B on
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. |
|
Independent Windows/MSVC + NVIDIA GPU (RTX 4060 Laptop 8 GB, DXC Tested
Diff Check (
|
|
Regression run of Setup: RTX 3060 12 GB (NVIDIA 581.80), i9-14900KF, Windows 11 26200, release builds of main main: this PR: 100 % of main's frames, 103 % of its peak commit. One run each. Not tested: the suite on this head; whether the title reaches the code this PR changes in its first 60 s; AMD. AI use: Claude Code (Claude Opus 5.5) ran these runs on this machine and wrote this report. |
|
Huge thanks to AI use: Antigravity (Gemini 4 Carbon) |
|
Tested on AMD Radeon RX 9070 (RDNA4) at this PR's head Tested
Not tested
AI use
|
|
merge-check claim |
|
merge-check
|
|
merge-check |
|
No open or merged PR makes the same change. Moving the AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Reject 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
@retrope13(#2814 (comment)) — Windows 11 26H2 (26300.9818), NVIDIA GeForce RTX 4060 Laptop GPU (8 GB, driver32.0.16.2140, wave32), Intel Core i5-14500HX, 24 GB RAM,rustc 1.100.0(stable-x86_64-pc-windows-msvc), Windows SDK10.0.26100.0DXC1.9.2602.17,XCL_ADAPTER=NVIDIA:cargo build --workspace --locked+cargo test --workspace --locked --no-fail-fast -- --test-threads=4(debug):1436 passed, 0 failed, 47 ignoredon15e88d74(vs1435 passed, 0 failed, 47 ignoredonb49be183).cargo test --locked -p xcl --lib -- gpu::dxil::round_tests --test-threads=4 --nocapture(debug &--release):9 passed, 0 failed, 0 ignored, 0 skipped(all 5 GPU rounding tests +direct_f32_round_mode_vintrp_p1_p2_rejected).@ettehn(#2814 (comment)) — Windows 1126200, Ryzen 9 8945HX, NVIDIA GeForce RTX 5070 Ti Laptop (12 GB, driver621.24),rustc 1.97.1MSVC debug, DXC1.8.2502.11,XCL_ADAPTER=NVIDIA XCL_REQUIRE_GPU=wave64: reproduced RED failure onb49be183(expected error for ("S_ROUND_MODE", "V_INTERP_P1_F32", "ENC_VINTRP", false)) and9 passed, 0 failed, 0 ignored, 0 skippedon15e88d74.x86_64host cross-check (x86_64-pc-windows-gnu,cargo check --offline --workspace --tests:0errors) and nativerustc --edition 2021 --testRED (8/9) → GREEN (9/9) harness overgpu::dxil::round_tests.Regression run
60 s
scripts/smoke.ps1pair (XCL_NETWORK=0, release builds) reported by@Anon64(#2814 (comment)) on NVIDIA GeForce RTX 3060 12 GB (driver581.80), Intel Core i9-14900KF, Windows 1126200:main:
this PR:
Not tested
wave64hardware, the47#[ignore]/SKIPPEDtests on wave32 NVIDIA adapters, and whether the retail title reaches directed-roundingENC_VINTRPpixel shaders underXCL_DIRECT_DXIL=allduring the 60 s smoke window (PR authored on a Linux CPU host; Windows GPU suite and retail smoke runs provided by@retrope13,@ettehn, and@Anon64).AI use
Lw::insthoist, wrotedirect_f32_round_mode_vintrp_p1_p2_rejectedand the Linux hostrustc --testRED-to-GREEN harness, and updated this description (bug isolated during upstream triage with Claude Opus 5.5). Windows test and smoke verifications reported by@retrope13(Antigravity / Gemini 4 Neon),@ettehn(OpenAI Codex), and@Anon64(Claude Code / Claude Opus 5.5).