Repository navigation
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>
fxceless#111) v_writelane_b32 and v_readlane_b32 ignore 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. In this title's pack 40 compute programs keep lane writes after unspill, all 32-lane ray-tracing trace programs: a small array of scalars in the lanes of one VGPR, written by constant lane and read by a computed one. Every such write stands in a block only some lanes run. A lane write, or a lane read of a VGPR that lane writes fill, in such a block is now refused there, and emit has the wave take the branches around it together (widen), so every lane is present; where the host's waves are the console's that costs no barrier. Under a guard the lane takes the scalar when some lane of the console wave is in EXEC; two host waves of 32 exchange their answers. A program whose branches cannot be taken together is translated as before, so none stops translating. On the pack for a 32-lane host: 2,669 of 2,682 compute programs emitted and validated before and after. Of the 40, 36 translate either way and get a pipeline on an RTX 5080: 25 with their branches wave-wide, 11 as before. The known-failure test is no longer ignored, and a second one covers the 32-lane pattern. Not checked in the game.
Flyander
left a comment
There was a problem hiding this comment.
Cross-check on Windows D3D12 with an RTX 5070 Ti: cargo test --locked -p victory-shader --lib wave64_tests -- --nocapture passes (7 passed, 0 ignored). Both new tests execute on the hardware device: the lane write/read cases produce the expected values for the 32-lane host, and the existing two-half wave cases still pass.
…ation fix(pe): validate section raw data bounds
…ation fix(pe): validate section raw data bounds (cherry picked from commit c5b83b9)
|
Offline check on the retail shader pack: no program gained or lost, but 25 programs' DXIL changes.
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. |
|
RX 7900 XTX (RDNA3), Windows 10 + #402 for SM 6.6, main |
Fixes #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 RTX 4080: the 14 CS_ShadowRenderTiled* programs look wrong in the deep-skips wave64 form (missing ceiling, dark room); loop limit 32 smears hair #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.