Shaders: lower a negated group atomic add to compare-exchange #4596
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!4596
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@tyr0nsur on GitHub · 2026-11-30 23:34 UTC · original
tyr0nsur:claude/atomic-add-of-negation-loop→main· +170 −0 · 2 files · 1 commits · openRefs #4450.
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 #4380. #4630 includes a controlled-clock check and a reproduction of the timeout with a simulated scheduling delay.Checked for overlap
Related: #1939 and #4450. #1939 was written against the older lowering. This carries the applicable part of its workaround on current main.
913335f012todd7e00a2c9@tyr0nsur on GitHub · 2026-12-01 00:10 UTC · original
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(#4297, #4321) and failed the same way on another branch here.mainnor reverted on purpose (#4450). 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.