GFX10 shader refusals: remaining shapes (tracking) #4
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?
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T06:57:22Z.
Listed in docs/ROADMAP.md section 3. Each is testable without the game using hand-assembled GFX10 code (crates/victory-shader/src/emit/gfx_refusal_tests.rs).
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T10:53:32Z.
Progress update: three shader PRs have merged to
maincovering related GFX10 shapes with hand-assembled synthetic tests:s_bfe_u32) in pixel primitive masksbuffer_load_{u,s}{byte,short})v_permlane16_b32andv_permlanex16_b32Keeping #4 open until we verify which of the seven refused title shaders now translate cleanly on a live run.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T15:56:52Z.
Status: three of the seven shapes landed (#27, #29, #30), and #92, #84 and #56 added related lowering. #94 and #49 are open with changes requested. Open until a run shows which refused title shaders remain.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T16:40:24Z.
Data point for the refusals, since #85 names the root type: in #110 (current
main, Series S), 52 of the 103 refusals listed are "FSPX metadata resource of root type 0: root constants in a compute shader". None are root type 5 or 6 (descriptor heaps), so I've dropped my heap change.Compute root constants were turned off on purpose in
a0b0990("Root constants in FSPX metadata only for graphics"). Before I touch it: what made you exclude compute? If it's the SGPR count, a guess per record seems risky to me, since a shader would read wrong values instead of being refused. A safer source may beNum32BitValuesin the root signature that compute pipeline 0x218 passes (the pure-Rust reader from #83 decodes it). Would you take that approach, or is there a reason compute constants can't be lowered yet?Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-26T17:07:50Z.
Opened #114: compute root constants now take
Num32BitValuesfrom the root signature passed to 0x218. d02869f's guess stays as the fallback when no readable root signature is available, and a count that disagrees with the program is refused rather than read wrong.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T17:13:42Z.
Update: today's fixes took the story load from 526 refused shaders to 149 unique ones. A further batch is on
fix/shader-refusals-2and being tested in game now:Offline, 29 of the 146 remaining refused shaders translate fully with it. @Olima34, #114 is next in review. It complements the span guess with the real
Num32BitValues.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T17:16:11Z.
@Olima34, assigning this to you. Please start from the shapes nobody here is working on:
v_pk_fmac_f16constant (2).We're keeping the cross-lane/LDS-in-divergent-code shapes and the bindless "descriptor outside the heaps" (host side). As before, one shape per PR with a gfx_refusal test.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T18:10:29Z.
Thanks @Olima34. #117 (
v_pk_fmac_f16constants), #120 (wave64 lane-mask joins) and #128 (s_absdiff_i32) are merged and lower those shapes. #118, #121 and #122 are merged too: they name the cause in the lane-mask, whole-wave-section and descriptor-dword refusals, so the next tester log will show which forms remain.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by umutbcomak on 2026-11-26T21:29:52Z.
The Windows forks that run on NVIDIA have the same 32-lane problem as Apple GPUs, so they had to solve some of the shapes you're keeping (cross-lane and LDS in divergent code). Three of their fixes may be worth porting. None of them is on main here: I checked at
3009640b, and there is no wave-uniformity proof (lane_uniform) and no loose-LDS fallback. I haven't tested any of this on Metal, so treat it as a lead, not a result.1. First-lane reads of a value that is the same in every lane of a console wave, inside a loop whose exit differs between console waves.
If every lane of the console wave holds the same value, each 32-lane half can read its own first lane, and the two halves never need to meet at a barrier. A fixed-point uniformity proof in
lower.rsdecides when that holds.39321a95223001ed,77360df21e12ea43and9fc111d3be79364f. Together with avatarmanz#66 (counted partial workgroups), the builder reached 53 of 53 pipelines on an RTX 5070 Ti.2. Loose-LDS fallback, a last resort for wave64 programs that read and write LDS inside one lane-branch region.
The two host waves are ordered only where the region is entered and left. It is approximate and can be turned off with
VICTORY_WAVE_LDS_LOOSE=0.3. The BVH builder runs all or none.
On those forks the builder is opt-in (
VICTORY_BVH_BUILDER=1).builder_runs/builder_restsin pipeline.rs.Here a refused stage is skipped on its own while the others run. You already withhold the builder's writes after a missed list (
memory::withholding), but an all-or-none gate might be a cheap experiment against the empty-AABB pointers, if they come back.Caveats: the translators have diverged since 24 November, so 1 and 2 would be ports, not cherry-picks. The NVIDIA results say nothing yet about Metal Shader Converter.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-26T22:04:25Z.
@LakshanSivakumar, before I write any code: may I port the first of umutbcomak's three leads above? It's the first-lane read of a value that is the same in every lane of a console wave, inside a loop whose exit differs between console waves. You said you'd keep the cross-lane shapes, so I'll leave it alone if it's already on your branch or you'd rather do it yourself.
What I'd do, at
561e783:split_sccinlower.rscounts everyv_readfirstlane_b32result as one that can differ between the two host waves. I'd add a fixed-point proof that the value read is the same in every lane of the console wave: scalar inputs, results of the uniform reads themselves, and VALU work on those only. Where the proof holds, each 32-lane half reads its own first lane and the result stays out ofsplit_scc. Anything the proof can't show stays refused as now.gfx_refusaltest: it fails on main and lowers with the change. I'd add a second test where one lane differs, which must stay refused.If yes, should it be its own PR against
main, or would you rather it go onto your cross-lane branch?Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-26T22:13:56Z.
Refusals by cause in the newest public log, the M5 Ultra run in #147 (
57b7ebd, 639 refused, 636 distinct shaders). I grouped thetitle shader refusedlines by their reason, without the code address.0xc000ffff)bb6e8f1)898208d)37f9cb5)Compared with the earlier logs in #110: "a sampler built from computed words" was the top cause on
b6f15be(145) and is 0 here. "Cross-lane outside compute" was 1 there and is 127 here, so it is probably the next refusal in the same pixel programs. Lowering it may uncover another refusal behind it.On the prologue crash (#15). The BVH and AABB data the title reads back comes from compute shaders, and the 127 "outside compute" refusals are all graphics, so that group is unlikely to cause the empty-node read. The three BVH builder prefix-scan programs umutbcomak named above (
39321a95223001ed,77360df21e12ea43,9fc111d3be79364f) do not appear in this log at all, neither refused nor translated. Either this build does not use them, or they are not logged when they translate cleanly. The candidates for an empty compute output stay the compute-only groups: 32 cross-lane and 10 LDS in divergent code. ROADMAP already ties the row-pitch assertion to one of those.#158 splits "a cross-lane operation outside compute" by operation and stage, for example
...: ds_bpermute_b32 in a pixel programor...: DPP row_shl, row_shr or row_ror in a pixel program. It lowers nothing. With it merged, one more tester log tells us which form to lower.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T22:52:54Z.
@m0rff Yes please. Make it its own PR against main, with the two tests you describe. "A cross-lane operation outside compute" is yours too.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-26T23:15:29Z.
A general route for the split-wave refusals in compute
Many compute refusals come from one thing. A console wave64 runs as two 32-lane host waves, and every cross-lane step then needs its own proof. Being built now on our side, as a fallback that only refused shaders take:
xchg.5f8b2e3b(#182) and the 10 G-buffer compute dispatches.So, to avoid duplicate work:
@Olima34, if you're on more of the masked-or-merged forms, say which, and we'll leave them to you.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T00:24:50Z.
The lockstep fallback is on main (
f8336377). A wave64 compute program refused on Apple's 32-lane host, with a group of 64 lanes or fewer, is retried with all 64 host threads following the console wave's one program counter: EXEC branches become uniform compares on the wide mask,v_readfirstlanereads the wide EXEC's first lane, LDS writes get group barriers either side, and whole-wave sections run literally. Shaders the fast path translates are untouched.Offline, over 1,765 unique refused compute dumps from our runs: 189 → 285 translate (+96: 35 cross-lane/LDS after the split, 34 lane-mask joins, 27 whole-wave code). A warm 300 s run had no fault and no GPU errors.
VICTORY_NO_LOCKSTEP=1turns it off.Still refused in lockstep: masks that would need to be carried as real 64-bit values (about 100 one-wave shaders, next), groups of several waves (74), and the descriptor families. If a tester sees a GPU hang or timeout in a compute pass on current main, a rerun with
VICTORY_NO_LOCKSTEP=1tells us whether it is this.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lautarocherro on 2026-11-27T02:31:59Z.
Heads-up on the split-wave refusals (cross-lane ops and LDS in divergent code, about 48 shaders in the #140 log): the Windows fork Belobug/VIctory-Belobug-AMD has a retry chain for exactly this on 32-lane GPUs. When a wave64 shader gets stuck, it translates it again without early exits, without skipped blocks, and with each half-wave on its own where that's exact. It's all IR work, nothing D3D12-specific. The entry point is emit/mod.rs:488.
One warning: they turned off their "wide" variant because it put barriers inside branches and hung the GPU. Their other large groups of refusals are the same as ours, so this looks like the one piece worth borrowing. Happy to help port it if you want.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T08:57:46Z.
/claim
Only the pixel/graphics cross-lane shape: "a cross-lane operation outside compute" (127 graphics shaders in the #147 log). Not the rest of #4. Branch
m0rff/cross-lane-outside-compute; first PR lowers the most common op/stage pair, one shape per PR.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T08:57:50Z.
@LakshanSivakumar, I'm dropping the first-lane port you approved above. On current main (
c1b9587) it would change nothing. Hand-assembled checks, run throughemit_withwithwave32_host, lockstep on and off (VICTORY_NO_LOCKSTEP=1):v_readfirstlaneper iteration of a loop with a lane exit (store changed toglobal_store_dword)v_readfirstlaneofv_mov v6, s4+ 1,s_cmp, SCC branch over av_readlane … 40that is storedDIVERGENT_EXCHANGE), either wayWhy the proof has nowhere to act:
v_readfirstlaneon split waves is never refused by itself: each half reads its own first lane (waveReadLaneFirst). On Vice-Tay it was refused ("a first-lane read where not every lane runs"), and that refusal was what their proof lifted. So their BVH case already translates on main.split_scchas two callers. One iswave_blocks, and through itsplit_wave_barriers; both are only for groups of one console wave, and lockstep retries every refusal there. The other is the mesh lane-mask join, which is a different shape.oncecomes fromonce_blocks, which ignoressplit_scc. A branch that is the same across one console wave can still differ between console waves, so a group barrier behind it can't be reached by every wave. Proving the value is the same across one console wave can't lift that refusal. Only a scheme for several waves could.The uniformity proof that is still live is marcus-4's
Lower::wave_uniformin #254, which picks between the per-half read and the exchange. Further work on that belongs there, so I'm not opening a second one. I haven't checked the 32DIVERGENT_EXCHANGEcompute refusals from #147 by group size. If most of them are groups of several waves, that is where the work is.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T08:57:59Z.
@m0rff this is already claimed by @Olima34. Pick another issue, or ask them here.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T09:04:32Z.
/release
@m0rff it's yours. We aren't working on the cross-lane-outside-compute shape, and our assignment on this tracking issue was a leftover from earlier work, not a live claim. Our current work is on #258 (#253, #267).
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T09:04:42Z.
Released. This issue is free to claim.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T09:11:36Z.
/claim
Only the graphics cross-lane shape, "a cross-lane operation outside compute" (127 shaders in the #147 log). Not the rest of #4.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T09:11:46Z.
Claimed by @m0rff. Open a draft pull request with
Refs #4in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T09:15:40Z.
@LakshanSivakumar @Olima34: for the graphics cross-lane shape, could one of you run the pixel "a cross-lane operation outside compute: ..." refusals on current main through
sort | uniq -c? Counts and op names only, no shader bytes. At57b7ebda constant-lane v_readlane of a spill counted under this cause, so part of the 127 may already translate; the tally says which op to lower first. I will stay off constant-lane section reads (#262).Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T09:17:19Z.
@m0rff here are counts from our two runs today, on
c1b95875+ #253 + #267 + #264 (M5 Pro, Series S, windowed; one cold run, one warm run that reached frame 2560). Pixel "a cross-lane operation outside compute" lines: 0 in both. The only cross-lane refusals were 10 "a cross-lane operation between host waves in divergent code", all compute. One caveat: we haven't checked whether a refusal served from a warm shader cache is logged again, so the cold run is the safer number. It's 0 too. Neither run is plain main, but none of those PRs touch graphics cross-lane lowering.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T09:24:16Z.
Thanks @Olima34 for the count. With 0 pixel "a cross-lane operation outside compute" refusals on current main, there is nothing in this shape to lower. #297 pins today's pixel behaviour: a spill read back after a join translates, and DPP8 is still refused under its name. I'm releasing the claim. If a tester log from plain main shows pixel refusals of this cause again, the shape can be claimed again.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by m0rff on 2026-11-27T09:24:17Z.
/release
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T09:24:38Z.
Released. This issue is free to claim.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T10:11:17Z.
/claim
This claim covers one compute shape only: "a lane mask holding lanes elsewhere read as data: a program input". It's in
9e5a12054881a74d(80x45 groups), the only writer of a 1280x720 R11G11B10 target in the lighting chain. Because that shader is refused, the host never writes the target ("draws 0 clears 0"), so the target keeps title memory, NaN included (#258). Not the rest of #4. A draft PR will follow withRefs #4.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T10:11:30Z.
Claimed by @Olima34. Open a draft pull request with
Refs #4in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T10:23:36Z.
Widening our claim a little. Behind the first refusal in
9e5a12054881a74dthere is a second one: "a lane-mask join of an untracked mask: data whose high dword is not known". It's a loop's break accumulator (s = 0before the loop,s |= execat break exits, then read back through copies as a mask). We're taking that shape only, for this shader's chain.On the first refusal: the "program input" label is misleading. It's a loop phi of EXEC copies (
s_andn2_wrexec), not an input. All 15 "program input" cases in our dumps are such phis. That fix will come as its own PR.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by derz92 on 2026-11-27T15:35:03Z.
An updated refusal table from a world run on current main, since the cause names have been refined since the table above (the two biggest causes here don't appear in it).
Run: Apple M5 Max, 36 GB, macOS 26.5,
--console series-s, main728845d1plus #335, #341, #342 and #358 (none of them touch the translator),VICTORY_METAL_RESIDENCY_SETS=heap. It ran about 4 minutes in the world, at 1–2 fps, with no GPU errors, and 434 distinct shaders were refused. Distinct shader (or shader pair) per cause, code addresses left out:Two questions, so nobody's work is duplicated:
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T16:21:15Z.
/release
Our shape here (the "program input" lane-mask refusal and the execz-skip join in
9e5a12054881a74d) landed with #304. We're pausing for a while, so I'm freeing the issue. The handoff, with the openeee76bf6cross-lane class, is on #258.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T16:21:25Z.
Released. This issue is free to claim.
Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by lucasferreira1610 on 2026-11-27T20:53:34Z.
/claim
Only the
"a descriptor's address or format read as data: a dword outside the descriptor"shape (multi-descriptor wide loadss_load_dwordx8/x16and offset-shifted/partial reloads inLower::descriptor_data), not the rest of #4. Opening the PR now.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by github-actions[bot] on 2026-11-27T20:53:45Z.
Claimed by @lucasferreira1610. Open a draft pull request with
Refs #4in its description within 24 hours, or the claim expires.Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-28T01:51:37Z.
I'm taking the "a descriptor's address or format read as data: an image's dwords 5 to 7" class, tracked in #540. @lucasferreira1610: #457 keeps those dwords refused, so we shouldn't overlap; tell me if you'd planned to go there.