Repository navigation
Shaders: v_writelane_b32 writes its lane whenever the wave runs it - #139
marketingwithlux wants to merge 2 commits into
Conversation
…C (known failure, ignored) A synthetic wave64 program run on the card: a lane write inside a per-lane branch whose target lane is not in EXEC is lost in every form, although the instruction ignores EXEC. The test is ignored until the lowering is fixed; docs/fork-writelane-outside-exec.md says how to reproduce it and what a fix must do. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The instruction ignores EXEC, but it was lowered under the guard of the lane that runs it, so a scalar parked in a lane outside EXEC was lost and came back stale. A guarded lane write now asks the wave whether some lane's guard holds; two host waves of 32 exchange their answers, which needs every lane, so a lane write where not every lane runs is refused as a lane read is and the forms without skips take over. The test runs the three cases on the card; it failed before in every form. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
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.
On this PR the "as is" form prints no lines, so it is refused and the forms without skips run, as the description says.
Not done here: the AI-assisted (Claude Code, Claude Opus 5.5): ran the tests on my machine and wrote this. |
|
Duplicate of #119? |
|
Build check only: this PR merges cleanly on main c96b4f2 and 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, |
… writes its lane whenever the wave runs it (by marketingwithlux)
* Shaders: reuse SSA sums when tracing memory addresses Co-Authored-By: GPT 6.2 Sol <noreply@openai.com> * Shader tests: an address from no root parameter is title memory Main reads such an address as title memory instead of refusing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: GPT 6.2 Sol <noreply@openai.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…ranslate --warm Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes #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 onmainat 4e17478 (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