HLSL pixel masks: adjacent Wave32 carry destinations lose s21 on WQM triangle edges #2584
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#2584
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?
@akimfomin on GitHub · 2026-11-26 00:15 UTC · original
On XCL
e1d84b7d9153f86a97d2ec5d209d196046fc0bea, a 76-byte Wave32 pixel program exposes an incorrect HLSL result at triangle edges on an RTX 4070 Ti SUPER (Windows, driver 617.14, DXC 1.9.2609.5).The first
v_add_co_u32writes its carry tos21. The second writes tos20. The program then reads the full population ofs21. Treating the second destination as a two-register overwrite can hide the live value ins21. With whole-quad mode enabled, red (the returned population) differs from green (the independently computed count in the same invocation) at 668/2,953 covered pixel-draws. The full-screen triangle alone passes. A single triangle edge differs at 176/496.Forcing whole reconstruction or using the ordinary direct DXIL path yields zero mismatches across four geometries. A narrowly scoped liveness correction on the HLSL path also gave zero mismatches and bit-identical images to both controls, with WQM enabled and disabled. A separate 72-byte program is the WQM-off control. Frequency in applications and independent AMD/Intel results are open.
PortBridge reproduction, assembly and raw GPU readbacks. We can provide the focused patch and regression separately for review. PortBridge used Codex for the witness and technical analysis. All reported GPU measurements were executed on physical hardware.
@DarkPanda69 on GitHub · 2026-11-26 00:33 UTC · original
Independent AMD result, plus a second NVIDIA generation: the bug reproduces on both an RX 9070 XT and an RTX 3060, and your fix commit makes the test pass on both, with nothing else changing in the GPU suite.
On
main08db802(the parent of akimfomin/xcl@d3e7725), debug, Windows 11 Pro 26200, card chosen withXCL_ADAPTER,cargo test -p xcl --lib -- gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edges:d3e7725(tests.rs), recompiler unchangedmask popcount at 32, left 10.0, right 16.0mask popcount at 0, left 12.0, right 16.0d3e7725With the whole commit,
cargo test -p xcl --lib -- gpu:: --test-threads=4againstmainon both cards:main), 6 SKIPPED both.gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edgesandwave32_carry_into_s20_preserves_a_whole_read_of_s21, both ok.Not tested: Intel,
XCL_DIRECT_DXIL=1(your report says the direct path was already right), a title.AI use: Claude Code (Claude Opus 5.5) read the commit, ran the tests on this machine and wrote this comment.
@akimfomin on GitHub · 2026-11-26 00:20 UTC · original · edited 2026-11-26 00:57 UTC
The focused fix is ready for review on top of XCL
08db802: implementation and regression tests. It keeps the stock HLSL output identical across 195 tested open configurations while fixing this witness. A broader correction had unnecessarily selected full ballots in Microsoft MiniEngine, so the linked change uses the narrower rule.For a short independent physical check, run
cargo test --release --locked -p xcl --lib gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edges -- --test-threads=1 --nocapture. PortBridge Test Lab #87 accepts the pass/fail/skip, GPU and driver. AMD or Intel results and a maintainer title smoke would help assess readiness. The branch is available for testing; an upstream merge has not been requested. Codex assisted this investigation.Update, 26 November. Thank you to DarkPanda69 for checking the baseline and fix on the RX 9070 XT and RTX 3060. On our RTX 4070 Ti SUPER, Windows 11, driver 617.14, the complete locked workspace suite at the same fix commit returned 1,431 passed, 0 failed and 47 ignored, with 28 explicit skips inside test bodies. The authored guest triangle rendered and read back on hardware. The fix also merges cleanly with main
b49be18in a local merge-tree check. A paired real-title smoke remains open. Commands, toolchain and complete sanitized logs. OpenAI Codex (GPT-6) assisted with this run.@luckyteagirl on GitHub · 2026-11-26 01:05 UTC · original
Independent RDNA2 check of the patch linked in #2584: the focused pixel carry fixture passes on my RX 6800M.
Setup: clean detached
akimfomin/xclpatch commitd3e7725f9f48c39c18e7b6e011ec76423edb0004(parent XCLmain08db8020d323bf478964fcc586152cce54959cfc); Windows 11 Home build 26200; Ryzen 9 5980HX; AMD Radeon RX 6800M, driver30.0.13002.13003; Rust 1.99.0 MSVC; DXC/dxil 1.9.2609.5. Debug lib-test binary built in an isolated target under a free-memory guard; the guard did not stop the build or test.Tested: With
XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=wave64, and pinnedXCL_DXC_DIR, I ran the exactgpu::recomp::tests::gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edgesfixture directly from that built binary using--exact --test-threads=1 --nocapture: 1 passed, 0 failed, 0 ignored, 0 measured, 1332 filtered out, 0.92 s, noSKIPPEDline. An earlier guarded Cargo invocation of the same fixture also passed; itsXCL_REQUIRE_GPU=1value was not a recognized requirement token, so the corrected direct run above is the result I rely on.Limit: This checks the Wave32-intended HLSL translation and rendered output on the selected RX 6800M. The pixel shader's physical wave width is not forced or recorded by the fixture, so I cannot claim it executed as native Wave32. I did not run the same witness on the parent commit, a full suite, or a title smoke pair. No game files were used.
AI use: Codex (GPT-6) and a Codex Luna subagent prepared the clean checkout, ran and checked the focused tests, and wrote this report.
@akimfomin on GitHub · 2026-11-26 02:26 UTC · original
luckyteagirl, thank you for checking the corrected requirement setting and recording the exact adapter. I added your RX 6800M run to the evidence record as a pass on the patched compiler. DarkPanda69, your side-by-side runs on the RX 9070 XT and RTX 3060 establish that the parent fails and the fix passes on those two cards.
I’m stepping back from routine work on PortBridge. For anyone continuing this fix, the narrow HLSL patch with regression and full test log are available. The remaining upstream step is the paired smoke on the same lawfully available title for a human-reviewed PR. The normal HLSL patch can travel on its own. The optional direct-DXIL optimization is a separate experiment. I welcome follow-ups here. Codex assisted with the handover.
@itsSio on GitHub · 2026-11-26 05:29 UTC · original
Verified on two NVIDIA GPUs (RTX 5080 and RTX 2080 SUPER) and prepared on top of
main(b49be183) as fork draft PRitsSio/xcl#9(recomp/wave32-pixel-mask-carry, commit382469c656ea95be862361fcca419fceecaa2784, preservingCo-authored-by: akimfomin <[email protected]>, omitting the unrelated README line), including the paired retailscripts/smoke.ps1runs.Tested
b49be183+ new GPU test only, DXC1.9.2609.5,XCL_ADAPTER=NVIDIA):gpu_wave32_pixel_carry_preserves_adjacent_mask_at_triangle_edgesFAILED as expected (mask popcount at 0: left 12.0, right 16.0).32.0.16.1088), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro build 26200.9974,rustc 1.97.0(stable-x86_64-pc-windows-msvc), DXC1.9.2609.5, debug build (XCL_ADAPTER=NVIDIA).cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1437 passed, 0 failed, 47 ignored, 25SKIPPEDlines (both new tests pass).32.0.16.1088), AMD Ryzen 5 5600X, 16 GB RAM, Windows 11 Pro build 26200.8653,rustc 1.99.1(stable-x86_64-pc-windows-msvc), Windows SDK 10.0.26100 DXC1.8.2502.11, debug build (XCL_ADAPTER=NVIDIA).cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4: 1437 passed, 0 failed, 47 ignored, 29SKIPPEDlines (both new tests pass).scripts/smoke.ps1on PC 1 (RTX 5080, release builds,XCL_DXC_DIR= DXC1.9.2609.5):main(b49be183):Rebased fix (
382469c6, warm cache):Not tested
scripts/smoke.ps1on the RTX 2080 SUPER, Linux / Wine / vkd3d-proton, and past-world-load visual scenes.AI use
Ran via Samaritan:
akimfomin's fix ontomain(382469c6), reviewed the diff, ran the pre-fix failure repro, and ran the dual-PC workspace test suites and release build.scripts/smoke.ps1run, ranscripts/pr_check.py --local, and wrote this comment.github-bot referenced this issue2026-11-26 12:25:54 +00:00