Shaders: v_writelane_b32 writes its lane whenever the wave runs it #139
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!139
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-139"
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?
@marketingwithlux on GitHub · 2026-11-24 21:48 UTC · original
marketingwithlux:fix/writelane-outside-exec→main· +174 −2 · 3 files · 2 commits · openFixes #111. Found while looking into #62; not yet shown to be its cause.
What was wrong
v_writelane_b32ignores EXEC on the console, but it was lowered under the guard of the lane that runs it. A scalar the compiler parks in a lane that is outside EXEC was lost and came back stale from the laterv_readlane_b32.unspillhides this for a VGPR used for parking alone; a parking VGPR with any other use keeps its lane writes.The change
crates/victory-shader/src/emit/lower.rs, the"v_writelane_b32"arm (28 lines):waveAnyTrue) and is written without the guard, so a wave with no lane in EXEC still writes nothing, as when the console takes the skip;exchange_halves). That needs every lane, so a lane write in a block not every lane runs is refused with "a lane write where not every lane runs", as a lane read already is, andemitgoes on to the forms without skips.Tests
a_lane_write_reaches_its_lane_outside_exec(synthetic GFX10 words), run on an RTX 3090 (32-lane waves, Windows 10 with the runtime from #69):cargo test --workspace: everything passes exceptemit::rect::tests::the_rectangle_stage_is_a_geometry_shaderandrectangles_are_drawn_whole, which fail the same way onmainat4e17478(PSV0 validation, #12).cargo clippy -p victory-shader --all-targetsis clean.Not done: help wanted
docs/fork-writelane-outside-exec.mdin this branch has the details, written so a person or an agent can pick it up. In short:VICTORY_HOST_WAVE=32 victory translate --validatebefore and after, and compare the translated and validated counts. A program that newly stops with "a lane write where not every lane runs" in every form is a regression; please report its name.waveAnyTruealone. Running the test above on an AMD card and posting its lines would settle it.The expected values are the instruction's documented behaviour, not a console measurement. Nothing from the game is attached. AI-assisted (Claude Code).
🤖 Generated with Claude Code
@ezbyDev on GitHub · 2026-11-24 22:05 UTC · original
The 64-lane run asked for in the description: passes on AMD, and the test catches the bug there.
Setup: AMD Radeon RX 9060 XT 16 GB (RDNA4, native 64-lane waves), Adrenalin 32.0.32029.2010; i7-9700K; Windows 11 Pro 26300; Rust 1.98.1 (pinned); DXC from the Windows SDK 10.0.26100.
cargo test -p victory-shader --lib a_lane_write_reaches_its_lane_outside_exec -- --nocapture3c408b4main4e17478+ only this PR's test file481569b+ only this PR's test fileOn this PR the "as is" form prints no lines, so it is refused and the forms without skips run, as the description says.
cargo test -p victory-shader --libon this PR: 211 passed, 0 failed, 2 ignored.Not done here: the
VICTORY_HOST_WAVE=32 victory translate --validatecomparison over a title's shaders and the prison cell A/B (#62). Both need the title's files, so they're for whoever has them; on a 64-lane card the first would only cover the 32-lane host path anyway.AI-assisted (Claude Code, Claude Opus 5.5): ran the tests on my machine and wrote this.
@kaayzouee on GitHub · 2026-11-25 01:27 UTC · original
Duplicate of #119?
@Revens2 on GitHub · 2026-11-25 05:13 UTC · original
Build check only: this PR merges cleanly on main
c96b4f2and the integration build of eight PRs (#115 #66 #36 #144 #147 #141 #139 #130) compiles (diagnostics profile). In the game, that combo was run alone 3 times (900 s,VICTORY_RELAY=2, scripted input): one run to the end (median 4.95 fps, about 4.9k draws per frame, against 4.84-5.04 fps on main), one title breakpoint0x80000003at about 157 s after a failed dstorage request (the pattern is explained on #115), one device removed (0x887A0005) at about 160 s that did not repeat in the two other runs. Nothing is proven for this PR alone: it was not run on its own,cargo testwas not run on the combo, and nothing was checked on the title side of its change. Not verified.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.