Repository navigation
Shaders: wave64 compute on 32-lane hosts, in halves and in the console flow (rebase of #233) - #1929
slatefield wants to merge 12 commits into
Conversation
A compute shader that reads other lanes declares the console's wave size. NVIDIA runs waves of 32 lanes only (D3D12 reports 32..32), so a console wave64 program of that kind was refused at pipeline creation and its dispatches were dropped without saying why. The host's wave range (D3D12 options 1) now goes into translation as `emit::Target`. A shader that needs a wave size the host does not run stops there with the reason, the shader cache keys entries by the range, and the run logs the range once with a warning when 64-lane waves are missing. `victory translate --host-lanes 32-32` counts these shaders without a GPU. This is the first step towards running these programs as two 32-lane waves on such hosts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
How one console wave64 runs as two 32-lane host waves under our per-lane structurisation, what has to cross halves, why exchanges need uniform regions, how to test on a machine with both GPU kinds, and the order of the remaining steps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`emit::host::Host::on(name)` and `VICTORY_ADAPTER` choose a hardware adapter by part of its description, and `adapters()` lists them, so a machine with an AMD and an NVIDIA GPU can run a test on each: the native wave64 form as the reference on the one with 64-lane waves, the 32-lane form on the other. A new test checks on every adapter that a wave64 program reading other lanes translates exactly when the adapter runs 64-lane waves, and that the adapter then takes it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a host without 64-lane waves (NVIDIA), a console wave64 compute program whose lanes read only their own 32-lane half (DPP, ds_swizzle) now declares WaveSize(32) instead of failing to translate. It must read no mask whole, test no bit of a mask held as a number, have no whole-wave sections and use no LDS. Every other wave64 program that depends on the lane layout still stops with the reason from the previous step. Mask ballots, wave reductions and lane-bit tests refuse the split form as a safety net. New GPU tests run hand-assembled programs on every hardware adapter and check each lane against the console's layout. On an RTX 5070 the split form is exact for 1-D groups of 32, 64 and 128 threads and for 3-D groups up to 8x8x4. A Radeon iGPU runs the same programs natively as the reference, and a read across halves (v_readlane 40) still needs 64-lane waves. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A console wave64 program that reads masks whole or lanes of the other
half now runs on a host without 64-lane waves when its group is one
console wave (64 threads or fewer, no LDS). It runs as the console
does ("console flow"):
- `structure::structure_console` never resolves mask joins from what
the lanes arriving know (every lane arrives); `Structured::execs`
gives each vector instruction's EXEC bit.
- Vector instructions are guarded by EXEC. Branches are the console's
s_cbranch_*: EXEC, VCC and mask-operation SCC tests are the console
wave's, from both halves' ballots exchanged through group-shared
memory between group barriers, which every thread reaches since both
halves branch alike.
- Masks read whole are the exchanged ballots. v_readlane and
v_readfirstlane read the owning half; v_writelane, v_mbcnt and mask
bit tests use the console lane.
The per-lane form is tried first; a program that needs the console
flow is lowered again from the console structure.
GPU tests on an RTX 5070 are exact against the console: s_bcnt1 over
both halves (64, 48 and 32 threads), v_readlane 40, an exchange inside
a branch only the lower half takes, and a loop the halves leave at
different iterations with a lane read in each. The last one shows that
the per-lane form, which hosts with 64-lane waves get, is wrong for it
(on a Radeon iGPU): noted in docs/wave64-on-wave32.md, not changed.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A wave64 program split over two 32-lane waves took the DPP row index from the host lane, so the upper half (console rows 2 and 3) read row_mask bits 0 and 1. The row now comes from the console lane there. New test: v_mov_b32_dpp with row_mask:0x3 writes lanes 0 to 31 only, exact on an RTX 5070 (split) and a Radeon iGPU (native). Found in review against Marvisak#189 and Marvisak#192, which both get this right. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v_readfirstlane reads the console wave's first lane. A wave64 program with DPP or ds_swizzle and a v_readfirstlane was split into two 32-lane waves, where the upper half read its own first lane: with all 64 lanes active, lanes 32 to 63 got lane 32's value where the console gives lane 0's (measured on an RTX 5070). Such programs now take the console flow, which reads the first lane in EXEC of the whole console wave (groups of at most 64 threads, no LDS), or stop with the reason as they did before the split existed. New test, exact on an RTX 5070 and a Radeon iGPU. Found by running the same program against Marvisak#192, which has the same result on both adapters. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…alar The comment on the console flow's SCC said both write the old EXEC to their scalar destination. Only saveexec does; wrexec writes the new EXEC to both, so either write names the mask SCC tests. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rol flow Main lowers a descriptor each lane holds by the path it took (Source::LanePhi, Marvisak#566) as a DXIL phi over the edges into the join. In the console flow every lane reaches the join by the edge the wave took, so the phi gave every lane that edge's descriptor, silently: the joined if/else program of the waterfall tests, lowered in the console flow, sampled the second texture in all 32 lanes where lanes 0-15 hold the first (RTX 5070; the module passes dxil.dll). The console flow now stops with its own reason there. A program that takes the console flow only for its lane reads keeps the per-lane form where that translates; one that needs it for the host's wave size stops with the reason. Found on the testers' branch, where Marvisak#566 and the console flow first met. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…-lane waves The GPU tests walk every hardware adapter and expect each to take the console's wave-size-dependent programs in one form or the other. An integrated GPU with narrower waves (an Intel UHD reporting 16-16 was reported on Marvisak#439) runs none of them: the translator refuses, correctly, and 30 tests failed there for expecting a pipeline. The list now leaves such an adapter out, by its wave range, as it already left out the software renderer by name. An adapter no SM 6.6 device can be made on stays listed, for its user to skip as before. Checked on an RTX 5070 (32-32) and a Radeon iGPU (32-64): both still listed, each_adapter_gets_what_it_runs and two split tests exact. Not checked on a 16-lane adapter (none here). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…e adapter list together main's new create() refuses a software default adapter for the hardware-only checks; the branch's VICTORY_ADAPTER selection stays in front of that, so an explicitly named adapter is still taken and the refusal only applies to the default.
|
Branch updated for The other three rebases (#1922, #1923, #1924) already merge cleanly onto |
|
Automated triage for the maintainers. This pull request does not merge cleanly into It will be reviewed once it is rebased onto the current Generated by Claude Code |
|
A question before merge, about the console flow's group barriers on NVIDIA. The console flow places group barriers ( For reference: a fork with a similar "two host waves" form that put barriers in branches and loops (Zettrox/ztrx, commit e9765a7) lost the device on an RTX 4070 in 4 of 4 runs when the title dispatched Could the 10 |
|
The NVIDIA run asked for above. Ran on Windows 11 with an RTX 3070 (Ampere, 32-lane waves, driver 616.56), debug build, at
So on a host without 64-lane waves, the whole-mask reads (a AI-assisted (Claude Code). Synthetic tests only. |
|
@slatefield, thank you for doing this; it saved real time. #233 itself is now updated with Since the stack is updated by merge commits rather than rebases (testers quote its hashes), the trees differ in history but should be close in content: AI-assisted (Claude Code). |
Closed: r4tedx updated #233 itself onto
main940d32f(head7147671), taking thehost_shadertarget point from this rebase and keeping one PR open so the testers' reports stay in one place, which is the right shape. The validation done here that was useful stays in #233's thread: upipibi's RTX 3070 run of thesplit_tests(13 pass; the two whole-mask-read cases are still refused on 32-lane hosts, which is a real limitation of the split form), and the wall of review about the console flow's group barriers inside branches and loops.Nothing else is open from this rebase. The branch
slatefield:up-233-rebasestays on the fork for reference.