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#1132
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@N7z on GitHub · 2026-11-24 16:03 UTC · original
Three independent implementations of console wave64 compute on hosts without 64-lane waves are open, none reviewed yet. They conflict with each other textually, so one has to become the base. This puts their synthetic GPU tests on one NVIDIA machine and lists what each covers, to make that choice cheaper. No game files were used: only
cargo test, no title run and notranslateover title data.Machine
Heads tested
mainffe310e714b818,b623fd3,bf0f951ffe310e54b333fffe310ewave64-emulation(#734)61b04f78e79c80(12 behind)Results:
cargo test -p victory-shader --locked -- --test-threads=1, forced onto the RTX 4060mainwave64_tests(Wave32 + Emulate modes)All green on the NVIDIA GPU. To get there I had to patch the test host locally (patch not part of any branch, see below): without it, this laptop runs the tests on the Intel GPU.
Two test-harness problems on a laptop with two GPUs
1. The default test device is adapter 0, which on a hybrid laptop is the iGPU.
emit::host::Host::new(false)callsD3D12CreateDevice(None, …). Onmain, #189 and #734, every "hardware" GPU test therefore ran on the Intel UHD, not the RTX 4060. A "tested on an RTX 4060 Laptop" report from such a machine may not have touched the NVIDIA GPU. #233/#439 addVICTORY_ADAPTER, which helps if you know to set it. Picking the device withIDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE)would make the default the discrete GPU. That is the local patch I used:A side effect on this machine:
valu_tests::v_med3_f32_matches_rdna2_with_nanfails onmainon the Intel UHD (v_med3_f32(1.0, 2.0, NaN) = 2, want 1). That is #971 reproduced on Intel Xe-LP, not only Arc.2. #233/#439: the split tests assume every hardware adapter runs 32- or 64-lane waves.
emit::host::adapters()drops WARP by its flags and name, but this Intel UHD reports 16..16. Every test that loops overadapters()stops on it withconsole wave64 lanes on a host without 64-lane waves is not supported: 10 failures on #233 and 30 on #439 (allsplit_tests, bothlane_read_loop_tests,each_adapter_gets_what_it_runs). The translator does the right thing (it refuses), but the tests expect a pipeline. Filteringadapters()onWaveLaneCountMax >= 32instead of on the name would cover WARP and these iGPUs alike.Related to #189:
wave64_tests::with_hostsstoresHost::new(..).ok()andrun_on_hostsdoescontinueonNone, so on a machine where device creation fails, the 26 GPU tests pass without running anything and print nothing. A line on stderr, or a failure when neither host exists, would make that visible.What each line covers (from the PR descriptions and code, not re-measured on the title)
Emulate; inWave32,v_readfirstlaneunder divergence returns each half's own first lane (documented as inexact)s_barrierplan_lds_fences; refuses unfenceable casesds_bpermute_b32Emulate(no wave size, all through TGSM)Target)v_mad_*64,ldexp/frexpcommits)Merge check (
git merge-tree): every pair of the three conflicts inemit/lower.rs,emit/mod.rsandvalu_tests.rs(and #439 + #189 also inhost.rs,shader_cache.rs,translate.rs).Reading
Emulatemode could follow as a separate PR on top ofTarget, instead of a secondWave64Modeplumbing next to it.Logs of every run are available on request.
@N7z on GitHub · 2026-11-24 16:16 UTC · original
A second machine agrees on the test side. @supidooo's run of #439 at
bf0f951on a desktop RTX 4060 Ti (Windows 10, no iGPU in the adapter list) gets the same 159 passed and 30split_testspassed as above. That also fits the harness problem here being specific to hybrid laptops: with no 16-lane adapter listed, it does not show up.Their whole-title counts on a 32..32 host also put a number on the gap in the coverage table. With #439, the driver's
E_INVALIDARGrejections go from 320 to 0 and compute host pipelines go from 1,121 to 1,420, but 43 programs are still refused asconsole wave64 lanes in a group of more than 64 threads. Those are the groups #189's multi-wave exchange handles, so that is how much the "#189 on top of #439'sTarget" step would be worth at most, before any other refusal those programs hit.One more thing from the same run: 35 compute modules fail
dxil.dllvalidation with stage-incompatible operations, and the NVIDIA driver still creates their pipelines. That looks like the known class from #201 (implicit-derivative samples emitted in compute, which #180 replaces), not something a wave64 line adds. But with wave64 programs now getting pipelines on NVIDIA, more of those modules actually run there, so #180 is worth landing alongside whichever line is chosen.@N7z on GitHub · 2026-11-24 16:23 UTC · original
@MichaelSmithAI Thanks, that corrects a row of the table above. "Lane reads inside divergent branches and loops: yes (console flow)" for #439 only holds when the program is routed to the console flow. A standalone
v_readfirstlane_b32under a partial EXEC isn't routed, and then lanes 32–63 read their own half's first lane, the same result #189's Wave32 mode documents. Your case is also a good one for the test suites, because it fails on a correct pipeline: pipeline creation succeeding says nothing about it.@MichaelSmithAI on GitHub · 2026-11-24 16:17 UTC · original · edited 2026-11-24 17:17 UTC
One qualification to the single-wave comparison: we tested a 64-thread Wave64 compute shader whose only cross-lane instruction was a non-waterfall
v_readfirstlane_b32. Lanes 10–63 were active and the source held3 * lane + 7. The first active guest lane was 10, so all 54 active lanes should read 37. On a single-adapter RTX 4090 (32..32) under Wine, the #439-derived integration and the #189-derived integration in Wave32 mode both returned 103 in lanes 32–63, the value from lane 32. These were live GPU dispatches.The #439-derived lowering has a console-flow implementation for this operation, but a standalone readfirstlane does not trigger that route. Enabling it in a probe produced the expected values on the same shader. Routing every such program that way can introduce refusals for workgroups larger than 64. The probe covers one compute group and doesn't establish title frequency. We did not test #734. This case can distinguish shader correctness from successful pipeline creation even on a machine with only one adapter.
Follow-up on the actual #439 head (
bf0f951): the entry and divergent reads now give the expected values on the RTX 4090 at 32, 48 and 64 threads. The 128- and 256-thread fixtures check translation only. We submitted the patch and regression to the author's branch in r4tedx/VIctory#12.We also ran the same first-lane shaders through both emitter modes on the older #189-derived build (
128f48f). For the divergent read above, Wave32 returned an incorrect value for 32 of 64 lanes and 64 of 128 lanes. Emulate refused that shader during translation at both sizes withv_readfirstlane in divergent control flow is not supported. Both modes produced the expected per-wave values for a read at entry and for a read after restoring EXEC following a masked write. In the 128-thread entry test the two console waves returned 0 and 64, respectively. The fixture selected each mode directly and checked GPU readback on the RTX 4090. These results cover those shaders on the older build; the newer #189 default and the title results are discussed in #1286.@alessiodeia on GitHub · 2026-11-24 17:14 UTC · original · edited 2026-11-24 17:40 UTC
Edited: corrected the regression counts. I first counted programs the title loaded only in one run as regressions. A regression now means a program that translated in the base run and is unusable in the variant: 60 for #189 (was 75), 0 for #439 (was 49). Recovered wave64 programs for #189: 31 (was 40; programs the run never loaded no longer count as recovered).
Title-level A/B of #189 and #439 on one machine: RTX 2070 SUPER (Turing, 32..32), driver 617.42, Windows 11.
Both branches sit on the same base, and each was run once, so the numbers are a single sample per tree. The base is
mainffe310e+ #493 + #587 + #282 + #876 + #67 + #490 + #464 + #984 +CitizenCinema:fix/unaligned-buffer-srv+alessiodeia:fix/reuse-aligned-cbv-tables(#840) +alessiodeia:perf/fast-texture-content-hash(#916). That base gets through theeeed82b877b44b5fworld hang (see #984). Variants: #189 at54b333f(log:wave64_mode=Emulate) and #439 atbf0f951(#223/#233/#320 as ancestors; tested before28aca3b). Each variant merges cleanly onto the base. The only change was thelower::Partsinitializer in #984's new test, which needed the new fields. Shader tests on the 2070 SUPER: #189 145 passed, #439 160 passed. Runs used a diag build, Series X,VICTORY_D3D12_DRED=1, default loop limit, Enter every 3 s, and 30 minutes each from launch.54b333fbf0f951E_INVALIDARGcompute refusals (wave size 64)E_OUTOFMEMORY(27 mesh), 8 GB cardWhere each one falls short, by the reason logged for the programs it leaves unusable:
v_readfirstlane in divergent control flow, refused inEmulate. Those programs translated and ran on the base. Two area lane mask from a carry. The last one iseeed82b877b44b5fitself, withLDS exceeding 32 KiB with wave64 emulation. That program already uses the full 32 KiB (a 1024-thread reduction at LDS0x5000–0x7fff), so it has no room for the emulation scratch.LDS accesses without a uniform LDS fence in split wave64, 32a 64-lane wave ballot in divergent control flow, 16v_readfirstlane in divergent control flow.console wave64 lanes in a group of more than 64 threads, 1 whole-wave section. These are the multi-wave groups #189 covers.mainffe310eemits 1 of them and #439 alone emits 1 of them, so they fail onmaintoo, mostly witha descriptor read only as data(28) anda structured buffer of unknown stride(11).The two cover complementary halves on this title. #439 recovers lane work inside divergent flow, and that is where most of the title's wave64 programs fail. #189 recovers the groups of more than 64 threads. On this card #439 leaves 63 fewer programs unusable than #189, regresses nothing the base run translated, and keeps the hit-detection pass the world needs. The draw counts differ a lot between the variants: #189 shows 834 draws per frame against about 1,830. I can't tell from the logs whether that comes from title gating on different compute results (as in #1086 row 2) or from fewer passes running. @NuraadGit's RTX 2080 note on #189 (world pass in
Wave32) may be the same effect.No game data attached. AI-assisted (Claude Code).
@tumbubu on GitHub · 2026-11-24 18:24 UTC · original
Wave64 lines on a host with native 64-lane waves: #439, #189 and #734's branch on an RX 7900 XT (RDNA3)
#1132 ran the three wave64 lines on NVIDIA (waves 32..32). This is the same comparison on a GPU that runs both wave sizes (waves 32..64). On this card the title takes the native path, and #439's split path can also be forced so it runs on AMD hardware. No game files were used: only
cargo test, no title run and notranslateover title data.Machine
dxil.dllpresent, so every emitted module was validated)Heads tested
mainffe310e28aca3bffe310e54b333fffe310ewave64-emulation(#734)61b04f78e79c80Each line was built in its own target directory.
Results:
cargo test --workspace --locked -- --test-threads=1victory-shadermainsplit falseEmulateandWave32(11wave64_tests::gpu::*), notNativehost_wave64 = false, no wave size declared, so the driver picks one)All green. The 6 ignored tests and the 4
diff_teststhat skip withoutVICTORY_CONSOLE_DXCare the same as onmain.#439's split path forced onto the 7900 XT
On a 32..64 host, #439 runs every
split_testsandlane_read_loop_testscase in native wave64. To run its 32-lane split on AMD as well, I madeHost::target()returnTarget { lanes_min: 32, lanes_max: 32 }with a local patch that is in no branch:34 passed, 0 failed. All 47 cases print
exact (split true), andeach_adapter_gets_what_it_runsseeswaves 32-32. The cases include backward permute, DPP row masks,v_readfirstlane, lane reads and writes in branches and loops, LDS order with one half busy, and whole-wave float reductions and prefix sums. So the split lowering is exact on RDNA3 too, not only on NVIDIA.What this machine shows that a 32-lane host cannot
Host::recommended_wave64_modein #189 picksNative, which is the path AMD users will run. Butrun_on_hostsexecutes onlyEmulate, plusWave32when the host supports it.Nativeis only checked to fail on hosts without wave64. #734's GPU tests likewise runlower_for(.., false)only. Both are green here, yet neither has run its own native output on a GPU.Wave32mode and #734's emulation run on an AMD 32-lane wave here. #1132 had them on NVIDIA only. Same result: exact.Target { 32, 32 }. AMD machines would then cover both paths with no local patch. It is the patch above turned into a loop over two targets.Logs of every run are available on request.
@Impre-visible on GitHub · 2026-11-24 20:00 UTC · original
Another side-by-side data point, on a Turing card under Linux (Wine from GE-Proton11-6 + vkd3d-proton, GTX 1660 6 GB, 32-lane waves only, NVIDIA 620.73.04, Series X mode, native
d3dcompiler_47so indirect execution runs). One run each into the world, to the title's stop at about frame 2000-2070.Both trees also carry #1077 #1175 #523 #530 #1040 #1406 #542 #1056 #1392 #1516 #1388 #1189 #1523.
cargo test -p victory-shader --libimage_sample_d_clWithout either (the #1511 stack alone): 111 of 477 compute pipelines refused.
Reading: on this card #1433 leaves far less compute work dropped, but its tree lacks the instruction lowerings of the #1511 stack (the pixel programs that draw the credits no longer translate), and the two do not merge (#1433 conflicts with #1511 in
emit/lower.rs,emit/wave.rs,structure.rs,waterfall_tests.rs). The final image is dark in both. Runs reach different numbers of shaders, so treat the counts as one run each.@wildheathen on GitHub · 2026-11-24 21:00 UTC · original
The retail-dump count this issue left out, on a 32-lane host: #439 builds the most compute pipelines and loses none. RTX 5080 (driver 32.0.16.2124, 32..32 lanes), Windows 11, dxil.dll 10.0.26100.
victory translate --validate --pipelines --listover the dump's shaders (2,682 compute programs). A program counts only when its D3D12 compute pipeline is created on this GPU. Release builds, each in its own target dir.mainffe310e0x80070057)ededb1b28aca3bEmulate, auto here)54b333f#233 ⊂ #439 (the stack): every program #233 builds, #439 builds too, plus 201 more.
#189 builds 4 programs #439 doesn't, and #439 builds 346 that #189 doesn't.
#189's 137 losses are 132 ×
v_readfirstlane in divergent control flow, 3 ×a lane mask from a carry, 2 ×LDS exceeding 32 KiB with wave64 emulation. That's the same count @dragoso got on a 5060 Ti; details on #189.Two programs that come up in the hang threads:
d3e44e754b3eb6aagets a pipeline with main, #233 and #439, and is refused by #189Emulate. Main's lowering of it hangs on a 4090 (@Yorivel on #189), and #189'sWave32hangs on it on this 5080.eeed82b877b44b5f, the #71 runaway loop, gets a pipeline with main, #233 and #439, and is refused by #189 (32 KiB LDS).So for both, "builds" doesn't settle whether #233/#439's lowering terminates. That needs a world run, which I can do next on this card.
Limits: offline counts only, nothing rendered; "pipeline created" isn't "correct". No game data, shader bytes or shader names; counts and hashes only.
AI-assisted (Claude Code).
@wildheathen on GitHub · 2026-11-24 21:13 UTC · original
Follow-up from my count above: #439 in the world on the same RTX 5080. One unattended run each: diag build,
VICTORY_D3D12_DRED=1, fresh copy of one save,VICTORY_KEYS, 480 s cap.28aca3balonefb7facdalonehost.rs, both functions kept)DispatchMeshwith this setup. #439's stop is op 5, which isn't a dispatch or a mesh draw, so I can't name a program for it from this log.d3e44e754b3eb6aanoreeed82b877b44b5fgot a pipeline in these runs, so they weren't reached. Whether #439's lowering of them terminates is still open.One run per tree; counts and hashes only.
AI-assisted (Claude Code).
@Marvisak on GitHub · 2026-11-25 10:06 UTC · original · edited 2026-11-26 00:50 UTC
Automated triage for the maintainers.
Thanks, a useful side-by-side of the three wave64 lines (#439 stack, #189, #734's branch). Choosing a base is for the maintainers. The measurements in the comments are on record for that decision: #439 gains the most compute pipelines on a 32-lane host and regresses none, and #189 covers groups of more than 64 threads. All of #439, #233 and #189 are still open and need a rebase.
main(63bcca4) has only the in-halfds_bpermute_b32part (0665a0e).The harness problem is confirmed on
mainin a changed form.Host::newincrates/victory-shader/src/emit/host.rsno longer passes a null adapter. It now useshardware_adapter, which takes the first adapter in DXGI order that is not software and has dedicated video memory. On a hybrid laptop that can still be the iGPU. Open PR #1487 makes the default the high-performance adapter, and open PR #1138 makes failures name the adapter that ran them. Both need a rebase.The other two points concern code that exists only on PR branches, so they belong in those reviews: the split tests stopping on a 16-lane adapter (
adapters()on #233/#439), andwave64_tests::with_hostssilently passing with no device (#189). Please comment on those PRs.New since the last triage: a synthetic 128-thread case (two nested loops, partitioned across console waves) is reported matching the CPU reference on an RTX 3080 with a patch series hosted outside this repository. For review it would need to come as a PR here with its tests.
Generated by Claude Code
@mosdefiscool-hub on GitHub · 2026-11-25 23:50 UTC · original
OpenAI Codex tested a related multi-wave case on a desktop RTX 3080. A 128-thread synthetic shader uses two nested loops. The inner counter advances to an invariant bound, and the outer loop clears its lowest set bit. Proving both loops terminate independently allowed the console-flow translator to partition the group. The control refused the shader. After the change, the GPU matched the CPU reference on all 256 output words.
In one fixed set of 36 opening-scene pipeline drops, 6 passed SDK validation and GPU pipeline creation before this change and 15 passed afterward. We have no output comparison for the nine individual title shaders. The opening still rendered nearly black, with pipeline builds pending during the frame-time sample.
Patch series and red/green commands · Frame intervals and shader outcomes