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!1589
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1589/head"
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?
@MamaLeVrai on GitHub · 2026-11-24 19:31 UTC · original
MamaLeVrai:bundle/wave64-189→main· +8517 −621 · 21 files · 106 commits · closed without mergingA merge resolution for one PR. #189 emulates Wave64 compute shaders on 32-lane and narrower hosts. The open issues from NVIDIA owners keep hitting that wall: compute pipelines refused because the shaders ask for wave size 64 and the device maximum is 32 (#1107, #1323, #1001). This is #189 merged onto the whole shader stack (#1319, #1402, #1492, #1504, #1511), where it conflicts and fails to compile in a few places. Every head is merged unchanged onto
mainplus #1511, and the result is built and tested together.What is inside
54b333fc5Changes made while bundling
No change inside #189. Two things came up when merging it onto the stack:
emit/lower.rs: a helper that buildsPartsand callslower. #189 adds anoptionsfield toParts(options: TranslateOptions::default()); another PR of the stack reformatted the closing lines of the same call. Resolution: #189's field, in rustfmt's layout.cube_image_get_lod_lowersfrom #1004 andimage_atomics_64_bit_lower_with_typed_int64_flagfrom #305 inemit/lower.rs, andbuildinemit/root_view_tests.rsfrom #1056) buildPartswithout the newoptionsfield. Each now hasoptions: super::TranslateOptions::default(), which is what #189 does in its own tests.That is all of the merge: #189 does not conflict with the stack in the lowering itself.
Left out, and why
host.rs(#208's capability probe next to #189'srecommended_wave64_mode) and inshader_cache.rs(#189's mode byte in the cache input,input[33..], next to #358'stranslatedflag), and two tests of #358 then need the newWave64Modeargument ofcached(). The resolution is small and is in the merge commit on top of the branchbundle/allofMamaLeVrai/VIctory(clippy twice and 725 tests pass there); no bridge pull request, as the GPU bundles do not depend on this one.Verification
Windows 11, RX 6950 XT, Rust 1.98.1 (the pinned toolchain):
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --lockedmain: 342 passed, 6 ignored)The title was not run, so this says nothing about in-game effect. No game data is used or committed.
Re-verify in one go
To confirm that no component PR moved since this was built, compare each
Headabove withgh pr view <n> --repo Marvisak/VIctory --json headRefOid. If one differs, the branch needs a rebuild: merge the new head in the same order.If this lands
The component heads are in the history unchanged, so each PR's commits and authorship are kept and GitHub should mark them merged. Merging them one by one instead works too, with the exceptions noted above.
AI-assisted (Claude Code); no game data.
🤖 Generated with Claude Code
ffe310e) into up/pixel-barycentrics 3bc83d0d7bDXIL allows at most two SV_Barycentrics input elements, one perspective and one linear. A program reading both perspective center and centroid I/J as values declared two perspective elements, which the validator refuses ("There can only be up to two input attributes of SV_Barycentrics with different perspective interpolation mode"). The second mode of the same kind is now an Unsupported reason rather than a second element. Reusing the first element would hand centroid reads center weights (or the reverse), which differ on edge pixels: a silent wrong value. Before this PR such reads were refused anyway. Test: center + centroid values are refused; centroid alone still translates with one element. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AZ9pSB4ZoXYUifuXg8gm66The console compiler spills scalars, lane-mask pairs among them, with v_writelane_b32 into constant lanes of a VGPR and restores them with v_readlane_b32 of the same lane. The restored pair was an opaque mask, so the selects, EXEC writes and joins that used it refused ("a select on an untracked mask", "an opaque lane mask", "a lane-mask join of an untracked mask"). structure now follows a constant-lane readlane back through a plain chain of writelanes to the scalar written to that lane, and gives the restored pair that scalar pair's mask. A chain with a phi or another write of the VGPR stays opaque (shortcut noted in code). Offline corpus, against fix/mask-phi-ballot (neither branch carries #585): vertex/pixel programs emitted 12250 -> 12269, compute 1443 -> 1452, "a lane-mask join of an untracked mask" 20 -> 0, "an opaque lane mask" 29 -> 8, "a conditional export" 8 -> 0. Synthetic pixel program fails before, lowers after. Stacked on fix/mask-phi-ballot (shares its test helper). Co-Authored-By: Claude Sonnet 5.5 <[email protected]>AI-generated & verified with Gemini 4 Neon (not written by a human engineer). s_add_i32, s_addk_i32, and s_sub_i32 previously left SCC as Val::Missing("the carry of a scalar operation"), causing any shader that reads SCC after these instructions (e.g. via s_cselect_b32 or s_cbranch_scc*) to fail lowering. Compute 32-bit two's-complement signed overflow directly in i32 (no i64 capability required), matching the AMD RDNA2 ISA: - s_add_i32 / s_addk_i32: ((a ^ r) & (b ^ r)) <s 0 - s_sub_i32: ((a ^ b) & (a ^ r)) <s 0 Verified with synthetic GPU + WARP + dxil.dll tests in valu_tests.rs on NVIDIA GeForce RTX 3060 Ti (Windows 11, Rust 1.98.1). No game data used. Co-Authored-By: Gemini 4 Neon <[email protected]>AI-generated & verified with Gemini 4 Neon (High Mode) — not written by a human engineer. `packed16` in `lower.rs` previously rejected `v.clamp` on all packed 16-bit integer instructions with `Err("modifiers on a packed integer operation")`. Under the AMD RDNA2 ISA (VOP3P), `clamp` on `v_pk_add_u16`, `v_pk_sub_u16`, `v_pk_mad_u16`, `v_pk_add_i16`, `v_pk_sub_i16`, and `v_pk_mad_i16` saturates each 16-bit lane to `[0, 65535]` (unsigned) or `[-32768, 32767]` (signed). Because `packed16` computes each lane in 32 bits (`u16*u16+u16 <= u32::MAX`, `i16*i16+i16` fits in `i32`), saturation is exact in 32-bit integer compares before masking to 16 bits. Non-saturating packed integer ops keep rejecting `clamp`. Verified with synthetic GPU + WARP + dxil.dll tests in `valu_tests.rs` on NVIDIA GeForce RTX 3060 Ti (Windows 11, Rust 1.98.1). No game data used. Co-Authored-By: Gemini 4 Neon (High Mode) <[email protected]>Fixes 5 shader emission and DXIL container/validator issues in `victory-shader`, raising validated shaders across the test corpus from 21,983 to 22,159 (+176; 100% of emitted VS/PS/CS shaders now validate cleanly): 1. Biased 16-bit image samples (`emit/lower.rs`): - Remove the `a16` rejection on `image_sample_b` and separate 32-bit prefix operands (offsets, bias, comparison reference) from `a16`-packed tail operands (gradients, coordinates, explicit LOD) starting at `regs[first]`, matching GFX10 MIMG hardware operand layout. 2. Conservative depth `SV_Position` interpolation (`emit/mod.rs`): - Declare `SV_Position` with `linear_noperspective_centroid` (5) instead of `linear_noperspective` (4) in pixel shaders outputting `SV_DepthLessEqual` or `SV_DepthGreaterEqual` (kinds 18/19). 3. Per-row interpolation mode consistency (`emit/mod.rs`, `emit/lower.rs`): - Add `harmonize_row_interp()` so elements sharing a signature row always declare the same interpolation mode: rows containing integer attributes or `SV_IsFrontFace` propagate `nointerpolation` (1) to sibling elements, and after pixel-shader lowering unread siblings inherit the actual read mode of sibling elements in the same row. 4. Container signature row ordering (`emit/container.rs`): - Sort `ISG1`/`OSG1` rows stably by register only (`row`) rather than `(row, col)`, preserving DXIL element-ID order within a row so the container signature matches DXIL validator expectations byte for byte. 5. SM 6.6 compute-shader implicit derivatives (`emit/shader.rs`, `emit/container.rs`, `emit/lower.rs`): - Track compute shaders emitting implicit-derivative sampling ops and emit `dx.valver = 1.8` with `PSVRuntimeInfo3` (52 bytes, carrying `EntryFunctionName`), enabling validation and D3D12 compute PSO creation. Adds 5 unit + `dxil.dll` validation (+ D3D12 compute PSO) tests in `emit::tests`.344704e028' into trial/shader-lowering-c 7b1455c40b5d6889e8be' into trial/shader-lowering-c d053700ea19483b1a962' into trial/shader-lowering-c 77e3d29e32645391bcce' into trial/shader-lowering-c 34826e71f2f47ebd83f3' into trial/shader-lowering-c 3cc282bc5d5ecb6abe76' into trial/shader-lowering-c f0f7e136c54b8a1ca6dd' into trial/shader-lowering-c d146ad8e931052a90a40' into trial/shader-lowering-c bea7e635068d67fa5b00' into trial/shader-lowering-c ada65a7ef93d71ad1a65' into trial/shader-lowering-c a95185b5f77b57e8e8da' into trial/shader-lowering-c a8a631bd6e41b2472e13' into trial/shader-lowering-c 0443f28edb393320dfa8' into trial/shader-lowering-c a624dc74ead25783b8d8' into trial/shader-lowering-c 6a1fcd41f2bf873ffd3b' into trial/shader-lowering-c c75ee332c7d160854be0' into trial/shader-lowering-c 5fb25849d47dffb2a6c2' into trial/shader-lowering-c 483258bff6ba53233923' into trial/shader-lowering-c df1fb77f525be1fe4b65' into trial/shader-lowering-c 1470fadc336a9cc8fef8' into trial/shader-lowering-c 8263ed574aea633e723d' into trial/shader-dxil4 0c7da166ed9459c12d2e' into trial/shader-dxil4 89bd94d284ad330155a5' into trial/shader-dxil4 bb85b04761428725aaed' into trial/shader-dxil4 538fb4b8eebd59ba346d' into trial/shader-dxil4 fcc5fb18e3PSV0 shared one string-table copy of a repeated semantic name (TEXCOORD0 and TEXCOORD1 pointing at the same "TEXCOORD"). DXC's PSV writer writes one copy per element, and validators before 1.8 compare PSV0 byte for byte, so any signature repeating a name was rejected there ("Pipeline State Validation does not match"); 1.8 compares the strings and accepted both. Checked against dxil.dll 1.7, 1.8 and 1.9. Validator::version() reads IDxcVersionInfo; the compute-derivative test skips dxil.dll validation when the validator predates 1.8, which rejects dx.valver 1.8 outright. Translated shaders never go through dxil.dll. Reported by @alexdeliu. Co-Authored-By: Claude Opus 5.5 <[email protected]>e3067ae(wrothgaril: PSV0 semantic names per element, skip on validators older than 1.8) 7e7c5be2db@Impre-visible on GitHub · 2026-11-24 19:53 UTC · original
Test report for this bundle on a 32-lane host under Linux (not a code review).
Setup: Arch Linux, Wine from GE-Proton11-6 + vkd3d-proton (Proton Experimental), GTX 1660 6 GB (Turing, 32-lane waves only), NVIDIA 620.73.04, Series X mode, diagnostics build, empty shader cache, native
d3dcompiler_47in the prefix so indirect execution runs.Tree: this bundle + #1077 #1175 #523 #530 #1040 #1406 #542 #1056 #1392 #1516 #1388 #1189 #1523 (all merge cleanly except #542, a small conflict in
emit/lower.rs; #1407 conflicts inemit/lower.rsand is left out).cargo test -p victory-shader --lib: 153 passed, 0 failed, 1 ignored.One run into the world, to frame 2073 (about 7 minutes):
So the refusals for
WaveSize(64)are gone on this card.Compute programs that now do not translate, by reason (distinct shaders warned about in this run): a lane mask holding lanes elsewhere read as data (67),
v_readfirstlanein divergent control flow (64), a structured buffer of unknown stride (56), LDS accesses without a uniform LDS fence in split wave64 (40), a 64-lane wave ballot in divergent control flow (35), an address not from a root parameter (29).By dropped work per frame the first one is
LDS accesses without a uniform LDS fence in split wave64(10 shaders actually dispatched).The final image is still dark at frame 2048, and the title's stop of #1323 still comes at about frame 2000-2070. Runs differ in how many shaders they reach, so the two columns are one run each, not an exact A/B.
@MamaLeVrai on GitHub · 2026-11-24 20:09 UTC · original
Thank you, Impre-visible: 111 compute pipelines refused by the host down to 0 on a 32-lane card is the number this PR is for, and the list of walls that remain (lane mask holding lanes elsewhere,
v_readfirstlanein divergent flow, unknown stride, split wave64 LDS fence, wave ballot in divergent flow, address not from a root parameter) is the useful next map. I see #1407 conflicts with #189 inemit/lower.rsin your tree; I am building your whole tree as one branch on top of this PR (the list you ran, with #1523, and #1407 resolved against #189 if it can be), and will post it here and on #1495 with the checks. AI-assisted (Claude Code); no game data.@MamaLeVrai on GitHub · 2026-11-24 20:17 UTC · original
Impre-visible: your tree is now one branch, #1638, stacked on this PR: #189 as merged here plus #1077 #1175 #523 #530 #1040 #1406 #1392 #1516 #1388 #1189 #1523 #542 (#1056 is already in #1319). Clippy (both runs) and
cargo test --workspacepass on it (461 passed, two runs). #1407 is left out for the reason you found: it rewrites the lane-mask ballot in the same function as #189 (mask_dword), and I did not try to join two different rewrites. What it took beyond your list is described in #1638: the one-linekeep_dynamicchange after #1388,root_uavsin four test literals, the duplicateRENDER_TARGETconstant between #1523 and #1040, #542's bound applied to the stack's raw-view branch, and a fix of #1040's test (it assumed every adapter refuses a typed UAV on B5G5R5A1; an RX 6950 XT accepts it). If your counts differ on that branch (MamaLeVrai/VIctory,bundle/nvidia-stack), I would like to know. AI-assisted (Claude Code); no game data.@MamaLeVrai on GitHub · 2026-11-24 20:30 UTC · original
Impre-visible: the unknown-stride wall (56 shaders in your list) has its own PR now, #1644 (#704 on #193, on top of #1511; branch
bundle/stride-stack). Clippy (both runs) and 412 tests pass here; I did not run the title. It is built on #1511, not on #1589 or on your tree, so it does not change your wave64 numbers by itself.I tried merging it onto your tree (#1638): 11 files and 28 conflict hunks (
emit/lower.rs6,emit/shader.rs6,emit/mod.rs4,pipeline/host.rs3,shader_cache.rs3, one in each of the other six), among them the root-UAV and wave64 changes. That is not a mechanical merge and I have not built it. If you want #1589 and the stride stack in one tree to run now,bundle/allhas both (751 tests; it does not have your world-run list). The other walls in your list are not touched by it.AI-assisted (Claude Code); no game data.
@Marvisak on GitHub · 2026-11-25 00:42 UTC · original
Automated triage for the maintainers. Closing because this pull request re-packages other open pull requests. Each of those is reviewed on its own, so a bundle cannot be merged.
If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.
Pull request closed