Read VCCZ after scalar writes to VCC #3759
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!3759
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3759"
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?
@xiepeixuan on GitHub · 2026-11-30 06:07 UTC · original
xiepeixuan:auto/scalar-vccz→main· +60 −1 · 3 files · 2 commits · draftRefs #1138 (triage map) and #2487 (the distinct SCC special-source/address-tracking change). No matching game issue identified.
What it changes
A shader can write VCC as scalar data, then read the scalar source
src_vccz(251). The IR already records the VCC dwords read, but the emitter rejected the source when its value became live.AMD RDNA 2 ISA, section 3.9: “VCCZ is updated every time VCC is updated: vector compares and scalar writes to VCC.” The same section specifies that only the low VCC dword contributes in Wave32. Both dwords contribute in Wave64. Section 5.2, Table 10 defines source code 251.
The new operand arm reads the available scalar VCC dword(s), compares with zero, and zero-extends the boolean to i32. It deliberately leaves tracked per-lane-mask dwords unsupported: a partial host ballot must not be substituted for the entire guest wave.
Expected effect on NVIDIA
Tier A: shader refusal. A shader that restores a numeric VCC mask and consumes its summary in a live compare can now translate. Previously the translation was refused. A missing draw or dispatch is a possible player-visible consequence; it is not measured in the game, and no particular game's shader has been identified here. This is a translator omission, not a WARP or floating-point precision difference.
How it was tested
scalar_compare_reads_vccz_at_the_console_wave_width; four dynamic VCC-dword pairs each in Wave32 and Wave64. With only bit 63 set, the stored answer must be 1 in Wave32 and 0 in Wave64.Unsupported { offset: 44, what: "a special operand (vccz, execz, scc, lds_direct)" }; regression exit 101. Pristine main Linux suite: 295 passed, 0 failed, 2 ignored.177fbbb0d3b9038503b231c95848d28e247188e9: regression exit 0; Linux suite 296 passed, 0 failed, 2 ignored. Restoring only the original emitter reproduces the original refusal, exit 101.cargo check --workspace --lockedpassed on both. Unfiltered shader tests: 457 / 458 passed, with the same five failures and 9 ignored. Excluding only those five baseline failures gives 458 passed, 0 failed, 9 ignored, exit 0, on the fix.flat_global_stores_and_atomics_fence_uavs_at_group_barriers_across_waves,cs_sort_ray_tiles_divergent_loop_atomics_stay_wave32_with_fence_only,nv05d1_native_readlane_gpu_reference,one_console_wave_divergent_loop_lds_widens_for_one_and_two_block_loops, andone_console_wave_divergent_loop_wave_ops_widen_for_one_and_two_block_loops.unwind_copy, two unused imports, argument count, unchanged loop condition). Nothing unrelated was changed.frame_users.rs; checking only the three changed files passes:asset policy: 3 files ok.unwind_copydead-code diagnostic present on pristine main; subsequent steps were skipped.cargo testpassed for the touched crate: yes on Linux; Windows has the explicitly listed baseline failures.Checked for overlap
Lower::operandand SCC address tracking; it does not implement VCCZ. #3440, #2389 and #1952 concern branch/wave uniformity, not operand 251.Uses audit and cost
Opened as a draft early so others know this is being worked on (README: 'Opening a draft pull request early works too').
AI-assisted (Codex). Not run in the game.
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.