RX 5700 XT (RDNA 1): wrong integer result for the translated v_sub_co_ci_u32_sdwa chain with uniform operands (pixel_aot_sdwa_int_extra_hardware) #2723
Open
opened 2026-11-26 04:15:14 +00:00 by ColorMeBoom
·
7 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#2723
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:15:14Z.
Commit or build
2215c26d(main)Reproduction
Expected behavior
The
co_cidraw matches the CPU reference in all three rows, as on WARP. Channel 1 isv_sub_co_ci_u32_sdwa v13, vcc_lo, s47, v18, vcc_lo dst_sel:WORD_0 ... src0_sel:WORD_1 src1_sel:WORD_1, with the borrow-in from the precedingv_add_co_ci_u32_sdwa. It should read0000fffc,00000005and0000ffff.Observed behavior
WARP passes. On the RX 5700 XT, channel 1 of every row reads the subtrahend
WORD_1(s45)(5, 4, 0) instead of the difference. Channels 0, 2 and 3 (including the final borrow) match:The emitted HLSL is plain integer arithmetic (
uint cp26 = sa26 - sb26; uint co26 = cp26 - ci26; ... co26 & 0xffffu). It fails the same way after each of these edits, run through the test's owncompile_shaderand--check-pixel-batch: removing everyprecise, keepingalu20/alu21asuint, computing the borrow-in directly, and folding the subtraction into one expression.The inputs come from the constant buffer, so they are wave-uniform. In a DXC
cs_6_0probe (offscreen_check --raw-uav-dump), the same chain is correct with per-thread inputs. When the inputs are made uniform withWaveReadLaneFirst, row 2 (s44 = 0xff, s45 = 0x1000, s46 = s47 = 0) returnsffffffffinstead of0000ffff, so the final mask is lost. This is the shortest form that still fails:Giving the borrow as a run-time value instead of deriving it from the carry compare, or using per-thread inputs, gives
0000ffffon both. The pixel-stage symptom (the subtrahend) and the compute symptom (an unmasked-1) differ. Both have uniform operands and a carry-derived borrow; I tested the run-time borrow only in the compute probe. That points at the driver's handling of this uniform pattern rather than at the translation. I did not check other drivers, other RDNA 1 adapters or the debug layer. I'm reporting it so the hardware failure is known; the fixture and its reference look right.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 (
-Gis -denorm preserve,ps_6_2, as in the test). 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:24:38Z.
Windows x64 Release comparison against
2215c26dusing DXC1.9.2602.17. I used the #2728 build after verifying its only differences from that base were GPU package tooling and CMake registration for the package recorder. Both adapter paths ran, with no skips. WARP driver10.0.26100.10068; physical NVIDIA RTX 4070 driver32.0.16.2124. Bothpixel_aot_sdwa_int_extratests passed, including the threeco_cireference rows and all mutation checks. The reported wrong channel 1 result did not reproduce on the RTX 4070.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T04:38:10Z.
The pixel mismatch and the uniform compute probe are useful separate results. Keep the integer pixel expectations and all mutation checks strict. For the next RDNA 1 run, please isolate this in the same ps_6_2 pipeline: use the original uniform derived-borrow input, then supply the same 0/1 borrow as a runtime uniform, and record the three destination words and final borrow for both. Include the driver and DXC versions. A newer AMD driver or a second RDNA 1 adapter would help distinguish the compiler path. The WARP and RTX 4070 checks establish the current cross-adapter baseline.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T06:38:53Z.
I will prepare a reproducible ps_6_2 comparison for the requested next RDNA 1 run. It will keep the original derived-borrow path, supply the same borrow through a runtime uniform in the same pixel fixture, and report destination and final-borrow words for all three rows. I can validate the probe on Intel UHD 770, RTX 4060 and WARP and leave the exact command for the RX 5700 XT reporter.
AI-assisted with Codex.
Imported from R0Y00/Xbox2Windows. Originally posted by RavenCurseBurg on 2026-11-26T06:51:25Z.
I ran the original translated
ps_6_2shader and a second build with the subtraction's borrow-in supplied through the constant buffer. Both builds matched all four channels in all three rows on Intel UHD 770, RTX 4060 and WARP. The RX 5700 XT result for the second build is still open.The standalone probe at 5e50c3fa uses the original fixture, compiler flags and integer target. Its only HLSL edit changes
uint ci26 = cmp25 ? 1u : 0u;touint ci26 = params[1].w;. Each row runs three draws. The first uses the original shader, the second supplies the matched borrow (1, 0, 1), and the third flips it in the same compiled uniform shader. Each draw checks all 4,096 readback pixels.00000005 0000fffc 000b1337 0000000100000005 0000fffd 000b1337 000000010000000a 00000005 fffd1337 000000010000000a 00000004 fffd1337 0000000100000000 0000ffff ffff1337 0000000100000000 00000000 00001337 00000000To run on RDNA 1, put the linked script next to
tests/pixel_aot_check.pyin a checkout ofe3cf6a91(or use the fork commit), and pass the paths to DXC and the repository's builtoffscreen_check:It reports every row before returning a mismatch. On the three local backends I also ran the unmodified
draw-sdwa-int-extrasuite. The baseline passed and each of its 13 mutants was detected, including all four carry-chain mutants. Windows build 26100.9711, DXC 1.9.2609.5, Intel 32.0.101.5973, NVIDIA 32.0.15.9579, WARP 10.0.26100.9711. The reporter used a different DXC and AMD driver, so the RDNA 1 comparison should use their original versions first.AI-assisted with Codex (GPT-6.2 Astra, xhigh).
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-26T08:05:46Z.
On RDNA 4 (
1002:7550, driver32.0.32029.2010) atb457f7ffthe SDWAco_cimismatch reported here does not reproduce: the fixture passes and the borrow probe matches on every row. Not a code change; measurements only.Environment
10.0.26200.9974; MSVC19.44.35230(BuildTools14.44.35207), presetdev.1.9.2602.17(dxcompiler.dll: 1.9(5184-21d28f72)(1.9.2602.17)), the same version the report above used, so the compiler is not what differs between the two runs; the adapter and its driver are.backend=hardware debug_layer=unavailable,adapter=AMD Radeon RX 9070 XT vendor=1002 device=7550,driver=32.0.32029.2010.b457f7ff(b457f7ffa48fe4adb87e6b7d58a21a179dfee221),git status --porcelain --untracked-files=noempty.tests/pixel_aot_check.pycarries both the lowering (translate_int) and theco_ciprogram. The copy at2215c26dand the one atb457f7ffare identical after LF normalisation (sha256 fcb94345…,1 620 580bytes,identical_lf=True). The HLSL this tree emits forco_ciis 206 lines,sha256 c6d00c57….XBOX2WINDOWS_ADAPTERfails withNo D3D12 hardware adapter matches, so the passing run selects the card by its DXGI name.Commands
The probe is
tests/pixel_sdwa_borrow_probe.pyfrom @RavenCurseBurg at5e50c3fa, copied unchanged intotests/of theb457f7ffcheckout:Observed
Nine probe lines, three per row. The channel-1 words the report expects (
0000fffc,00000005,0000ffff) are what thederivedandmatcheddraws return:The same pipeline drawn through the renderer directly reports
pixels=4096 channels=16384 max_absolute_error=0withreadback_first=00000000 0000ffff ffff1337 00000001.What the readback says
flippedcolumn changes channel 1 by one unit on rows 0 and 1, and moves0000ffffto00000000on row 2, so the GPU output tracks the supplied carry-in and the readback is sensitive to it on this adapter.0000ffff; the report's observed word there was00000000. Theflippeddraw also reads00000000on that row, so row 2 alone does not separate "read the subtrahend" from "lost the mask". Rows 0 and 1 carry that distinction (0000fffcagainst the reported00000005, and00000005against00000004).passon one row;tests/pixel_aot_check.py:11351only requires amismatchsomewhere in the three-row list, so a per-rowpassis not examined. Bothco_cimutations print['mismatch', 'mismatch', 'pass'].Limits
32.0.21045.29003"; it shows the report does not extend to RDNA 4 on32.0.32029.2010, which is neither the reporter's adapter nor his driver.WaveReadLaneFirstprobe in the report is not reproduced here; only the pixel fixture and the pixel borrow probe ran.d3d12SDKLayers.dllabsent), so no API validation; one preset.sdwa_int_extra_reference. The probe does cross-check its expectations with a second computation of its own (forced_reference) and asserts equality on all three rows before drawing, so the run reaching its draws means both agreed — an internal cross-check, not an external oracle.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by ColorMeBoom on 2026-11-26T13:11:09Z.
RDNA 1 run of the requested comparison, in the same
ps_6_2pipeline. The derived borrow is wrong on the RX 5700 XT; the same borrow supplied as a run-time uniform is exact.Setup: main
4992a46e, dev preset. DXC 1.9.2602.17 (Windows SDK 10.0.26100.0), compiled with the fixture's owncompile_shader(-Gis -denorm preserve,ps_6_2). AMD Radeon RX 5700 XT (1002:731f), driver 32.0.21045.29003; WARP 10.0.26100.9818. Windows 11 build 26200.9974. Debug layer unavailable.Method: the same comparison as @RavenCurseBurg's probe, from a local script that uses only the repository's helpers (
uncompressed_export,translate_int,compile_shader,SDWA_INT_EXTRA_*,sdwa_int_extra_reference) andoffscreen_check --check-pixel-case. The only HLSL edit replacesuint ci26 = cmp25 ? 1u : 0u;withuint ci26 = params[1].w;, and that word is supplied after the four row words. Each draw reads back all 4,096 pixels. Words are channels 0–3 of pixel (0, 0); "pixels" counts pixels that differ from the reference for the matched borrow.RX 5700 XT
00000005 00000005 000b1337 0000000100000005 0000fffc 000b1337 0000000100000005 0000fffd 000b1337 000000010000000a 00000004 fffd1337 000000010000000a 00000005 fffd1337 000000010000000a 00000004 fffd1337 0000000100000000 00000000 ffff1337 0000000100000000 0000ffff ffff1337 0000000100000000 00000000 00001337 00000000WARP: derived and matched both read the reference on every row (0/4096). The flipped draws read
0000fffd,00000004and00000000 00001337 00000000, the same as the RX 5700 XT and as the Intel/RTX/WARP flipped column above.What this shows on this adapter and driver:
cmp25.0000fffdwith the opposite borrow, not00000005. That fits a miscompile of the derived pattern better than a wrong borrow value.Limits: one RDNA 1 adapter and one driver. I did not try a newer AMD driver for this pattern, so RDNA 1 versus this driver is still unseparated. @thepatrickworld's RX 9070 XT on 32.0.32029.2010 passes, which differs in both at once. The pixel draws only, not the compute probe. One run per draw.
AI-assisted with Claude Code (Claude Opus 5.5).
Imported from R0Y00/Xbox2Windows. Originally posted by xiaoqi72665 on 2026-11-27T03:23:11Z.
RDNA3 post-#2850 SDWA borrow comparison (RX 7900 XT)
Source-built public fixtures at
a4fae199517158fd443bfdd450f476b2c7b5f4c1, cleanmain, Debug (devpreset), Windows 10 build 19045.6466, Windows SDK 10.0.26100.0 DXC 1.8.2502.11. RX 7900 XT (1002:744c), driver 32.0.32029.2010; in-box WARP 10.0.19041.5794. D3D12 debug layer unavailable. SPIRV-Tools262bdab4/ Headersb824a462, SPIRV-Cross57e4efcwith the repository MinLod patch.The previously captured stock
pixel_aot_sdwa_int_extra_(hardware|warp)entries passed on the preceding README-only branch89a821d5; the relevant source files did not change between that revision and current main. On the current main revision I also ran the derived-borrow / matched runtime-uniform / flipped-uniform comparison from @RavenCurseBurg's public probe at 5e50c3fa, adapted for the merged #2850 lowering.Important reproducibility detail: #2850 (
1940788) now usescmp25directly to select the completed difference. The original probe replaces onlyci26, so its flipped-borrow controls no longer inject the same bit into both consumers. I observed that stale-probe discrepancy on both backends. The local diagnostic adaptation asserts both original lines occur exactly once and makes both replacements in the uniform variant:No changes to production translation or the CPU reference. The adapted probe passed 9/9 draws on each adapter (three rows x three variants); all 4,096 pixels per draw matched the independent expected RGBA words. Derived and matched uniform were identical. Flipped uniform correctly produced these distinct words:
The probe was run with the repository tests directory on PYTHONPATH, using
python -B <adapted-probe.py> <SDK-dxc.exe> out/build/dev/offscreen_check.exe hardwareand the same command withwarp, with XBOX2WINDOWS_ADAPTER set to RX 7900 XT. Both exited 0. Original and adapted probe and logs retained locally.This is additional RDNA3 coverage after the merged fix, not a claim to have reproduced or fixed the RDNA1 RX 5700 XT failure.
Buhe (@xiaoqi72665). AI-assisted; tests executed on local hardware.