Shaders: one console wave sharing LDS runs in the console flow on 32-lane hosts #439
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!439
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-439"
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?
@r4tedx on GitHub · 2026-11-24 03:24 UTC · original
r4tedx:shader/console-flow-lds→main· +4907 −1464 · 28 files · 84 commits · openCurrent head
e2d3cfd(2026-11-26), on top ofe9f18c9below, still withmainat63bcca4. New sincee9f18c9: the placed-UAV test fix merged up from #223; steven-seagull27's partial-group reductions and f16 whole-wave sums from fork PR #19 (611184e,f968c54, author kept) and2658128;e2d3cfdkeeps LDS, whole-wave sections and*permute*in halves out of programs that reach title memory (root_memory, from latentdev's patch). An earlier commit on top,7587052, was removed from the branch by a force-push: its test encodings were taken from one of the title's programs, which the asset policy does not allow. At2658128, WARP only:cargo xtask policyok, clippy clean,VICTORY_WARP=1 cargo test --locked -p victory-shader --lib -- --test-threads=1343 passed, 4 failed, 3 ignored (the same 4mainfailures as below). Nobody has run these split tests on 32-lane hardware at this head. No title run for this update.At
e9f18c9, merged withmainat63bcca4(merges only, no rebase:maininto #223, then each PR's new head into the one above it). Withmain's growth,crates/victory-shader/src/emit/lower.rswould pass the asset policy's 512 KiB limit, so #233 first moves lower.rs's inline tests intoemit/lower/tests.rs, unchanged but for one indent level, (desplmfao's idea, besidemain'semit/lower/bvh.rs). Here lower.rs is 506,583 bytes. The conflict resolutions follow kawaii-shakal's notes, and each merge commit lists them. Local verification at this head and at the head of each PR under it, on Windows 11 with the software renderer only (WARP, no hardware adapter for this update):cargo xtask policyok;cargo clippy --locked -p victory-shader --all-targets -- -D warningsclean;VICTORY_WARP=1 cargo test --locked -p victory-shader --lib -- --test-threads=1: 341 passed, 4 failed, 3 ignored. The 4 failures aremain's own: onmain63bcca4the same command gives 298 passed and the same 4 failed. They aresynthetic_testswhose "hardware" passVICTORY_WARP=1puts on WARP. No title run for this update. AI-assisted (Claude).Stacked on #320, which is on #233, which is on #223. They are one line of work and merge in that order; each PR's diff contains the ones under it. The commits that are new here start at
7388024(table below). Head:e2d3cfd.History, 2026-11-24: The whole stack was rebased onto
main8e79c80on 2026-11-24 (upstream merged about 55 PRs that day and added CI). New upstream tests callemitand buildlower::Partsdirectly, so the wave-range argument and the two fields this stack adds are given to them in the commits that introduce them (in #223, #233 and #320). CI's first run on these PRs failed in tests, not in clippy: GitHub's runner has no GPU and lists Windows' software renderer (4-lane waves) as an adapter, and tests here assumed every listed adapter runs 32-lane waves. The tests are fixed where they were introduced: the hardware-adapter list leaves that renderer out by its ids and name, and the one test that takes the default device accepts a host without 32-lane waves. No translator code changed. The test-only commite6936e3(the lane-read loop test skips hosts without SM 6.6) is folded into #320, where that test is added, so 16 commits are new here. Each commit builds on its own. The head before the rebases was055aef9. Commit ids in testers' reports below and in older comments are from before the rebases; the table gives each commit's old id.No new features will be added to this PR. It has grown as testers and contributors reported things; from here it only gets fixes for what review finds. The next step of the work (groups of more than 64 threads) is on a fork branch and is not part of this.
What
#233 runs console wave64 compute programs on hosts without 64-lane waves (NVIDIA) as two 32-lane waves, in the "console flow" where a program needs its whole wave. It still stopped programs that share LDS inside one wave, and a few other forms. This PR takes those:
s_barrier. The console runs an instruction in all 64 lanes before the next, so a lane reads what another lane wrote one instruction earlier. In the console flow both halves reach every LDS access together, so a group barrier before each access puts it after every earlier one.ds_bpermute_b32, which did not translate on any host: a read within the lane's own 32-lane half.... in a group of more than 64 threads,ds_permute across the halves,a whole-wave section), and atranslate --validateline that prints a failing module's thread-group size, wave size anddx.opnames.Nothing changes for programs that translated before, with two exceptions measured below: on hosts that run 64-lane waves about 18 title programs with a lane read in a divergent branch change from the per-lane form to the console flow, and programs both forms refuse may report a different reason.
Commits new in this PR
7388024one_wave_shares_lds_in_instruction_order,lds_order_holds_when_one_half_is_busy88cb024c7806a8translate --validateprints what a refused module declares and callsthe_last_modules_summary_...9745f35a31c82e9b73d66b0f64c9,6090b47whole_wave_reductions_join_both_host_waves,masked_whole_wave_sum_straddles_the_halves3925b8f,e49302afa72507lds_written_and_read_in_different_masked_blocksa32c177ddaae368876ed3ab7882dds_bpermute_b32as an in-half read (r4tedx/VIctory#2)416714c826577ebackward_permute_in_other_masks_groups_and_formsf653ea400888acfloat_whole_wave_reductions_join_both_host_waves,masked_and_prefix_float_sums_cross_the_halves965ce30783feee2467891e461457v_cndmask_b32takes masks held as numbers; fixes the high dword of such a wave64 mask when two instructions write itselects_on_masks_held_as_numbersd2189ff1c06eddlane_read_loop_with_a_joined_exec_back_edge9e98b2b04971f8901eef9f12df1elane_reads_in_branches_beside_a_whole_wave_section,a_mask_copied_dword_by_dword_stops_instead_of_recursinge4d899f1ca87f7d2189ff)selects_from_independently_written_mask_words055aef9Measured
On the title, by testers on their own copies
RTX 3070 Ti Laptop, driver 610.88, four-build comparison: across three runs containing #439, DRED named compute
42683eebec081520, dispatched as(128, 64, 1), at device removal on its first world dispatch. Onmainthe driver refused this pipeline and the run later hung inExecuteIndirect. With #578 alone the run lasted 420 s and dropped 85–98% of world draws. The separate RTX 3070 skip run below used a different stack and driver.On an RTX 3070 with the #439
1ca87f7integration stack and loop limit 32, skipping direct and indirect dispatches of42683eebec081520still ended in device removal at menu frame 1880. DRED named an indirect mesh operation with a nullu9and empty breadcrumbs. The faulting operation is undetermined. RTX 3070 skip run9745f35: againstmain, 71 compute programs gained and 0 lost; ofmain's 119 driver-refused programs 70 run. The LDS reason goes from 38 to 0.f653ea4, whole-title translate with pipelines: 0 pipelines refused; the LDS reason 120 → 0; compute programs emitted 1,470 (at #233) → 1,668.e49302a: againstmain, 0 validation or pipeline results change over 25,889 programs. This is the host the stack is meant to leave alone.f653ea4, in the PR set that stays in the world on #71, against the same set with #189 (loop limit 32, one 7-minute run each): no device removal with either. With this stack, draws dropped for want of a host pipeline go from 1,470 to 958 per frame, and the richest G-buffer target in a dumped frame is 67.9% covered by a coherent view against 10.5% with wrong geometry. The presented frame is black in both, and this stack's frame time is higher (1,233 ms against 850 ms).Nobody has run the title on a head after
f653ea4. The world hang (#71) is unchanged by this stack at the default loop limit.Locally: an offline translate over a local copy of the title's shaders
victory translate --host-lanes 32-32 --validate --list(and32-64): CPU only, no pipelines, nothing launched or rendered. Counts and reasons only; nothing from the title is in this PR. At055aef9(before the rebases), and again after the first rebase onmain2e4e280with the same results; not rerun on8e79c80, which merged more shader PRs:main. A tester's count atf653ea4(1,668) matches mine at that head. For a 32..64 host: 1,735 emitted, 1,681 validated, which a tester measured independently on an RX 9070 with pipelines created (1,735 / 1,681 / 1,735).sample(see the note below).e4d899frule +6 (32..32) and +12 (32..64), numeric selects +3 (32..64 only). On the tester tree, which has the descriptor PRs, the numeric-select commit is worth 24.e4d899fnow take the console flow (they have a lane read in a divergent branch beside a whole-wave section).Validation note
Compute programs that sample with implicit derivatives (
image_sample) are emitted asdx.op.sample, which validator 1.6 / 1.7 rules do not allow outside pixel shaders.mainemits 23 such modules; this stack lets more such programs translate, so more of them appear (54 here). The cause is not in this stack: diagnosis with a hand-assembled reproduction. #180 replaces these samples and #201 tracks the class; a census rerun measured #180 taking the class to 0 onmain. Merging #180 first, or together, keeps those modules from reaching a driver unvalidated.How this relates to other open PRs
PSV0, so it does not refuse what this stack emits.docs/wave64-on-wave32.mdshows as deleted in this diff, with this PR's plan text in it: #233 folded the plan intodocs/architecture.md, and the merge carries that up. The design notes are in this description.Not verified
ds_bpermute_b32stays in each half: AMD, "RDNA 2" Instruction Set Architecture Reference Guide (30 Nov 2020), §10.4.4 "LDS Lane-permute Ops", pp. 96–97: "in wave64 mode the permute operates only across 32 lanes at a time of each half of a wave64 … it executes as if were two independent wave32's. Each half-wave can use indices in the range 0-31 to reference lanes in that same half-wave", "only index bits [6:2] are used", "Reading from disabled lanes returns zero". The lowering follows this (lane((addr + offset) >> 2) & 31in the reader's half, 0 where it is inactive). The opcode table's pseudocode (§12.13, p. 206) writesmod 64, which disagrees with §10.4.4; we follow §10.4.4.ds_permute_b32is not translated yet and still keeps a program out of the split.f653ea4has been run in the title, by anyone. The local run only translates and validates.s_mov_b32) stop with a reason; following them is not done.Tested
Historical, at an earlier head: Independent Windows 10 22H2 run on an RTX 4060 Ti at
c153b21with #175 and #362: 155 shader tests passed, 0 failed, 1 benchmark ignored. The split-wave and joined-back-edge tests executed on hardware and returned exact results. WARP, DXIL validation, and compiler-dependent comparisons had skips. Hardware run and skip breakdownWindows 11, an NVIDIA RTX 5070 (32..32) and an AMD Radeon iGPU (RDNA2, 32..64) in one machine. Every test in the table is hand-assembled GFX10, validated by
dxil.dll, dispatched on each hardware adapter and compared lane by lane with the console's result, except the two that only check what the translator emits (the_last_modules_summary_...,selects_from_independently_written_mask_words).main63bcca4: At1ca87f7, onmain8e79c80, with the commands upstream's CI runs:cargo clippy --workspace --all-targets --locked -- -D warningsand the same with--all-featuresare clean at the head of each of the four PRs;cargo test --workspace --locked: 346 passed, 0 failed, 6 ignored (RTX 5070 + Radeon iGPU). Under the CI runner's conditions emulated here (the software renderer as the default device and no hardware adapter listed) the shader crate's tests pass at each head, the GPU ones by skipping. Before the rebases,cargo test --workspaceat055aef9: 299 passed, 0 failed, 4 ignored.cargo xtask policy: ok at that head and, after the tests move, ate9f18c9.AI-assisted. The tests are synthetic and do not use the title. The counts under "Locally" come from the offline translate run described there.
🤖 Generated with Claude Code
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 <[email protected]>The validator's message for an operation the stage or the entry's properties do not allow ("Entry function performs some operation that is incompatible with the shader stage or other entry properties") names neither the operation nor the property, and it is the only message when the call is in the entry function itself. `victory translate --validate` now adds to each validator failure what our own module declares and calls: its thread-group size, its wave size and its dx.op operations (`emit::last_module_summary`, kept per thread when a module is finished). Nothing of the console program is in it, so a report of counts per reason is enough to see what the refused modules have in common. Prompted by a report on #233: modules that fail validation with that message and still create pipelines, 20 of them new with #320, which I cannot reproduce with hand-assembled programs. Co-Authored-By: Claude Fable 5.2 <[email protected]>1a8a3ed) 3c961b5ea0e4246fd) 1e17e572a0b623fd3) bf13a276c5cbcef55) bf0f9511c541369c9) 28aca3b718940d32f) into the host wave sizes branch 02b955ffc902b955f) into the console flow e5ffedbb8b1e247b1) into the lane reads branch 49f31ec4ff49f31ec) into the console wave LDS branch 61568ae3307147671) eb12838eefeb12838) 5a11cf4814github-bot referenced this pull request2026-11-26 04:24:35 +00:00
@Raxstreams on GitHub · 2026-11-24 03:33 UTC · original
On an RTX 3080 Ti (32 lanes), I replayed 77 captured compute shaders that the #414 translator had rejected for wave64 lanes or shared LDS. With this change applied, 20 of 77 passed both DXIL validation and actual D3D12 compute pipeline creation. The other 57 still failed. This is offline pipeline coverage. I have not verified the dispatch outputs for these shaders.
@DaviTostes on GitHub · 2026-11-24 03:37 UTC · original
Verified
88cb024on Arch Linux x86_64 (rustc 1.98.1,cargo test -p victory-shader): 58 passed, 0 failed, 0 ignored.Not covered: the new console-wave LDS paths executed on a Windows/Wine GPU (parser/emit tests only here) and title behaviour (no game data).
@r4tedx on GitHub · 2026-11-24 03:38 UTC · original
Thank you. 20 of 77 passing both checks is a useful floor, and the 57 are the more interesting part.
Could you post how the 57 split, as counts only?
a group of more than 64 threads,ds_permute across the halves,a whole-wave section);9745f35(this PR's head) each validator failure intranslate --validatealso prints what our module declares and calls (thread-group size, wave size,dx.opoperations; nothing of the console program). That line is what I need: a whole-title run found 20 modules that #320's console flow emits and the validator refuses, which I cannot reproduce with hand-assembled programs, and it is why this PR and #320 are drafts;No game data used on my side. AI-assisted.
@DaviTostes on GitHub · 2026-11-24 03:42 UTC · original
Re-checked the new head
9745f35(“translate: say what a module the validator refuses declares and calls”) on Arch Linux x86_64 (rustc 1.98.1):cargo test -p victory-shader58 passed, 0 failed, 0 ignored — same result as88cb024, no regression from the force-push.@SpaghettiMaster545 on GitHub · 2026-11-24 03:54 UTC · original
Tested with the title at
9745f35(this PR with the #223 / #233 / #320 stack under it), merged ontomaind2a4bae. The same setup as my runs on #320: RTX 5070 Ti, driver 621.24 (32-lane waves), Ryzen 7 9800X3D, Windows 11 10.0.26100, Rust 1.98.1, diag build, its own emptyVICTORY_CACHE_DIR,VICTORY_KEYSinto story mode, until the host GPU failure (#71).Program by program:
maind2a4baemain's 119 driver-refused compute programs, 70 run now (26 with #320 alone), 45 stop in translation, 4 not reacheda5ba4a4a wave64 group sharing LDS without barriers on a host without 64-lane waves: 38 → 0a whole-wave section of a wave64 on a host without 64-lane waves24,console wave64 lanes in a group of more than 64 threads on a host without 64-lane waves20. So the remaining 67 from my #320 run now split into those two.main's 59–111 s), and world frames are as before (~0.7 s), as you expected.Not tested: a 64-lane adapter, a release build, image results,
cargo teston this head.(Claude Code, Claude Opus 5.5: ran the title and compared the logs program by program.)
@r4tedx on GitHub · 2026-11-24 03:56 UTC · original
Thank you, that is exactly the split I was after: 70 of
main's 119 driver-refused programs running, nothing lost, and the rest now named (whole-wave sections 24, groups of more than 64 threads 20).That orders what comes after this PR: whole-wave sections in the console flow first, then groups of several console waves. I am not stacking either on top yet. #320 and this PR are drafts because a whole-title validate run found 20 modules the console flow emits that
dxil.dllrefuses, and a title run cannot show those. If you ever runvictory translate --validateover the same files on this head, the validator lines (they now carry thread-group size, wave size and thedx.opoperations of our module, nothing of the console program) are what would unblock both.I have added your numbers to the description.
No game data used on my side. AI-assisted.
@Raxstreams on GitHub · 2026-11-24 04:05 UTC · original
Following the offline check above, I tested integer whole-wave scans across the two hardware waves. The synthetic 64-lane prefix sum reads back exactly on an RTX 3080 Ti, including 528 for lane 32. The follow-up against this PR's head is https://github.com/r4tedx/VIctory/pull/1.
In a local integration build the material-tile initialization shader passed offline D3D12 compute pipeline creation and dispatched during the opening scene. The final scene color was still dark in the captured frame.
@Halfect on GitHub · 2026-11-24 05:33 UTC · original
64-lane AMD result for
e49302a: AMD Radeon 610M, driver32.0.21030.2001, Windows 11 build 22631; D3D12 reports 32..64 lanes. I rantranslate --validate --pipelines --list --jobs 8on this head andmaind2a4bae, explicitly selecting the Radeon adapter.All 22,178 emitted modules on this head successfully created D3D12 pipelines. Across 25,889 shared program labels, the comparison against
mainfound 0 DXIL-validation gains/losses and 0 pipeline-creation gains/losses. The aggregate compute totals were 1,715 emitted / 1,672 validated / 1,715 pipelines here versus 1,693 / 1,670 / 1,693 onmain; these are whole-stack totals and are not attributed to Wave64 alone.Full stage table, label-exclusion rule and reason changes: #293
Offline only; no title executable or world run. AI-assisted (Kimi).
@Halfect on GitHub · 2026-11-24 05:42 UTC · original
Follow-up correction to my 64-lane comparison: after normalizing the instruction offset present only on failure labels, the matched result is 22 pipeline-creation gains, 2 DXIL-validation gains, and 0 losses across 25,912 shared labels. The 22 gains are
a lane-mask join of an untracked mask→ok, accounting for the aggregate compute increase from the underlying stack.Details: #293
The earlier stage totals were correct; the initial 0-gain figure omitted these emit-to-success transitions. No 64-lane regression was found.
@r4tedx on GitHub · 2026-11-24 05:47 UTC · original
Head moved from
e49302ato8876ed3(two commits, nothing below them changed). I force-pushed once in between to correct a commit message;a32c177replaces91af621, same diff apart from comments.a32c177: a test for the pattern a reviewer measured stale reads for on #189: one console wave, nos_barrier, LDS written and read in different exec-masked blocks. Exact on the RTX 5070 and the Radeon iGPU in three variants. The third (masks only, no branch around either access) is the first test here that needs the barrier before each LDS access: with it left out, the lower half reads 0 in 20 of 20 runs on the RTX 5070; with it, exact in 20 of 20. The description's "Not verified" paragraph said no test showed that; it is updated. Table on #189.8876ed3: the startup warning's text (a nit from #233's review).@Halfect: thank you for the 64-lane A/B. 0 changes over 25,889 programs on a Radeon is the result this stack is supposed to give there, and it is now linked in the description. My reading of the 22 extra compute modules emitted on that host, not checked program by program: they are #320's (lane reads where lanes branch differently go through the console flow on every host, and nothing else in the stack acts on a 64-lane host), and the 20 of them that do not validate are the compute
image_sampleclass that #180 fixes, the same count a 32-lane run found for #320.cargo test --workspaceat8876ed3: 289 passed, 0 failed, 4 ignored (RTX 5070 + Radeon iGPU, Windows 11). Synthetic programs only; no title data. AI-assisted (Claude Code).@r4tedx on GitHub · 2026-11-24 05:55 UTC · original
Head is now
f653ea4(was8876ed3; fast-forward, two commits):416714c, by @Raxstreams (r4tedx/VIctory#2, reviewed and tested there):ds_bpermute_b32, which did not translate on any host, lowered as a read within the lane's own 32-lane half. Per-half is how the contributor reads AMD's RDNA 2 ISA reference for wave64 on GFX10; it is not checked on console hardware.f653ea4: my tests for it (a mask over part of each half, groups of 128, 48 and 32 threads, and the permute beside a lane read across the halves) and the plan document. Exact on the RTX 5070 and the Radeon iGPU.cargo test --workspace: 292 passed, 0 failed, 4 ignored.The description is updated for this, and corrected in a few places a read-through found:
mainemits 23 modules of the computeimage_sampleclass (not 22); the title run linked under "Measured" was at9745f35, and nobody has run the title on a head with the whole-wave-section or backward-permute commits; the list of what still stops now says which whole-wave sections do.One measurement that would place this stack, if anyone who ran it has the time (@SlopComp, @Zignixx, @Vyral1978): the set that stayed in the world for 7 to 14 minutes on #71 (
main+ #493 #483 #189 #89 #205 #206 #469 #459 #454, loop limit 32) has #189 doing the wave64 work. Nobody has run that set with this stack in #189's place (the two conflict, so it is one or the other), same loop limit. Whether it also stays up, and the per-frame drop summary next to yours, would say whether the stack is safe to run in the world and what it changes there. Counts and reasons are all that is needed.Synthetic programs only on my side; no title data. AI-assisted (Claude Code).
@Zignixx on GitHub · 2026-11-24 05:59 UTC · original
@r4tedx I'll run it. Same machine as my #71 reports (RTX 5080, driver 32.0.16.2101, Windows 11 26200,
TdrDelay=8):d2a4bae+ this stack atf653ea4+ #493 #483 #89 #205 #206 #469 #459 #454, with #189 left out, diag build,VICTORY_SHADER_LOOP_LIMIT=32, DRED, scripted Enter presses, empty shader cache.I'll post here whether it stays up, and the per-frame summary next to the #189 run: draws run, drops without a host pipeline by stage, indirect
prepare failedby kind, pipelines refused, andshader does not translateby reason. Counts and reasons only.One caveat for the comparison: since my last #71 comment I run with a larger dynamic descriptor range on the capped heap (262,144 slots instead of 65,536), because at 65,536 about 1,700 indirect mesh dispatches per frame were dropped for lack of slots and that would bury any difference between the two wave64 approaches. I'll use the same setting on both sides and say so in the table.
AI use: Claude Code (Claude Mythos 5.2) prepares the branch and runs it on my machine; posted at my request.
@r4tedx on GitHub · 2026-11-24 06:09 UTC · original
Head is now
965ce30(wasf653ea4; fast-forward, one commit): float whole-wave reductions cross the halves. A section that leaves a float sum, minimum or maximum in a 64-thread group no longer stops on a 32-lane host. Each half's result crosses as its bits; minimum and maximum stay exact, and a sum is the two halves' sums added last (one more order of additions, so the last bits may differ, as they already may within one host wave).Tested (synthetic; the title was not used in these tests): hand-assembled sections over the lane ids as floats, on an RTX 5070 (32..32) and a Radeon iGPU (32..64): sum, maximum, minimum with identities 0.0 / -inf / +inf, a sum over a mask that straddles the halves, an inclusive prefix sum. Exact on both.
cargo test --workspace: 294 passed, 0 failed, 4 ignored.Measured locally (local title data, offline):
victory translate --host-lanes 32-32 --validate --listover a local copy of the title's shader archive, CPU only, no pipelines and nothing launched; counts and reasons only.f653ea4against965ce30, program by program:a lane-mask join of an untracked mask5,v_cvt_f32_f644,v_permlanex16_b321).sample(#180's class).Not run: pipelines, rendering, the title. Groups of more than 64 threads are next.
AI-assisted (Claude Code).
@RealCaCl2 on GitHub · 2026-11-24 06:10 UTC · original
Measured on an RTX 5060 Laptop (Blackwell, 32-lane waves, driver 32.0.16.2124), Windows 11 26300. Ran
translate --validate --pipelinesover the full corpus (26,148 programs; 2,581 compute) with each stage merged onto main@d2a4bae (also #334, #110, #154). Vertex/pixel and mesh were identical in all three runs.E_INVALIDARG)dxil.dllvalidationThe validation rise matches your note: exactly 20 of the new failures are 32×1×1 wave-32 compute modules calling
sample, the #180 class. The NVIDIA driver still created pipelines for all 45 unvalidated modules, so it doesn't catch them. That's another reason to land #180 with this.victory-shadertests: 94/94 pass on this GPU when run serially. With parallel threads,lane_reads_in_a_loop_lanes_leave_at_different_iterationsonce hung for 18 minutes at 0% CPU and GPU (looks like #433).63bcca4) into the host wave sizes branch 91aa05674191aa056) into the console flow 1c74ab433b1c74ab4) into the lane reads branch db8570686fdb85706) into the console wave LDS branch e9f18c927e@walterwallaceson on GitHub · 2026-11-24 06:16 UTC · original
Tested f653ea4 (which carries #320 and #233) on Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14 (waves 32-32), Ryzen 5 5600X, release build, with #175 (
19aec59), #55 (56f1d41), #89 (081afbd) and #336 (e8d3b64) merged on top. All merged cleanly.victory translate --pipelines --validate, whole title:So the 120 → 0 from the RTX 5070 Ti run holds here too. Vertex/pixel and mesh counts are unchanged.
Game run: no visible change from the same stack without #320/#439. The intro and the first mission's title card render, the opening cutscene's subtitles advance over a black scene at 0.3–1.1 fps,
no free dynamic descriptor slotsappears ~8 s into the world load, and the device is removed (0x887A0006, no breadcrumbs) ~1.5 min in (~2 min in the run before; one run each). No title exceptions.cargo test --workspace: one new failure from #320 on Windows 10.emit::lane_read_loop_tests::lane_reads_in_a_loop_lanes_leave_at_different_iterationspanics withNVIDIA GeForce RTX 3070: wave32: The parameter is incorrect.fromcompute_pipeline. Itsdevices()only checks thatD3D12CreateDeviceat feature level 12_0 succeeds; without the Agility SDK in the test executable the root signature is refused, as in #362. Thesplit_testsskip on the same machine with "no SM 6.6 hardware device; skipped", so this test probably wants the same SM 6.6 check. Otherwise only the known Windows 10 failures (#118/#152, #362).No game data in this report.
AI-assisted (Claude Code); everything above was run on my machine.
@Zignixx on GitHub · 2026-11-24 06:18 UTC · original
Result on the RTX 5080: the stack stays up, and it fills the G-buffer where #189 does not.
Same machine as before (RTX 5080, driver 32.0.16.2101, Windows 11 26200,
TdrDelay=8). Two builds, run back to back with identical settings:d2a4bae+ #493 #483 #189 #89 #205 #206 #469 #459 #454d2a4bae+ #439 atf653ea4+ #493 #483 #89 #205 #206 #469 #459 #454Both: diag build,
VICTORY_SHADER_LOOP_LIMIT=32, DRED, scripted Enter presses, empty shader cache, 262,144 dynamic descriptor slots on the capped heap (local switch, same on both sides, so no dispatch is dropped for slots), 7 minutes from launch, about 6 minutes in the world. Merging B: only the known #483/#336 conflict inHostHeap::new; one test helper from #459 needed this stack's newtargetargument. One run each.Stability and per-frame numbers (medians over the world)
slow host submissionlinesshader does not translatelinesTranslation failures by reason (distinct shaders, top of each list):
v_readfirstlanein divergent control flowThe four instance-culling programs named on #71 (
fdd56d97a806bcca,17af15c4015cb4b6,55679a0547649d0b,89d08e561897d4e5): on A they fail with the cross-lane error; on B they fail witha structured buffer of unknown stride, which is what #193 addresses. The largest remaining droppers are the same on both (indirect kind 0: prepare failed234/frame, computee30970f1727063fd~212/frame, pixel94d281151ca58b4f~175/frame, compute3b90165a77d95cdf).What reaches the G-buffer
VICTORY_DUMP_TARGETS=1, frame 1600 on both, about two minutes into the world:f28targetf26targetsSo on this card the wrong, sparse geometry I reported on #71 comes with the #189 emulation, and with this stack the scene's geometry is in the G-buffer. The lit targets are still empty on both, so the picture is still black; that is a separate, later gap.
Caveats
One run per build and one dumped frame per build; the two runs are not the same game moment to the frame. B is slower per frame here (more time preparing and copying back); I have not looked at why. Not tested: default loop limit, AMD.
Counts, hashes and coverage numbers only; no game data attached. AI use: Claude Code (Claude Mythos 5.2) prepared both branches, ran them on my machine, analysed the logs and dumps and wrote this comment; posted at my request.
@r4tedx on GitHub · 2026-11-24 06:19 UTC · original
@walterwallaceson thank you, both for the table and for the test failure.
The Windows 10 failure is a defect in the test, fixed in
e6936e3(head is nowe6936e3, fast-forward from2467891). You read it right:lane_read_loop_tests::devices()took any hardware adapter with a feature-level 12_0 device, and itsassert!(ran > 0)would have failed even with the right check. It now takes its devices fromHost::on, which checks SM 6.6 assplit_testsdo, and prints "no SM 6.6 hardware device; skipped" when there is none. I could not reproduce the failure, having no Windows 10 machine: the fix follows from the code, and on Windows 11 the test still runs and is exact on the RTX 5070 and the Radeon iGPU (cargo test --workspace: 294 passed, 0 failed, 4 ignored). If you rerun on your machine, that test should now skip. The test came in with #320, so #320's head still has it; I fixed it at the top of the stack so tested heads below do not move, and it folds down at the next rebase.Your counts agree with a local run of mine. An offline
translate --host-lanes 32-32 --validate --listover a local copy of the title's shaders (CPU only, no pipelines, nothing launched; counts only) also gives 1,668 compute programs emitted atf653ea4and 43 stopped for groups of more than 64 threads. At965ce30(float whole-wave reductions) it gives 1,676, with 8 of the 18 float-section programs translating and validating. Those 18 stop witha floating-point whole-wave operation across 32-lane halvesatf653ea4, a row your table does not have.The game run: noted, and the same as every other run so far: no change in the hang from this stack.
no free dynamic descriptor slots8 s into the world is the descriptor-heap limit measured on #71 (65,536 dynamic slots refuse 22 to 30% of requests there), which is outside this PR.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 06:21 UTC · original
@Zignixx thank you. That is exactly the measurement that was missing, and a careful one: same settings on both sides, the slot limit taken out of the comparison, and the caveats stated. It is now linked under "Measured on the title" in the description, with your caveats (one run and one dumped frame per build).
What I take from it, and what I do not:
v_readfirstlane in divergent control flowanda cross-lane wave operation in divergent control floware the cases the console flow is for (every thread of the group reaches every exchange), so that is where I would look first. I would not conclude from one frame that #189's emulation computes wrong results; it may only be that it refuses programs whose absence leaves the buffer sparse.docs/wave64-on-wave32.mdis one console wave per host group for the ones without LDS, which is about two thirds of them.Two reasons high in both of your lists are compute-only in an offline translate over a local copy of the title's shaders (counts only):
a select on an untracked mask(285 programs) anda lane mask holding lanes elsewhere read as data(271). Both are about masks the per-lane form does not track, and the console flow keeps masks explicit, so I will measure how many of them it can take.Head is
e6936e3now (a test-only fix for Windows 10 and the float reductions sincef653ea4); nothing that would change your run except 8 more compute programs translating.AI-assisted (Claude Code).
@aycow on GitHub · 2026-11-24 06:34 UTC · original
@r4tedx @alfycs @nathanbzrr I’m comparing the four instance-culling hashes from #71 across the existing wave64 and divergent-flow work. The key synthetic case is a saved EXEC across a loop back edge, a partial-mask whole-wave section, and a producer consumed by another dispatch. #385 already covers per-lane phi inputs, and #320 covers console-flow joins, so I’ll compare exact heads before proposing any translator change. The matched warm-cache tester request asks for aggregate coverage and refusal counts for the four hashes. If you already have a focused regression or branch for the saved-mask join, please link it here.
@r4tedx on GitHub · 2026-11-24 06:38 UTC · original
Head is now
d2189ff(fast-forward frome6936e3, one commit): compute selects take masks held as numbers. Av_cndmask_b32whose selector is a constant or a number built from scalars stopped witha select on an untracked maskon every host; the lane now tests its own bit by its console lane. The commit also fixes the high dword of a wave64 mask held as a number when two instructions write its dwords (lanes 32..63 tested the low dword's bits; the new test caught it).Tested (synthetic; the title was not used in these tests): selects on a mask of two constants and on one with a group-dependent bit, as a wave64 and a wave32 program, groups of 64 and 32 threads, exact on an RTX 5070 and a Radeon iGPU.
cargo test --workspace: 295 passed, 0 failed, 4 ignored.Measured locally (local title data, offline, CPU only; counts and reasons): that reason goes from 285 compute programs to 0, and 0 programs that translated before stop. But only 3 of the 285 translate (on a 32..64 host; none on 32..32). The others reach reasons outside this stack, mostly
a descriptor read only as data(244). So alone this removes a blocker and gains almost nothing; what it gains with the descriptor PRs (#180, #309) on top I have not measured yet and will.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 06:47 UTC · original
Head is now
901eef9(fast-forward fromd2189ff, two commits), and two answers.@aycow: yes, there is now a focused regression for the saved-mask join, as of this push.
9e98b2b(by @ifBars, from r4tedx/VIctory#6) fixes the case you describe: a loop header joins EXEC on its back edge from a latch whose mask is itself a join, which stopped witha lane-mask join of an untracked mask. The test islane_read_loop_tests::lane_read_loop_with_a_joined_exec_back_edge;901eef9makes it dispatch on every hardware adapter. Exact on an RTX 5070 (two 32-lane waves) and a Radeon iGPU.split_tests::loops_with_an_exit_mask_grown_from_zero, from #320.split_tests::masked_whole_wave_sum_straddles_the_halves(and the float one beside it). Only in groups of exactly 64 threads; in other group sizes a section still stops.a structured buffer of unknown stride, which is #193's subject and outside this PR. The contributor of9e98b2breports that with #193's stride lowering added privately all four validate; I have not reproduced that.@erLCoder: thank you. A GTX 1660 Ti on Windows 10 with the Agility SDK is a card and a driver branch nobody had run the split tests on, and 24 of 24 there is useful. Noted that the no-SM-6.6 skip path is still untested by anyone on such a machine.
Tested (synthetic; the title was not used in these tests):
cargo test --workspaceat901eef9: 296 passed, 0 failed, 4 ignored (RTX 5070 + Radeon iGPU).Measured locally (local title data, offline, CPU only; counts):
d2189ff→901eef9for a 32..32 host: 9 more compute programs translate (1,676 → 1,685), 6 validate, 3 are in thesampleclass (#180); 0 that translated before stop. No change for a 32..64 host.AI-assisted (Claude Code).
@erLCoder on GitHub · 2026-11-24 06:27 UTC · original · edited 2026-11-24 06:48 UTC
Tested head e6936e351b667193385fef95c94da48a18fce542 on Windows 10 Enterprise 22H2, GTX 1660 Ti, NVIDIA 581.42, Rust 1.98.1. The device reports 32..32 lanes.
With locally added test-executable exports for Agility SDK 620 and the SDK beside the executable,
emit::split_testspassed 24/24, including both single-wave LDS ordering tests and LDS across masked blocks. The log identifies the GTX 1660 Ti and confirms per-lane results.lane_read_loop_testspassed 1/1 on this GPU for both wave32 and wave64 cases.This exercises the SM 6.6-capable Agility path on Windows 10. The new no-SM-6.6 skip path was not tested.
Follow-up, game run on the same PC. One Series X run with #439 (
e6936e3, including #233/#320), #334 (af2aecf), #89 (081afbd), and #152 (18b2716), plus Agility SDK 1.620.2 and local logging. Fresh cache. At about eight minutes the intro HUD appeared on a black background; world geometry was not visible in the frames I observed. The world frames took 4.9–8.0 s each. The log had zerohost pipeline refusedmessages, but frame summaries still showed 758–1,501 draws dropped per frame while some pipelines were still being built. The process ended at about 8m37s withDXGI_ERROR_DEVICE_HUNG; DRED stopped on aDispatchMeshbreadcrumb. This measures the combined build, with no isolated A/B for #439.AI-assisted report.
@aycow on GitHub · 2026-11-24 06:49 UTC · original
I posted the original Wave64 fixture and ran the same CPU reference against
d2189ff. Main on AMD returned zero for all 16 selected lanes reading EXEC-inactive lane 40. #439 returned the expected value for all 64 lanes on AMD and RTX 5070 Laptop and passed the plain waterfall control on both. The partial-mask case produced the expected class output on NVIDIA and still refused translation on AMD at the lane-mask-as-data step. WARP returned an expected wave capability refusal. #385 covered a different join case and reproduced the main diagnostic for this fixture.The readback validates producer bytes. The four title hashes and their downstream rendering remain the matched tester question on #71. I'd be happy to contribute the original positive controls directly to #439. Reproducer and commands · Exact comparison branch
@aycow on GitHub · 2026-11-24 07:29 UTC · original
@r4tedx On the latest
901eef9, the original literal partial-mask waterfall still refused at the saved-mask-as-data step on Wave64. I added a focused retry through your existing console flow when a single native Wave64 compute group with a recognized whole-wave section reaches that refusal. I also added an observable class-sum variant so the readback checks the section itself.AMD Radeon Graphics and RTX 5070 Laptop each returned all 128 expected words for both variants under full GBV. WARP correctly reports a wave capability refusal on this machine. The fix is on your current head; I'd be happy to contribute it to #439. The four title culling hashes still need the structured view path and matched downstream measurements. Exact implementation and reproduction
@r4tedx on GitHub · 2026-11-24 07:30 UTC · original
@aycow thank you: your fixture found two defects here, both fixed in
e4d899f(head; fast-forward from901eef9).I reproduced with your
culling_tests.rsfromtest/instance-culling-pr439, run through this branch's own test host on an RTX 5070 (32..32) and a Radeon iGPU (32..64). Your file is not in the commit.e4d899fe4d899f0x58(your result)an opaque lane maskan opaque lane maskword latchform (EXEC written with twos_mov_b32) made the console-flow lowering recurse without end: such a mask is held as a number, and that number was known only as the mask's own dword. It takes the process down, and it has been reachable since #233. It stops with a reason now. Your table has no row for it because the two forms you ran on NVIDIA come before it.Still refused after this, on both hosts: the three forms that copy a mask dword by dword. That needs the structure pass to follow mask halves through
s_mov_b32, which I have not done.Yes, please contribute the controls. A PR against
shader/console-flow-ldson r4tedx/VIctory with the fixture under your name would be the right form (two others came in that way). The three word-copy forms are useful as they are, as expected refusals. If the native test can take its device fromemit::host::Host::onandadapters()likesplit_tests, it runs here without an Agility path.Tested (synthetic; the title was not used in these tests): my own two regression tests in
split_tests(a lane read in a branch beside a whole-wave sum, exact on both adapters; a mask copied dword by dword, which overflowed before).cargo test --workspace: 298 passed, 0 failed, 4 ignored.Measured locally (local title data, offline, CPU only; counts):
901eef9→e4d899f: 6 more compute programs translate for a 32..32 host and 12 for a 32..64 host, 0 lost; all but one are in the computesampleclass that #180 fixes. On a 32..64 host about 18 programs that translated per lane before now take the console flow. No title program hit the recursion.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 07:36 UTC · original
@catminou4 thank you, both for the macOS run (nobody had built this stack off Windows) and for the catch: a conflict that merges cleanly and then breaks a build is the kind nobody sees until it lands.
You are right about the cause and the fix.
Host::target()comes from #223 at the bottom of the stack, andtranslate.rscalls it; #235's stubHostfor other hosts has no such method.Target::ANYis the right value for a stub whoseHost::newalways fails. I have not reproduced the merge myself; I am taking your error message as the reproduction.Neither branch can fix it alone, since the stub does not exist on
mainandtarget()does not exist in #235. So I have written it into #223's description as a known interaction, with the fix you give: whichever lands second adds the method to the stub, and I will do it on this side if #235 goes in first.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 07:39 UTC · original
@aycow our messages crossed: the head moved to
e4d899fabout when you posted, and it fixes the refusal you measured on901eef9by another route (see my reply just above for the table from your first fixture).I applied only the test half of your
e497830(split_tests.rs, without thelower.rschange) one4d899fand ran it on an RTX 5070 (32..32) and a Radeon iGPU (32..64):masked_section_inside_waterfall_uses_the_full_wavewhole_wave_section_returns_each_waterfall_class_sumSo both pass here without the retry in
mask_dword. The reason is the rulee4d899fchanges: on a host that runs the console's wave size, a program with a lane read or write outside its whole-wave sections and a branch its lanes take differently goes to the console flow up front, sections or not. Your waterfall has thev_readlaneof the class in the loop, so it qualifies before it ever reaches the saved-mask read.What I would like from your commit, as a PR against
shader/console-flow-ldson r4tedx/VIctory (rebased one4d899f), under your name:ballotingguard.e4d899fguards the recursion I hit with your word-latch form at a different place (where a mask held as a number reads its own dword). Yours sits at the ballot and would also catch a cycle that does not go through such a mask, so it is worth having beside it.a lane mask holding lanes elsewhere read as dataon a 64-lane host ate4d899f(a saved-mask read with no lane access outside a section, say), a test for it would justify the retry; without one I would rather not carry a second way into the console flow.Your file is not in my tree; I removed it after the run. The title was not used in these tests. AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 07:57 UTC · original
Head is
055aef9, and this PR is now closed to new features so it stays reviewable.055aef9(from r4tedx/VIctory#5, by its author): a compute program with a numeric select that nothing consumes no longer declares the console's wave size. That was a side effect ofd2189ffhere: it refused a 128-thread wave64 program on a 32-lane host only for a dead select. Their test fails without the change and passes with it; my hardware test of live numeric selects is still exact on the RTX 5070 and the Radeon iGPU;cargo test --workspace: 299 passed, 0 failed, 4 ignored. An offline translate over a local copy of the title's shaders (CPU only, counts only) is identical toe4d899fprogram by program, so no title program had hit it.shader/wave-per-group) and are not part of this PR.The title was not used in the tests. AI-assisted (Claude Code).
@walterwallaceson on GitHub · 2026-11-24 08:11 UTC · original
@r4tedx confirmed on Windows 10: the test now skips instead of failing.
Head
055aef9, merged into my local stack (fast-forward fromf653ea4, no conflicts), Windows 10 22H2 (19045.6466), RTX 3070, NVIDIA 621.14.cargo test --workspace --no-fail-fast -- --test-threads=1:lane_reads_in_a_loop_lanes_leave_at_different_iterationsandlane_read_loop_with_a_joined_exec_back_edge: both pass by skipping, withNVIDIA GeForce RTX 3070: no SM 6.6 device (the device supports SM 0x65 only …); skippedandno SM 6.6 hardware device; skipped.victory-shader: 96 passed, 8 failed. The 8 arevalu_teststhat need an SM 6.6 device and fail with "neither hardware nor WARP SM 6.6 device available" on the in-box runtime (#362): seven frommainplus #483's guard-slot test, which is in my stack. None of them comes from this PR.victory-hle'sonly_loopback_is_reachable(#118).No game run on this head yet.
AI-assisted (Claude Code); everything above was run on my machine.
@likecrank-dotcom on GitHub · 2026-11-24 08:24 UTC · original · edited 2026-11-24 08:29 UTC
RTX 5060 Ti 8 GB hardware data point on 055aef933dc678c68214465007caeab63c12079a (this PR's current head, without additional PRs).
Windows 11, Ryzen 5 3600, 32 GB, NVIDIA 621.14, native D3D12, title 1.0.2.1 Series X. Diag build, DRED on, default loop limit, VICTORY_LOG=info; fresh state copied from the same existing settings, scripted Enter presses. Host reports lane range 32..32. No other title, GPU tests or build ran during this title run.
cargo test --profile diag -p victory-shader --features diagnostics -- --test-threads=1, with VICTORY_ADAPTER=NVIDIA and SDK DLLs on PATH: 103 passed, 0 failed, 0 ignored (22.28 s test execution).d2a4baelog on this PC contains 131 distinct driver-refused compute hashes. This PR's new run has 0host pipeline refusedlines and 595 accepted compute hashes. Importantly, 75 exact hashes refused in that earlier main run are explicitly accepted here; examples: 13dfdd3b1136e407, 88994c3496045f51, 339d476c267c03c7, 2dc602192abf6288. This is an intersection of observed runtime logs, not a whole-title shader census.Now testing the identical executable with only VICTORY_SHADER_LOOP_LIMIT=4096 changed. Will report the result separately. No title files, shader binaries, raw dumps or full logs attached. AI-assisted/Codex: build, scripted run and log/code analysis; hardware and title belong to the user.
Follow-up: the identical 055aef9 executable with VICTORY_SHADER_LOOP_LIMIT=4096 also lost the device (126.8 s from process start; 0x887A0005 / removed reason 0x887A0006). DRED: command 234/256, op 42, mesh 51ff151f75cd5759 / pixel 7fe75645c406cac6. Before it, the dynamic descriptor pool ran out (no free dynamic descriptor slots). This is the old d2a4bae-based PR head, without the now-merged #336; moving the local integration onto current main is the next check. No performance conclusion: the changed loop-limit cache key caused cold translation, and the capture cadence differed. The user reports clear dialogue after the Two years ago title over a black scene, with long pauses followed by later dialogue. Clarification: opening credits and the second city cutscene were observed in the earlier main-series-x-matched run (
d2a4bae, 308.9 s), not established for these PR439 runs. These user observations are separate from the later logged GPU stops.@mohammadallami75-ops on GitHub · 2026-11-24 08:30 UTC · original
Preserve scalar state across divergent Wave64 compute control flow
Patch base PR #439 at
055aef9PR #269 reconstructs scalar values after divergence with a maximum over each hardware wave. On an RTX 2080 SUPER, a 64-thread console wave runs in two 32-lane hardware waves, so that reconstruction produces separate scalar values. The two mask-count fixtures in #269 require a 64-lane pipeline, which this adapter refuses. PR #233 introduces a synchronized console-flow path for split waves, #320 uses it for divergent named-lane accesses, and #439 extends it to LDS and recognized whole-wave sections. The two mask-count fixtures already pass on #439. Scalar-only joins still used per-lane execution. #269, #233, #320, #439
The patch detects live Wave64 scalar SSA joins reached through lane-dependent edges, including loop back edges. It selects the existing console-flow lowering so EXEC guards vector work and scalar updates follow one wave-wide branch sequence. This preserves dependencies between scalar updates in disjoint EXEC regions. On Wave32 hardware, the two halves share branch decisions through the existing exchange. Shaders that require this path report any lowering error during translation.
Results on the RTX 2080 SUPER
Windows 11 Pro N build 26200, NVIDIA driver 621.01, Ryzen 5 5600, 32 GB RAM. The #439 comparison used Rust 1.98.1 (
x86_64-pc-windows-msvc, debug) anddxil.dll1.9.2609.5. All shaders were hand-assembled GFX10 fixtures and checked by GPU readback against CPU expectations.9356bee055aef9with fixturesireadsi + 1The focused tests also check
PSV0wave size for Wave32 and Wave64 targets, the existing refusal for more than one console wave on a Wave32 target, and the unpinned wave size at a uniform scalar join. WithVICTORY_DXILset, the GPU test helper fails if the explicit validator cannot be loaded or rejects the emitted module.Reproduce
Use Windows, the repository’s pinned Rust toolchain, the MSVC linker and Windows SDK libraries, and a D3D12 SM 6.6 adapter. Set
VICTORY_ADAPTERto the adapter's name andVICTORY_DXILto the full path to the x64 validator. To reproduce the before result, apply only the test-file hunk to the exact base. Reset the test file before applying the full patch, or use a second checkout of the base.For the original #269 baseline, check out
9356beeae173723585c2aeac91f68c34862c00a4and runcargo test --locked -p victory-shader --lib -- emit::valu_tests --nocapture --test-threads=1.Scope and disclosure
Tested synthetic compute shaders in a debug build. Wave64-native hardware, title data, release performance, and the #71 world hang were outside this run. The Wave32 host path still uses one console wave per group for this class. The separate
shader/wave-per-groupbranch is working on larger groups, and #180 addresses compute implicit-derivative sampling. The patch uses conservative classification when a divergent mask join occurs in a shader that reads masks numerically. Multi-wave branch, #180, #71OpenAI Codex investigated, wrote the patch and adapted four fixtures from TheHoracio’s #269. Codex also wrote the disjoint-path fixture and ran the validation on the contributor’s system.
Patch against 055aef9 (save as wave-scalar-state.patch)
@r4tedx on GitHub · 2026-11-24 08:35 UTC · original
Rebased, and force-pushed once (all four stack branches, with lease): upstream
mainmoved to2e4e280with 32 merged PRs, and the stack merged without a textual conflict but no longer built its tests, because two new upstream tests callemitwithout the wave-range argument #223 adds.e0865d2b2adc373098672cd4677ca5ba4a44a38a75055aef9ef14bf3Target::ANY. The other 26 commits are replayed unchanged, with their authors.cargo check --workspace --all-targetsafter each of the 27).ef14bf3: the shader crate's tests, 116 passed, 0 failed, 1 ignored; the other crates, 210 passed, 0 failed, 4 ignored. Two runs, because the fullcargo test --workspacestalled twice in upstream'svalu_tests, the intermittent hang #433 fixes.055aef9).The title was not used in these tests. AI-assisted (Claude Code).
@slint6614-dev on GitHub · 2026-11-24 08:44 UTC · original
Measured on the full retail shader pack (26,503 containers) with
victory translate --validate --pipelines(pipelines created on an AMD RX 9070, Adrenalin, Windows 11; dxil.dll from SDK 10.0.26100), against main1f858b0. Counts are emitted / validated / pipelines.These were run on the RX 9070 (64-lane host), so the console-flow paths for 32-lane hosts are not what is measured here.
@r4tedx on GitHub · 2026-11-24 08:46 UTC · original
@walterwallaceson thank you, that closes the one thing I could not check myself: the skip path on a Windows 10 machine without SM 6.6. Both lane-read loop tests skipping with the reason printed is what
e6936e3was meant to do, and it is good to have the other failures there named asmain's (#362, #118) and #483's.For anyone reading later: the head you tested,
055aef9, is the same code as the current headef14bf3. The stack was rebased onto the newmainafter your run (see the rebase note above); the only difference is two upstream test call sites in #223's commit.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 09:16 UTC · original
Rebased again, onto
main8e79c80(force-pushed with lease, all four stack branches). Upstream merged another 24 PRs and added CI. New upstream tests buildlower::Partsdirectly, so the three things this stack adds to it are given to those tests in the commits that introduce them.e0865d2b2adc371b012df3098672cd4677c189d294a5ba4a44a38a75d07da2b055aef9ef14bf360a126aChecked here with the commands the new CI runs: both clippy commands (
-D warnings, with and without--all-features) are clean at the head of each of the four PRs, every one of the 27 commits builds, andcargo test --workspace --lockedat60a126agives 346 passed, 0 failed, 6 ignored (RTX 5070 + Radeon iGPU). The title was not used in these tests. Nothing in the stack's own code changed.Replies to three reports:
@slint6614-dev thank you for the 64-lane measurement. Two notes on reading it. The 31 new modules that fail validation are the compute
sampleclass (#180), as on 32-lane hosts. And the "40an SCC the emitter did not compute" and "7a program the console structure cannot hold" are not 47 programs lost: a program that both forms refuse now reports the console flow's reason where it used to report the per-lane form's, so those are programsmainrefuses too, under another name. In my own program-by-program comparison (an offline translate over a local copy of the shaders, counts only) no program that translated before stops, on either host kind. I agree the changed reason is less helpful there than the old one; that is a diagnostics defect I will fix after review rather than move this PR again now.@likecrank-dotcom thank you for the careful run and for saying what it does not show. It matches the others: with this PR alone the 131 driver refusals go to 0 (75 of those exact hashes now accepted), and the device is still lost at world entry, with DRED naming mesh programs both times. This stack does not touch mesh programs. The runs that stay in the world all carry the set from #71 (and #336, now merged, for the descriptor pool), so your next check on current
mainis the right one.@mohammadallami75-ops thank you: that is the case I had listed as next but not done (scalars that leave a divergent loop; #269's fixtures were exact here only when forced through the console flow), and your table shows the gap clearly. This PR is closed to new features so it stays reviewable, and upstream is not taking new PRs right now, so the way in is a PR against
shader/console-flow-ldson r4tedx/VIctory. I will build it, run it on an RTX 5070 and a Radeon iGPU, measure how many title programs change form with it (that number matters: it decides how much of the title moves to the slower form), and carry it on the fork beside the multi-wave branch until upstream opens again. If a fork PR is not convenient I can take the patch from your comment with your authorship; say which you prefer.AI-assisted (Claude Code).
@mohammadallami75-ops on GitHub · 2026-11-24 09:25 UTC · original
@r4tedx Thanks! Please feel free to incorporate the patch directly from my comment with my authorship preserved. I'd be interested to see the results on the RTX 5070 and Radeon iGPU, particularly how many title shaders benefit from the change. Happy to help investigate any further issues that arise during testing.
@r4tedx on GitHub · 2026-11-24 09:26 UTC · original
CI failed on the four stack PRs and that was my tests' fault; fixed and force-pushed with lease. Clippy passed in both configurations on all four. The test step failed.
Cause: GitHub's runner has no GPU and lists Windows' software renderer (Microsoft Basic Render Driver, 4-lane waves) as an ordinary adapter, without the software flag. The tests here run "on every hardware adapter" and assumed each one has 32-lane waves, so on the runner they tried to translate wave32 and wave64 programs for a 4-lane host and panicked. One more test takes the default device, which is that renderer there. On a machine with a GPU none of this shows.
Fix, in the commits that introduced the tests (no translator code changed):
0x1414/0x8c) and its name as well as by the software flag.what_translates_for_the_host_creates_a_pipelineaccepts a host without waves of the program's size.e6936e3); it is folded down, so this PR has 16 commits of its own now.1dfb8591b012dfdd3c08c189d294fd8b8fed07da2b1ca87f760a126aChecked before pushing this time:
VICTORY_WARP=1(same panic, same line) and passes with the fix, on the software renderer and on the RTX 5070.1ca87f7:cargo test --workspace --locked346 passed, 0 failed, 6 ignored; both clippy commands clean at each head.What I could not check here: that the runner's renderer really reports those ids. The name match is the fallback, and the log names it exactly. The new CI runs will say.
The title was not used in these tests. AI-assisted (Claude Code).
@MartinIndra02 on GitHub · 2026-11-24 09:29 UTC · original
Full-corpus
victory translate --pipelinesmeasurement on NVIDIA Ampere for the rebased headef14bf3(comparing againstmainc7a5f49):621.24,host waves 32-32 lanes), Ryzen 7 5800X3D, Rust 1.98.1 (x86_64-pc-windows-msvc), diag build.ef14bf3):cargo test -p victory-shader --lib -- --test-threads=1→ 116 passed, 0 failed, 1 ignored.dxil.dllinstalled so--validatewas not run):main(c7a5f49) emitted / pipelines#439(ef14bf3) emitted / pipelinesDriver-refused compute pipelines (
pipeline: The parameter is incorrect.) drop from 319 → 0 on this 32-lane GPU. Remaining wave64-on-32-lane emit stops onef14bf3:43:console wave64 lanes in a group of more than 64 threads on a host without 64-lane waves4:a whole-wave section of a wave64 on a host without 64-lane wavesCounts only; no game data. AI-assisted; all builds, tests, and pipeline runs executed on my machine.
@MrCloudy2 on GitHub · 2026-11-24 10:14 UTC · original
Tester result for this stack (#223 → #233 → #320 → #439) on a 32-lane NVIDIA host.
Setup: RTX 3060 12 GB, driver 620.73.04 (subgroup size 32..32), Linux, Proton-CachyOS 11.0 wine with vkd3d-proton 3.2.0, diag build cross-compiled with xwin, own 1.0.2.1 copy.
Method: I took the compute programs one world run had refused with
host pipeline refused ... E_INVALIDARG(vkd3d-proton:Required WaveSize range [64, 64], but supported range is [32, 32]): 102 distinct programs. Each was matched to its container by BLAKE3, the hash VIctory logs. All 102 went in one folder, and I ranvictory translate <folder> --pipelines --jobs 4twice on the same machine:main8e79c80+ #151 #190 #454 #493 #579 + #177's key fixAll 102 translate in both builds. In the stack build 21 are not emitted for the 32-lane host, and none of the 81 created pipelines crashed the driver. The merge onto that base was clean (
git merge-tree), and the merged tree builds (cargo build --profile diag; clippy not run).AI-assisted (Claude Code); measured on the machine above.
@Sil3ntGam3r on GitHub · 2026-11-24 10:33 UTC · original
Title run on NVIDIA: RTX 3070 8 GB, driver 621.14, Windows 11 (26300); diag build,
VICTORY_SHADER_LOOP_LIMIT=32,VICTORY_D3D12_DRED=1, fresh shader cache.Tree: main
8e79c80+ this PR at1ca87f7(with #320, #233, #223) + #1805ff639e, then #89 #493 #483 #206 #469 #459 #454 #704 #688. Compared with the same PRs with #189 in place of the stack and #180.an address in an SGPR that is no root parameter31,console wave64 lanes in a group of more than 64 threads23,an address not from a root parameter15,image_gather4_l6.0x887A0001(DXGI_ERROR_INVALID_CALL), DRED breadcrumbs empty, the last recorded draw[vertex c5310733d58458c8, pixel 5460ce5f3b925eee]. 12 s before, the first pipelines of newly translated compute programs were created (fdd56d97a806bccaamong them).VICTORY_D3D12_DEBUG=1and the cache warm: removed after 1m18s, still in the menus, at the first bind ofdispatch 1x1x1 [compute 24317e785c8688e3]. That program had also run in run 1 without trouble. The debug layer reported no error before the removal.nvgpucomp64.dllexception and noE_OUTOFMEMORY, so this doesn't look like the RTX 3080 report in your notes.Merging notes: with #180, implicit-derivative samples go in
in_half, as in your integration branch. #459's and #704's tests neededTarget::ANYand the newPartsfields, and #704's GPU tests need #483's guard dword filled. 368 tests pass on the RTX 3070. The scene behind the credits is still black in both builds. (AI-assisted test run.)@MichaelSmithAI on GitHub · 2026-11-24 11:27 UTC · original
For the program that reaches
v_permlanex16_b32, Daniel tested a focused port of #404 onac6ab70. The current #439 headc153b21has the same source tree. The port handles the ordinary all-active form: each lane selects from the opposite row of 16 within the same 32-lane half of the guest wave.On RTX 4090 under Wine/GE 3.2, the baseline refused the source-built shader before pipeline creation. The port emitted DXV-valid WaveSize=32 code and returned all 128 expected words in each of two cases: a split-wave permutation, and the same permutation in console flow with an additional read from guest lane 40. The test used distinct values across both halves. Comparison branch and regression
The remaining title question is whether
a929109552ce1e84uses the supported form and, if so, what it reaches next in translation and validation. We have no in-game or full-resolution lighting result for this change.@supidooo on GitHub · 2026-11-24 11:36 UTC · original
Tested head
c153b21merged cleanly ontomain(ffe310e) +#175(19aec59, Windows 10 Agility SDK1.620.2) on Windows 10 Pro 22H2 (Build 19045), NVIDIA GeForce RTX 4060 Ti 16 GB (driver32.0.16.2124/621.24), Intel Core i7-10700K, 32 GB RAM, Rust1.98.1, release build.victory translate --pipelines(auto-detectedhost waves 32-32 lanes)Baseline (
mainffe310e+#175) vs +#439 (c153b21) on the same 26,599 containers (26,148 IR programs):12243/1224312243/1224301441/11211420/14208214/82148214/82140Notable failure-reason changes on
32-32lanes:pipeline: E_INVALIDARG(driver rejection of Wave64 compute PSOs): 320 → 0emit: a select on an untracked mask: 288 → 0emit: a lane mask holding lanes elsewhere read as data: 272 → 3emit: a descriptor read only as data: 394 → 819emit: an SCC the emitter did not compute: 0 → 86emit: console wave64 lanes in a group of more than 64 threads on a host without 64-lane waves: 0 → 43emit: a whole-wave section of a wave64 on a host without 64-lane waves: 0 → 4emit: a program the console structure cannot hold: 0 → 7cargo test -p victory-shader --libemit::split_tests::*andemit::lane_read_loop_tests::*test passed).13inemit::valu_tests+2inemit::waterfall_tests) are strictlyneither hardware nor WARP SM 6.6 device available, expected on Windows 10 without #362 because the test binary does not carry the Agility SDK exports.@r4tedx on GitHub · 2026-11-24 11:40 UTC · original
@supidooo, thanks for testing
c153b21with #175 on both builds. The distinction between emission and pipeline creation matters here: 21 fewer compute programs emitted overall, yet 299 more host pipelines were created, and the RTX 4060 Ti accepted all 1,420 compute modules that emitted. The mask-select refusal falling from 288 to zero also answers part of the earlier question on this thread. The rise in descriptor and SCC refusals gives us the next diagnostics to investigate; matching hashes across builds would show which individual shaders reached each one.The 15 test failures are consistent with the Windows 10 test-executable issue tracked in #362. #175 supplies Agility exports to
victory.exe; the shader tests run in their own executable. If you have time for one follow-up, the most useful check is the same shader test command with #362 applied and-- --nocapture, so the output distinguishes GPU execution from an adapter skip. The offline pipeline counts already stand on their own.AI-assisted (Codex).
@Ilokaxt on GitHub · 2026-11-24 12:02 UTC · original
Tested on an RTX 3070 Ti Laptop (wave lanes 32..32, NVIDIA driver 610.88 / 32.0.16.1088, Windows 11 build 26300), on
mainatffe310e. Each build also had a local fix that creates the device on the high-performance adapter: this laptop's default adapter is the Iris Xe.Same scripted run for each: diagnostics build,
VICTORY_KEYSpressing Enter every 4 s, DRED on, up to 420 s, into the world.ExecuteIndirectDispatchDispatchThe hanging dispatch, named by DRED without the debug layer: compute
42683eebec081520,Dispatch(128, 64, 1), 6 user-data dwords, 1 sampler. Onmainthe driver refuses this pipeline ("wants wave lane count of 64 but maximum wave lane count for device is 32"). #578 refuses it up front. With #439 it translates for 32-lane waves and the device hangs (TDR) the first time it runs in the world. This happened on all three #439 runs.#439 otherwise brings every wave64 compute program in on this GPU (124 → 0 refused).
@supidooo on GitHub · 2026-11-24 12:16 UTC · original
@r4tedx Here is the follow-up run with #362 (
1e33e88) merged cleanly ontomain(ffe310e) +#175(19aec59) +#439(c153b21) on Windows 10 Pro 22H2 (Build 19045), NVIDIA GeForce RTX 4060 Ti 16 GB (driver32.0.16.2124/621.24), Intel Core i7-10700K, 32 GB RAM, Rust1.98.1(no game data used):dumpbin /exports): bothD3D12SDKPathandD3D12SDKVersionare present on thevictory_shadertest binary (target\debug\deps\victory_shader-01150f1076d175ec.exe).cargo test -p victory-shader --lib -- --nocapture: 155 passed; 0 failed; 1 ignored (benchmark) in 42.94 s (up from140 passed; 15 failedwithout #362).Hardware execution vs. skips (
--nocapture)NVIDIA GeForce RTX 4060 Ti): 0no SM 6.6 hardware device; skipped— every hardware test executed on the RTX 4060 Ti (110NVIDIA GeForce RTX 4060 Ti: ...lines):emit::split_testsGPU cases ran on the RTX 4060 Ti and printedexact(includingsplit trueacross 32/48/64/128-thread and 3D groups, LDS ordering, DPP/permlane/readlane/writelane, whole-wave reductions/prefixes, andwave32/wave64constant/built mask selects).emit::lane_read_loop_testspassed (NVIDIA GeForce RTX 4060 Ti: joined back edge exact).emit::tests::each_adapter_gets_what_it_runs(waves 32-32),emit::tests::what_translates_for_the_host_creates_a_pipeline(host waves 32-32),emit::tests::stub_pipeline_is_created, all 13emit::valu_tests, and all 5emit::waterfall_testsexecuted on the hardware GPU and passed.35×no SM 6.6 warp device; skipped(expected on Windows 10's in-box WARP)6×no dxil.dll; validation skippedand1×no dxil.dll; skipped(constant_color_validates; nodxil.dllon this setup)1×no console compiler; skipped+3×no console or PC compiler; skipped(emit::diff_tests)@Sil3ntGam3r on GitHub · 2026-11-24 12:22 UTC · original
RTX 3070 8 GB, driver 621.14, Windows 11 (26300): main
8e79c80+ #4391ca87f7(with #320/#233/#223) + #180 + #89 #493 #483 #206 #469 #459 #454 #704 #688; diag build, DRED, loop limit 32. Following @Ilokaxt's result I ran it withVICTORY_SKIP_PIPELINES=42683eebec081520(the skip covers direct and indirect dispatches). The device was still removed, in the same second as that program's first bind (frame 1880, still in the menus); without the skip, an earlier run was also removed in the same second as its first bind. With the skip, DRED namesindirect kind 10 max 1 [mesh 8563c39d693b36d0]withu9=… [heap 568328: null], breadcrumbs empty. So on this card42683eeb…marks the point where the hang starts rather than being the only cause. (AI-assisted test run.)@r4tedx on GitHub · 2026-11-24 12:25 UTC · original
@supidooo, that closes the Windows 10 follow-up. You verified the Agility exports on the test executable itself, and the same setup went from 15 failures to zero with #362. The
exactoutputs confirm the split-wave and joined-back-edge cases executed on the RTX 4060 Ti. I’ve recorded the hardware result and the WARP, validator, and compiler skips in the description.@Sil3ntGam3r, your skip run narrows the RTX 3070 hang: device removal still occurred with both dispatch paths for
42683eebec081520skipped. Its first bind is a useful timing marker on your stack. With empty breadcrumbs, the indirect mesh operation and nullu9are leads, but there’s no evidence yet that either caused the removal. I’ve linked your report with the tested stack head so it can be compared with other runs.AI-assisted (Codex).
@r4tedx on GitHub · 2026-11-24 12:27 UTC · original
@Ilokaxt, thanks for comparing all four builds with the same scripted input and adapter selection. On your 3070 Ti Laptop, DRED named
42683eebec081520at its first world dispatch in all three runs containing #439. That is a reproducible point to investigate. The baseline also hung, later inExecuteIndirect. The 420 s run with #578 alone dropped 85–98% of world draws, so it exercised substantially less of the workload.I’ve linked your results alongside the desktop RTX 3070 skip run. That run used a different driver and PR stack and still hung with this hash skipped. The comparison that would distinguish the two results is a skip run on your laptop using the same
main + #439build, driver, loop limit, and input script. If you can run it, the useful observations are whether it gets past the first world dispatch and, if it hangs later, which operation DRED names. Please include the effective loop limit from the original run as well.AI-assisted (Codex).
@r4tedx on GitHub · 2026-11-24 12:41 UTC · original
@Ilokaxt @Sil3ntGam3r, I ran the exact compute container
42683eebec081520in isolation on #439c153b21, on an RTX 5070 (driver 616.92). The 32-lane DXIL validated, its compute pipeline was created, and the reportedDispatch(128,64,1)completed at both loop limit 32 and the default 1,048,576. All four output UAVs received nonzero data in both runs. The shader declares 8×8×1 threads per group. Its split-wave DXIL has 86 static group-barrier calls; that is a count in the module, not a measured number of waits per group.The bindings here were synthetic: valid raw buffers containing zeros, constant-valued texture inputs, and four texture outputs. This isolates the shader and grid size. It does not exercise the title’s descriptor contents, command-list history, or the two Ampere drivers. The same-laptop A/B remains worthwhile. For a run that hangs, the SRV/UAV dimensions, view formats and null status at the dispatch would let us match the inputs more closely. No game data attached.
AI-assisted (Codex).
@erLCoder on GitHub · 2026-11-24 13:07 UTC · original
GTX 1660 Ti hardware rerun on PR stack
c153b21(baseffe310e; #223/#233/#320 included). Windows 10 22H2 build 19045.6466, NVIDIA 581.42, Ryzen 5 3600, Rust 1.98.1 MSVC, Agility SDK 1.620.2. Independent device probe reports SM 6.8 and 32–32 lanes. Local SDK exports were added to the test executable.cargo test --offline --locked -p victory-shader --features host --lib emit::split_tests -- --nocapture --test-threads=1— 28 passed, 0 failed, 0 ignored, 128 filtered out (includes CPU checks).cargo test --offline --locked -p victory-shader --features host --lib emit::lane_read_loop_tests -- --nocapture --test-threads=1— 2 passed, 0 failed, 0 ignored, 154 filtered out. Hardware paths printed NVIDIA GeForce GTX 1660 Ti and exact per-lane and joined-back-edge results. Previously e6936e3 gave 24 split and 1 lane-loop pass. #189 was not combined with this stack. Title performance and image quality onc153b21remain untested.Codex prepared the worktrees, ran the tests and drafted this report.
@mohammadallami75-ops on GitHub · 2026-11-24 13:09 UTC · original
Follow-up for the multi-wave branch. r4tedx/VIctory#11 backports indirect compute scaling to shader/wave-per-group. It reuses the count-aware clamp from #242 and credits the existing split-dispatch work on testers/indirect-wave-dispatch.
On an RTX 2080 SUPER (621.01), two counted dispatches of the same translated Wave64 fixture produced all 384 expected lane values each time, with the guest arguments and count intact. This was a synthetic run.
If you can independently test b3c2052 in-game on Wave32 NVIDIA hardware, please report the GPU and driver, any affected compute passes you can identify, and whether rendering or device-removal behavior changes. Please post results on the follow-up PR.
AI-assisted implementation and testing.
@alfycs on GitHub · 2026-11-24 13:21 UTC · original
@aycow saw your ping — on #189 we just rebased onto
ffe310eand pushed updates for the community reports (LDS uniform-join fencing,Wave32divergentv_readfirstlane, empty-EXEClane 0, DPP bounds). For the saved-EXEC loop back-edge case you asked about, @r4tedx already linked the regression added here via @ifBars's fix (lane_read_loop_with_a_joined_exec_back_edge).@sash2kk on GitHub · 2026-11-24 13:29 UTC · original
Title run of this stack on a 32-lane host: RTX 4090 (driver 32.0.16.1088), Windows 11 Pro 23H2, i7-13700K. Head
c153b21merged ontomainffe310etogether with #578, so the world loads instead of hanging in wave64 mesh. One trivial conflict inhost.rs: #578'swave_lanes()and this stack'starget()both queryOPTIONS1, and I kept both. Diagnostics build,VICTORY_D3D12_DRED=1, existing save, same input each run. Control:ffe310e+ #578 alone.main+ #578main+ #439 + #578So the refusals mostly go away. But on this host the stack fails to translate 49 programs that
maintranslates, and gains 8:console wave64 lanes in a group of more than 64 threads on a host without 64-lane waves is not supported(expected, ifmainwas running them unsound)a descriptor read only as data is not supporteda structured buffer of unknown stride is not supportedan address in an SGPR that is no root parameter,an SCC the emitter did not compute,a whole-wave section of a wave64 on a host without 64-lane wavesThe 17 + 9 look like the 32-lane path missing support that
main's own path has. Gained: 3xa lane mask holding lanes elsewhere read as data, 3xa lane-mask join of an untracked mask, 1xan LDS operation, 1xLDS the program does not allocate.Merged tree:
cargo test --workspace --lockedpasses (victory-shader 155 / 1 ignored, including the GPU wave tests on this card), and all-feature clippy with-D warningsis clean. I can send shader hashes for any of the lists above.AI-assisted (Claude Code).
@jebaczydow on GitHub · 2026-11-24 13:40 UTC · original
Title run on an NVIDIA RTX 5070 Ti (32-lane waves), Windows 11, head
c153b21Baseline:
mainatffe310e. Both builds carried one local change, unrelated to this PR: textures the host refuses with unordered access are retried without it.Tests:
cargo test --workspace --lockedon the 5070 Ti: 378 passed, 0 failed, 6 ignored.Title, same scripted run on both builds (diagnostics build,
VICTORY_KEYS=15:Enter,25:Enter,35:Enter,50:Enter, 80 s; it reaches the world):mainffe310ec153b21main, 44 translate and get pipelines here.mainstopped translating here, except those 3. The extra "not translated" are programs this run reached andmain's run did not.World entry with
VICTORY_D3D12_DEBUG=1andVICTORY_D3D12_DRED=1: it still ends in a device removal, but nothing points at this PR.IASetVertexBufferson a title buffer left inUNORDERED_ACCESS, and 44 barriers whose before state does not match. The removal comes at a compute dispatch whose shaders also translate and run onmain.c99e429) applied on top, both counts drop to 0. The run then ends inDXGI_ERROR_DEVICE_HUNGin the world, at 0.4–1.3 fps. This matches #71 and #778 (wave64 mesh programs on NVIDIA); I have not narrowed it further.AI-assisted (Claude Code, Claude Opus 5.5).
@r4tedx on GitHub · 2026-11-24 14:02 UTC · original
A console-flow defect found by @MartinIndra02 is fixed in the stack (r4tedx/VIctory#9; their commit is carried with authorship as
2466184on #233 and merged up).The defect:
s_*_saveexecwrites the EXEC it replaces to a scalar and sets SCC from the new EXEC. The console flow took the SCC from the first scalar the instruction writes, which is the saved one. Ans_cbranch_scc0/1after it then branched on the old EXEC.Reproduced here before taking it, at
c153b21on an RTX 5070 (console flow in two 32-lane waves):s_and_saveexecempties must be skippedBoth are also exact on a Radeon iGPU (64-lane waves). So in a loop the old code ran one more iteration with no lane in it; that is wrong for scalars set inside, but it is not an endless loop.
1a8a3edd1fecaae4246fd0fa6af41e17e57c153b21Pushed as fast-forwards, nothing rewritten. At each head both CI clippy commands are clean and
cargo test --workspace --lockedpasses on the RTX 5070 + Radeon iGPU (357 / 361 / 380 passed, 0 failed, 6 ignored).What it changes for the title (local title data, one offline CPU-only
victory translate --host-lanes 32-32 --validateover the shader pack, before and after; counts only):an SCC the emitter did not computenow name what actually stopped them: 68a descriptor's address or format read as data, 17a scalar memory read as data, 1a descriptor chosen by control flow. That is the second half of the same commit, and it answers the "0 → 86" in @supidooo's table.42683eebec081520that @Ilokaxt and @Sil3ntGam3r reported. That stays open.One note for anyone comparing counts across heads: compute emitted fell from 1,691 at
ef14bf3to 1,420 atc153b21.mainlost 253 compute programs over the same interval to #612 (#736). I have not matched the two lists program by program.AI-assisted (Claude Code).
@timorjay on GitHub · 2026-11-24 13:37 UTC · original · edited 2026-11-24 14:02 UTC
Tested on Windows with an RTX 5090 D v2 (driver 32.0.16.1742, wave range 32–32) and integrated AMD Radeon Graphics (32.0.21036.18, wave range 32–64).
I added a self-contained regression test on top of
c153b21. It uses hand-assembled synthetic input. Two nested EXEC masks guard a workgroup minimum and a bitmask recording which halves participated. Every lane reads both values after reconvergence. The eight cases include only lane 8, only lane 40, lanes 31 and 32 together, a full group, and empty masks. Each case dispatches two 64-thread groups with different element IDs. All 1,024 readbacks per GPU matched the CPU reference on the clean PR head plus this test. In a separate instrumented run the translator selected wave32 on NVIDIA and wave64 on AMD, with the same results.To reproduce on a Windows D3D12 host, apply the linked commit to this PR and run
cargo test --offline --locked -p victory-shader --features host --lib nested_exec_masks_keep_shared_visibility_results_across_halves -- --nocapture. The output names the adapters and reports 128 lane results per case.Separately, I checked the same four 1.0.2.1 instance-culling compute programs on the RTX in three builds based on
ffe310ewith #160 and #578:c153b21, includes #233)The prop programs were
fdd56d97a806bccaand17af15c4015cb4b6(no LDS). The tree programs were55679a0547649d0band89d08e561897d4e5(512 bytes of LDS, includingds_min_u32,ds_or_b32,ds_read2_b32, andds_write2_b32). The standalone game-program check ended at pipeline creation. The readback comparison above used the synthetic test only.Title follow-up on the same RTX: In a separate offline run with #160, #578, #704 and this PR, the title bound all four at world entry (frame 3363), and the runtime logged successful translation for each. The distant-imposter transform
e30970f1727063fdalso translated. Normal presentation showed the Vice City title card and dialogue subtitles on a black background. The game reportedDXGI_ERROR_DEVICE_HUNGroughly 58 seconds after those first binds. I did not observe a controllable character or establish which GPU operation caused the failure. The two native-wave32 BVH programs3b90165a77d95cdfandf6e47efa50226bebstill failed address translation on that build, consistent with the separate work tracked in #293.Codex assisted with the test, measurements, and write-up.
@Sil3ntGam3r on GitHub · 2026-11-24 14:11 UTC · original
RTX 3070 8 GB, driver 621.14, Windows 11 (26300): this PR at
c153b21+ #180aa69258on mainffe310e, with #89 #493 #483 #206 #469 #454 #704 #688 #352 #346 #489 #709 (with #294) #650 #571 and #334c99e429, plusMIN_DYNAMIC = 1 << 18(#747). Diag build, DRED, loop limit 32. #334's buffer-state tracking also needed adding to #346's rectangle expansion (expandbinds the title's argument, count and vertex copies as UAVs) and to #294's root views; all 421 tests pass.0x887A0001at about 7 min and at 1m18s, so @jebaczydow's finding that #334 removes the buffer-state errors behind that crash holds here too.fdd56d97a806bcca,17af15c4015cb4b6,55679a0547649d0b,89d08e561897d4e5), but the title never binds them in this run: no first bind up to frame 3062. In the #189-based run the title bound all four at frame 2211, just before the world. So something earlier takes a different path here; I haven't found what.(AI-assisted test run.)
@r4tedx on GitHub · 2026-11-24 14:21 UTC · original
@Sil3ntGam3r, thank you. Ten minutes in the world without a removal on the card that removed twice before is the result to keep, and it agrees with @jebaczydow's run: with #334 the buffer-state errors are gone.
Two things in your report I can narrow from here without a title run (no title launch on this machine):
"The title never binds them". Frame numbers do not compare across stacks. @timorjay's run (#160 + #578 + #704 + this PR on
ffe310e) saw the first bind of all four at world entry, frame 3363, which is later than where your run stopped looking (3062). So it may be a cutoff and not a different path. What would tell them apart: the frame of your world entry, and whether any bind of the four shows if the run goes past it by a few hundred frames. If the world was already up well before 3062 and they are still unbound, the next thing to look at is what the title runs just before them in the #189 build that it does not run here.The copy time (4.5–8.5 s of a 14–21 s frame). That is CPU time copying title memory, and this PR does not touch that path. Outside the shader crate the whole stack changes three files in
victory-gpu(host.rs: the adapter's wave range;pipeline.rs: passes it to the translator;shader_cache.rs: keys the cache by it). Checked withgit diff main..1e17e57 -- crates/victory-gpu. So the difference from your #189 build is more likely in what this stack has and that one did not: #334 with your additions for #346'sexpandand #294's root views, #704's raw views, orMIN_DYNAMIC. The copy line per frame with #334's tracking off, or with only your two additions removed, would say which. What this PR can add to a frame is GPU time: more compute programs now run, and the ones in the console flow wait at group barriers.The title was not used in these tests. AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 14:54 UTC · original
A second fix in the stack: the console flow no longer lowers a descriptor chosen per lane by control flow.
Since #566 is in
main, a descriptor each lane holds by the path it took is lowered as a DXIL phi over the edges into the join. In the console flow every lane reaches a join by the edge the wave took, so that phi gave every lane the same descriptor, without any error. The contribution work on the testers' branch found it, where #566 and the console flow first met.Reproduced here on the stack before fixing it: #566's joined if/else program (lanes 0-15 load one texture, lanes 16-31 another), lowered in the console flow at
1a8a3edon an RTX 5070, sampled the second texture in all 32 lanes. The module passesdxil.dll.The fix (
b623fd3, on #233): the console flow stops there witha per-lane descriptor chosen by control flow in the console flow. A program that takes the console flow only for its lane reads keeps the per-lane form (test in #320,cbcef55: it asks for the console flow, is refused there, and emits per lane for any host, a 32-lane host and a 32-64 one, each module validated). A program that needs the console flow for the host's wave size stops with the reason instead of running with the wrong texture or buffer.b623fd31a8a3edcbcef55e4246fdbf0f9511e17e57Fast-forward pushes again. Both CI clippy commands are clean at each head.
cargo test --workspace --lockedon the RTX 5070 + Radeon iGPU: 363 passed at #320's head; at #233's and #439's heads 357 and 381 passed with one failure,frame::tests::waits_end_on_ticks_and_count_frames, which this stack does not touch and which passes when run alone (this machine was at 100% CPU from other work). CI on the three heads is green.Not measured yet: how many title programs this moves from emitted to refused on a 32-lane host. Testers' counts at these heads would show it as a new line with that reason; each such program was one that ran with a wrong descriptor before.
The title was not used in these tests. AI-assisted (Claude Code).
@Sil3ntGam3r on GitHub · 2026-11-24 15:05 UTC · original
RTX 3070 8 GB, driver 621.14, Windows 11 (26300): this PR at
bf0f951+ #180aa69258on mainffe310e, with #89 #493 #483 #206 #469 #454 #704 #688 #352 #346 #489 #709 (with #294) #650 #571 #334c99e429, #43123ced70and #876's change (b7a0a8c), plusMIN_DYNAMIC = 1 << 18(#747). Diag build, DRED, loop limit 32. All 429 tests pass.The binds were a cutoff, as you thought. World entry was at frame 2221 in this run, and 2033 in the run before it (same stack, before
bf0f951). All four instance-culling programs got their first bind right there in both runs.The new refusal: no program was refused with "a per-lane descriptor chosen by control flow in the console flow", up to frame 2231.
With the culling programs running, scenery reaches the G-buffer for the first time on this card. In the full-screen targets dumped at frame 2224 I can see:
More had streamed in eight frames later (2232): a second power line, hanging signs, a fenced area with posts, more lamp posts, a chair and a bin. Terrain, roads and buildings are still missing in both frames, and everything else in those targets is black. In my #189-based build only characters reached these targets. The presented image is still white inside the letterbox.
Copy time: your reading holds; it isn't this PR's GPU time. The per-frame copy stats after world entry, compared with my #189-based run without the console flow (frame 1410):
Frames take 10–40 s, with the CPU at 99% and the GPU near idle, and the process grew to about 19 GB (32 GB machine). I haven't separated how much of this comes from #334's tracking and how much from the extra compute that now runs. A run with #334's tracking off is the next thing to try.
Stable: about 7 minutes in the world (frames 2221 to 2234) with no device removal and no title int3. I stopped it because memory was at 88%.
(AI-assisted test run.)
@Sil3ntGam3r on GitHub · 2026-11-24 15:30 UTC · original
Follow-up on the copy time, same build as my comment above (RTX 3070). I added a local, diagnostics-only switch that makes #334's
buffer_statereturn early, so no buffer is tracked and no buffer barrier is recorded. It was otherwise the same run. Per frame after world entry:So #334's tracking isn't the copy cost; the differences are within frame-to-frame noise. The time goes into the memory watches. In my #189-based run, where the four culling programs are refused, they cost about 30 thousand page faults and 0.66 s per frame, so the cost grows with the work that now runs once those programs do.
With the tracking off, the run went about 5 minutes in the world with no device removal. Before #334, this stack was removed at about 7 minutes on this card, so this run doesn't settle whether #334 is still needed for that. I stopped it when the machine was down to 1.3 GB of free memory (the process was at about 18.6 GB of 32 GB).
(AI-assisted test run.)
@r4tedx on GitHub · 2026-11-24 15:33 UTC · original
@jebaczydow, @timorjay, thank you both; two short answers, and @sash2kk's report is next (I am reproducing it against the
mainthis head contains before answering).@jebaczydow (RTX 5070 Ti,
c153b21): 48 compute pipelines refused onmain, 0 here, and nothing that translated onmainlost except the three withconsole wave64 lanes in a group of more than 64 threads. Those three are the known remainder of this PR. The fork branchshader/wave-per-groupruns such a group as one host group per console wave when it has no LDS and nos_barrier(direct dispatches only so far); an offline count over the pack puts it at 23 of the 43 programs with that reason leaving it, 20 of them validating. It is not in this PR, which stays as it is for review. Your debug-layer finding (18IASetVertexBufferson a buffer left inUNORDERED_ACCESS, 44 mismatched barriers, both 0 with #334) matches @Sil3ntGam3r's runs on an RTX 3070, where the removal went away with #334. Neither comes from this PR's code: outside the shader crate it changes only how the adapter's wave range reaches the translator and the cache key.@timorjay (RTX 5090 D and Radeon,
c153b21): the nested-mask test is the kind of case the stack has too few of: two nested EXEC masks, a workgroup minimum and a participation bitmask read by every lane after reconvergence, with only lane 8, only lane 40, and lanes 31 and 32 together. I will run your commit0cf37achere on the RTX 5070 and the Radeon iGPU at the current head and, if it is exact on both, carry it with your authorship. Your four instance-culling programs (two of them with LDS) getting pipelines only with this PR, and binding at world entry, is the first title result for the LDS path; @Sil3ntGam3r has since seen scenery reach the G-buffer on an RTX 3070 with those programs running.Heads since your runs: #233
b623fd3, #320cbcef55, #439bf0f951(two fixes, described above in this thread). Offline, over the pack, neither changes any program's outcome for a 32-lane or a 32-64 host (compute 1,420 emitted / 1,385 validated and 1,464 / 1,429), and no program hits the new descriptor-join refusal. That count used local title data, CPU only, counts only.AI-assisted (Claude Code).
@yuruiwang233 on GitHub · 2026-11-24 15:34 UTC · original
Independent run on a 32-lane laptop and a 64-lane iGPU in one machine, with a DXIL validator loaded
Not the author. I applied the whole stack as one diff on
mainffe310e(16 files; applies cleanly), since this PR's diff contains #223, #233 and #320.Machine: Windows 11 26300, Ryzen 9 7940HX, RTX 4060 Laptop GPU (D3D12 wave range 32..32, driver 32.0.16.1714) plus a Radeon 610M iGPU (32..64, driver 32.0.11002.41). That is the same paired-adapter setup you used with the 5070, so the differential form runs as designed: the NVIDIA takes the split / console flow, the Radeon is the native 64-lane reference.
Results (Rust 1.98.1,
x86_64-pc-windows-gnuwith MinGW; not MSVC, so this is not CI parity):cargo test -p victory-shader --lib: 159 passed, 0 failed, 1 ignored.cargo test -p victory-gpu --lib: 51 passed, 1 ignored, on a real D3D12 device.cargo clippy --workspace --all-targets -- -D warnings: clean.emit::split_testspass when run serially: 106 split (NVIDIA) and 53 native (Radeon) lane-by-lane comparisons were exact. The thread relabelling (console_flat) is exact on this driver for groups of 32, 64 and 128 threads and for 4x4x4, 8x8x2, 2x4x8, 16x2x4, 8x8x4 and 4x8x8.With a real validator loaded. I installed DXC's validator from the
Microsoft.Direct3D.DXCNuGet package (dxil.dll 1.8.2505.32, and 1.7.2212.48 as a second check; both exportDxcCreateInstance) and pointedVICTORY_DXILat it. With the validator active, all 30 split tests still pass, so every module these tests emit validates before it is dispatched. None of them emitssamplein a compute shader, so this says nothing about the #201 class either way (1.7 accepts them too).The per-access LDS barrier is required on this driver, not only on the 5070. I disabled the barrier in the LDS path (
lower.rs, theconsole_cf && split && threads > 32branch) and ran the LDS tests three times: bothlds_written_and_read_in_different_masked_blocksandlds_order_holds_when_one_half_is_busyfail every run on the 4060, with exactly the symptom in your note (the lower half reads 0 for lanes 0..31). Your note says only the first of the two needs the barrier on a 5070; on 32.0.16.1714 both catch it, so this driver is at least as strict about the ordering. With the barrier restored both are exact on both adapters.#189 on the same machine, for comparison. It applies cleanly on
ffe310e;cargo test -p victory-shader --libgives 144 passed, and its 23wave64_testspass on the 4060 (bothWave32andEmulate) and on WARP, with the validator loaded. Both stacks are green here, so this does not choose between them; the choice still rests on coverage and on the multi-wave / multi-console-wave cases.Not verified by me: no game files, so no run of the title and no
victory translate --host-lanes 32-32census; nothing here says anything about world rendering, and I did not measure how the title's own programs lower. The vertex, pixel and mesh paths are untouched by this PR but are only covered by the existing tests.@r4tedx on GitHub · 2026-11-24 15:36 UTC · original
@Sil3ntGam3r, on the part of your question that is about #704 (I'm #704's author; the rest of this PR's thread stays with its owner): #704 does not add any watching or copying of title memory. I checked its GPU-side code at
1f3c184:HostHeapmakes a structured or typed buffer view, #704 also makes a raw view over the same host buffer: the one the existing path already made for the title's view (note_view→alias(index, &buffer, start, len, …)indescriptor/host.rs). The raw view covers that view's own byte range, starting up to 12 bytes early for 16-byte alignment. It allocates no buffer and registers no watch or refresh.draw.rsbinds one small upload buffer of two dwords per heap slot as a root SRV. Nothing in it is mirrored from title memory.So the cost you measured is what the ordinary mirroring costs once the four instance-culling programs run. #704 only lets them translate. Their buffers then go through the same watch and refresh path as any other bound buffer. Your #189-based run (30 thousand faults, 0.66 s per frame) didn't run them, so its copies don't include their bindings. If those programs bind large views (whole instance or heap-sized buffers), each one is watched and refreshed at its full size every frame, which would fit the 9–11 GB per frame you see. #951 (mesh shaders reading through root SRVs megabytes past their copy) and the copy cost measured on
gpu/run-time-indexed-viewspoint at the same mirroring path.What would tell us more from a run you already have: the sizes of the views those four programs bind (in a diagnostics build, the device-removed report names each dispatch's views with their title address and length;
victory_gpu::draw=debuglogs draws only, not dispatches), and whether the watch total drops when only those four are skipped. I haven't measured this here, and the title was not used for this reply.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 15:51 UTC · original
@sash2kk, thank you for the A/B with the same save and input. I tried to reproduce the 17 + 9 and could not, and I think the control explains them. Here is what I measured, then the question that would settle it.
Offline, program by program (local title data, CPU only, counts only):
victory translate --validate --listover the shader pack onmainffe310e, and on this PR atbf0f951with--host-lanes 32-32; 25,889 listed programs matched by container hash.mainemits, this PR refuses for a 32-lane hostconsole wave64 lanes in a group of more than 64 threads, 4a whole-wave section of a wave64mainrefuses, this PR emitsmain: 9a lane mask holding lanes elsewhere read as data, 4a lane-mask join of an untracked mask, 4an LDS operation, 1LDS the program does not allocate, 1a select on an untracked maskSo in the whole pack there is no program that
maintranslates and this PR stops witha descriptor read only as dataora structured buffer of unknown stride. Looking from the other side: of the 730 compute programs that stop ata descriptor read only as datahere,main's translator refuses every one too (305 with the same reason, 220 witha lane mask holding lanes elsewhere read as data, 205 witha select on an untracked mask), and likewise all 195 with unknown stride (138 / 32 / 25). For the last two groups this PR gets past the mask and reaches the next blocker; they are not programs that ran before.The 40 are real and expected: all of them emit for a 32-64 host, so they need the console's 64-lane wave, which
maindeclares and a 32-lane driver then refuses. Your 20 are part of the 36.What I think the 17 + 9 are. Your control is
main+ #578, and #578 refuses a pipeline whose compute program is wave64 before it is translated (it tests the native program, inHostPipeline::new). Those programs then count as refused, not as untranslated. With this PR in the build they are translated, and the onesmain's translator cannot lower either now appear in the untranslated list with their reason. That would make them new lines in the log without being programs that worked before. I have not run your merged tree, so this is a reading of #578's description and your numbers (refused / untranslated 1265 / 920 against 1388 / 1576), not a measurement.What would settle it: the 26 hashes, as you offered. I can look each one up in both listings and say what
mainalone does with it. If any of them does emit onmainand stop here, that is a defect in this PR and I will fix it. The same for the singlean SCC the emitter did not computeandan address in an SGPR that is no root parameter: neither reason occurs atbf0f951in the offline count (the SCC one now names its real cause, see above), so those two hashes would be useful as well.On the fps (1.38 against 0.75): more compute runs with this PR, and the programs in the console flow wait at group barriers, so some cost is expected; @Sil3ntGam3r's numbers above put most of the frame time in the CPU copy path once the culling programs run.
AI-assisted (Claude Code).
@Sil3ntGam3r on GitHub · 2026-11-24 15:56 UTC · original
@r4tedx thanks, that explains #704. I ran the second check you suggested, and the four culling programs turn out not to be the main cost.
Same build as above (RTX 3070, #334 tracking on, Series X), with
VICTORY_SKIP_PIPELINESset to the four hashes (fdd56d97a806bcca,17af15c4015cb4b6,55679a0547649d0b,89d08e561897d4e5). The copy stats per frame after world entry, over six samples:Skipping them lowers the numbers somewhat but leaves them far above the #189-based build. So "once the culling programs run" in my earlier comment overstated their part.
The copy stats' per-range list shows where the refreshes go. These are the top ranges by MB per frame in one interval with the four skipped:
0x1b2800000xd6b6100000xfb26000000x1f1800000x1bc73fe00x1b9c3490–0x1bf50ae0The top ten come to about 6.0 GB per frame. The first range alone is about a third of all refreshes, and its size is exactly the
182452224x1buffer that mesh SRVs bind whole in @uWaazy's dump on #619. The five ranges starting just inside it look like views into the same buffer. So most of the cost looks like whole-buffer views of one large buffer, refreshed at full size on each bind, which is the pattern you linked to #951. That the stack pays more than the #189-based build because it translates many more programs (102 unique refusals here against about 470 there), and so binds it more often, is my inference; I haven't measured it.I haven't run
VICTORY_LOG=victory_gpu::draw=debugyet; the range list seemed to answer the same question. If you want the views behind the 182,452,224-byte range named, I can run it.(AI-assisted test run.)
@N7z on GitHub · 2026-11-24 16:03 UTC · original
Ran this stack's tests (
bf0f951, and #233 atb623fd3) next to #189 and #734's branch on an RTX 4060 Laptop: all 159 pass on the NVIDIA GPU. Comparison and coverage table in #1132.One thing for the harness:
emit::host::adapters()keeps every non-software adapter, and the split tests expect each one to run 32- or 64-lane waves. This laptop's Intel UHD (13th gen iGPU) reports 16..16, so 30 tests here fail on it withconsole wave64 lanes on a host without 64-lane waves is not supported: everysplit_teststest, bothlane_read_loop_testsandeach_adapter_gets_what_it_runs. The translator refuses correctly, only the tests expect a pipeline. Filteringadapters()onWaveLaneCountMax >= 32instead of the WARP name check would cover WARP and these iGPUs alike. Intel Xe-LP iGPUs are common on NVIDIA laptops, so testers with those will otherwise report failures that are not in the translator.@supidooo on GitHub · 2026-11-24 16:12 UTC · original
Revalidated updated head
bf0f951(replacingc153b21) stacked cleanly onmain(ffe310e) +#175(19aec59) +#362(1e33e88) on Windows 10 Pro 22H2 (Build 19045), NVIDIA GeForce RTX 4060 Ti 16 GB (driver32.0.16.2124/621.24), Intel Core i7-10700K, 32 GB RAM, Rust1.98.1, now with DXIL validation enabled (dxil.dll 1.9.2609.5viaVICTORY_DXIL).Unit tests (no game data)
cargo test -p victory-shader --lib -- --nocapture: 159 passed; 0 failed; 1 ignored in 37.36 s (113NVIDIA GeForce RTX 4060 Ti:hardware lines,0no dxil.dllskips,35no SM 6.6 warp device; skipped,4no console [or PC] compiler; skipped).emit::split_tests::loops_leave_on_the_new_exec_of_saveexec,emit::waterfall_tests::the_console_flow_refuses_descriptors_joined_per_lane, andemit::waterfall_tests::joined_descriptors_keep_the_per_lane_form_when_the_console_flow_is_asked_for.cargo test -p victory-shader --lib emit::split_tests -- --test-threads=1 --nocapture: 30 passed; 0 failed in 19.55 s.cargo test -p victory-gpu --lib: 51 passed; 0 failed; 1 ignored in 0.28 s.victory translate --validate --pipelines(host waves 32-32 lanes)Answering the open count question for
bf0f951:emit: a per-lane descriptor chosen by control flow in the console flow:0programs moved from emitted to refused on this32-32host.c153b21run across the same 26,148 IR programs (26,741containers walked,614duplicates skipped):c153b21emitted / pipelinesbf0f951emitted / validated / pipelines12243/1224312243/12167/122431420/14201420/1385/14208214/82148214/8152/8214Other emit/resource counts (e.g.
emit: a lane mask holding lanes elsewhere read as data: 3,emit: console wave64 lanes in a group of more than 64 threads on a host without 64-lane waves: 43,emit: a descriptor chosen by control flow: 41) are unchanged fromc153b21.Summary of the
173dxil.dll 1.9.2609.5validation rejections (all of which still builthostD3D12 pipelines here):53meshvertex plus primitive output size is greater than 3276849signature row interpolation-mode conflicts36containerProgram Input Signature/Program Output Signaturemismatches35compute stage-incompatible operation errors (matching your offline1,420 emitted / 1,385 validated)AI-assisted test run (Antigravity).
@Ctrl-Alt-Haze on GitHub · 2026-11-24 16:51 UTC · original
Independent verification on Windows 11, NVIDIA GeForce RTX 5070 Ti (Blackwell, Wave32, driver
32.0.16.2135) + WARP, Windows SDK10.0.26100.0dxil.dll(1.8.2502.11), Rust1.98.1, againstupstream/main(ffe310eb):ffe310ebon both#233(b623fd3) and#439(bf0f951).#439(bf0f951):cargo xtask policy:157 files okcargo clippy --workspace --all-targets --locked -- -D warningsand--all-features: passcargo test --workspace --locked: 382 passed, 0 failed, 6 ignoredvictory-shader --features host(RTX 5070 Ti &VICTORY_WARP=1): 159 passed, 0 failed, 1 ignored (allsplit_testsandlane_read_loop_testshardware readbacks pass)victory-gpu --features diagnostics(RTX 5070 Ti &VICTORY_D3D12_WARP=1): 54 passed, 0 failed, 1 ignored#233b623fd3also passes all gates cleanly:358workspace,135shader host/WARP,54GPU RTX/WARP.)unsafeblocks inhost.rshave// SAFETY:comments. Looks ready from a CI + Wave32 Blackwell hardware-test standpoint.AI-assisted verification on local RTX 5070 Ti + WARP; no game data.
@r4tedx on GitHub · 2026-11-24 17:05 UTC · original
@N7z, thank you for the run and for the harness report; it is fixed. @timorjay, your test is in.
Adapters with narrower waves (the Intel iGPU at 16-16). You were right that the translator refuses correctly and only the tests were wrong: they walk every hardware adapter and expect each to take the console's wave-size-dependent programs in one form or the other. The adapter list (
emit::host::adapters()) now keeps only adapters whose device runs 32- or 64-lane waves, by the wave range the device reports, as you suggested; the software renderer was already left out by name and falls under the same rule now. An adapter no SM 6.6 device can be made on stays listed for its user to skip, as before. Commitededb1bon #233, merged up. I have no 16-lane adapter, so what I could check is that both adapters here (RTX 5070 at 32-32, Radeon iGPU at 32-64) are still listed and pass; whether your UHD now drops out cleanly is something only your machine can show, and a rerun would be welcome.The nested-mask test (
0cf37ac, carried as1f53745with @timorjay's authorship, plus a one-line clippy fix of mine,72eb174): exact here on the RTX 5070 (console flow in two 32-lane waves) and on the Radeon iGPU, all eight cases, 128 lane results each.ededb1bb623fd341369c9cbcef5528aca3bbf0f951Fast-forward pushes. Tests and the test harness only; no translator code changed. Both CI clippy commands are clean at each head, and
cargo test --workspace --lockedat the #439 head passes on the RTX 5070 + Radeon iGPU: 383 passed, 0 failed, 6 ignored.The title was not used in these tests. AI-assisted (Claude Code).
@465d6a0eac on GitHub · 2026-11-24 17:02 UTC · original · edited 2026-11-24 17:20 UTC
Thank you for this, @r4tedx! Many pull requests here are still waiting to be merged, so I've ported this one to 465d6a0eac/AgentRecompVI, a VIctory fork where AI agents review and merge each other's work: https://github.com/465d6a0eac/AgentRecompVI/pull/34. It includes #320, which this pull request builds on. You're credited as the author there. This pull request stays the original.
Test results
cargo clippy(both variants) andcargo test --workspacepass (407 passed, 0 failed).victory translateover the 26,148 shader programs in my own copy of the game with--host-lanes 32-32, before → after #320/#439: compute programs emitted 1,221 → 1,422 of 2,582 (+201). "console wave64 lanes on a host without 64-lane waves" 162 → 0, "a wave64 group sharing LDS without barriers" 120 → 0, "a select on an untracked mask" 284 → 0, "a lane mask holding lanes elsewhere read as data" 266 → 3. New first blockers: "console wave64 lanes in a group of more than 64 threads" (43, the open item in your doc) and later steps such as descriptors read as data.@aycow on GitHub · 2026-11-24 17:24 UTC · original
@r4tedx Our independent divergent scatter control on
28aca3bmatched the CPU reference on AMD Wave64, AMD split Wave32 and NVIDIA split Wave32 with full GPU validation. It covers prefix plus per-lane scatter through a table UAV. Root-only producers and title inputs remain separate.@r4tedx on GitHub · 2026-11-24 17:32 UTC · original
@mohammadallami75-ops, I owe you the result on your scalar-state patch (the comment with the diff). I applied it to the current head, reviewed it, ran it on both GPUs and measured it over the title's shaders. Short version: the fixtures expose real faults and I want them, but the detection as written costs 75 working programs on NVIDIA, so I am not carrying it as it is.
Applying it. Onto
bf0f951withgit apply --3way: the three source files merged cleanly; only the end ofsplit_tests.rsconflicted, and both sides were kept. No logic changed.The fixtures are right, and two of them show faults on a 64-lane host that are not about scalars. At
bf0f951, with only your tests added (run here, RTX 5070 and Radeon iGPU):loop_exit_mask_counted_after_the_loopmask_grown_inside_a_branch_counted_after_ita lane mask holding lanes elsewhere read as data)The first is a silent wrong result today on AMD hosts. Your
|| reads_mask_dataclause fixes both by sending such a program to the console flow on every host. With the whole patch, all seven of your tests pass on both adapters; six of the seven fail without it. Both CI clippy commands are clean and the workspace suite passes.What it does to the title (local title data, offline, CPU only, counts only;
translate --validate,bf0f951against the patched tree, program by program):console wave64 lanes in a group of more than 64 threadsThe 75 ran per lane with no wave size before. The rule marks them as needing the console's lanes because of plain scalar joins, and in a group of more than 64 threads that stops them on a 32-lane host. Nothing went from refused to validated.
Why it fires so widely. It fires for 414 wave64 compute programs:
Three probes (an exit-mask loop, a uniform branch inside a divergent region, a uniform counted loop inside one) return identical values per lane and in the console flow on both adapters, yet the patched tree pins all three and refuses them at 128 threads on a 32-lane host.
The fallback.
Err(e) if what == lower::SCALAR_CONSOLE_FLOW => return Err(e)inemitremoves the per-lane fallback when the console flow cannot lower such a program, on every host. The stack's rule is that a program taking the console flow only for correctness keeps the per-lane form where the console flow declines, so nothing that translated before is refused. On this title that line costs nothing today (0 programs at 32-64), but it is a trap for the next one.What I would carry, and how
reads_mask_dataclause, as one change. That is a correctness fix for 64-lane hosts that costs no program.This PR is not taking new behaviour while it waits for review, so both would go on the branch after it (
shader/wave-per-groupon the fork), where a group of more than 64 threads without LDS runs as one host group per console wave instead of stopping. A fork PR against that branch with part 1 alone is the quickest way in; if you prefer, I will split it out of your diff myself and keep you as the author.AI-assisted (Claude Code).
@erLCoder on GitHub · 2026-11-24 17:34 UTC · original · edited 2026-11-24 17:38 UTC
GTX 1660 Ti hardware retest of the saveexec SCC fix on Windows 10 22H2 (19045.6466), NVIDIA 581.42, Rust 1.98.1 MSVC, Agility SDK 1.620.2. Local test-executable exports enabled Agility. An independent D3D12 probe identified NVIDIA LUID
00000000:00017c52, software flag 0, SM 6.8 and 32–32 lanes; the GPU test logs name the GTX 1660 Ti.At
1e17e572a03013e5d8f3dd7e6b0c28af3f373786,emit::split_testspassed 30/30 andemit::lane_read_loop_tests2/2, with zero failures or ignored tests. The newsaveexec_scc_tests_new_exec_not_saved_execand the loop leaving on saveexec SCC both produced exact 64-thread results on the GPU; the latter checks 64 wave iterations rather than the erroneous 65. Joined back-edge and wave32/wave64 lane-read results were exact. Split totals include CPU-only checks.At
bf0f9511c5720e08f97026c9a08a2ba5e33a99ba, split tests again passed 30/30 and lane-loop tests 2/2.waterfall_testspassed 7/7, but WARP-dependent paths internally skipped for lack of an SM 6.6 WARP device; the descriptor-join refusal test is translator coverage, not GPU output coverage. Builds were cleaned between different revisions after detecting and discarding a stale shared-target result. No #189 code was combined with this stack.Update: at
28aca3b718f7b61e3b71e7496bc4d9352b043e8f, the newnested_exec_masks_keep_shared_visibility_results_across_halvestest passed 1/1. All eight mask ranges returned 128 exact lane results each on the GTX 1660 Ti. This also confirms the updated adapter filter retained this 32-lane GPU; no 16-lane adapter was available to test exclusion. The previous full suites were not rerun on this head.Codex prepared the worktrees, ran the tests and drafted this report. Synthetic fixtures do not prove all control-flow cases or title correctness.
@sash2kk on GitHub · 2026-11-24 17:43 UTC · original
@r4tedx, thanks for checking. You are right, and my 17 + 9 were an artifact of comparing two title runs, not regressions.
I checked each hash against the control run's log (
mainffe310e+ #578):console wave64 lanes in a group of more than 64 threadsand the onea whole-wave section of a wave64. That is your expected group of 40.a descriptor read only as data, the 9a structured buffer of unknown stride, and the two singles. The title simply did not request them in that run, which got less far into the world before its removal. So nothing thatmaintranslated stops here.The hashes, in case you want to cross-check them against your listings:
a descriptor read only as data(17):1261271b20a35d1b,12efa84143ac3f9c,149cb3508b989d0e,1a83504bcee28c3b,254d39dc062ccbd2,2964f72e06633f7c,326652d23fe73e99,503cf21ee3992b39,511b165e8c6f13f1,89cc3adb9b3b587e,9cfd9c092e1d5a97,a7d9b706b3465142,aa221f469520e809,d5c18b9fbcd08f36,e685f0080b144a9c,f0d5c40a8c448a86,ff26243811447aeda structured buffer of unknown stride(9):1f55c45de66dc2c4,5e5b5c98afaa1753,5f970e9e47594541,8d5d3f97369050bd,ad17f5c4f7acac25,b2433b5b9845e711,cf4ce294accdd428,f0afa89ecfb6944e,fdfd1675ebbd57bcan address in an SGPR that is no root parameter:5e19e7c728d956dfan SCC the emitter did not compute:5c9d6316a51968c5Sorry for the noise. Next time I'll compare program by program instead of across runs.
AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 17:46 UTC · original
@sash2kk, no noise at all: the A/B was worth having, and the hashes let me close it from this side too. Looked up in both offline listings (local title data, CPU only;
mainffe310eand this PR for a 32-lane host):main's translator does with thema descriptor read only as dataa select on an untracked mask, 5 witha lane mask holding lanes elsewhere read as dataa structured buffer of unknown stride5c9d6316a51968c5(an SCC the emitter did not compute)a descriptor's address or format read as data, which is also what this PR reports for it since the SCC fix)5e19e7c728d956dfshaders.rpf; it must come from another containerSo none of the 27 I can see ever translated on
main, which agrees with your log check; my guess about why they were missing from the control run (#578 refusing them up front) was wrong, yours (the run did not get far enough to request them) is the measured one. For the 16 thatmainstops at a mask reason, this PR gets past the mask and reaches the next blocker, a descriptor or stride one; those belong to #704 and the descriptor work, not here.Your 21 that did translate on the control are the real cost on a 32-lane host and the known remainder: the 20 in groups of more than 64 threads and the one whole-wave section. The branch after this PR (
shader/wave-per-group) runs such a group as one host group per console wave when it shares no LDS, and now lowers whole-wave sections in groups of 32 threads or fewer.AI-assisted (Claude Code).
@mohammadallami75-ops on GitHub · 2026-11-24 18:07 UTC · original
@r4tedx I split the patch on
shader/wave-per-group. Part 1 is the mask-data fix and all seven fixtures in one commit. Part 2 enables the remaining fixtures and narrows scalar detection to join-relative divergence and loop scalars used outside the loop. It recognizes zero-grown exit masks, carries the flag across passes and keeps the per-lane fallback. Native Wave32 stays on the existing path because forcing console flow pins 32 lanes and there is no emulation for narrower hosts.Both CI Clippy commands passed on each head. Locked workspace results were 387 passed / 10 ignored for Part 1 and 395 passed / 6 ignored for Part 2, with zero failures. The 43 split tests passed on the RTX 2080 SUPER, and all four portable per-lane regressions had exact WARP readback.
Could you compare
05c7cbb,8a4d40bandfb45f7fshader by shader with offlinetranslate --validateat32-32and32-64? I’d like to know any new refusals and what happens to the original 75. I don’t have the title corpus, so their recovery is unverified.AI.
@Ahmet-Dedeler on GitHub · 2026-11-24 18:08 UTC · original
A data point from a third GPU vendor: this ran on an Apple GPU through D3DMetal (macOS, CrossOver 26.3, Rosetta 2), which reports
WaveLaneCountMin/Max = 32/32and turns aWaveSize(64)compute pipeline into a silent no-op.Tree:
BeachesOfViceCity/VIctory-Linuxf1e94ce plus my Mac host commits, with this PR atc153b21(the head before the current28aca3b). It was not applied alone: the fork's LDS-barrier plan decides first and this PR's console flow takes what is left needing 64 lanes, plus one local commit that joins the two mask-join loops. So read the numbers as "this PR beside the fork's plan", not this PR on its own. Two 295 s runs from boot into the opening of the world.InstanceCulling:CS_Prop_BatchCull/CS_Tree_BatchCull,depth_pyramid:*,tiled_lighting:CS_GenerateMaterialMasks/CS_MaterialTilesInitial/CS_ClusterLightsWorldSpace,shader_binning_utils:*. Before, about 89% of the mesh indirect draws had zero group counts because their culling pass was refused. After, the G-buffer holds props, a fence, signs and a low-detail character, and depth varies on up to 29% of the pixels in a captured frame (1 to 3% before).--host-lanes 32-32: compute programs usable on a 32-lane host go from 2,180 to 2,434 (+254, none lost), and all 254 pass Apple's Metal shader converter.console wave64 lanes in a group of more than 64 threads) and whole-wave sections.The presented frame did not change on this host, but that's a later stage (the tiled lighting draws), not this PR. Details in #1128.
Not tested: Windows, this PR on plain
mainwithout the Linux fork's commits, and the test suite.@SantannaCarlos on GitHub · 2026-11-24 18:10 UTC · original
@r4tedx in-game data on the cascade-shadow chain with your wave-per-group branch (
05c7cbb), RTX 4070, on the 4070 stack from #841 (main+ #493 + #876 + this PR with #223/#233/#320 + #116 + #984 + #949 + #1020 + #1198 + #1019), 10-minute world runs, a local writer trace:CS_ShadowRenderTiled*programs andCS_ComputeInfiniteRRIntensitytranslate and validate (offline, 32 lanes), and the run has no pipeline refused and no device removal.ExecuteIndirect: 343 of 343CS_ShadowRenderTiled*commands in the trace wereindirect kind 2, and all were dropped as "not prepared on the host" (the indirect limit the branch states). So the indirect path is not optional for this title.testers/indirect-wave-dispatchbranch (the record's X times the group's waves in the argument clamp, put back after), those passes are recorded (54 recorded; 8 dropped for dynamic slots, 4 "not prepared", 15 other) andCS_ShadowTileClassifytoo. The 20x12 reveal mask and the 2560x1440 lighting target still show nothing in the three captured frames.CS_ShadowUnifiedClearRaster,CS_CalcRasterClassificationListCounts,CS_WriteRasterClassificationResults), outside the branch's scope; #1433 targets that case, not tested here.One run per configuration. Context for the lighting chain is on #841.
@r4tedx on GitHub · 2026-11-24 18:13 UTC · original
@SantannaCarlos, thank you; that is the measurement the branch needed, and it reorders my list.
ExecuteIndirectsettles that the branch's "indirect dispatches of multi-wave shaders are dropped" is not a detail for this title. The rewrite for it is in review on the fork (r4tedx/VIctory#11): the record's X scaled by the group's waves into a list-owned buffer, the title's arguments and count left untouched. One caution about the version ontesters/indirect-wave-dispatch(831cdb3), in case your local patch copies its shader: its budget step is a compare-and-swap retry loop, and a pass with thousands of records aborted on an RTX 5070 here withnvlddmkmerrors; the form in review replaces it with one atomic add and a refund, and that ran the same workload once with correct values and no driver event. With one record per dispatch, as in your trace, the loop is unlikely to bite, but I would not keep it. I will post here when the pass is merged into the branch.s_barrier(10 in groups of 1024 threads, 6 of 256, 2 of 512, 2 of 128), so "one host group per console wave" cannot take them; their waves have to stay one host group. That is the next design step indocs/wave64-on-wave32.md. I have not looked at #1433 yet and will, since it aims at exactly that.CS_ComputeInfiniteRRIntensitytranslating is the section change at05c7cbb(whole-wave sections in a group of 32 threads or fewer); good to see it confirmed outside this machine.That the reveal mask and the lighting target still show nothing with the shadow passes recorded is worth keeping separate from this PR; #841 is the right place for it.
AI-assisted (Claude Code).
@JFIREonFIRE on GitHub · 2026-11-24 18:18 UTC · original
I compared the open wave64-on-32-lane approaches on one set of shaders: the 320 compute programs from a retail 1.0.2.1 world run that an RTX 3090 (driver 621.01, Windows 11, lanes 32..32) refuses on
mainffe310e. Every one of them declaresWaveSize(64). Each branch was built in its own target dir. I ranvictory translate --pipelines --listover the same 320 containers, so a pipeline here means the driver created it. Output was not checked, and none of this comes from a title run.mainffe310eE_INVALIDARG714b81854b333fededb1b28aca3b(on #320, #233, #223)wave64-emulation61b04f7* That branch only learns the host's lanes in
victory-gpuat device creation.translate --pipelinesnever callsemit::set_host_wave64, so the tool emitsWaveSize(64)and the driver refuses all 319 it emits. The 71 is with one local line added afterHost::newintranslate.rs:set_host_wave64(32, 32).#189 and #734's branch get nothing #439 doesn't, except 4 programs:
53c21e950d143cc7,d5f011b145497918ande18931c72af42e46. #439 refuses them as a whole-wave section. #189 and #734 both create pipelines for them.4b57ec4af6de25fe. #439 refuses it as a group of more than 64 threads. #189 creates a pipeline for it.Across all branches, 284 of the 320 get a pipeline. That leaves 36 that no open branch handles: 35 groups of several 64-lane waves (#439 says that is the next step, on a fork branch), plus one whole-wave section,
25328ea424d08c00.On this card, #439 is the stack that turns most of the NVIDIA refusals into working pipelines.
AI-assisted (Claude Code); the numbers are from the runs above.
@r4tedx on GitHub · 2026-11-24 18:20 UTC · original
@JFIREonFIRE, thank you; the same 320 containers through every branch, each built in its own target dir and counted by pipelines the driver really created, is the comparison this needed. Your 280 with 36 + 4 left matches what I count offline for this head (36 groups of more than 64 threads, 4 whole-wave sections).
On the five programs you name, looked up by hash in my offline listings (local title data, CPU only) for this PR and for the branch after it (
shader/wave-per-group,05c7cbb), 32-lane host:53c21e950d143cc7a whole-wave sectione18931c72af42e46a whole-wave section25328ea424d08c00a whole-wave sectiond5f011b145497918a whole-wave section4b57ec4af6de25fea group of more than 64 threadsThe first three are wave64 programs in groups of 32 threads or fewer: the lower half alone, so their sections need nothing exchanged; that went into the branch today, and it covers the one you list as handled by no open branch (
25328ea424d08c00).d5f011b145497918is a section in another group shape and stays open.4b57ec4af6de25feshares LDS across its console waves, as do all 20 programs the branch still stops for their group size; "one host group per console wave" takes the other 16 or so of your 36 (offline: 23 of the 43 in the pack leave that reason there, 20 of them validating).Pipelines created is the right first measure and, as you say, it is not output. For that the stack has the per-lane readback tests, and for the title the runs above.
AI-assisted (Claude Code).
@jeremygold02 on GitHub · 2026-11-24 18:36 UTC · original
On Windows 11 with a physical RTX 5070, this head created pipelines for 8/8 compute shaders that the renderer actually reported dropping near mission loading. On the same head, translating the same eight with
Target::ANYgave 0/8. The only change between these two columns was passing the detected device target totranslate_for.28aca3b7Target::ANYhost.target()The baseline reported 32..32 wave lanes through D3D12 OPTIONS1. All eight baseline shaders declared
WaveSize=64. Their root signatures were created successfully before compute PSO creation returned an invalid-parameter error. A two-case, no-resource SM 6.6 compute fixture with a 64-thread group reproduced the device boundary when changing only[WaveSize(32)]to[WaveSize(64)].The eight identities came from the renderer’s missing-pipeline reports surrounding a fence-confirmed texture readback. In the later reporting interval their rates were 30, 24, 17, 15, 15, 11, 11 and 6 dropped attempts per frame. Identical inputs on #192 at
4a365e3acreated 3/8, #189 at54b333fcin the device-recommended mode created 4/8, and #233 atededb1bain the device-targeted mode created 1/8. Those are independent PR heads.The same #439 test still refused translation of 24 other compute shaders named by those drop reports, in both target modes. The check ends at pipeline creation. Actual shader dispatch, output values and visible gameplay on this revision remain unverified.
Tested locally with SDK validator 10.0.26100.0 and adapter identity checked by D3D12 device LUID. AI-assisted investigation.
@aycow on GitHub · 2026-11-24 18:57 UTC · original
I independently ran exact 28aca3b's nested shared-atomic/mask and masked LDS fixtures on AMD 32–64 and NVIDIA 32–32 with DXIL validation. The 2,048 lane-word checks and six masked LDS cases passed. WARP passed only the 4-lane capability case; this upstream harness did not enable GBV.
A current RTX 5080 title capture reports 128 refusals of caa78b8ca62bc3d6 and 76 admitted calls of 3b90165a77d95cdf on older #189-derived rgarage. Its LDS-fence diagnostic is specific to that planner; we still need #439's outcome for the same two hashes. I've requested aggregate-only results on the same adapter and runtime stack, including effective wave mode, native thread-group shape and first resource-matched consumer. Your existing nested-mask fixture and multi-wave branch are useful controls; no new lowering is proposed here.
@r4tedx on GitHub · 2026-11-24 18:59 UTC · original
@aycow, thank you for the independent run of both fixtures on a 32-64 and a 32-32 host.
On the two hashes: I looked for
caa78b8ca62bc3d6and3b90165a77d95cdfin my offline listings and neither is there. Those listings cover the programs inshaders.rpfonly (local title data, CPU only, 25,889 programs by container hash), so both must come from another container, and I cannot give this PR's outcome for them from here.3b90165a77d95cdfwas named earlier in this thread by @timorjay as one of two native wave32 ray-tracing (BVH) programs that fail address translation; if that is right it is not a wave-size case and this PR would neither help nor hurt it.What would answer it on the tester's side, without a title run:
victory translate <the file that holds them> --host-lanes 32-32 --validate --liston this PR's head prints one line per program with its outcome and reason. The two lines for those hashes are all that is needed (hash, stage, outcome); nothing in them is game data beyond the shader's name, which can be left out.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-24 19:40 UTC · original
@SantannaCarlos, as promised: the indirect path is in the branch.
shader/wave-per-groupis nowc734600.CS_ShadowRenderTiled*should no longer be dropped as "not prepared on the host" for being indirect. The budget step is one atomic add with a refund, not the retry loop of the oldertesters/indirect-wave-dispatchversion.05c7cbb: a program that counts a lane mask after a loop its lanes leave at different iterations now takes the console flow (Marvisak/VIctory#1498: the per-lane form gave 1 where the console counts 32, on every host, silently). Offline that moves about 300 wave32 compute programs to the console flow on a 32-lane host and changes no program's outcome. It is a behaviour change worth an A/B if you have the time: counts feeding culling and compaction are the candidates.Checked here with synthetic programs only: both CI clippy commands clean; the suite passes on an RTX 5070 and a Radeon iGPU; a 6,000-record rewrite ran on the software renderer, the Radeon and once on the RTX 5070 without a driver event. I have no title run of it. If you rerun the cascade-shadow trace on
c734600, the recorded / dropped counts for the shadow passes and whether the reveal mask changes are what I would most like to know. The three classification programs with LDS and a group barrier are still outside it.The title was not used in these tests. AI-assisted (Claude Code).
@x3ero0 on GitHub · 2026-11-24 19:57 UTC · original
Before/after on a 32-lane NVIDIA card under Wine, offline and in the title.
Setup: RTX 5080, driver 620.70, CachyOS (kernel 7.3.5), GE-Proton11-6's Wine,
d3d12.dll/d3d12core.dllbuilt from vkd3d-proton30b0eb9beside the executable, diagnostics builds cross-built withcargo xwin, Series X 1.0.2.1, network off.mainffe310e+ #177 + #259 (this card needs those two and the newer vkd3d-proton to get through pipeline creation at all).28aca3bwith the same two on top (they apply cleanly).The device reports
host waves 32-32 lanes.Offline:
translate <pack> --pipelines, every pipeline created on the host--host-lanes 32-32)Invalid parameter.)So 299 more compute pipelines exist on this card, nothing that was made before is lost, and the 21 programs no longer emitted are ones that were refused by the host before anyway.
One oddity, not reproduced: the first
translate --pipelinesrun of the after build without--host-lanesended one second in with glibc'sdouble free or corruption (!prev), right after the second device was created (the first is the wave probe). Two repeats of the same command ran normally. I can't say whether that is this PR, Wine or the driver.In the title: one 210 s run each, same scripted input
+0x23cf683(#1118)Both runs reach their first 3D frame at frame 1550, so
VICTORY_DUMP_TARGETS=1at that frame gives a like-for-like look inside it:The clearest single difference: after, one 2560x1440
R8G8B8A8target holds the scene's geometry, drawn in what looks like a per-primitive id colouring (large surfaces in the foreground, thin structures behind). Before, no target of that frame holds geometry; the nearest one is uniform noise. Several half- and full-resolution targets that were empty before also have content after.Per the asset policy I am not attaching the captures; the numbers above are from them.
Limits: one run per build, one GPU, Wine only, and about a minute of world time before the
+0x23cf683stop in both builds. I did not run the PR's GPU tests on this machine.@catminou4 on GitHub · 2026-11-24 06:51 UTC · original · reviewed
Verified locally on macOS 26 arm64, rustc 1.98.1, head
901eef9:cargo test -p victory-shader --locked: 58 passed, 0 failed (+2 vs main's 56).Semantic conflict with #235 (non-Windows build): this PR adds
Host::target()(victory-gpu) and calls it from translate.rs:182, but #235's#[cfg(not(windows))] mod offhoststubHosthas notargetmethod. Merging both breaks the macOS/Linux build of the app crate:(Reproduced locally: #439 head + #235 head
16704a5merged, no textual conflicts.)Whichever PR lands second needs the stub updated, e.g. in
offhost:(
Host::newalready returnsErrthere, so the method is unreachable at runtime —Target::ANYis the neutral value.)The core wave64/LDS change itself is Windows-only runtime behavior I can't exercise here; the shader-crate side is green.
@Sil3ntGam3r on GitHub · 2026-11-24 21:07 UTC · original
@r4tedx a follow-up on the mesh side of the stack, and one correction.
Same stack as my last two comments (#180
aa69258+bf0f951+ #431 + #876 + #334), now with #298 (54f97db) and #660 (19b02ec) on top. RTX 3070, driver 621.14, Series X, diag build, cold cache. Translation caught up in the world this time. The head is now28aca3b, but sincebf0f951it only adds tests and the adapter filter, so the translator results below should be the same on it.Scenery still reaches the G-buffer, and ground, roads and buildings are still missing. I checked the dumped full-screen targets.
16 mesh programs are still refused. 9 of them stop at "a lane mask read as data":
093c64546c55554e0x1b740bd4d80ad23b106b0x1288235e56869c1ea8830x1ccc41b1fbed3ee9b8ff0x1f0c4ee6e34d8e008c630x1ea463083c777948927a0x1cb4c0b56ee903fc6dfb0x1cccef5409053e14aa820x1a54fc2e14d6971785dd0x1edcThe other 7 are "a descriptor read from the first lane of computed VGPRs" (4) and "a scalar memory read as data" (3).
Offline over the whole
shaders.rpf(victory translate --validate --host-lanes 32-32, same build), 160 mesh programs stop at "a lane mask read as data", the same number as before #298 and #660. So the 9 above are the ones this scene reached.This refusal comes from
main's lowering, not from this PR. On a #189 tree without #180, 5 of the 9 stop at the same offsets. The other 4 (235e…,41b1…,4ee6…,c0b5…) stop earlier there, at "a scalar memory read as data", and get past that on this stack, probably because of #180.#298 and #660 don't change them. The 8 that the run before the merge reached stop at the same offsets in both runs (
0bd4…was only reached this time). #298 targets a different refusal, "a lane mask holding lanes elsewhere read as data".One more thing from the same offline run: with #298, 27
CS_RaytracingResolvevariants get pastmain's "a lane mask read as data". They now stop at this PR's "a program the console structure cannot hold" (at0x0, from36e05dc). In the title run, 11 compute programs now stop there.Is the mask-data fix in mohammadallami75-ops's Part 1 (r4tedx/VIctory#13), or the lane-mask count change now on
shader/wave-per-groupc734600, meant for this refusal? If either is, which commit should I test? Whether these mesh programs draw the ground and buildings is only my guess; that run would tell.Correction to my scenery comment: 102 was a count taken partway through the run. The full log of that run has 154 unique programs not translated (13 mesh). No other number in that comment changes.
(AI-assisted test run.)
@mohammadallami75-ops on GitHub · 2026-11-25 00:12 UTC · original
@Sil3ntGam3r Thanks for the hashes and the offline comparison. For a compute-only A/B, use
05c7cbbas the baseline and88b38e8as the test. That revision includes the broader joined-mask rule (eaf0d36) and the Wave32 regression.c734600already contains both if you also need the indirect-dispatch changes. The branch rule supersedes my Part 1 for this test and also catches masks built from a scalar zero.The rule is in compute lowering, so I wouldn’t expect it to clear the nine mesh refusals. For the
CS_RaytracingResolvevariants that already reacha program the console structure cannot hold, the rule can select console flow, but the same control-flow limits still apply. If you run the A/B, please compare the first refusal for the same hashes at32-32. That will show whether any of those variants make it further before another title run.AI-assisted.
@Marvisak on GitHub · 2026-11-25 00:18 UTC · original · edited 2026-11-26 08:25 UTC
Automated triage for the maintainers.
Needs work. I reviewed the two commits new since
2658128.e2d3cfdreads right.console::leaves_title_memory_outin the newemit/lower/console.rskeeps a wave64 program out of the console flow in halves when it reaches title memory by address (root_memory) and also shares LDS, has whole-wave sections or permutes lanes. The refusal goes in at the same place as the other split refusals inLower.lds_in_halves_keeps_out_of_programs_reaching_title_memorychecks both sides.7587052breaks the asset policy (docs/asset-policy.md: no "decompiled or disassembled code" from the game, in any form, fixtures included). Inemit/split_tests.rs,SECTION_SUMandSECTION_PREFIXare described as the console compiler's sequences "as the tile classifierbad01f53f53248e5has it". The testswhole_wave_sums_of_one_laneandwhole_wave_prefixes_of_one_lanealso follow "the classifier's" append and offsets. That makes these encodings words copied from one of the title's programs, not synthetic data we wrote. Please drop7587052from the branch by rewriting it (force-push), not with a follow-up commit. Then, if you want, add tests whose sequences are written from the ISA alone and that do not refer to a title program. A DPP/v_permlanex16/v_readlanereduction built from the RDNA2 ISA guide is fine.Still blocking from the last triage:
What would change the verdict:
7587052removed from the branch history, then the stack question and the builder gate settled.CI: passing.
Generated by Claude Code
@r4tedx on GitHub · 2026-11-25 07:08 UTC · original
Updated for the needs-rebase triage:
main(940d32f) is merged in through #320 and #233, head5a11cf4(merge commits, no rebase). It carries #233's implicit-sample guard; its recursion guard was here already.Two auto-merged regions were semantically wrong and are rewritten:
ds_bpermute_b32: both lowerings survived the merge. One arm is kept, inmain's style (16-bit offset,lane_bit_of), gathering within the reader's 32-lane half as this stack does for wave64: GFX10's backward permute in wave64 does not cross the halves (AMD's RDNA 2 ISA reference). For wave32 it equalsmain's.v_cndmask_b32: uniform selectors lower as onmain; numeric ones test the console lane's bit where console lanes exist outside the in-half form, and are otherwise deferred in compute.Checks: both CI clippy commands clean. The
victory-shadersuite passed on an AMD Radeon iGPU only (287 passed, 3 ignored,float_whole_wave_reductions_join_both_host_wavesskipped while the machine's GPUs are on a hold) before the last merge, whose only change here is covered by a CPU-only test (passed). Not run on a 32-lane card today (see #233). A differential of every test program's module before and after the merge: 122 of 136 identical apart frommain's heap clamp, the other 14 the bpermute programs, re-expressed equivalently.Offline counts of this head against
main(local title data, CPU only) are running; I will add them here.AI-assisted (Claude Code).
@r4tedx on GitHub · 2026-11-25 07:13 UTC · original
The offline counts for
5a11cf4, as promised (local title data, CPU only, counts only;victory translate shaders.rpf --host-lanes 32-32 --validate --list, compared program by program withmain940d32f's own listing, 25,889 programs):5a11cf4, 32-lane hostmain: 21 compute programs (16 thatmainstops ata register joining a lane mask and data, read as data, 5 ata lane-mask join of an untracked mask).main, refused here: 47 compute programs: 43console wave64 lanes in a group of more than 64 threadsand 4a whole-wave section of a wave64, eachon a host without 64-lane waves.mainemits all 47 withWaveSize(64), which a 32-lane driver refuses at pipeline creation, so on such a card none of them ran before either. They are the known remainder of this stack.main: no vertex, pixel or mesh outcome changes. (867 vertex shaders fail validation with "Flags must match usage" onmainand equally here; that ismain's own, #1973 / #1987.)Upstream CI passed on all four heads (
02b955f,7147671,eb12838,5a11cf4), and each now merges cleanly intomain.AI-assisted (Claude Code).
@desplmfao on GitHub · 2026-11-25 10:20 UTC · original
@r4tedx thanks for this. On an RTX 5080 under Linux/Proton (vkd3d-proton 3.2.0) it's what stops the title's wave64 compute from hanging the GPU in the intro.
One thing came up under vkd3d-proton. Some console-flow programs (
InstanceCulling:CS_Prop_BatchNoCull,deferred_tiled:CS_LaserLightShadowRaytracing, and the big*:CS_RaytracingResolveones) end up with a block that branches back to two loop headers, or with a header that has three back edges. dxil-spirv's structurizer recurses on that until the stack runs out, so the process dies or the pipeline workers stall while those pipelines are created.mainhas the same shapes, but without lane reads, and dxil-spirv only walks the graph when there are lane reads.#2309 fixes it in the bitcode writer, stacked on this PR: one back edge per loop header (powplusplus's commit from #1885) and one per block. It doesn't touch
lower.rsorwave.rs, and only the 8 programs with those shapes change. The shader suite gives 178 passed, 0 failed under Proton. If you'd rather take it into #439 directly, that's fine with me.@r4tedx on GitHub · 2026-11-25 10:39 UTC · original
@desplmfao thanks. I reviewed #2309 at
91e3bdf. These are the checks I ran:364c1bchas the same patch ID as powplusplus'sd48ec76from #1885. The only difference is the cherry-pick trailer.victory-shadersuite on WARP, on5a11cf48plus the two commits: 290 passed, 2 failed, 3 ignored. All three latch tests passed. The two failures (gathers_at_a_level_match_the_hardware,permutes_read_the_lane_named_and_zero_from_lanes_left_out) also fail without your commits. This test used no title data and no hardware GPU. I did not reproduce the Proton run or the eight-program census; those are your results.branch_termincrements only the taken header's loop counter, so the other header's counter PHI can be missing an input. The writer copies that incomplete list into the latch PHI. #1540 proposes per-edge counter guards for it.I'll take both commits into #439 after the update that is in progress there, with authorship preserved, and post the new head here.
AI-assisted
@desplmfao on GitHub · 2026-11-25 10:54 UTC · original
@r4tedx thanks for the careful review, and yes, please take both into #439. Once the new head is up I'll check it here (Proton, RTX 5080, the same eight programs) and close #2309 as included. Noted on the pre-existing both-back-edges counter PHI; I'll leave that to #1540.
@r4tedx on GitHub · 2026-11-25 10:55 UTC · original
Pushed
3fab5a19: #320'sd5f8f2cemerged up (no conflicts;wholekeeps both #320's named-lane rule and this PR'sds_bpermute_b32exception), anddocs/architecture.mdnow namesds_permute_b32, which is not translated yet, as what still stops splitting. The description now cites RDNA 2 ISA §10.4.4 (pp. 96–97) fords_bpermute_b32working per 32-lane half, and notes that §12.13's pseudocode saysmod 64.Verified locally at
64a5be92(the commit after it changes one doc sentence): clippy-D warningsclean (default and--all-features);victory-shader --libon WARP, one test thread: 288 passed, 2 failed, 3 ignored, the 2 being the known hardware-only checks. No hardware adapter and no title data used.The #2309 commits come next, as said above.
AI-assisted
@r4tedx on GitHub · 2026-11-25 11:29 UTC · original
Following triage's scope point: #2309's bitcode-writer commits stay out of this PR. I am not pushing the local merge of them, and #439 stays at
3fab5a1.@desplmfao, that reverses what I said under #2309, sorry. Please keep #2309 open as its own PR. #439 passes CI at
3fab5a1without them.AI-assisted
@desplmfao on GitHub · 2026-11-25 11:37 UTC · original
@r4tedx no problem, that makes sense. #2309 stays its own PR, now merged up to your
3fab5a1with no conflicts. Its change is still only the twobitcode.rscommits.@hah346 on GitHub · 2026-11-25 12:38 UTC · original
Independent Windows / NVIDIA Turing validation of VIctory PR #439 at
3fab5a19f586c690fedf4578c1fb7b4c2de298dd.cargo +1.98.1 test -j 4 -p victory-shader --lib --locked split_tests -- --nocapture --test-threads=1returned 33 passed, 0 failed, 0 ignored (26.60 s). Hardware readback explicitly reported the RTX 2060 withsplit truefor LDS ordering (including the busy-half and masked-block cases), cross-half lane reads, integer and float reductions and prefixes, and 3D thread groups.one_wave_shares_lds_in_instruction_order: I copied only that synthetic fixture and its two test helpers into a separate checkout of #320 atd5f8f2ce7615897baf6340991b4202f5a550eca0, leaving the translator unchanged. On that base the translator refused wave64 shared LDS without barriers on a host without 64-lane waves. On the unmodified #439 head the same fixture dispatched two 64-thread groups and matched all 128 lane outputs.Synthetic fixtures only. AI-assisted with Codex.
@r4tedx on GitHub · 2026-11-25 12:41 UTC · original
@hah346 thank you. It's the first run of the current head on Turing, and the A/B is the useful part.
I checked what I could from here.
3fab5a19is the PR head, andd5f8f2ceis #320's head, which #439 sits on.emit/split_tests.rsat3fab5a19holds 33 tests, so 33 passed is all of them.one_wave_shares_lds_in_instruction_orderexists only on #439, so copying it onto #320 isolates this PR's LDS change. The refusal you saw on #320 is the expected one: without this PR, a wave64 program that shares LDS has no form on a 32-lane host.Your run covers what triage asked for at this level: the LDS ordering of the console flow on 32-lane NVIDIA hardware, with
split truereported. Earlier 32-lane runs were upipibi's RTX 3070 at #233's head, and now yours on an RTX 2060 at #439's.Checked here by reading the two heads only; no title data was used.
AI-assisted
@hah346 on GitHub · 2026-11-25 12:52 UTC · original
Thanks, @r4tedx. I can run another Windows hardware test on the RTX 2060. Is there an open PR or synthetic regression test where another Turing result would help most? If you have a commit or test command in mind, I can run it and post the results.
@r4tedx on GitHub · 2026-11-25 12:53 UTC · original
@hah346 thanks for offering. The one that would help most is #2366 (rectangle lists get their fourth corner across the diagonal from the right-angle corner). Its tests have only run on WARP and macOS so far, never on a hardware D3D12 adapter.
At head
1853bce5:Leave
VICTORY_WARPunset. Each of the three tests (rectangles_get_their_fourth_corner,rectangles_with_the_corner_first_complete_across_their_diagonal,rectangles_with_the_corner_third_complete_across_their_diagonal) draws one square through the generated geometry shader on the default adapter first and then on WARP, and checks every pixel of the 32x32 target. If the RTX 2060 draws it differently, the failure beginswarp false pixel (x, y). If everything passes, 3 passed is the full set. The PR description has the WARP comparison withmain(the two new tests fail there).I checked the test code and the adapter choice (
Host::newinemit/host.rs) at that head here; I ran nothing on hardware. No title data used.AI-assisted
@crissuper20 on GitHub · 2026-11-25 15:16 UTC · original
In-game A/B on a GTX 1650 (Turing, 4 GB, 32-lane waves, driver 32.0.16.2124), diag build,
--console series-s, same save and input, 18 min each, as asked on #233. Base:940d32f+ #2016 #1775 #454 #1731 #1997.691ff20)3fab5a19)The 11 left: 6 × "console wave64 lanes in a group of more than 64 threads", 3 × "an implicit-derivative sample in the console flow", 2 others.
The removal hits mid-list on a small compute dispatch (7×1×1). With #233 alone, the same program is bound and runs, and nothing is removed in 18 min. So one of the programs this PR now translates looks like the likely cause on Turing. One run each.
AI-assisted (Claude Code); measured on my own machine.
@r4tedx on GitHub · 2026-11-25 15:18 UTC · original
@crissuper20 thank you. This is the first device removal reported on
3fab5a19, and the A/B against #233 narrows it to the programs this PR newly translates.To find which program it is, could you send the log of the removal run? These are the lines that would help most:
host GPU device removed after a submission of N lists ...line, in full. In a diag build it names the pipeline that each noted command runs. If you can run it once more withVICTORY_D3D12_DRED=1, the same line also gives the faulting address, the allocations it hit and the breadcrumbs, with the command that was running when the GPU stopped.With the program's name I can translate it here from both heads offline and compare what changes on a 32-lane host. Until then, #439 shouldn't be used on Turing for play. #233 alone ran 18 minutes on your card without a removal.
AI-assisted (Claude Code). No game run on my side for this reply; I checked the log lines against the code at
3fab5a19.@crissuper20 on GitHub · 2026-11-25 15:38 UTC · original
@r4tedx from the removal run's log (
VICTORY_D3D12_DRED=1was already on). No program hashes, per #1633's rule.0x887A0006(device hung). No page fault is reported.a list stopped at command 1026 of 1920 (op 6), commands 1003..1043 between its barriers, a submission of 1 list. Every earlier list in the breadcrumbs is complete.E_INVALIDARG) at 1m20s before the removal. The other was refused after the removal, at device-suspended time.AI-assisted (Claude Code); from my own run's log.
@r4tedx on GitHub · 2026-11-25 15:39 UTC · original
@crissuper20 thank you, that narrows it a lot. A hang (
0x887A0006) with no page fault, stopped inside a run of small dispatches of a program that #233 alone already ran, points to something feeding that program, not to the program itself. For example, a newly translated program earlier in the frame could leave a count or an index that makes a loop run far longer than it should.Two runs would tell those apart. Both use switches that exist at
3fab5a19in a diag build, and you can keep the hashes on your machine.VICTORY_SHADER_LOOP_LIMIT=4096, everything else the same. Translated loops then stop after 4096 iterations instead of 2^20 (it's part of the translation, so the shader cache retranslates). If the removal goes away, a loop running far too long is the likely cause, and the picture may be wrong but the device survives.VICTORY_SKIP_PIPELINES=<hash>,<hash>,...(16-digit hashes, comma separated), to bisect. Pipelines using any listed shader are skipped. Take the programs this head translates that #233 refused, which is the difference between your two runs' "doesn't translate" lists. Skip half of them and see whether the hang stays, then halve again. Posting only the refusal reason and the stage of the one that matters is enough here.One thing to check, if it's easy: equal DXIL sizes on both heads don't quite prove the two programs are identical. If the shader cache keeps both heads' entries, comparing their bytes (for example by sha256) would settle it.
Until this is found, #439 stays not for play on Turing, as above.
AI-assisted (Claude Code). I ran nothing on my side for this reply; I checked the two switches in the code at
3fab5a19.@Capi360 on GitHub · 2026-11-25 16:01 UTC · original
Offline test on RTX 3060 Ti (8 GiB, NVIDIA 616.56), Ryzen 7 5700X3D, 32 GiB RAM, Windows 11 Pro build 26200. I tested this stack with the NVIDIA raw structured-buffer and packed-target changes.
In a prior Series X run the debug layer rejected 119 distinct compute programs because they requested 64 lanes on a 32-lane device. This build created 81 of those exact programs and logged zero such driver rejections. Of the other 38, the translator explicitly refused 12 during the run. The run still ended in device removal near the start of world rendering, so the other 26 were unobserved.
All 33 split-wave tests and the four shader-cache tests passed. AI-assisted integration and test. Code-only integration: https://github.com/Capi360/VIctory/tree/codex/rtx-3060-ti-wave64-split
@Machad3x on GitHub · 2026-11-25 21:33 UTC · original
A related report with two small fixes to this console flow (whole-wave sections in partial groups; 16-bit sums in split halves) is here: #2214 (see the latest comment). Written with Claude Code.
@kawaii-shakal on GitHub · 2026-11-26 01:09 UTC · original
Tester report for this stack (#223 → #233 → #320 → #439), whole-title corpus on a 32-lane host. RTX 5070 Ti, NVIDIA 617.42, Windows 11.
Method:
translate --cache --pipelinesovershaders.rpf(26,503 containers) plus the executable,XboxBvhBuilder.dlland the FidelityFX DLL. Each column is a fresh cache. Counts only, no game data.WaveSize(64))With #2633, the refusal mostly moves from the driver into the translator. This stack is the one that makes about 300 of these programs run. All 52 of the BVH builder's programs translate here, so I also merged #2311 (with #2118): the builder now runs whole on NVIDIA, and the walks wait for it.
Still refused (
translate --host-lanes 32-32, compute):Merging onto current
main: these conflicts weren't mechanical, in case they help the rebase.lower.rs, lane-mask phi joins.main'suniform_join/numberpath (masks popped from memory by the BVH walks) has to sit besideconsole_cf'sst.othermasks.no_mask_lane_on_edgemust stay out of the console flow.lane_bitnow returnsResult, so that arm needs?.host.rs.main's process-wide WARP device (SharedDevice/WARP_LOCK) and this stack'sVICTORY_ADAPTER/Host::onboth change device creation. I kept the shared WARP device and gavecreate_devicean optional adapter.ds_bpermute_b32:main's testds_bpermute_wave64_preserves_32_lane_halfexpects nowaveGetLaneIndexfor wave32, so the half base stayswave64-only.main'sa_scalar_result_needs_no_execcallslower()directly and now getsCONSOLE_FLOW. Its helper has to retry the wayemit_withdoes.With those resolutions,
victory-shader's lib tests pass. The ones that fail also fail onmainon this machine: the heap-cap tests and one access violation inheap_direct_texture_reads_mark_their_heap_index.I haven't done a title run on this head yet.
@r4tedx on GitHub · 2026-11-26 01:10 UTC · original
@kawaii-shakal thank you. The middle column is the useful part: with #2633 alone the refusal moves from the driver into the translator, and with this stack about 300 of those programs run. That's the first whole-corpus measurement of the stack on current-era main.
The merge notes come at the right time, since the stack is due a merge of current
main(merged upward from #223, never rebased). I'll take them as a checklist and credit them in the merge commits:main'suniform_join/numberpath beside the console flow's masks, withno_mask_lane_on_edgekept out of the console flow and a?on the now-falliblelane_bit;main's shared WARP device and givecreate_devicean optional adapter;ds_bpermute_b32half base for wave64 only;a_scalar_result_needs_no_exec's helper the retryemit_withuses.The still-refused list matches what we expect at this level: the 44 multi-wave groups are #2214's ground, and the 13 implicit-derivative samples are stopped on purpose by the guard. I'll post the merged heads with test results.
This reply is based on reading your report and the stack's code only; no title data used.
AI-assisted
@r4tedx on GitHub · 2026-11-26 01:30 UTC · original
@neonbyte1, thank you for the bisect on #2118 (#2118). It shows a real interaction with this PR.
In your stack (main
219878a+ #2723, #1129, #1548 + #233, #320 and this PR), this PR makes BVH builder program28918b7150a7aad5translate. Its sibling14394a322f6dd5c2stays refused ("console wave64 lanes in a group of more than 64 threads"). The builder then runs only some of its stages, and the title crashes while loading (a write to 0, in 2 of 2 runs). Skipping28918b71, or adding #2118, avoids it, and gameplay ran for 10 minutes.So when this PR changes which builder programs translate, it needs a builder gate that runs the builder all-or-none, such as #2118. I've added a note saying so at the top of the description. We'd rather keep that all-or-none rule in one place (#2118) than duplicate it here. If you'd prefer this PR to be safe on its own, say so and we'll look at holding back a newly translated builder stage while a sibling stays refused.
The finding and the runs are neonbyte1's, made with their local title data; we haven't run the title for this comment.
AI-assisted
@neonbyte1 on GitHub · 2026-11-26 01:30 UTC · original
Results on an RTX 5090 (driver 620.73.04, 32-lane waves) under Linux: Wine 11.22, vkd3d-proton 3.1-83 (GE-Proton11-14), DXVK
dxgi, diagnostics build. I merged #439 with #320 ontomain219878a, which also carried #2723, #1129, #1548, #233 and a Wine-compilable argument clamp (#1279's approach). The only conflict was the test helperlowersinlower.rs, which now takes the console flow asemitdoes.Translation (whole shader pack, from the port's census): compute emitted goes from 2,410 to 2,644 of 2,734, with no program lost on any stage. The instrumented translation found 0 group barriers placed inside per-lane branches across about 35,800 barriers, which is the pattern that hung NVIDIA here before (Xid 109).
In game, same base without and with #439, both warm, frame summaries at the end of the run:
CS_MaterialTilesInitial,CS_MaterialTiles) now translate and run, so tiled deferred lighting gets instances. Before, all 180 of its indirect draws had an instance count of 0.28918b7150a7aad5now translates while a sibling stage stays refused. The half-run build crashed the title during loading in 2 of 2 runs; #2118 fixes that (details there).AI-assisted (Claude); measured on my machine, no game data shared.
@steven-seagull27 on GitHub · 2026-11-26 01:56 UTC · original
@r4tedx I checked Machad3x's partial-group reduction report on #2214 directly on this stack at
3fab5a1. I put their proposed upper-half check and a new regression in a one-commit candidate. The test covers integer sum/min/max ofgroupThreadID + 7at 1, 6, 31, 32, 33, 36, 48, 63 and 64 threads, two groups per dispatch. Choosing 7 as the smallest input exposes the zero from an absent half.All 140 differences in the middle row were minima of zero instead of seven, at 1, 6, 31 and 32 threads. Built-in WARP (Wave4) cannot run either required fixed wave width.
Portable Microsoft.Warp 1.0.22 still has a separate partial-group failure. With the candidate it had 652/1,884 wrong at fixed Wave32 and fixed Wave64, for sums/maxima at 31, 33, 36 and 63 threads. The unmodified PR head also got the same 652 wrong with the Native Wave64 target. A direct DXC
cs_6_6shader reproduced the 31-thread case outside the translator, at both fixed wave sizes. Thread 30 reported all of these in the same dispatch:So the missing-upper-half guard fixes a real RTX error and the portable WARP case remains open. A native AMD readback on the 31- and 33-thread groups would help decide how broadly to enable this. No title run on my side.
@r4tedx on GitHub · 2026-11-26 01:58 UTC · original
@steven-seagull27 Thank you for checking this and for the candidate (9cc76b8). I have not tested it yet. #439 conflicts with main
63bcca4at the moment. I'll review your commit when I bring the stack onto main and report the result here. On this PC, synthetic tests run on WARP only, and built-in WARP can't run the fixed wave widths, as you noted. So I can't reproduce the RTX 5080 counts myself. That leaves a static review plus the existing suites. A native AMD readback on the 31- and 33-thread groups would still be welcome from anyone who has the hardware.AI-assisted
@latentdev on GitHub · 2026-11-26 03:35 UTC · original
This PR on an RTX 4090 in the opening cutscene, and a heads-up on
lower.rs's sizeSize, for the rebase onto current
main.cargo xtask policyallows 512 KiB per file (MAX_FILE_SIZEinxtask/src/policy.rs).crates/victory-shader/src/emit/lower.rsis already 520,563 bytes onmain63bcca4. This PR adds 38,546 bytes to it (451,690 at940d32f, 490,236 at3fab5a1). A trial merge onto63bcca4leaves it at about 559 KB, so part of it will need to move to another file. The trial merge conflicts inapps/victory/src/main.rs,emit/host.rsandemit/lower.rs.Setup. RTX 4090, driver 621.24, Windows 11, title 1.0.2.1, diag build, opening cutscene. Tree:
main63bcca4+ #1630 + #1832 + #2332 + #2178 + #2121, this PR at3fab5a1, #2118 (af8b9ad) and #2703 (7bb3eba).Translation.
bad01f53f53248e5translates with this PR for a 32-lane target, passes the validator, and the 4090 makes its pipeline. It's the tiled lighting's tile classifier. Without it, the three tiled lighting passes run no groups on NVIDIA (details in #1835). In a run, 51 programs the title uses still don't translate, 33 of themconsole wave64 lanes in a group of more than 64 threads(#2214's case).In game, two runs with #2118 and #2703:
2dc364df5d3278b8,63381c3250b287faanddce085c07b9414b6get work once the classifier's pipeline is made. In the first run they got 0 groups for the first 29 world frames, while pipelines were still being made. After that they got work in almost every frame, with2dc364df5d3278b8at the 65,535 clamp (#2256). Without this stack they get 0 groups in every frame.pipelines=53 made=48 refused=5, so no frame ran part of it. With this PR but without #2118 (only the two builder stagescaa78b8ca62bc3d6and28918b7150a7aad5skipped), the title exited without a log line while the world was loading, 88 s in, as your note at the top says.I don't have a clean picture from this PR yet. In the first run, frame 80 of the cutscene was still dark; the lighting had started 51 frames earlier. The second run ended before frame 80. A local change of mine does the same for this program (a barrier after each LDS access, sections combined across the halves). With it, the cutscene is lit by frame 80.
@r4tedx on GitHub · 2026-11-26 03:37 UTC · original
@latentdev thanks, and the size figures match ours. Our trial merge of
main63bcca4upward through the stack giveslower.rsat 521,541 bytes at #223 (under the limit), 541,045 at #233, 547,008 at #320 and 559,844 at #439, so the policy check would refuse the merge from #233 up. The plan is to move the stack's console-flow lowering (console_read_lane, the half exchange and the console-flow refusals) intoemit/lower/console.rs, next to main'semit/lower/bvh.rs. That goes on #233 as its own commit and is then merged up through #320 and #439. The conflicts we hit match yours:apps/victory/src/main.rs,emit/host.rsandemit/lower.rs. The rebase starts after our current game-run window, and this PR will show the new head.Your frame-80 result is useful. Is the local change (a barrier after each LDS access, sections combined across the halves) on a branch you could share, or could you post it as a patch? We would test it on top of the rebased head.
No title data was used for this reply; the sizes come from our trial merges in git. AI-assisted
@r4tedx on GitHub · 2026-11-26 05:07 UTC · original
Merged current
main(63bcca4) into the whole stack. Merges only, no rebase or force-push:maininto #223, then each PR's new head into the one above it. New heads: #22391aa056, #2331c74ab4, #320db85706, this PRe9f18c9. Each merges cleanly withmain.main's growth,emit/lower.rswould pass the 512 KiB limit from #233 up. So #233 first moves lower.rs's inline tests, unchanged, intoemit/lower/tests.rs, besidemain'semit/lower/bvh.rs. Here lower.rs is 506,583 bytes; at #233 it's 488,121.main'suniform_join/number path sits beside the console flow's masks;no_mask_lane_on_edgestays out of the console flow;lane_bittakes?;main's shared WARP device is kept, andcreate_devicetakes an optional adapter;ds_bpermute_b32's half base is wave64-only;lowerstest helper retries in the console flow, asemit_withdoes.cargo xtask policy: ok;-D warnings: clean;VICTORY_WARP=1 cargo test -p victory-shader --lib -- --test-threads=1: 341 passed, 4 failed here; at the PRs below, 301, 316 and 322 passed, each with the same 4 failures. Every level gainsmain's 53 tests and loses none of the stack's. The 4 failures aremain's own: on63bcca4the same command gives 298 passed and the same 4 failed (synthetic_testswhose hardware pass runs on WARP underVICTORY_WARP=1).Still open on this head, as triage noted: crissuper20's GTX 1650 hang, and steven-seagull27's partial-group reduction fix. That fix is next, reviewed against this head.
Synthetic tests only for this update; no title data used.
AI-assisted
@r4tedx on GitHub · 2026-11-26 05:14 UTC · original
Correction to my last comment: CI's clippy failed on the previous head. Main's view-mark draw test (
crates/victory-gpu/src/draw.rs) buildsemit::Options { view_marks: true }by hand, and this stack adds atargetfield toOptions. My local clippy run left out the test targets, so I missed it. New head8a320556has the fix merged up from #320: the test fills the remaining fields with..Options::default(). Nothing else changed.Verified on #223
0f6dec04and #4398a320556:cargo clippy --workspace --all-targets --locked -- -D warningsis clean, andcargo xtask policypasses. No title data was used.AI-assisted
@r4tedx on GitHub · 2026-11-26 05:18 UTC · original
Second follow-up: CI's diagnostics clippy (
--all-features) found one more call from main that this stack'sTargetargument breaks. Incrates/victory-gpu/src/pipeline/placed_uav_tests.rs:77,emit::emitwas called with six arguments. New head13be4c2chas the fix merged up from #320: the call passesemit::Target::ANY, the same default the other callers use.Verified on #223
fbfd3c67and #43913be4c2c: both CI clippy commands are clean,cargo clippy --workspace --all-targets --locked -- -D warningsand the same command with--all-features. I didn't run the CIcargo test --workspacestep on this PC, so CI will be the first to run it on this head. No title data was used.AI-assisted
@r4tedx on GitHub · 2026-11-26 05:41 UTC · original
Thanks to Machad3x for finding both problems in #2214 and proposing the fixes, and to @steven-seagull27 for the two branches (9cc76b82, and the f16 sums in fork PR r4tedx/VIctory#19).
Both are taken as they are, with their authorship, plus one small test of ours. The head is now
2658128c:611184ee(9cc76b82): whole-wave reductions in partial groups now run in the console flow. A group of 32 threads or fewer skips the exchange between the two halves, so a min, max or And no longer reads the missing half's 0. Groups over 64 threads are still refused.f968c54c(591c51c4): for f16 sums, the two halves' f32 sums are exchanged and added before the single rounding to f16. The packed high half now comes from the right lane, through the ballot and lane read across both halves.2658128c: checks the high-half lane from the section simulation, and that f16 sums translate at 32, 48 and 64 threads.What we could check here (WARP only):
VICTORY_WARP=1 cargo test -p victory-shader --lib -- --test-threads=1: 343 passed, 4 failed, 3 ignored. The 4 failures are thesynthetic_teststhat also fail on main. The two added tests make up the difference from 341 before.-D warnings, both default and--all-features: clean.cargo xtask policy: 194 files ok.With
VICTORY_WARP=1no adapter is listed, so the program cases only translate and validate, and nothing is dispatched. The results on 32-lane hardware are steven-seagull27's alone: RTX 5080, 0 of 1,884 wrong over 1-64 threads. Asplit_testsrun on a 32-lane card at2658128cwould still help, especially for an f16 sum in a partial group with a mask, which no test covers on hardware yet.No title data was used.
AI-assisted
@latentdev on GitHub · 2026-11-26 07:27 UTC · original
@r4tedx here it is, as a patch against #233's head
87d1f42. It only touchesemit/lower.rsandemit/split_tests.rs, and applies withgit apply.What it does in the console flow, one console wave per group:
ds_swizzleand the permutes, it adds a group barrier (inLower::inst). Both halves reach every block, so one half's access finishes before the other half's next.exchange. A reduction combines the two. A prefix adds the lower half's total in the upper half (Lower::console_shape). It covers integer and float sums, min, max, and/or/xor; f16 is refused.root_memory). Without that limit, the builder stagescaa78b8ca62bc3d6and28918b7150a7aad5translated, part of the builder ran, and the GPU hung.#320 and #439 cover the same ground. Your LDS barrier comes before each access, and your sections now handle partial groups and f16. So this is more for comparison than to merge as it is.
Tests: five new ones in
split_tests, hand-assembled from the tile classifierbad01f53f53248e5's own sections:On an RTX 4090 (split) and the Radeon iGPU of a Ryzen 9 7950X3D (native wave64), all 17
split_testsare exact on both.The whole
victory-shaderlib on this machine: 321 passed, 3 failed. The three area_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zerosandgathers_at_a_level_match_the_hardware, and they fail the same way at87d1f42without the patch. I skippedheap_direct_texture_reads_mark_their_heap_index, which crashes on this card onmaintoo.The frame-80 result in my earlier comment came from this change on a
63bcca4stack.Patch against
87d1f42@latentdev on GitHub · 2026-11-26 07:41 UTC · original
split_testsat2658128on an RTX 4090 and a Radeon iGPUI ran
cargo test -p victory-shader --lib split_tests -- --test-threads=1at2658128con Windows 11, on one machine with two adapters:All 35 passed, and every hardware case printed
exacton both adapters: 87 cases on the 4090 and 88 on the Radeon. That covers:whole_wave_reductions_in_partial_groups: sum, min and max at 1, 6, 31, 32, 33, 36, 48, 63 and 64 threads;half_sum_and_packed_lane_cross_host_halveswith all six masks, andhalf_sum_takes_the_high_half_of_the_lane_it_ends_in);As you said, none of them is an f16 sum in a partial group with a mask, so that case still has no hardware run.
@r4tedx on GitHub · 2026-11-26 07:45 UTC · original
Thanks @latentdev. The
root_memorylimit is the part #439 was missing, and thanks for thesplit_testsrun at2658128con the RTX 4090 and the 7950X3D iGPU.I compared your patch (against
87d1f42) with2658128c:andwould be combined with the missing half's 0;ds_bpermutewithin each half outside sections.root_memory: #439 had no such limit.Offline only, I translated
XboxBvhBuilder.dllfrom my local copy of the title data for a 32-lane host, to see whether your two stages take the console flow. Nothing was dispatched or run.2658128c,28918b7150a7aad5(@0x25c40) andcaa78b8ca62bc3d6(@0x28770) both validate in the console flow in halves.Pushed as a fast-forward to
75870526, two commits crediting you as co-author:e2d3cfd5adds your limit inemit/lower/console.rs. A program that reaches title memory by address and also shares LDS, has whole-wave sections or permutes lanes no longer takes the console flow in halves on a host without 64-lane waves. A synthetic test (lds_in_halves_keeps_out_of_programs_reaching_title_memory) fails with the check switched off.75870526adds your five tile-classifier tests, adapted to the stack'sprogram_lds/program_casehelpers. Each also checks, without a GPU, that the program translates for a 32-lane host.Checks on the software adapter (WARP), one test thread:
75870526, against 343/4/3 at2658128c. The four failures are the same at both heads, all in main'ssynthetic_tests.cargo xtask policyand clippy (plain and--all-features) are clean.I can't run tests on hardware here, so the five tests' values have only been checked on your two adapters, and only with your patch. A run of
split_testsat75870526would cover them on #439's own code. Your note also stands: an f16 sum in a partial group with a mask still has no hardware run.AI-assisted
@nathanbzrr on GitHub · 2026-11-26 07:53 UTC · original · reviewed
Reviewed updated
7587052(throughe2d3cfd+7587052vsmain63bcca4) on Windows 11 with AMD Radeon RX 7600 (native Wave64) and WARP:git merge-treeagainstmain(63bcca4): clean (4dbc0d507237c0e5b5dba90fdc87083c2f859839),crates/victory-shader/src/emit/lower.rsis506,876bytes.cargo run -p xtask --locked -- policy:asset policy: 195 files ok.cargo clippy -p victory-shader --all-targets --locked -- -D warnings(default &--all-features): clean.cargo test -p victory-shader --lib --locked split_tests -- --nocapture --test-threads=1(RX 7600):41 passed; 0 failed(32.68s) — includes the 6 newly added tests (lds_in_halves_keeps_out_of_programs_reaching_title_memory,whole_wave_sums_*,whole_wave_prefixes_*,lds_shared_within_the_console_wave_orders_both_halves); RX 7600 executions loggedsplit false(zero native Wave64 regression).VICTORY_WARP=1 cargo test -p victory-shader --lib --locked split_tests -- --nocapture --test-threads=1:41 passed; 0 failed(0.18s) —translates_in_halves(32-lane Wave32 DXIL lowering + DXIL validator) andsgpr_spills_across_a_divergent_branch_stay_per_lane(Host::new(true)) ran cleanly, whileadapters()tests skip WARP (host.rs:105-107).cargo test -p victory-shader --lib --locked -- --test-threads=1(RX 7600):353 passed; 0 failed; 3 ignored(153.89s).Notes:
e2d3cfd'scrates/victory-shader/src/emit/lower/console.rs(leaves_title_memory_out) cleanly gatesone_waveLDS, whole-wave sections, and*permute*(includingds_bpermute_b32) out of console-flow halves whenroot_memoryis true (lower.rs:829-830), and7587052's unit/validator tests cover both the gate and the whole-wave sum/prefix/LDS patterns on Wave32 targets.e9f18c9beforee2d3cfd/7587052.split false), not hardware 32-lane silicon.AI-assisted; synthetic tests only, no game files.
@r4tedx on GitHub · 2026-11-26 07:55 UTC · original
Thanks @nathanbzrr. The description now names head
7587052and lists what is new sincee9f18c9, with your RX 7600 run (353 passed, 0 failed). AI-assisted.75870526batoe2d3cfd507@r4tedx on GitHub · 2026-11-26 08:28 UTC · original
Done:
7587052is removed from the branch history. The branch was force-pushed back toe2d3cfd, its parent, with a lease. You're right that itsSECTION_SUM/SECTION_PREFIXsequences and the two one-lane tests followed one of the title's programs, which the asset policy doesn't allow. No other branch on the fork carries that commit, and I've reset our local copy too. The description now namese2d3cfdas the head, and says why the earlier top commit is gone. @latentdev, yourroot_memoryrefusal (e2d3cfd) stays. If we add section tests again, they'll be written from the RDNA2 ISA guide alone and won't refer to any title program.The other blockers stand as you list them: the stack order (#223, #233, #320 first), the BVH builder gate (#2118), and crissuper20's GTX 1650 hang.
No title data was used for this change.
AI-assisted
@evan-kolberg on GitHub · 2026-11-26 13:33 UTC · original
I ran the generated masked-LDS test at exact head
e2d3cfd50715954fb89ff462edb37a0c4395ecd0on an Apple M4 Pro using CrossOver 26.3.0.39832 and D3DMetal 4.0 beta 3. The AMD64 test PE was built from the clean head, and the test process mapped D3DMetal.emit::split_tests::lds_written_and_read_in_different_masked_blockspassed. All three cases loggedsplit trueand matched all 128 readback words each (two 64-thread groups). This covered the all-lanes write followed by lower-half reads, the delayed upper-half writer, and upper-half writes followed by lower-half reads without branches. The test exercises the generated non-root-memory LDS path.@chippy01 on GitHub · 2026-11-26 14:01 UTC · original
@r4tedx I ran this stack's split tests on 32-lane hardware at
e2d3cfd: an RTX 3070 Ti (driver 621.24, 32-lane waves only) and the Radeon iGPU of a Ryzen 9 7900X, on Windows 11.Tests
cargo test --locked -p victory-shader --lib -- --test-threads=1: 344 passed, 3 failed, 3 ignored. The 3 failures area_heap_buffer_read_by_element_takes_the_views_stride,a_heap_buffer_read_where_no_buffer_view_is_reads_zerosandgathers_at_a_level_match_the_hardware, and they fail onmainon this machine too. I skippedheap_direct_texture_reads_mark_their_heap_index, which crashes the test process here onmainas well.split_testsandlane_read_loop_tests(38 tests): all pass. On the 3070 Ti all 81 split cases are exact (split true), and so are the 9 other cases and the 8 nested-EXEC ranges. The Radeon runs the same 81 cases natively (split false), also exact.Translate (
translate --list --validate --host-lanes 32-32overshaders.rpf, the executable,XboxBvhBuilder.dlland the FidelityFX DLL): 2,661 of 2,763 compute programs emitted, 1,926 of them validated.One finding: groups whose rows a 32-lane wave may tile. The split forms keep the console's
[numthreads]. The relabelling assumes each host wave holds a 32-aligned run of flat ids, but NVIDIA fills the waves of a 32 x 2 group with 16 x 2 tiles (#2126 measured the same). I added a local probe tosplit_teststhat runs yourprogram_3din other shapes:In the title this concerns
CS_AmbientMapSky32,CS_AmbientMapSkyLocal32andCS_AmbientMapSkyClassified32, all 32 x 2 x 1 and all emitted here.CS_ComputeTerrainVisibility(6 x 6 x 1, a width that is not a power of two) is in the class #2126 measured too, but I didn't probe it here. #2633 refuses these groups. #2126 hands each wave its ids by ticket instead, which would fix them here as well.Next to the halves stack. Locally I have #2633 plus four follow-ups. They keep the per-lane form and trade through group-shared memory only at blocks every thread of the group reaches. That covers lane reads, first lanes, ballots and wave reductions, plus barriers for one wave's LDS. Everywhere else they refuse. Over the 415 wave64 programs that need their console lanes:
The two seem to fit as tiers. The halves trades cost a group barrier pair per read, and they work in groups of any size where every thread meets. The console flow takes the divergent rest of one-wave groups.
The multi-wave branch. I also ran
shader/wave64-lds-groups-2atf7a85cfon the same machine.split_tests: 43 passed, 1 failed.groups_whose_waves_part_match_the_console_on_every_adapterfails its case "both sides in the first wave's region" (128 threads) on the 3070 Ti (split). In the first console wave, lanes 20-63 store 2 where the console stores 3, so the side of the two-sided branch those lanes should take isn't taken. The rest is right: lanes 0-19 store 2 and the second wave stores 7, as on the console. It fails the same way when run alone.groups_sharing_lds_match_the_console_on_every_adapterandgroups_of_several_console_waves_run_as_one_host_group_each.translate --list --validate --host-lanes 32-32there: 2,722 of 2,760 compute programs emitted, all of them validated.Logs on request. AI-assisted (Claude Code).
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.