tests: two hardware negative controls are not caught on RDNA 1 (f32_med3 branchless control, mac_f32 fused mad() mutation) #2722
Closed
opened 2026-11-26 04:14:10 +00:00 by ColorMeBoom
·
4 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows#2722
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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-26T04:14:10Z.
Commit or build
2215c26d(main)Reproduction
Expected behavior
Each test's negative control produces a mismatch on hardware. The translated results themselves are correct on the RX 5700 XT in both tests, so only the controls fail.
Observed behavior
Both tests pass on WARP and fail on the RX 5700 XT, each at its negative control. In both, the control is non-
precise(orFMad) code whose result HLSL does not pin down, and this driver resolves it the same way as the correct lowering.startup_gfx2hlsl_f32_med3_hardware. The translatedmed3_32draws the ISA words3f800000,40000000,3fc00000,3f800000with FXC and DXC, also after #2044. The restored branchless helpermax(min(a, b), min(max(a, b), c))also draws3f800000on the NaN lane, so the check reportsfxc/dxc branchless lowering on hardware was accepted: the draw does not catch the defect. In the fixturebandcare the literals 2.0 and 1.0. In a DXCcs_6_0probe with inputs read at run time (offscreen_check --raw-uav-dump):40000000400000003f80000040000000precise float o = ...4000000040000000clamp(a, 1.0, 2.0)3f8000003f800000With constant bounds, the non-
precisemedian folds to a clamp, whose NaN result is not fixed (WARP returns 1.0 forclamptoo). Through the fixture's own--startup-entry-wordsdraw at2215c26d, aprecisebranchless helper restores the control:With it, the NaN lane draws
40000000and the other three lanes match. That holds on the RX 5700 XT and WARP, with FXCps_5_1and DXCps_6_0.compute_store_aot_mac_f32_hardware. The translated shader matches all 320 words. The hardware mutationprecise float r = mad(...)then escapes withmutation 'fused mad() instead of unfused multiply+add' escaped detection. DXC emits it asFMad(op 46), which the driver may fuse or not. Probe with4097 * 4097 - 16785408(1 if fused, 0 if unfused):precise float m = mad(a, a, c)mad(a, a, c)RDNA 1 still has the unfused
v_mad_f32, so on this adapter the mutation computes what the correct shader computes. The review of #2164 found the same equivalent mutant on WARP and suggested not requiringmaddetection on every backend. The mutation is now hardware-only, but this hardware does not fuse either. One option is a first dispatch that measures whether the adapter fusesmad(), with this one mutation reported as a capability skip when it does not. The other three controls would stay strict.I can send the
med3change as a PR, and themac_f32change once you pick the approach.Environment
Windows 11 Home build 26200.9974, VS 2022 Build Tools (MSVC 19.44.35230), Windows SDK 10.0.26100.0, DXC 1.9.2602.17 and FXC from the SDK. AMD Radeon RX 5700 XT (RDNA 1, 1002:731f), driver 32.0.21045.29003, hardware backend; WARP 10.0.26100.9818. Debug layer unavailable.
AI-assisted with Claude Code (Claude Opus 5.5).
Checklist
Imported from R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-26T04:27:23Z.
Cross-adapter comparison on Windows
26300.10075, MSVC Release, with the relevant source unchanged from2215c26dand the D3D12 debug layer enabled: all four CTests passed on in-box WARP (10.0.26100.10068) and physical RTX 4070 (32.0.16.2124). Both FXC and DXCmed3mutations changed only the NaN lane to40000000on the RTX 4070. The hardwaremac_f32run also caught its fusedmadmutation here. The translated shaders matched their references on both backends. These are comparison results for the reported RDNA 1 control behavior.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T04:28:11Z.
Please send the test-only changes. The
precisebranchless median is an appropriate negative control if the same draw keeps the expected NaN-lane mismatch and the other three lanes on both FXC and DXC. For MAC, measure whether the actual shader target fusesmadusing the same cancellation input. If readback reports the unfused value, log that this one mutation is inapplicable. Keep the translated shader's full word comparison and the other three mutations mandatory, and fail on probe compilation, dispatch, readback or any unexpected probe value. This should never skip the whole CTest. Please include the RX 5700 XT and WARP results. HLSL madImported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T04:28:44Z.
AMD RDNA 4 (
1002:7550) onmainf14219f2: themac_f32mutation escapes here too, thef32_med3control does not. Not a code change; measurements only.Environment
10.0.26200.9974(UBR0x26f6,DisplayVersion25H2); MSVC19.44.35230; DXC and FXC fromWindows Kits\10\bin\10.0.26100.0\x64\.AMD Radeon RX 9070 XT,vendor=1002 device=7550, driver32.0.32029.2010. Thewarpbackend selects an adapter reported asMicrosoft Basic Render Driver, driver10.0.26100.9818.debug layer unavailable, so no API validation is involved.mainf14219f2(f14219f220df38ac3ee2be9a06b5527b48de63d5).Commands
Observed
The two controls split on this adapter: the branchless
med3helper is caught (that entry passes), and only themad()mutation escapes, attests/compute_store_check.py:3784withmutation 'fused mad() instead of unfused multiply+add' escaped detection. Before it, the hardware run printsgroups=1 compared_words=320 mismatches=0.What that says about fusion here, without needing the mutation: on the correct shader the fixture first requires the fused model to be detected at word 0 (
mac_f32_words(fused=True), lines 3755-3764), and this run reached line 3784, so all those reference controls were rejected. The adapter therefore matched the unfused model on all 320 words and differed from the fused one at word 0. The translated source ispreciseon both products, so what this measures is that the driver honoursprecisehere, not a general property of the adapter.The assertion at 3784 fires when the mutated draw does not come back as a clean difference (
returncode 1withCompute readback differson stderr). So on this card themad()source produced no reported difference: the control could not separate it, the same outcome as the RX 5700 XT report above.That makes three adapters in this thread: the RX 5700 XT and this card report the unfused value, the RTX 4070 above catches the mutation. Under the rule described in the reply above, this readback means that one mutation is inapplicable on this adapter rather than a defect of the lowering; the full 320-word comparison and the four reference controls ran and passed before it.
Limits
mad()" is read from the readbacks, not measured as a capability.f32_med3passes" says that entry's control is caught on this adapter; it says nothing about which rows of the RX 5700 XT table above would reproduce.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by stan495 on 2026-11-26T13:26:35Z.
AMD Radeon RX 7900 XTX (RDNA 3,
1002:744c) comparison on174f963d:startup_gfx2hlsl_f32_med3_hardwarepasses (both FXC and DXC), whilecompute_store_aot_mac_f32_hardwarefails at the samefused mad()mutation (escaped detection).Measurements only; no repository files modified.
Environment
10.0.26200.9974)174f963d(working tree has an unrelated pre-existing modification intools/startup/debug_launch.py), presetrelease10.0.26100.0FXC and DXC (dxcompiler.dll1.8.2502.11)$env:XBOX2WINDOWS_ADAPTER = "7900"):AMD Radeon RX 7900 XTX(vendor=1002 device=744c), driver32.0.32029.2010,debug_layer=enabledMicrosoft Basic Render Driver(vendor=1414 device=008c), driver10.0.26100.9818,debug_layer=enabledCommands
Observed
startup_gfx2hlsl_f32_med3_warp: Passed (0.98 sec,debug_errors=0 debug_warnings=0)startup_gfx2hlsl_f32_med3_hardware: Passed (1.37 sec,debug_errors=0 debug_warnings=0)3f800000,40000000,3fc00000,3f800000for the translated lowering and40000000,40000000,3fc00000,3f800000(mismatched only on the NaN lane) for the branchless control.compute_store_aot_mac_f32_warp: Passed (4.00 sec,groups=1 compared_words=320 mismatches=0,debug_errors=0 debug_warnings=0; themad()mutation only runs onbackend == "hardware")compute_store_aot_mac_f32_hardware: Failed (4.85 sec)groups=1 compared_words=320 mismatches=0,debug_errors=0 debug_warnings=0), and all four reference controls failed as expected before reaching the hardware-only mutation attests/compute_store_check.py:3784:This places RDNA 3 (
RX 7900 XTX) alongside RDNA 1 (RX 5700 XT) and RDNA 4 (RX 9070 XT) forcompute_store_aot_mac_f32_hardware, whilestartup_gfx2hlsl_f32_med3_hardwarecatches its branchless control on this adapter.AI-assisted; commands listed were executed locally.