Shaders: lower a negated group atomic add to compare-exchange #4595
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4595"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-11-30T23:34:02Z.
Refs #4449.
What it changes
The driver refuses compute pipeline
7f61193d2c0e5f22withE_OUTOFMEMORYon affected RTX 50 runs. Inspection on the RTX 5060 Ti found a group-sharedatomicrmw addwhose operand was a negated value. This adapts the add-of-negation part of #1939 to current main, retaining the old atomic value and repairing the affected control-flow edges. Credits to notquiteog for the original rewrite and Claude Opus 5.5 for the adaptation.How it was tested
913335f0and repeated the same beach save/load at 1440p, Series X, DLSS Quality and frame generation off. On v2026.11.30.03 that load reportedE_OUTOFMEMORYfor7f61193d2c0e5f22. The patched build recorded the host creating that pipeline. Hardware reportdd7e00a2on7d93ee07. The two files changed by the patch are byte-identical to913335f0. The game result belongs to913335f0and measures pipeline creation.dd7e00a2, Windows and RTX 4060.cargo test --locked -p victory-shader --lib atomic_adds_of_a_negation_become_loopsandcargo test --locked -p victory-shader --lib an_lds_subtraction_takes_the_data_off_and_runs_on_the_cardeach passed. The fullcargo run --locked -q -p xtask -- policyscan passed for 464 files.Windows CI on
dd7e00a2. The check job reached the GPU unit tests and returnedTimedOutinstead ofDoneinwatch::ask_holds::wait_open_done_covers_immediate_fast_spin_yield_cleared_and_timeout. This timing-sensitive test was also reported on main in #4379. #4629 includes a controlled-clock check and a reproduction of the timeout with a simulated scheduling delay.Checked for overlap
Related: #1939 and #4449. #1939 was written against the older lowering. This carries the applicable part of its workaround on current main.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by tyr0nsur on 2026-12-01T00:10:33Z.
More evidence for this change (on
913335f0, which the rebased head keeps byte-identical in the two files):victory translate shaders.rpf --validate --listover all 26,084 programs (VICTORY_HOST_WAVE=32) withmain(e1251c31) and with the patch: exactly one program's output changes,7f61193d2c0e5f22(d3d51ed6b64543d6→e2266fb29a574b64). 25,622 validated in both, with no validator error. No other program has an add of a negation on group memory.--pipelineson an RTX 4060 (driver 621.14) for that program: created before and after. The RTX 40 card takes both forms, so the change costs nothing there.victory-shaderlib suite on the RTX 4060: 536 passed, 1 failed,split_lds_wave32_read_after_read_barrier_coalescing_and_parity. That test already fails onmain(#4296, #4320) and failed the same way on another branch here.mainnor reverted on purpose (#4449). So this brings back the one missing piece.AI-assisted with Claude Code.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.