Skip to content

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
LooperSalty:anyxboxx/fork-7b0-lot9-mursfrom
Skyfrye:port/wave64-split
Closed

Skyfrye wants to merge 2 commits into
LooperSalty:anyxboxx/fork-7b0-lot9-mursfrom
Skyfrye:port/wave64-split

Conversation

@Skyfrye

@Skyfrye Skyfrye commented Nov 25, 2026

Copy link
Copy Markdown

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) and victory-gpu/src/host.rs. Ported diff: +1,248 / −27 against the upstream PR's +1,256 / −43.

  • Five upstream test files this base does not have (bvh_tests, memory_tests, semantics_tests, stride_tests, synthetic_tests) are not added; split_tests.rs builds HostShader as this base declares it.
  • The cache key keeps this base's form (no 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 --list on the 1.0.2.1 shader pack, launcher environment:
pin 80d58f8 this branch
compute pipelines created 2,285 2,665
compute refused, E_INVALIDARG 383 2 (vfx_triangleClip:CS_CollectTriangles 6832a9da15c2e584, …_Meshlets 6b82bc7d22016cb5)
compute refused, E_OUTOFMEMORY 0 1 (weatherParticle:CS_BeginUpdate 7f61193d2c0e5f22; the RTX 50 refusal of #10, not yet confirmed)
XboxBvhBuilder.dll compute refused 9 of 52 0 of 52

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

beamdotdev and others added 2 commits November 25, 2026 14:42
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)
@Skyfrye

Skyfrye commented Nov 25, 2026

Copy link
Copy Markdown
Author

Update on the one E_OUTOFMEMORY refusal (weatherParticle:CS_BeginUpdate): #10 does not clear it (checked on the RTX 5080 with both applied), so it is not the plain LDS subtract. Cause still open.

AI use: Claude Code (Claude Fable 5.2).

@Skyfrye

Skyfrye commented Nov 25, 2026

Copy link
Copy Markdown
Author

Closing: AnyXboxX Marvisak#199 moved the engine into the main repository (third_party/victory, no fork any more), so this fork is no longer where changes land. I am re-basing this onto current AnyXboxX main and will re-submit it there, re-measured on that base.

AI use: Claude Code (Claude Fable 5.2).

@Skyfrye Skyfrye closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants