Shader preparation: masked-lane walk takes 150 to 400 s on Stray's large pixel shaders since fda4aa90 (#3279), and the title no longer starts #3504

Closed
opened 2026-10-11 12:00:49 +00:00 by ThatsLeo · 13 comments
ThatsLeo commented 2026-10-11 12:00:49 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T12:00:49Z.


Since #3279, two of Stray's pixel shaders (PPSA02101 v01.002, UE4) take 2.5 and 7 minutes to prepare. The render thread waits for them, and the title stops on Unreal's watchdog before its first frame:

GameThread timed out waiting for RenderThread after 120.00 secs

On main 8ec0e131 this happens at about 158 s with a warm shader cache, every run. With the same shaders preparing in about 10 s, the title gets past it.

Bisection

The same recompile request of shader 0x200f780000 was replayed offline with agc_shader_replay on each commit of the series. Release, GCC 16.2.1, one run per row:

Commit Time
961b25fe (before the series) 32.0 s
c2a48416 exec phis and long kill chains 29.7 s
cd4eaacf walk limit scaled with the program 9.3 s
98f99d38 across loops 10.5 s
83f8c193 image reads 10.2 s
fda4aa90 image writes, explicit-LOD gathers, size queries 152.6 s
main 8ec0e131 146.7 s

The second shader, 0x200f7a0000, takes 406 s on main. Both produce SPIR-V. Nearly all of the time is in MaskedSelectEliminator::Eliminate, in the masked-lane walk.

What changes at fda4aa90

Counted in MaskedSelectEliminator::Eliminate for 0x200f780000, with the counters not in any commit:

83f8c193 fda4aa90
walks 59,415 56,190
values visited 202 M 1,233 M
implications computed 3.5 M 210.9 M
selects removed 1,391 4,616

The commit does what it says: three times as many selects are proven dead. The cost comes from two things:

  • Walks go deeper. Explicit-LOD gathers and size queries are now lane-local, so walks continue past them. Most walks still fail in the end: about 51,500 of 56,000, after about 20,000 visits each.
  • Each ImageWrite asks Implies about its exec. Implications::Reset clears the results for every walk, and almost every select has its own mask (about 51,000 distinct masks in 112,000 walks), so nothing is shared.

I tried three caches on top of main, all with byte-identical SPIR-V on the 43 Stray shaders I have requests for, and none helped:

  • failed selects per mask;
  • values that reach an observing use through unguarded uses only;
  • doomed paths per mask (slower).

Keeping Implications results across walks does nothing either, as the masks are almost all distinct. So I don't have a fix. A per-program budget, or proving implications between conditions once rather than per mask, seems to be what is needed. @AlxcBTW, you know this code; I can rerun timings or counters on any branch.

Before the series

On f1ae427b the same two shaders took 28 and 78 s. With a change that stamps visits by dense value id and stops a walk at a select whose walk already failed under the same mask, they took 3.5 and 11.5 s, with identical SPIR-V on 33 Stray shaders. Stray then went on rendering (#2749). main now stamps visits the same way, so only the failed-select part would be new, and on main it does not help (above).

Setup

Fedora 44, GCC 16.2.1, Release, Intel Arc (Meteor Lake, Mesa 26.2.3 ANV). The requests come from APS5_DUMP_SHADERS=1 and replay without the game.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5800853140 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T12:00:49Z. --- Since #3279, two of Stray's pixel shaders (PPSA02101 v01.002, UE4) take 2.5 and 7 minutes to prepare. The render thread waits for them, and the title stops on Unreal's watchdog before its first frame: ``` GameThread timed out waiting for RenderThread after 120.00 secs ``` On `main` `8ec0e131` this happens at about 158 s with a warm shader cache, every run. With the same shaders preparing in about 10 s, the title gets past it. ### Bisection The same recompile request of shader `0x200f780000` was replayed offline with `agc_shader_replay` on each commit of the series. Release, GCC 16.2.1, one run per row: | Commit | Time | |---|---| | `961b25fe` (before the series) | 32.0 s | | `c2a48416` exec phis and long kill chains | 29.7 s | | `cd4eaacf` walk limit scaled with the program | 9.3 s | | `98f99d38` across loops | 10.5 s | | `83f8c193` image reads | 10.2 s | | **`fda4aa90` image writes, explicit-LOD gathers, size queries** | **152.6 s** | | `main` `8ec0e131` | 146.7 s | The second shader, `0x200f7a0000`, takes 406 s on `main`. Both produce SPIR-V. Nearly all of the time is in `MaskedSelectEliminator::Eliminate`, in the masked-lane walk. ### What changes at fda4aa90 Counted in `MaskedSelectEliminator::Eliminate` for `0x200f780000`, with the counters not in any commit: | | `83f8c193` | `fda4aa90` | |---|---|---| | walks | 59,415 | 56,190 | | values visited | 202 M | 1,233 M | | implications computed | 3.5 M | 210.9 M | | selects removed | 1,391 | 4,616 | The commit does what it says: three times as many selects are proven dead. The cost comes from two things: - **Walks go deeper.** Explicit-LOD gathers and size queries are now lane-local, so walks continue past them. Most walks still fail in the end: about 51,500 of 56,000, after about 20,000 visits each. - **Each `ImageWrite` asks `Implies` about its exec.** `Implications::Reset` clears the results for every walk, and almost every select has its own mask (about 51,000 distinct masks in 112,000 walks), so nothing is shared. I tried three caches on top of `main`, all with byte-identical SPIR-V on the 43 Stray shaders I have requests for, and none helped: - failed selects per mask; - values that reach an observing use through unguarded uses only; - doomed paths per mask (slower). Keeping `Implications` results across walks does nothing either, as the masks are almost all distinct. So I don't have a fix. A per-program budget, or proving implications between conditions once rather than per mask, seems to be what is needed. @AlxcBTW, you know this code; I can rerun timings or counters on any branch. ### Before the series On `f1ae427b` the same two shaders took 28 and 78 s. With a change that stamps visits by dense value id and stops a walk at a select whose walk already failed under the same mask, they took 3.5 and 11.5 s, with identical SPIR-V on 33 Stray shaders. Stray then went on rendering (#2749). `main` now stamps visits the same way, so only the failed-select part would be new, and on `main` it does not help (above). ### Setup Fedora 44, GCC 16.2.1, Release, Intel Arc (Meteor Lake, Mesa 26.2.3 ANV). The requests come from `APS5_DUMP_SHADERS=1` and replay without the game. AI-assisted: yes.
MarcZX10 commented 2026-10-11 13:02:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-11T13:02:22Z.


I opened PR #3550 with a per-shader budget for masked-lane proof work. Failed and successful walks both debit the shared budget; when it runs out, remaining selects stay unchanged unless the existing proof already completed.

The PR has a synthetic regression for exhausting the budget while preserving unproven selects. I could not replay Stray's dumped shaders locally, so title-specific timing and budget tuning remain unverified. If you can rerun the requests, could you share results for both 0x200f780000 and 0x200f7a0000 with the budget at 1x, 8x and 32x the per-walk limit? For each run, elapsed time, values visited, implications computed, selects removed and whether the shader produced valid SPIR-V would show the performance/optimization tradeoff the review asks about. The current PR setting is 32x.

I also added a test to the PR for a later masked proof removing its select after an earlier proof has spent part of the budget and conservatively failed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109301402 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6109301402). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-11T13:02:22Z. --- I opened [PR #3550](https://github.com/boykopovar/AnyPS5/pull/3550) with a per-shader budget for masked-lane proof work. Failed and successful walks both debit the shared budget; when it runs out, remaining selects stay unchanged unless the existing proof already completed. The PR has a synthetic regression for exhausting the budget while preserving unproven selects. I could not replay Stray's dumped shaders locally, so title-specific timing and budget tuning remain unverified. If you can rerun the requests, could you share results for both `0x200f780000` and `0x200f7a0000` with the budget at 1x, 8x and 32x the per-walk limit? For each run, elapsed time, values visited, implications computed, selects removed and whether the shader produced valid SPIR-V would show the performance/optimization tradeoff the review asks about. The current PR setting is 32x. I also added a test to the PR for a later masked proof removing its select after an earlier proof has spent part of the budget and conservatively failed.
AlxcBTW commented 2026-10-11 14:12:19 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T14:12:19Z.


@ThatsLeo thanks for the bisection and the counters. That makes it clear: the walks fda4aa90 lets past gathers and size queries mostly fail late, and every ImageWrite restarts Implies from scratch. That regression is mine, and I'm on it.

I'm looking at two things that don't trade selects for time:

  • caching Implies(condition ⇒ mask) per pair of condition and mask across walks, instead of resetting it per walk;
  • stopping a walk as soon as one visited use is known unguarded under that mask.

@MarcZX100's budget in #3550 is a good safety net either way. I'll put candidate branches up for your timings on 0x200f780000 and 0x200f7a0000 and post the selects removed next to the times, so we can see whether a budget still bites after that.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6109910403 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6109910403). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T14:12:19Z. --- @ThatsLeo thanks for the bisection and the counters. That makes it clear: the walks fda4aa90 lets past gathers and size queries mostly fail late, and every `ImageWrite` restarts `Implies` from scratch. That regression is mine, and I'm on it. I'm looking at two things that don't trade selects for time: - caching `Implies(condition ⇒ mask)` per pair of condition and mask across walks, instead of resetting it per walk; - stopping a walk as soon as one visited use is known unguarded under that mask. @MarcZX100's budget in #3550 is a good safety net either way. I'll put candidate branches up for your timings on `0x200f780000` and `0x200f7a0000` and post the selects removed next to the times, so we can see whether a budget still bites after that. AI-assisted: yes (Claude Code)
AlxcBTW commented 2026-10-11 17:03:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T17:03:08Z.


Status on the two ideas from my last comment, so nobody waits on a branch from me:

  • Early exit for walks that fail anyway (a precomputed path from each value to a failing use, checked against the select's mask). It keeps the SPIR-V byte-identical: Sword of the Sea's 482 requests, 200,000 fuzzer programs and the soundness fuzzer all match main. But it doesn't buy time. On a synthetic where most of the cost is failing walks it cuts values visited and implications by 40%, and its bookkeeping eats that; on two SotS programs it is slower (0.9 → 1.4 s, 3.5 → 4.0 s). I'm not putting it up.
  • Caching Implies across walks doesn't work as is: many late failures come from Implies hitting its depth limit of 64 on long exec chains, and whether it does depends on the order of the questions, so a cached answer isn't the same answer.

The synthetic reproduces the fda4aa90 jump (0.07 s → 9 s) when most of the cost is in walks that end up removing a select. Those can't be skipped without changing the output, so the real fix is a per-mask proof that doesn't depend on order, which lets walks with the same mask share results. That changes which selects are removed (mostly more), so it needs its own PR and review. Until then @MarcZX100's budget in #3550 is the right stopgap.

@ThatsLeo if you rerun 0x200f780000 and 0x200f7a0000, the split that would tell which case Stray is: time with the cache off (ANYPS5_NO_SHADER_CACHE=1 time ./agc_shader_replay --spv shader_200f780000.req) on main, on fda4aa90~1 and with #3550 at 1x, 8x and 32x, plus the selects removed in each. That also answers what #3550's review asks.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111475910 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6111475910). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T17:03:08Z. --- Status on the two ideas from my last comment, so nobody waits on a branch from me: - **Early exit for walks that fail anyway** (a precomputed path from each value to a failing use, checked against the select's mask). It keeps the SPIR-V byte-identical: Sword of the Sea's 482 requests, 200,000 fuzzer programs and the soundness fuzzer all match `main`. But it doesn't buy time. On a synthetic where most of the cost is failing walks it cuts values visited and implications by 40%, and its bookkeeping eats that; on two SotS programs it is slower (0.9 → 1.4 s, 3.5 → 4.0 s). I'm not putting it up. - **Caching `Implies` across walks** doesn't work as is: many late failures come from `Implies` hitting its depth limit of 64 on long exec chains, and whether it does depends on the order of the questions, so a cached answer isn't the same answer. The synthetic reproduces the fda4aa90 jump (0.07 s → 9 s) when most of the cost is in walks that end up removing a select. Those can't be skipped without changing the output, so the real fix is a per-mask proof that doesn't depend on order, which lets walks with the same mask share results. That changes which selects are removed (mostly more), so it needs its own PR and review. Until then @MarcZX100's budget in #3550 is the right stopgap. @ThatsLeo if you rerun `0x200f780000` and `0x200f7a0000`, the split that would tell which case Stray is: time with the cache off (`ANYPS5_NO_SHADER_CACHE=1 time ./agc_shader_replay --spv shader_200f780000.req`) on `main`, on fda4aa90~1 and with #3550 at 1x, 8x and 32x, plus the selects removed in each. That also answers what #3550's review asks. AI-assisted: yes (Claude Code)
ThatsLeo commented 2026-10-11 18:42:55 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T18:42:55Z.


@MarcZX100 measurements of #3550 (b58c0428) on both shaders, per budget multiple. Offline replay with agc_shader_replay, Release, GCC 16.2.1, Intel Arc (Meteor Lake) host CPU. The counters are summed over every MaskedSelectEliminator::Eliminate call of the shader (2 for 0x200f780000, 6 for 0x200f7a0000, 4 to 6 for 0x2013010000). They were added locally and are not in any commit; the multiple came from an environment override of WalkBudgetMultiple. "Unbounded" is a multiple of 10^9, and its SPIR-V is byte-identical to main 8ec0e131. Every SPIR-V module passes spirv-val --target-env vulkan1.3.

0x200f780000

Budget Time Walks Values visited Implications computed Selects removed Budget exhausted SPIR-V words
1x 1.0 s 1,646 0.42 M 0.05 M 422 2/2 1,155,188
8x 1.1 s 5,260 3.2 M 0.53 M 952 2/2 1,143,075
32x 1.3 s 9,674 12.9 M 2.2 M 1,602 2/2 1,126,113
128x 2.3 s 15,476 51 M 9.0 M 2,450 2/2 1,103,553
512x 8.2 s 26,492 205 M 36 M 4,068 2/2 1,060,287
unbounded 140.7 s 112,272 2,465 M 421 M 9,232 0/2 909,393

0x200f7a0000

Budget Time Walks Values visited Implications computed Selects removed Budget exhausted SPIR-V words
1x 1.5 s 4,768 1.2 M 0.17 M 874 6/6 582,520
8x 1.6 s 15,774 9.7 M 1.6 M 2,038 6/6 576,478
32x 2.4 s 28,412 38 M 6.7 M 3,340 6/6 567,997
128x 5.8 s 45,584 153 M 27 M 5,126 6/6 556,717
512x 23.5 s 78,058 612 M 107 M 8,514 6/6 535,084
unbounded 384.9 s 276,066 5,982 M 1,022 M 18,456 0/6 459,637

What the budget costs. Even at 1x the two shaders are fine for time. But there is a correctness cost that the timings do not show. Stray's pixel shader 0x2013010000 relies on a removed select for the packed ancillary lowering (the #2881 case that #3279 fixed). Under the budget, that select survives, and the shader fails again:

Budget 0x2013010000
1x, 8x, 32x, 64x packed pixel ancillary input has an unsupported live use (used by SelectU32 ? ?)
128x and up compiles (231,749 words), 0.9 s

In the title, main + #3550 at 32x (plus the bring-up set in #2749) stops on that error at 35 s. At 128x it renders the calibration screen at about 2.3 FPS. The ancillary lowering needs the select gone, so a budget that leaves it there turns a slow shader into a failing one.

Of the 41 Stray shaders I have requests for, the other 40 compile at 32x, and 34 of them produce the same SPIR-V as main.

@AlxcBTW glad to time your candidates on the same requests as soon as they're up.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112389664 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6112389664). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T18:42:55Z. --- @MarcZX100 measurements of #3550 (`b58c0428`) on both shaders, per budget multiple. Offline replay with `agc_shader_replay`, Release, GCC 16.2.1, Intel Arc (Meteor Lake) host CPU. The counters are summed over every `MaskedSelectEliminator::Eliminate` call of the shader (2 for `0x200f780000`, 6 for `0x200f7a0000`, 4 to 6 for `0x2013010000`). They were added locally and are not in any commit; the multiple came from an environment override of `WalkBudgetMultiple`. "Unbounded" is a multiple of 10^9, and its SPIR-V is byte-identical to `main` `8ec0e131`. Every SPIR-V module passes `spirv-val --target-env vulkan1.3`. **`0x200f780000`** | Budget | Time | Walks | Values visited | Implications computed | Selects removed | Budget exhausted | SPIR-V words | |---|---|---|---|---|---|---|---| | 1x | 1.0 s | 1,646 | 0.42 M | 0.05 M | 422 | 2/2 | 1,155,188 | | 8x | 1.1 s | 5,260 | 3.2 M | 0.53 M | 952 | 2/2 | 1,143,075 | | 32x | 1.3 s | 9,674 | 12.9 M | 2.2 M | 1,602 | 2/2 | 1,126,113 | | 128x | 2.3 s | 15,476 | 51 M | 9.0 M | 2,450 | 2/2 | 1,103,553 | | 512x | 8.2 s | 26,492 | 205 M | 36 M | 4,068 | 2/2 | 1,060,287 | | unbounded | 140.7 s | 112,272 | 2,465 M | 421 M | 9,232 | 0/2 | 909,393 | **`0x200f7a0000`** | Budget | Time | Walks | Values visited | Implications computed | Selects removed | Budget exhausted | SPIR-V words | |---|---|---|---|---|---|---|---| | 1x | 1.5 s | 4,768 | 1.2 M | 0.17 M | 874 | 6/6 | 582,520 | | 8x | 1.6 s | 15,774 | 9.7 M | 1.6 M | 2,038 | 6/6 | 576,478 | | 32x | 2.4 s | 28,412 | 38 M | 6.7 M | 3,340 | 6/6 | 567,997 | | 128x | 5.8 s | 45,584 | 153 M | 27 M | 5,126 | 6/6 | 556,717 | | 512x | 23.5 s | 78,058 | 612 M | 107 M | 8,514 | 6/6 | 535,084 | | unbounded | 384.9 s | 276,066 | 5,982 M | 1,022 M | 18,456 | 0/6 | 459,637 | **What the budget costs.** Even at 1x the two shaders are fine for time. But there is a correctness cost that the timings do not show. Stray's pixel shader `0x2013010000` relies on a removed select for the packed ancillary lowering (the #2881 case that #3279 fixed). Under the budget, that select survives, and the shader fails again: | Budget | `0x2013010000` | |---|---| | 1x, 8x, 32x, 64x | `packed pixel ancillary input has an unsupported live use (used by SelectU32 ? ?)` | | 128x and up | compiles (231,749 words), 0.9 s | In the title, `main` + #3550 at 32x (plus the bring-up set in #2749) stops on that error at 35 s. At 128x it renders the calibration screen at about 2.3 FPS. The ancillary lowering needs the select gone, so a budget that leaves it there turns a slow shader into a failing one. Of the 41 Stray shaders I have requests for, the other 40 compile at 32x, and 34 of them produce the same SPIR-V as `main`. @AlxcBTW glad to time your candidates on the same requests as soon as they're up. AI-assisted: yes.
AlxcBTW commented 2026-10-11 18:44:43 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T18:44:43Z.


@ThatsLeo thanks, that table settles the time side: at 128x both shaders are at 2.3 s and 5.8 s, against 141 s and 385 s unbounded. It also shows the real problem: under any budget that bites, a select that 0x2013010000's ancillary lowering needs gone can survive, and a slow shader becomes a failing one.

AlxcBTW/AnyPS5#39 takes that coupling away. With it, a select the walk keeps no longer stops the recompile: every read it keeps gets the whole packed word (prim type, sample index, layer), so the lowering doesn't depend on the walk finishing. If you have time: 0x2013010000 with #39 under #3550 at 1x and 32x. If it compiles there, the budget can stay low without breaking titles. The branch is carry/pixel-ancillary-word-v2 (9870a3ff7), on an older main; the #3279 commits in it are the merged ones, so it should merge onto 8ec0e131 with #3550.

I have no faster walk to offer yet: the early exit I tried kept the output but saved no time (my comment above). Your s_wqm fold on #2548 is the better fix for 0x2012f90000's shape, because it removes the selects instead of computing the word.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112406173 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6112406173). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T18:44:43Z. --- @ThatsLeo thanks, that table settles the time side: at 128x both shaders are at 2.3 s and 5.8 s, against 141 s and 385 s unbounded. It also shows the real problem: under any budget that bites, a select that `0x2013010000`'s ancillary lowering needs gone can survive, and a slow shader becomes a failing one. AlxcBTW/AnyPS5#39 takes that coupling away. With it, a select the walk keeps no longer stops the recompile: every read it keeps gets the whole packed word (prim type, sample index, layer), so the lowering doesn't depend on the walk finishing. If you have time: `0x2013010000` with #39 under #3550 at 1x and 32x. If it compiles there, the budget can stay low without breaking titles. The branch is `carry/pixel-ancillary-word-v2` (`9870a3ff7`), on an older `main`; the #3279 commits in it are the merged ones, so it should merge onto `8ec0e131` with #3550. I have no faster walk to offer yet: the early exit I tried kept the output but saved no time (my comment above). Your `s_wqm` fold on #2548 is the better fix for `0x2012f90000`'s shape, because it removes the selects instead of computing the word. AI-assisted: yes (Claude Code)
ThatsLeo commented 2026-10-11 18:58:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T18:58:57Z.


@AlxcBTW with AlxcBTW/AnyPS5#39 (9870a3ff7) and #3550 (b58c0428) on main 8ec0e131, 0x2013010000 compiles at every budget. Offline replay, same counters as above:

Budget Result Selects removed Time
1x compiles, 244,860 words 638 0.3 s
8x compiles, 240,105 words 2,296 0.4 s
32x compiles, 236,324 words 3,698 0.7 s
128x compiles, 231,749 words 2,490 0.9 s
unbounded compiles, 231,749 words 2,490 0.9 s

At 32x all 43 Stray requests I have compile, and every module passes spirv-val --target-env vulkan1.3. The two slow shaders take 1.1 and 2.3 s.

Taking only 9870a3ff7 onto 8ec0e131 conflicts with #3228's alphaToCoverage. Both claim request serialization version 16, and both touch the same lines in DrawDecode, DrawLookup, DrawRegisterKey, the disk cache format version and ShaderMemory. For this run I kept both fields and read rasterPrimitive from version 17. That is fine for the replay, but the rebase will need a real choice there.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112538193 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6112538193). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T18:58:57Z. --- @AlxcBTW with AlxcBTW/AnyPS5#39 (`9870a3ff7`) and #3550 (`b58c0428`) on `main` `8ec0e131`, `0x2013010000` compiles at every budget. Offline replay, same counters as above: | Budget | Result | Selects removed | Time | |---|---|---|---| | 1x | compiles, 244,860 words | 638 | 0.3 s | | 8x | compiles, 240,105 words | 2,296 | 0.4 s | | 32x | compiles, 236,324 words | 3,698 | 0.7 s | | 128x | compiles, 231,749 words | 2,490 | 0.9 s | | unbounded | compiles, 231,749 words | 2,490 | 0.9 s | At 32x all 43 Stray requests I have compile, and every module passes `spirv-val --target-env vulkan1.3`. The two slow shaders take 1.1 and 2.3 s. Taking only `9870a3ff7` onto `8ec0e131` conflicts with #3228's `alphaToCoverage`. Both claim request serialization version 16, and both touch the same lines in `DrawDecode`, `DrawLookup`, `DrawRegisterKey`, the disk cache format version and `ShaderMemory`. For this run I kept both fields and read `rasterPrimitive` from version 17. That is fine for the replay, but the rebase will need a real choice there. AI-assisted: yes.
AlxcBTW commented 2026-10-11 19:00:03 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T19:00:03Z.


@ThatsLeo thanks, that's the result I hoped for. With #39 a low budget is both fast and correct: all 43 Stray requests compile at 32x, and the two slow shaders take 1.1 and 2.3 s. So #3550 and #39 belong together, and #3550 doesn't need to go to 128x just to keep 0x2013010000 working.

On the conflict: #3228 is on main now, so it keeps version 16. #39 takes the next request serialization version for rasterPrimitive, and the disk cache format moves one step. I'll rebase #39 onto 8ec0e131 that way, rerun its tests, and post the branch here. I can open it upstream once #3546 is merged; the intake rules allow me one open PR until then. If #3550's review wants the pair sooner, anyone is welcome to carry the rebased branch.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112548306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6112548306). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T19:00:03Z. --- @ThatsLeo thanks, that's the result I hoped for. With #39 a low budget is both fast and correct: all 43 Stray requests compile at 32x, and the two slow shaders take 1.1 and 2.3 s. So #3550 and #39 belong together, and #3550 doesn't need to go to 128x just to keep `0x2013010000` working. On the conflict: #3228 is on `main` now, so it keeps version 16. #39 takes the next request serialization version for `rasterPrimitive`, and the disk cache format moves one step. I'll rebase #39 onto `8ec0e131` that way, rerun its tests, and post the branch here. I can open it upstream once #3546 is merged; the intake rules allow me one open PR until then. If #3550's review wants the pair sooner, anyone is welcome to carry the rebased branch. AI-assisted: yes (Claude Code)
AlxcBTW commented 2026-10-11 20:31:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T20:31:52Z.


@ThatsLeo the rebased branch is up: carry/pixel-ancillary-word-v3 (db92ece3c). It's a single commit on main a11c8f7f.

  • Serialization: #3228's alphaToCoverage stays at request serialization version 16, and rasterPrimitive reads from 17. The disk cache format is 28. The round-trip and legacy checks in ShaderMemory.cpp cover both fields.
  • Tests: agc_driver_pixel_ancillary_word and agc_driver_alpha_to_coverage pass, and the full agc_driver set is 296/297 on an RTX 5070. The one failure, agc_driver_emulated_color_compare (the sRGB sampling refusal), fails the same way on plain main. Non-GPU tests are 527/530, the same three failures as main on that machine. check_conventions.py passes.

It should merge onto 8ec0e131 with #3550 without the version juggling you had to do.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6113434476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6113434476). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T20:31:52Z. --- @ThatsLeo the rebased branch is up: [`carry/pixel-ancillary-word-v3`](https://github.com/AlxcBTW/AnyPS5/tree/carry/pixel-ancillary-word-v3) (`db92ece3c`). It's a single commit on `main` `a11c8f7f`. - **Serialization:** #3228's `alphaToCoverage` stays at request serialization version 16, and `rasterPrimitive` reads from 17. The disk cache format is 28. The round-trip and legacy checks in `ShaderMemory.cpp` cover both fields. - **Tests:** `agc_driver_pixel_ancillary_word` and `agc_driver_alpha_to_coverage` pass, and the full `agc_driver` set is 296/297 on an RTX 5070. The one failure, `agc_driver_emulated_color_compare` (the sRGB sampling refusal), fails the same way on plain `main`. Non-GPU tests are 527/530, the same three failures as `main` on that machine. `check_conventions.py` passes. It should merge onto `8ec0e131` with #3550 without the version juggling you had to do. AI-assisted: yes (Claude Code)
ThatsLeo commented 2026-10-11 21:33:53 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T21:33:53Z.


@AlxcBTW carry/pixel-ancillary-word-v3 (db92ece3c) merges cleanly onto main a11c8f7f7 together with #3550 (b58c0428). The results match what I posted for #39:

Budget 0x2013010000 Selects removed Time
1x compiles, 244,860 words 638 0.3 s
8x compiles, 240,105 words 2,296 0.4 s
32x compiles, 236,324 words 3,698 0.7 s
128x compiles, 231,749 words 2,490 0.9 s

At 32x all 43 Stray requests compile, and every module passes spirv-val --target-env vulkan1.3. The two slow shaders take 1.0 and 2.2 s.

Full suite with both merged, on Intel Arc (Mesa 26.2.3 ANV) and lavapipe: agc_driver_pixel_ancillary_word and agc_driver_alpha_to_coverage pass on both. The only failure is agc_driver_vop1_float_unary on Arc, which fails on main too.

One thing you may want to know: on both devices, agc_driver_emulated_color_compare passes with v3 alone. On main it fails with the sRGB sampling refusal, also with an empty shader cache. On lavapipe the same goes for agc_driver_image_plane_address_on_line_implicit_lod. I haven't looked into why.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114021265 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6114021265). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T21:33:53Z. --- @AlxcBTW `carry/pixel-ancillary-word-v3` (`db92ece3c`) merges cleanly onto `main` `a11c8f7f7` together with #3550 (`b58c0428`). The results match what I posted for #39: | Budget | `0x2013010000` | Selects removed | Time | |---|---|---|---| | 1x | compiles, 244,860 words | 638 | 0.3 s | | 8x | compiles, 240,105 words | 2,296 | 0.4 s | | 32x | compiles, 236,324 words | 3,698 | 0.7 s | | 128x | compiles, 231,749 words | 2,490 | 0.9 s | At 32x all 43 Stray requests compile, and every module passes `spirv-val --target-env vulkan1.3`. The two slow shaders take 1.0 and 2.2 s. Full suite with both merged, on Intel Arc (Mesa 26.2.3 ANV) and lavapipe: `agc_driver_pixel_ancillary_word` and `agc_driver_alpha_to_coverage` pass on both. The only failure is `agc_driver_vop1_float_unary` on Arc, which fails on `main` too. One thing you may want to know: on both devices, `agc_driver_emulated_color_compare` **passes** with v3 alone. On `main` it fails with the sRGB sampling refusal, also with an empty shader cache. On lavapipe the same goes for `agc_driver_image_plane_address_on_line_implicit_lod`. I haven't looked into why. AI-assisted: yes.
AlxcBTW commented 2026-10-11 21:35:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T21:35:10Z.


@ThatsLeo thanks for running it on two more devices. So v3 and #3550 merge cleanly and keep all 43 Stray requests compiling at 32x. I'll open #39 from v3 as soon as my intake slot frees up (#3546 pending). On the emulated_color_compare difference: on our RTX 5070 it fails with v3 too, so it doesn't look like v3 is what changes it. Possibly device-dependent; I'll note it rather than claim anything.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114032363 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6114032363). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T21:35:10Z. --- @ThatsLeo thanks for running it on two more devices. So v3 and #3550 merge cleanly and keep all 43 Stray requests compiling at 32x. I'll open #39 from v3 as soon as my intake slot frees up (#3546 pending). On the `emulated_color_compare` difference: on our RTX 5070 it fails with v3 too, so it doesn't look like v3 is what changes it. Possibly device-dependent; I'll note it rather than claim anything. AI-assisted: yes (Claude Code)
AlxcBTW commented 2026-10-11 21:36:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T21:36:46Z.


Opened as #4031 from carry/pixel-ancillary-word-v3, with @ThatsLeo's Arc/lavapipe results for v3 + #3550 in the description. It pairs with @MarcZX100's #3550.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114046701 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6114046701). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-11T21:36:46Z. --- Opened as #4031 from `carry/pixel-ancillary-word-v3`, with @ThatsLeo's Arc/lavapipe results for v3 + #3550 in the description. It pairs with @MarcZX100's #3550. AI-assisted: yes (Claude Code)
oneandonlydean commented 2026-10-12 02:47:45 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T02:47:45Z.


A fix is being tested: the masked-select pass does one walk per select, and since #3279 most of those walks run to the end of the program, so its cost grew to selects times program size. The replacement is a single backward pass with the same result. I will open it once it has been through the title checks, and ask you to try it on 0x200f780000 and 0x200f7a0000 then.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116840229 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6116840229). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T02:47:45Z. --- A fix is being tested: the masked-select pass does one walk per select, and since #3279 most of those walks run to the end of the program, so its cost grew to selects times program size. The replacement is a single backward pass with the same result. I will open it once it has been through the title checks, and ask you to try it on `0x200f780000` and `0x200f7a0000` then.
oneandonlydean commented 2026-10-13 02:06:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:06:58Z.


Closing: fixed by #4331. On its head 0x200f780000 and 0x200f7a0000 prepare in 0.9 s and 1.8 s and all 43 requests compile (ThatsLeo's replay on the PR). Reopen if Stray still trips the render-thread watchdog on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136594557 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3504#issuecomment-6136594557). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:06:58Z. --- Closing: fixed by #4331. On its head `0x200f780000` and `0x200f7a0000` prepare in 0.9 s and 1.8 s and all 43 requests compile (ThatsLeo's replay on the PR). Reopen if Stray still trips the render-thread watchdog on current main.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#3504
No description provided.