tests: keep two hardware negative controls meaningful on RDNA 1 (#2730) #2836
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2844"
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?
Imported from R0Y00/Xbox2Windows. Originally posted by ColorMeBoom on 2026-11-26T13:20:16Z.
Refs #2730
These are the test-only changes requested in #2730. Two hardware negative controls had stopped catching anything on an RX 5700 XT, because their mutated code is non-
preciseand the driver lowers it to the same result as the correct translation. Nothing changes in the translator, the shim or the reference models.Changes
startup_gfx2hlsl_f32_med3. The restored branchless helper in the draw control is now computed asprecise:Without
precise, this adapter folded the median against the fixture's constant bounds into a clamp. It drew the ISA value0x3f800000on the NaN lane with both FXC and DXC, so the control could not detect the defect it exists for. Withprecise, the NaN lane draws0x40000000and the other three lanes match, on this adapter and on WARP. The text mutation that the translator must reject still uses the plain helper.compute_store_aot_mac_f32. Before the hardware mutationfused mad() instead of unfused multiply+addis required to fail, the newmac_f32_mad_fusion()runs the mutated shader against two models: the fused model and the unfused model. The models differ at word 0 (4097 * 4097 - 16785408is 1 when fused and 0 when unfused).The full 320-word comparison, the four reference controls and the other two mutations are unchanged and still required. The test never skips.
docs/experiments.mddescribes both controls.Evidence
Commit
5f4932c8onmain4992a46e.Environment:
1002:731f), driver 32.0.21045.29003.Result:
100% tests passed, 0 tests failed out of 7.git diff --checkis clean.startup_gfx2hlsl_f32_med3branchless lowering on hardware mismatched on the NaN lane (40000000,40000000,3fc00000,3f800000) and matched the other three: okcompute_store_aot_mac_f32mac_f32: mad() fusion probe (hardware): unfused, thenmutation 'fused mad() instead of unfused multiply+add' is inapplicable on this adapter: mad() reads back the unfused model on all 320 wordsfused mad()mutation runs only on the hardware backend, so WARP is unchangedstartup_gfx2hlsl_f32_med3_controlsBefore this change, the same commands on the RX 5700 XT failed at the two controls (
escaped detection), as reported in #2730.Probe controls without a GPU. I called
mac_f32_mad_fusion()with a simulated renderer:unfusedfusedAfter both returned results, the case file held the expected model again. I did not run the probe on an adapter that actually fuses
mad(), so that branch is tested only through the simulation.AI-assisted: I used Claude to write and run these changes and checks. I reviewed the results.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T13:41:03Z.
Review: COMMENTED
Review of head
bd596df4(code + tests; comment only).Question checked: do the two hardware negative controls still fail when they should, or were they only loosened?
startup_gfx2hlsl_f32_med3(tests/startup_gfx2hlsl_f32_med3_check.py): not loosened. The control is the same branchless helper, now computed asprecise. The expectation is unchanged (mismatch on the NaN lane, 0x40000000 vs 0x3f800000, other three lanes match). Mutation run on WARP: makingnaive()return the unchanged ISA-correct HLSL (no defect) makesstartup_gfx2hlsl_f32_med3_warpfail withfxc/dxc branchless lowering on warp was accepted: the draw does not catch the defect. So the control still rejects a lowering that does not show the defect.compute_store_aot_mac_f32(tests/compute_store_check.py): the exemption is narrow. Themad()mutation is only added forbackend == "hardware", so WARP behaves exactly as before. On hardware, the mutated shader is read back against both the fused and the unfused model, and exactly one must match all 320 words; compile/dispatch/readback errors or "neither" or "both" raise. The mutation is skipped only when the unfused model matches (where the mutation equals the lowering and cannot be caught by any readback). The reference controls and the other two mutations (p - c, accumulator dropped) still run on every adapter. That is a fair narrowing, not a blanket relax.Not verified by me: both RX 5700 XT / RX 9070 XT outcomes (no hardware here; real-GPU run not available). That
preciserestores the med3 control on the RX 5700 XT rests on the table in #2730. Worth a confirming run on that adapter by the author.Checks run:
git diff --check origin/main...HEAD,python3 tests/docs_links_check.py,python3 tests/bidi_controls_check.py(all clean). Win2025 WARP dev+release 2/2 on both tests (receipt posted separately). Docs (docs/experiments.md) match the new behavior. No other open or merged PR covers this slice.AI-assisted; commands listed were executed locally.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-26T13:41:02Z.
Win2025 WARP receipt for head
bd596df4after updating with main.Verified on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP) at commit
bd596df48d4f90809842eca6885149e72da9f5d1:--preset dev):ctest --preset dev -R '^(startup_gfx2hlsl_f32_med3|compute_store_aot_mac_f32)_warp$' --parallel 5 --no-tests=error --output-on-failure: 2/2 passed (startup_gfx2hlsl_f32_med3_warp,compute_store_aot_mac_f32_warp)/O2(--preset release): same regex: 2/2 passedPYCHECK name=tests/startup_gfx2hlsl_f32_med3_check.py rc=0AI-assisted; commands listed were executed locally.