Shaders: a lane write or read finds its lane where not every lane runs (#111) #219
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!219
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-219"
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?
@Alexr03 on GitHub · 2026-11-24 22:40 UTC · original
Alexr03:fix/writelane-outside-exec→main· +329 −0 · 4 files · 2 commits · openFixes #111. Overlaps with #119 and #139; see "How this differs" below.
What was wrong
v_writelane_b32andv_readlane_b32ignore EXEC on the console. The write was lowered as the lane's own, so it was lost when the lane named was outside EXEC or had left the block, and a later read gave the old value.What the title's shaders actually do
Measured over the whole shader pack, translated for a 32-lane host:
unspill(5,423 writes). All 40 are 32-lane programs, and all are ray-tracing trace programs:shadowmask:CS_TraceShadowRays_*,rtdirectionalshadows:*,sr_tracing:CS_Raytrace*, the screen-probe tracers.v_readlane_b32 s22, v29, s22). The VGPR is an ordinary temporary elsewhere, sounspillleaves it.CS_ShadowRenderTiled*programs of #62 are not among the 40, so this is not what is wrong with them.The change
LANE_ELSEWHERE), naming the block.emitthen has the wave take the branches around it together (widen), so every lane is present. Where the host's waves are the console's, as for all 40 programs, that costs no barrier. A console wave run as two host waves goes through its forms without skips instead.with_lanes_as_they_stand). No program stops translating.How this differs from #119 and #139
Both fix the guarded write and the two-host-wave case, which is what the synthetic test in #111 exercises, and this PR does the same there. As far as I can tell from their descriptions, neither changes anything for a write with no guard in a program whose waves are the host's, which is all 40 programs in this title. This PR adds that route, the matching rule for reads, and the fallback. #139 asks for a run over a title's shaders; the numbers below are that run for this change.
The first commit is the failing test from #111's branch, by its author.
Results
RTX 5080 (32-lane waves), Windows 11.
dxil.dll)VICTORY_WAVE_WHY=1printsLANE-ELSEWHERE ...with the reason.Tests, both run on the card:
a_lane_write_reaches_its_lane_outside_exec(no longer ignored): a console wave of 64 on a 32-lane host gives 5, 5, 7 in both forms without skips; as it is, the program is refused and handed to those forms.a_lane_array_is_written_and_read_with_the_skip_wave_wide(new): a 32-lane wave with the trace programs' pattern, including the computed lane read and the fallback.cargo test --workspacepasses,cargo clippy -p victory-shader --all-targetsis clean,cargo xtask policyis ok.Not done
ir::unspillwould settle those too, at no cost per frame.shortcut:in the code.Details are in
docs/fork-writelane-outside-exec.md. Nothing from the game is attached: counts and program names only.@JRamos1993 on GitHub · 2026-11-25 06:56 UTC · original
Offline check on the retail shader pack: no program gained or lost, but 25 programs' DXIL changes.
victory translate --validate --listover the title's full shader pack (26,084 programs) on an RTX 5090,main310c6ebagainst this head merged onto it. I added a local DXIL hash on each validated line (two runs of one build hash the same):I have not looked at what changes in them or checked it in game.
AI use: Claude Code with Claude Opus 5.5 ran the pack and wrote this. Nothing from the title is in it.
@HAL9000RELOADED on GitHub · 2026-11-25 19:29 UTC · original
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main
d510ee4: both new tests pass on the card with this PR. No other test changed. Run table: #129 (#129).View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.