GPU+shader: translate wave64 programs for 32-lane host waves when WaveLaneCountMax < 64 #2176
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2176
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2176"
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?
@n-romanovich on GitHub · 2026-11-25 07:06 UTC · original
n-romanovich:pr/wave32-translation→main· +203 −13 · 15 files · 3 commits · openSummary
NVIDIA and Intel GPUs only execute 32-lane compute waves (
WaveLaneCountMax < 64) and reject pipelines declaringWaveSize(64).This adds Wave32 host translation mode so wave64 console programs run as two 32-lane host waves instead of failing pipeline creation:
D3D12_FEATURE_DATA_D3D12_OPTIONS1invictory-gpu(host_wave32(), overridable viaVICTORY_HOST_WAVE32).set_host_wave32/host_wave32invictory_shader::emitand emitWaveSize(32)when enabled, masking wave lane indices inread_lane,ds_bpermute, andcross_laneviahost_wave()/host_lane().victory-gpu::shader_cache::keyso Wave32 and Wave64 shader caches stay isolated.Verification
Tested on NVIDIA GeForce RTX 5060 Ti:
cargo test --release -p victory-shader --lib -- diff_tests valu_tests:33 passed; 0 failedcargo test --release -p victory-gpu --lib -- shader_cache:3 passed; 0 failed@iGoldenNinja on GitHub · 2026-11-25 07:14 UTC · original · edited 2026-11-25 07:35 UTC
Correction. My original
ds_bpermute_b32fixture used the wrong expected result. On RDNA2 the permute stays within each 32-lane half of a Wave64. The observed values, 1000 in lanes 0–31 and 1032 in lanes 32–63, match that rule. I withdraw the claim that the fixture found ads_bpermute_b32regression. Thank you @upipibi for pointing out the distinction. AMD RDNA2 ISA, section 10.4.4 · XCL native hardware checksThe original PSO result stands. RTX 5080, driver 617.14, Windows 11 Pro build 26200.9974, PR head
3feadc6. Three of four matched compute inputs translated and validated with host Wave32 off and with it on. Those PSOs went from 0/3 created to 3/3. The fourth input reached a separate descriptor translation refusal in both modes. Successful PSO creation does not establish shader output parity.I also independently reproduced @Dathinel's actual
v_readlane_b32issue on this RTX 5080. Selecting guest lane 5 produced 5 in the lower half and 37 in the upper half. Selecting guest lane 32 produced 0 and 32, respectively. Every lane should receive the selected guest lane's value. Both synthetic DXIL pipelines validated, ran, and failed their readback assertions. The corrected permute fixture passed.Corrected test report · Synthetic fixtures
OpenAI Codex (GPT-6) ran the RTX 5080 tests and drafted this correction.
@Dathinel on GitHub · 2026-11-25 07:14 UTC · original · edited 2026-11-25 07:36 UTC
The cross-half issue also affects scalar
v_readlane_b32. I ran the same ten synthetic GFX10 words on an RTX 3050 Laptop with host Wave32 explicitly enabled on the revisions below. One 64-thread group starts withv0 = tid.x, executesv_readlane_b32 s12, v0, 32, and stores the result toout[tid.x].5a11cf4, 32-lane targetAll three pipelines dispatched successfully. This tests scalar
v_readlane_b32specifically. Until the two waves exchange values, it would be safer to reject this cross-half read than return the wrong scalar.Fixture words (hex), raw UAV at heap index 0:
d760000c 00014100 7e06020c be810380 f4080200 fa000000 341e0082 e0701000 8002030f bf810000.Control with lane 5: changing only the source lane from 32 to 5 produced 5 for threads 0–31 and 37 for threads 32–63 on this PR. On #189 and #439 all 64 threads returned 5. A guard that only rejects indices above 31 would miss this case.
AI-assisted; synthetic inputs only.
@upipibi on GitHub · 2026-11-25 07:25 UTC · original · edited 2026-11-26 00:22 UTC
Update for
fb99078: this note was on an earlier head.fb99078refuses cross-halfv_readlane_b32/v_writelane_b32in compute and ballots ors_bcnt1/s_ff1that read EXEC or VCC as numbers. A constant 64-bit EXEC is still taken from the low word in both halves (measured: #2176). (Edited: I removed a sentence claimings_cbranch_execz/vcczcan send the halves different ways. That was wrong: here each lane branches on its own bit.)Overlap note: #189 (alfycs) and #233 / #320 / #439 (r4tedx) also run wave64 programs on 32-lane hosts, and they emulate the operations that cross the halves. This PR runs each half as its own 32-lane wave, and
host_lanemaps a console lane tolane & 31, so anything that needs the other half or the whole 64-bit mask comes out per-half:v_readlane_b32/v_writelane_b32with lanes 32–63 read or write the reader's own half (Dathinel'sv_readlane_b32 s12, v0, 32above), andv_readfirstlane_b32in the high half returns a high-half lane.v_cmpinto VCC ands_*_saveexecare per-lane booleans here and are fine. Reading EXEC or VCC as a number (ballots,s_bcnt1/s_ff1) sees 32 bits;fb99078refuses those. A constant or SGPR-pair EXEC still takes the low word in both halves (measured, linked above). (Edited: the first version saidv_cmpands_*_saveexecsee 32 bits; they don't.)ds_bpermute_b32is fine with the mask: in wave64 it stays inside each 32-lane half. XCL #1022's test of that passes on native wave64 AMD hardware (RX 7600 XT, RDNA3); I know of no RDNA2 measurement.Programs without cross-half operations run correctly this way, which matches iGoldenNinja's 3/3 PSOs. For the rest, #233 refuses by name what it can't emulate yet. Taking this as a fallback only for programs with no cross-half operation, or building on #233's split, would avoid silently wrong lanes.
AI-assisted (Claude Code); source read only.
@sinan-cmyk on GitHub · 2026-11-25 07:59 UTC · original
Offline measurement on a retail dump
Result: no count change against
main.I merged head 3feadc6f onto
main940d32f(clean merge) and ranvictory translate --validate --listonshaders.rpf(1.0.2.1), with dxil.dll 1.8.2502.11. I compared the result withmainprogram by program (25,889 programs). Validated: 23,918 onmain, 23,918 with this PR.No program changes its failure reason. The count shows that the change rejects nothing on this data. It does not show whether the output is right.
No shader names or data are included, per the asset policy. AI-assisted (Claude Code).
@imrealynailong on GitHub · 2026-11-25 08:29 UTC · original
RTX 4060 Laptop: the PR takes compute PSO refusals from 115 to 0, and the world still fails on the descriptor heap
Independent check on a card not yet reported: RTX 4060 Laptop (Ada), driver
32.0.15.6607, Windows 11 build 26200, i7-13620H, 16 GB. Ranmain940d32fand this PR's head3feadc6through the same scenario, in separate worktrees, same package, same cache cleared between.The detection works here:
INFO victory_gpu::host: host wave lanes min=32 max=32 wave32=true.The PR does what it says for pipeline creation
Counted from a
--features diagnosticsrun over the prologue into the world:main940d32f3feadc6host pipeline refused(0x80070057, allcompute)host wave lanes ... wave32=true,min=32 max=32frame=seenSo on this machine every one of the 115 wave64 compute pipelines that
mainrefuses now creates. That is a clean result and consistent with @iGoldenNinja's 3/4 → 3/3 on the 5080 (mine is a wider count because it goes through the whole prologue, not a four-input fixture).What it does not change: the world still dies on the capped descriptor heap
Same two runs, the counters that matter for reaching the world:
main940d32f3feadc6title slot past the host heaphost view heap capped at 1000000 ... count=1245184device removed310,720is exactly1,245,184 − 934,464, the unmirrored-slot count in #1760. It does not move at all with this PR, because it is not a wave problem.So on this card the two failures are independent, and fixing the wave side does not get the world up. That may be worth stating plainly in the PR body: this PR removes the
host pipeline refusederror class entirely, but a run that had only the wave problem fixed still dies at the same place for an unrelated reason.Agreement with @sinan-cmyk's offline result
Their
translate --validatecomparison found the same validated count on both sides (23,918). Mine is the runtime half of the same picture: the offline pass count does not move and the runtime PSO refusals go to zero, because the wave64 programs previously failed atCreateComputePipelineState, not at translation. Both measurements are consistent with "the change rejects nothing and unblocks pipeline creation".Not tested / not claimed
v_readlane_b32cross-half result or @upipibi's list of per-half operations. iGoldenNinja's 5080 readback failures are the relevant evidence and I have not repeated them.emit::valu_tests::fspx_programs_run_with_the_hardwares_dot_products,emit::valu_tests::image_atomics_of_64_bits) — but they fail identically onmain940d32fwith no PR applied, so they are pre-existing here and not caused by this change. The PR body's "33 passed; 0 failed" is on a 5060 Ti; on the 4060 Laptop I get 31 passed, 2 failed, both pre-existing.Logs and the failing-test detail available if useful.
@Marvisak on GitHub · 2026-11-25 13:28 UTC · original · edited 2026-11-26 00:22 UTC
Automated triage for the maintainers.
Needs work. The rebased head
fb99078moveshost_wave32intoemit::Options/lower::Parts(no global state any more), fixes the earlier CI error, and adds a refusal for one-wave LDS sharing (Lower::run) with tests. CIcheckpasses and it merges cleanly.Two points still hold it back:
Lower::host_wave()(crates/victory-shader/src/emit/lower.rs) returns 32 wheneverx.host_wave32is set, whatever the stage, so the newhost_wave() < wave()checks incross_lane, the ballot-as-data path and the wave scan also refuse wave64 pixel and mesh programs, which never getWaveSize(32). A tester measured this on an RTX 5080 (pixel programs not translating 3 -> 330, mesh 0 -> 67). This was the open point from the earlier note. Please makehost_wave()return 32 only for the compute programs that are givenWaveSize(32), and add a test showing a wave64 pixel program with a cross-lane op still translates withhost_wave32: true.lane_bitpicks the low or high mask word withlane < 32, but the lane comes fromwaveGetLaneIndex, which is 0..31 in each host wave, so the high word is never used:s_mov_b64 exec, 1stores in lanes 0 and 32, andexec = 1 << 32stores nothing. Either select the word by the half the host wave stands for, or refuse such masks on a 32-lane host, with a test.On your reply: the move to
Optionsand the LDS refusal address those points; the pixel/mesh scope above is the part still open. Note also that #2177 changes the sameOptionsandshader_cache::key, so one of the two will need a rebase.Generated by Claude Code
@n-romanovich on GitHub · 2026-11-25 14:09 UTC · original
@Marvisak, updated
pr/wave32-translation(b2ea86a) to address the triage points:host_wave() < wave()(crates/victory-shader/src/emit/lower.rs):Lower::cross_lane(false)now returnsErr("a cross-half operation on a 32-lane host")(coveringv_readlane_b32,v_writelane_b32,v_readfirstlane_b32,ds_bpermute_b32,v_mbcnt, and wave-wide DPP; 4-lanequad == trueops remain allowed).Lower::mask_dwordand the wave-scanwaveActiveBallotpath returnErr("a 64-bit wave mask read as data on a 32-lane host")/Err("a cross-half wave scan on a 32-lane host").WaveSize(32)split now applies only to wave64 compute shaders without cross-half operations.emit::tests::wave64_cross_half_readlane_is_refused_on_wave32_hostverifying that a wave64 compute shader usingv_readlane_b32is refused on a 32-lane host.@Bladureau on GitHub · 2026-11-25 16:20 UTC · original · edited 2026-11-25 17:06 UTC
RTX 4060 Laptop, in the world: wave64 mesh draws without a hang; BVH-builder programs hang; other wave64 compute makes GPU frames ~80× longer (both heads)
Machine: RTX 4060 Laptop 8 GB (driver 617.14), i7-13650HX, 32 GB RAM, Windows 11 26300. The log shows
host wave lanes min=32 max=32 wave32=true. Series X mode, title 1.0.2.1. Diagnostics build withVICTORY_D3D12_DEBUG=1andVICTORY_D3D12_DRED=1. No input once in the world.Tree:
main940d32f+ #2121 (40bd210) + #1763 (50d91b1) + #1630 (3c036f7) + this PR + #579 (rebased, patch from its thread) + #2332 (0e350ab, without it this card loses the device on the format-115 render target before or just after world entry, #1952). The only conflict wasshader_cache.rs: I kept both #2121'sview_pagesand this PR'swave32in the cache key. Each translator was warmed withtranslate --cachebefore its runs.Offline, whole retail set (25,985 containers):
3feadc6refuses 307;b2ea86arefuses 1,021, so 714 more.3feadc6DXGI_ERROR_DEVICE_HUNG33 s after world entry. DRED: the list stopped at command 1799 of 6978,dispatch 229x1x1 [compute 28918b7150a7aad5], in a stretch alternating withcaa78b8ca62bc3d63feadc6VICTORY_SKIP_WAVE64=compute3feadc6XboxBvhBuilder.dllprograms +f607780aa8e502d0(VICTORY_SKIP_PIPELINES)+0x23cf683write 0x0 (#1118), 2 min 10 s in, 10 s after a 42 s capture frame (see the edit)b2ea86ab2ea86aVICTORY_SHADER_LOOP_LIMIT=1024b2ea86atranslate --cache --pipelines)What I read from it:
28918b7150a7aad5/caa78b8ca62bc3d6. These are the LDS-sharing builder programs #2311 names, sob2ea86a's guard does not cover what they need: both halves in one flow.b2ea86arefused 95 programs at run time (90 compute, 3 pixel, 2 mesh; 70 for "a 64-bit wave mask read as data", 25 for "a cross-half operation"), and the frames stayed as long. So the slow programs are not the ones the new guard catches.VICTORY_SHADER_LOOP_LIMIT=1024, the GPU part of a world frame falls from 9–20 s to 0.1–0.7 s outside captured frames. Why they run that long is my reading, not a measurement: I think they wait on values the other half writes. A console wave64 runs both halves in lockstep, so a value written by lanes 32–63 is already there when lanes 0–31 read it. As two host waves, one half can spin until the limit. Such programs use no cross-lane instruction, so the new guard cannot see them.Edit (after a ninth run): I first wrote that run 8's long frames were pipeline compilation. They were my own captures.
VICTORY_DUMP_TARGETSwrote 550–780 targets for each captured frame, which took 22–42 s. Every frame over 20 s in runs 8 and 9 is one of them, and so are the 2–3 s GPU values. The watchdog in runs 6, 7 and 8 fired 1–10 s after a 38–42 s capture frame, and capture frames of 22–30 s never set it off. So those three stops say more about my captures than about this PR (runs 6 and 7 still spend 9–22 s of GPU time per frame). Run 9 repeats run 8 with every pack pipeline prebuilt, none made during the run. It ran 6 min 40 s in the world with five capture frames of 22–28 s, no watchdog, no device removal and 0ERRORlines, until I stopped it. Its G-buffer holds the outdoor scene's geometry, and the presented frame is still black.If it helps, I can name the programs that hit the limit:
VICTORY_GPU_TIMING=1on run 6's settings, then their hashes here.One run per row. Counts, hashes and messages only, no game data. AI-assisted (Claude Code).
@moe-miau on GitHub · 2026-11-25 18:30 UTC · original
Tested on an RTX 4070 SUPER (driver 32.0.16.1742, Windows 11 26300), title 1.0.2.1, Series X profile, diag build, 6-minute runs with scripted Enter presses. Base stack:
main67e8ae1+ #1906 + #2098 + #2626 + #2628 + #2464 (with #2464 the world draws on NVIDIA).WaveSize(64))0x887A0006)Of the 118 programs this PR leaves untranslated here, 80 fail with
a 64-bit wave mask read as data on a 32-lane hostand 32 witha cross-half operation on a 32-lane host(plus the cross-half scan). Each host wave already stands for one half (ballothigh dword 0,host_lanemasks to 31), so I tried letting those three cases through with exactly those semantics, the way Zettrox/ztrx's default wave-local fallback does:Everything translates then, but the BVH builder (
XboxBvhBuilder.dll; the hung submission held 14394a32 and 28918b71) really needs 64 lanes and hangs the GPU. With #2118 merged as well, plus one line holding the builder back on such hosts, the run went 6 minutes without a removal and the picture improved a lot:The builder then stays off on NVIDIA, as it does on
maintoday, where its programs are refused. The approximation is exact for programs whose waves only work within themselves (compaction, reductions, one atomic per wave), and approximate for real cross-half exchanges. If you'd like it in this PR, I can send the change on top of it. Otherwise I can open it as a follow-up once this and #2118 are in.AI-assisted (Claude Code); runs done on my machine.
@frenziedcoder on GitHub · 2026-11-25 19:23 UTC · original
RTX 5080 (Blackwell), driver 621.40, this PR (
9857ed1) on top of the stack from #2464: no compute pipeline is refused any more (171 → 0), but on this 32-lane host it also stops pixel and mesh programs from translating that translate without it (pipelines skipped for that reason: pixel 3 → 330, mesh 0 → 67). The world still draws and the run had no device removal in 10 minutes.Setup: NVIDIA GeForce RTX 5080 16 GB (driver 621.40), Ryzen 7 9800X3D, 64 GB, Windows 11 Pro 26200. Title 1.0.2.1, Series X profile,
diagbuild with diagnostics,VICTORY_D3D12_DRED=1, scriptedEnter. The log sayshost wave lanes min=32 max=32 wave32=true.Trees: "stack" =
main13f91ca+ #1906 + #2098 + #2626 + #2628 + #2464, as reported on #2464. "+ this PR" merges9857ed1on top. Two conflicts with #2628, resolved by keeping both settings:emit::Optionsgets bothportable_viewsandhost_wave32, and the shader cache key inshader_cache.rshashes both the view heap limit and the wave32 flag. One test initializer #2628 adds (memory_tests.rs,lower::Parts) neededhost_wave32: false. Workspace tests build;shader_cacheandwavetests pass.translate --cache --pipelines(whole pack,--jobs 12):In the title (one 600 s run each):
shader does not translate; its pipelines' draws are droppedReasons for the 166 compute programs: 80
wave64 compute shader sharing LDS within one wave on a 32-lane host, the resta 64-bit wave mask read as data on a 32-lane hostanda cross-half operation on a 32-lane host. So in the run most of the 171 refusals became translation refusals, and their dispatches are still skipped, as @moe-miau found (118 on the 4070 SUPER).The pixel and mesh refusals carry the same two messages. Without this PR those programs translate and the host takes them, so it looks like the new
host_wave() < wave()refusals inLoweralso reach pixel and mesh stages, which the PR doesn't split. Limiting them to the compute programs that getWaveSize(32)would keep those draws.Not tested: more than one run per tree; @moe-miau's
wave32_approxchange, #2118 and the builder hold-back on top; Series S profile.AI use: Claude Code (Claude Opus 5.5) merged the trees, resolved the conflicts, ran the title on my machine (sandboxed at Low integrity, game folder read-only), read the logs and frame captures, and wrote this report.
@frenziedcoder on GitHub · 2026-11-25 20:41 UTC · original
Follow-up on the RTX 5080 (621.40): @moe-miau's
wave32_approxchange plus #2118 and the builder hold-back, on top of this PR and the #2464 stack, removes the pixel / mesh regression I reported above, and the run is the best on this card so far: exposure normal, ~1.8 fps, no device removal in 600 s.Tree: the stack from #2464 + this PR (
9857ed1) + #2118 (60632d3, clean merge) + the two local changes from @moe-miau's comment, applied as written:&& !super::wave32_approx()on the threehost_wave() < wave()refusals inlower.rs(withwave32_approx()returningtrue), andlet open = all_made(&states) && !crate::host::host_wave32();inpipeline/builder.rs(victory_shader::emit::host_wave32()is not on this head;victory-gpu's ownhost::host_wave32()stands in). Same machine, switches and scriptedEnteras before.translate --cache --pipelines(on the triage's minor point:--cachetranslates throughvictory_gpu::shader_cache::host_shader, which fillshost_wave32from the host, so these offline counts do include the 32-lane refusals; only plaintranslatewithout--cachepasses..Default::default()):In the title (one 600 s run each):
80 of the 84 compute programs still dropped are
wave64 compute shader sharing LDS within one wave on a 32-lane host, which the two changes don't touch (this head refuses that case; @moe-miau's run may have been on an earlier head, with 4 left).Not tested: more than one run; the changes one at a time; Series S profile.
AI use: Claude Code (Claude Opus 5.5) merged the tree, applied the changes from the comment, ran the title on my machine (sandboxed at Low integrity, game folder read-only), read the logs and frame captures, and wrote this report.
@n-romanovich on GitHub · 2026-11-25 22:57 UTC · original
@Marvisak Updated
pr/wave32-translation(fb99078):host_wave32intoemit::Optionsandlower::Parts(no global state).wave64 && host_wave32whenone_wave && lds_dwords > 0(single-wave LDS without barriers), alongside the existing cross-lane refusal.wave64_one_wave_lds_is_refused_on_wave32_hostand verifiedwave64_cross_half_readlane_is_refused_on_wave32_host.main; CIcheckpasses.@upipibi on GitHub · 2026-11-25 23:54 UTC · original · edited 2026-11-26 00:22 UTC
@n-romanovich a measured case at
fb99078that is neither refused nor right: a constant 64-bit EXEC in a wave64 compute program on a 32-lane host.RTX 3070 (driver 616.56, 32-lane waves,
host_wave32: true), a 64-thread wave64 CS: every lane writes0xFFFFFFFFtoout[tid], then EXEC is set, then each active lane storestid. Two runs, identical:fb99078s_mov_b64 exec, 1out[0]out[0]andout[32]1 << 32(vias_mov_b64 exec, s[14:15])out[32]0x1_00000001out[0],out[32]out[0],out[32](right only because both words are equal)lane_bitbuilds both words for a constant or SGPR-pair mask (emit/lower.rs~2615-2633) but picks between them withlane < 32, andlanecomes fromwaveGetLaneIndex, which is 0..31 in each 32-lane host wave, so the high word is never used. Selecting by the half the host wave stands for (console lane = host lane + 32 · half) would likely fix it (untested). Writing EXEC ass_mov_b32 exec_lo, 0 ; s_mov_b32 exec_hi, 1is refused (a lane mask holding lanes elsewhere read as data is not supported). The probe is an ignored test on top offb99078:github.com/upipibi/VIctory@8beefc4f63(cargo test -p victory-shader --lib probe_2176 -- --ignored --nocapture).AI-assisted (Claude Code, Claude Opus 5.5). Synthetic instruction words only.
@moe-miau on GitHub · 2026-11-26 00:13 UTC · original
@n-romanovich #2925 builds on your one-wave LDS refusal: instead of refusing, it plans a group barrier between the program's LDS phases at a point every thread reaches once, and keeps your refusal wherever no such point exists. On an RTX 4070 SUPER it lets the program that writes the ray-march step volume (
34d88edf583f3778) translate; the lighting passes that read it go from ~95-147 ms to under 3 ms per dispatch. Happy to fold it into this PR instead if you prefer.@walterwallaceson on GitHub · 2026-11-26 02:04 UTC · original
RTX 3070 on Windows 10:
3feadc6hung the card during loading in 2 of 2 runs;fb99078runs the same program and goes 15 minutes with no removal.Setup: RTX 3070 8 GB, driver 621.14, Windows 10 22H2 (19045),
host wave lanes min=32 max=32 wave32=true. Diag build, a scripted Enter at the start screen, nothing skipped.3feadc6:main940d32f+ #463 + #1763 + #1906 + #385 + #688 + this PR (in place of #189). Run 1 plain, run 2 with the debug layer and DRED.fb99078:main63bcca4+ #463 + #2626 + this PR, debug layer and DRED on. 15-minute run.3feadc6(2 runs)fb990780x887A0006at ~1:37 and ~1:42, during loadingWhere
3feadc6stopped (DRED, run 2): list 2 of the submission at command 4,673 of 15,360; the command it names is adispatch 1x1x1of a wave64 compute program with 6 user-data words, first bound around frame 1,660. The same program runs with #189's wave32 mode on the old stack, and withfb99078it is translated (not among the refusals) and bound at frame 1,769 and the run goes on. So one of the refusals added since3feadc6(cross-half operations, 64-bit masks as data, one-wave LDS) most likely covers what hung here; I haven't narrowed it to which one.For comparison on the same new base: with #189 (
3e39e34, wave32) instead of this PR, 117 programs don't translate and none are refused. With this PR, 168 don't translate (the debug layer makes this run's frame rate, about 1 fps, not comparable).On the stack where the world draws on NVIDIA (
main63bcca4+ #463 + #2626 + #2098 + #2464 + #2628), one 15-minute run each:So on this card the clearer picture and the speed come from #2118; adding this PR changes which programs don't run (refused by D3D12 before, refused by the translator now) without changing the picture or the frame rate, and with no removal.
Merging with #2628: both add a field to
emit::Optionsand an input toshader_cache's key, so they conflict inshader_cache.rsandemit/mod.rs. Keeping both (portable_viewsandhost_wave32inOptions,options()setting both,key()taking the view heap limit and the wave32 flag) builds, and the tests compile.Not tested: a second run of any of these;
fb99078on the old base; which refusal covers the hang.No game data attached. I'm testing with Claude's help, and Claude drafted this comment.
@DenRakEiw on GitHub · 2026-11-25 07:24 UTC · original · approved these changes
Verified locally merged onto
origin/main(940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):cargo test -p victory-gpu --lib shader_cache::— 3 passed, 0 failedcargo test -p victory-shader --lib emit::lower::tests::— 21 passed, 0 failedcargo clippy -p victory-gpu -p victory-shader --all-targets— 0 warningscargo xtask policy— ok (183 files ok)Clean host-wave32 translation path and cache-key inclusion for wave64 programs on hosts with
WaveLaneCountMax < 64. Looks good.AI-assisted (Gemini 4 Neon).
@catminou4 on GitHub · 2026-11-25 07:30 UTC · original · approved these changes
Tested locally: macOS arm64, rustc 1.98.1, PR head merged into main
940d32f69b,cargo test -p victory-shader --locked(shader half; the GPU half is Windows-only).144 passed / 0 failed / 2 ignored. Wave64 programs translated for 32-lane host waves — wave64→wave32 translation; relates to #189/#233/#1960's wave64 cluster. Shader side green; GPU execution path needs Windows hardware validation.
@frenziedcoder on GitHub · 2026-11-26 07:45 UTC · original
For the test the triage asks for (a wave64 pixel program that should still translate with
host_wave32: true): a fixture, run onfb99078. It puts one 64-bit wave mask read as data (v_cmp_lt_f32 vcc, 0.5, v1; s_bcnt1_i32_b64 s12, vcc) into a wave64 compute, pixel and mesh program, keeps the result live (LDS store /exp mrt0/ folded into the position), and runs each throughemit_withwithhost_wave32off and on. CPU-only translation, synthetic instruction words only.host_wave32: falsehost_wave32: truea 64-bit wave mask read as data on a 32-lane host(intended)Once
host_wave()is scoped to the programs that getWaveSize(32), the pixel and mesh rows should read "translates" in both columns. The cross-lane forms I tried first (v_readlane_b32of lane 1 or 33,exec_hias data) don't work for this: pixel and mesh refuse them already withouthost_wave32(a cross-lane operation outside compute is not supported,a hardware SGPR input is not supported), so the mask-as-data form is the one that isolates the stage scope. The four forms are all in the file; it prints a row per case rather than asserting, so it can be turned into asserts once the scope is decided.crates/victory-shader/src/emit/stage_scope_fixture_tests.rs(plus#[cfg(test)] mod stage_scope_fixture_tests;inemit/mod.rs)AI use: Claude Code (Claude Opus 5.5) wrote the fixture, ran it on my machine (RTX 5080 box; this check needs no GPU) and wrote this comment.
@Creaa on GitHub · 2026-11-26 08:38 UTC · original
@n-romanovich a small follow-up on this PR's 32-lane path, as #3115 (stacked on
fb99078, one commit): DPP rows/DPP8,ds_swizzle_b32(group-of-32 mode) andds_bpermute_b32only read lanes of their own half, socross_laneno longer refuses them as cross-half (DPP rows only when the row mask is the same for both halves). On an RTX 4070 a GPU test checks all 64 lanes of a wave64 program against RDNA2; offline the refusal falls from 69 to 51 programs of the title's pack. Happy for you to fold it into this PR instead if you prefer.AI use: Claude Code (Claude Opus 5.5) wrote the change and this note.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.