Repository navigation
Conversation
|
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. |
|
Verified 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). |
|
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?
No game data used on my side. AI-assisted. |
|
Re-checked the new head |
|
Tested with the title at Program by program:
Not tested: a 64-lane adapter, a release build, image results, (Claude Code, Claude Opus 5.5: ran the title and compared the logs program by program.) |
|
Thank you, that is exactly the split I was after: 70 of 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 I have added your numbers to the description. No game data used on my side. AI-assisted. |
|
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 r4tedx#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. |
…64 stack For testers: the wave64 stack (Marvisak#223, Marvisak#233, Marvisak#320, Marvisak#439) with Marvisak#180, whose sampleGrad form makes compute programs that sample with implicit derivatives pass dxil.dll validation. One conflict, in emit/lower.rs, where a compute program is found to need the console's lanes: Marvisak#180's quad gradients read within four lanes, so they go with DPP and ds_swizzle among the reads that stay inside a 32-lane half, and such a program runs on a 32-lane host in two halves. Checked on an RTX 5070 and a Radeon iGPU: cargo test --workspace passes, and a hand-assembled compute image_sample validates and samples the right value in groups of 64x1x1, 8x8x1, 32x1x1, 128x1x1 and 4x4x2.
…73d66, and Marvisak#180) The wave64 stack (Marvisak#223, Marvisak#233, Marvisak#320, Marvisak#439, with Peter Bonanni's whole-wave sections across the halves, 9b73d66) merged with Marvisak#180 (twin descriptor loads and quad gradients for compute samples), at 24b3bcc. That commit has one parent (e49302a); Marvisak#180's changes come in without its commits. Marvisak#233 is in this tree as 1eb9995, the same tree as 3098672, so each file was merged with 3098672 as the base instead of the e0865d2 git chooses. Conflict resolutions: - emit/wave.rs, v_permlane16/x16 in whole-wave sections: Marvisak#98's "every lane active" and 9b73d66's "or fi set" are both kept, for both instructions. - emit/lower.rs, Lower::new: Marvisak#320's test for lane reads and writes in divergent programs counts live instructions only, as Marvisak#233's does with Marvisak#309 (dead SGPR-spill lane instructions are no lane reads). Marvisak#307's waterfall arm of v_readfirstlane still comes before the console-flow arm; Marvisak#320 adds no arm of its own. - Compute samples with implicit derivatives (Marvisak#160, Marvisak#180, Marvisak#306): Marvisak#180 decides plain and biased samples, all of Marvisak#160's forms of them (implicit_derivatives from sample_form: _o, _cl, cube, a16), with Marvisak#160's bias address (bias_at) and level clamp; Marvisak#306's validator 1.8 is now declared only for what still uses the host's derivatives in compute (comparison samples, op 64). The Marvisak#306 test of image_sample now asserts no 1.8 (48-byte PSV0) and still validates and creates the pipeline; a twin test with image_sample_c asserts 1.8. - sgpr_spill test (Marvisak#309): without forwarding, the per-lane form still stops with "a lane mask holding lanes elsewhere read as data", but emit now takes the console flow (Marvisak#320); the test checks both, and that forwarded spills do not ask for the console flow. - Mechanical: per_lane_only in two hand-built Parts in emit/lower.rs tests; emit/mod.rs module order (split_tests before threading). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Marvisak#320 and Marvisak#439 (with peter-bonanni's 9b73d66) are in, with Marvisak#180, whose quad gradients fix the compute samples that failed validation. Records the in-title measurement by testers and this merge's resolutions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
64-lane AMD result for All 22,178 emitted modules on this head successfully created D3D12 pipelines. Across 25,889 shared program labels, the comparison against Full stage table, label-exclusion rule and reason changes: #293 (comment) Offline only; no title executable or world run. AI-assisted (Kimi). |
|
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 Details: #293 (comment) The earlier stage totals were correct; the initial 0-gain figure omitted these emit-to-success transitions. No 64-lane regression was found. |
91af621 to
a32c177
Compare
|
I ran the generated masked-LDS test at exact head
|
|
@r4tedx I ran this stack's split tests on 32-lane hardware at Tests
Translate ( One finding: groups whose rows a 32-lane wave may tile. The split forms keep the console's
In the title this concerns 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
Logs on request. AI-assisted (Claude Code). |
|
| program | dropped per frame |
|---|---|
ptfx_prerender:ptfx_CS_lightAtlas_Sprite (2561af9577c47289) |
19 |
ptfx_CS_lightAtlas_Trail / _NonLocalLights_Sprite / _NonLocalLights_Trail (c06aa621, cabb8759, e8f6ae05) |
4.5 / 4.5 / 1 |
indirect_light_probes:CS_IrradianceCache_Shade (a53a7977fe762268) |
2 |
scattering_transmittance_system:CS_DensityShadowMapMips (5b2ce592c3a5dd09) |
1 |
vfx_proj_decal_vbuffer:CS_ProjDecalResolve_Scalarized / _Vectorized (e4a9f58e, c4183d3c) |
1 each |
What I checked:
implicit_sample(true)translates for the 32-lane target and the module passesdxil.dll.- The full warm-up refuses 247 programs instead of 259.
- In the title, all eight programs bind and run, and
indirect kind 2: no host pipelinedrops go from 26.6 to 1.3 per frame. - One run went 7.5 minutes with no hang. It ended in a
0x887A0005removal with empty breadcrumbs, which on this 31 GB PC has been the machine running out of memory, with or without this change.
So the device losses behind the refusal may have come from the invalid sample in compute rather than from sampling in halves.
Not checked:
- Pixel-exact agreement with the console.
- Partial quads:
waveReadLaneAtof an inactive host lane is undefined in DXIL, while the console reads the register.
|
RTX 5080 (Blackwell), Windows, in the title at Setup: RTX 5080, driver 617.42, Windows 11 26200.
Tests on this card:
Not tested: more than one run; this PR without #2118; other scenes. Local diagnostics only. No game data: counts and pixel statistics. AI-assisted. |
Current 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 Shaders: wave64 compute on 32-lane hosts, in halves and in the console flow #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