Repository navigation
Port of Marvisak/VIctory #1890 onto lot 9: console wave64 compute on 32-lane hosts (383 → 2 refused compute pipelines on RTX 5080) - #12
Closed
Skyfrye wants to merge 2 commits into
Conversation
A compute program that depends on its lane layout declares the console's wave size, so on a device without 64-lane waves (NVIDIA: WaveLaneCountMax 32) every wave64 one was refused by CreateComputePipelineState. Such a program now runs split: it declares WaveSize(32), and each console wave runs as two host waves, its low and high half, with the console's thread ids, lane numbers and masks. DPP, ds_swizzle and v_permlanex16 stay within 32 lanes. Ballots, v_readlane, v_readfirstlane of a varying value, and whole-wave reductions and prefix sums combine the halves through group-shared dwords between barriers, exactly, where the whole group runs together (emit::split::convergent); elsewhere each half works over its own lanes, as pixel and vertex programs do over the host's wave. One-wave groups also get the LDS barriers the console compiler leaves out. The device's width reaches the translator when victory-gpu (and the offline `translate --pipelines`) creates the device; the shader cache keys on it, and VICTORY_HOST_WAVE_MAX=32 translates split on any device. 16-bit wave reductions and ds_bpermute_b32 are refused when split. Port to this fork (base 80d58f8), which already runs many such programs in 32-lane waves by its own forms (emit::emit: 32-lane halves, exchanging host waves, local waves): split waves are tried last, for a program those forms leave on 64-lane waves or stop where not every lane runs (lower::with_split_waves; VICTORY_WAVE_SPLIT=0 turns it off), and a split lowering skips the fork's forms. The width is the fork's record (set_host_max_wave; set_host_wave_max writes the same), which the shader cache already keys each entry on; the two new switches join its build key. Under split, SCC of a mask operation as data is exchanged like a ballot, a wave-wide branch is refused, and the added barriers follow VICTORY_GROUP_SYNC. emit::host::Host::new leaves the width alone in this crate's tests. The upstream test files this base does not have (bvh, memory, semantics, stride, synthetic) are not added; split_tests builds HostShader as this base declares it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit d047e12)
The cache's folder is named by its key, which includes the host's widest wave; it was opened at start-up, before any device had set the width, so its key always said 64. The warm-up (`translate --cache`) also translated before making a device, so on a 32-lane host it cached WaveSize(64) translations that a run then took from the cache and the host refused. The cache now opens on its first translation, and a run creates its device before translating; the warm-up makes one before it starts, so both translate for the device and key the cache the same way. Port to this fork (base 80d58f8): its shader cache already keys each entry on the device's wave width, read when the entry is looked up (shader_cache::target, with a re-check after translating), its warm-up already makes the run's device first (prepare_host), and a run's translation already asks for the device before it translates (probe_view_limit). So the cache stays opened where it was and shader_cache.rs and pipeline.rs are unchanged; what is taken is the warm-up's line naming the wave width (print_host_waves). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 73ee4dd)
3 tasks
Author
|
Update on the one AI use: Claude Code (Claude Fable 5.2). |
This was referenced Nov 25, 2026
Author
|
Closing: AnyXboxX Marvisak#199 moved the engine into the main repository ( AI use: Claude Code (Claude Fable 5.2). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A port onto
anyxboxx/fork-7b0-lot9-murs(80d58f8) of the two commits of Marvisak/VIctory Marvisak#1890 by beamdotdev, cherry-picked with-x, authorship kept:d047e12a2"Shaders: console wave64 compute on 32-lane hosts (split waves)"73ee4dd0c"Shader cache and warm-up: key on the device's wave width, known first"This is the candidate fix named in LooperSalty/AnyXboxX#186. If your own port is further along, close this one; the numbers below may still be useful for it.
Conflicts and how they were resolved
Conflicts in
emit/lower.rs(12 hunks),emit/mod.rs(3),emit/host.rs,emit/valu_tests.rs,victory-gpu/src/shader_cache.rs(3) andvictory-gpu/src/host.rs. Ported diff: +1,248 / −27 against the upstream PR's +1,256 / −43.bvh_tests,memory_tests,semantics_tests,stride_tests,synthetic_tests) are not added;split_tests.rsbuildsHostShaderas this base declares it.shader_opt) and gains the device's wave width.The resolution was done by an AI agent and I have not reviewed every hunk by hand; the evidence that it is right is the tests and counts below.
Measured (RTX 5080, driver 621.01, 32-lane waves)
cargo test --profile diag -p victory-shader: 208 passed, 0 failed, 2 ignored (with the PR's split tests).-p victory-gpu: 120 passed, 0 failed, 1 ignored.victory translate --pipelines --liston the 1.0.2.1 shader pack, launcher environment:80d58f8E_INVALIDARGvfx_triangleClip:CS_CollectTriangles6832a9da15c2e584,…_Meshlets6b82bc7d22016cb5)E_OUTOFMEMORYweatherParticle:CS_BeginUpdate7f61193d2c0e5f22; the RTX 50 refusal of #10, not yet confirmed)XboxBvhBuilder.dllcompute refused6b82bc7d22016cb5). The character in the prologue's first rooms renders whole in 16 captured frames. Frame rate not comparable (other work was running on the machine).VICTORY_BVH_BUILDER=1the builder now starts ("the ray-tracing structure builder runs: all of its programs have host pipelines pipelines=53"), and the title then dies at world entry with access violations in its own code (reads at0xffffffffffffffff, first at+0x4e51965). No device loss. So the builder still cannot be turned on; that is a separate problem this port only uncovers.Not tested
AMD and hosts with 64-lane waves (the split should not apply there); long sessions; whether any shader that translated before now renders differently (outcome counts did not regress: 25,246 → 25,626 pipelines created).
AI use: Claude Code (Claude Fable 5.2) did the port, ran the tests and the game on my machine with my own copy, and wrote this description.
🤖 Generated with Claude Code