fix(shader): guard shared loop exit routing and preserve valid fallbacks #2471
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2471"
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 boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-09T22:26:04Z.
What
Selections inside natural loops can repeatedly split shared exit joins until
CFG shared merge splitting exceeded budget. Guarded shared-exit routing lets additional valid graphs structure while refusing fallback outputs that fail the construct checks. Shared nested continuations are privatized to keep their branches inside the enclosing construct.This change is updated onto main
a11c8f7f7, head3943287d63. The topic diff contains only the control-flow implementation/header and synthetic ControlFlow/Structurizer tests. AlxcBTW's underlying #20/#24 work retains author credit; main's #2941 iteration-selection behavior is preserved. The overlapping three-line global-join fallback was removed after differential testing. AlxcBTW found it adds valid large-block cases to main alone, but later passes in this stack recover those cases; removing it changes some valid outputs. The separate shared-exit continue-join helper remains, so this does not supersede that entire helper.Two synthetic regressions exercise the shared continuation and padded large-block case. The original local title capture passed an earlier guarded head with 35 additional blocks, zero instruction clones and zero routing variables; that historical result is not a fresh title replay on this head. Title code, assets and serialized captures remain local.
Tested
Validation (Windows 11 / MinGW GCC 15.2):
77bd928a: two complete 30,000-case differential runs, at 16 and 1000 words/block, with 6,883 / 6,633 formerly failing cases fixed, zero status regressions and zero new invariant failures.77bd928adetects 23 warned outputs in 100 attempts; external validation rejects 15 of its 25 emitted modules. These are synthetic inputs, not title captures.a11c8f7f7preserves the topic implementation/header and both test files from bb5756097. Main changed GraphBuilder and request serialization, so focused ControlFlow and Structurizer executables were freshly compiled/linked with the current-main shader library and the topic Structurizer override; both pass. A complete 30,000-case 16-word comparison and 500-case 1000-word comparison have identical statuses/error text to the previous topic head. The local fuzz harness does not hash output identity or isolate cases in subprocesses. Conventions and diff checks pass. No standalone whole-project build/suite or playable-game result is claimed on this head.Independent validation, attributed to AlxcBTW's report: full-graph hashes and structured/post-dominator/original-target reachability checks on four 30,000-case seed-3 corpora plus 60,000 random reducible graphs found no invalid outputs or regressions for bb5756097. Small-block outputs match 1773c64b; some large-block outputs differ and remain valid. Their Windows median of three on 500 large-block graphs is 8.5 s for bb5756097 versus 27.9 s for a396b019. b0e6631f fired zero times in 210,000 runs on the guarded head and changed no outputs. These are their results, not additional local runs; the separate ordinary-dominance harness warnings have now been investigated and corrected locally as described above. Mouhand-Kaddo also reports three focused Linux CPU checks passing on bb5756097; no GPU/title result is claimed.
The guarded fallback still needs maintainer review; the former local end-to-end construct warnings came from the harness membership calculation and are no longer unexplained on these samples. Alxc's smaller b0e6631f early-refusal change was independently cross-tested on the previous a396b019 head with identical statuses/error text across both 30,000-case runs; it remains a separate alternative rather than being silently folded into this replacement.
Checklist
Based on current main
a11c8f7f7; shader control-flow topic onlyUnderlying collaborator commits credited; #2941 behavior retained
Generic synthetic regressions; no title data or investigation artifacts
No new third-party dependencies; unsupported paths retain errors
Conventions and diff checks pass
AI-assisted: yes (Codex); author remains responsible for review
Depends on: none (the underlying current-main changes are already included in the base)
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T22:53:48Z.
Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-10T10:04:56Z.
Additional platform validation on standalone PR head
f088fb73646e2e5ee3924cfbdfb9736a350e2dd5:Linux: passed — Arch Linux in WSL2 (kernel 6.6.87.2), GCC 16.2.1 20260810; CMake 4.3.1 / Ninja.
Release /
BUILD_TESTING=ON: built the selected test targets; 3 CTest cases, 0 failures, 0 CTest skips.Tests:
agc_structurizer,agc_spirv_module,agc_shader_control_flow.Reproduce after building the test targets:
ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_(shader_control_flow|structurizer|spirv_module)$".Vulkan: Mesa lavapipe 26.2.4 software Vulkan; no native Linux GPU/retail-title validation.
Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T13:15:42Z.
Fuzzed this against
maina29ef592with random structured programs (30,000 graphs throughStructurize, oracle =requireStructuredBranchesfromtests/Structurizer.cpp; samples throughRecompilewith SPIRV-Tools validation). Harness and commands: https://github.com/orishamir/anyps5-cfgfuzz.mainregress.Recompile: 60 valid, 104Selection must be structured, 6 valid but failingverifyStructured, 24 still over budget, 6 refused. The rule flags 225 graphs onmainalready (#2762); with this PR 1,526.Minimal case, budget on
main, invalid SPIR-V here. Intests/Structurizer.cpp:Structurized with this PR (10 -> 13 blocks):
SPIR-V allows a merge-less
OpBranchConditionalonly as a direct break or continue, so conditionals whose arm reaches the junction need their ownOpSelectionMerge, or the junction has to be the loop's merge block. Same shape as a wave64 compute shader throughrecompile()intests/ControlFlow.cpp:main:CFG shared merge splitting exceeded budget: originalBlocks=11 currentBlocks=55 splitBudget=44. This PR:SPIR-V validation before optimization failed: level=2 word=219: Selection must be structured OpBranchConditional %150 %31 %30.Suggestion: run
requireStructuredBrancheson this PR's test graphs (verifyStructuredintests/ControlFlow.cppdoes not check that rule), and only returncommonExitwhen every conditional that branches to it directly has a merge.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T13:31:50Z.
One more data point, this time with large blocks. Real shaders reach
privatizeSharedReturnsonly when a block'sestimatedSpirvWordsexceeds 256 (the test graphs with 0 words never do, as noted on #2642), so I reran the same 30,000 programs with 1,000 words per block and with one random 1,000-word block per program.mainstructurizes (0 regressions with the fork fix from #2642 alone, in every configuration). One random large block: 589 fixed, 0 regressions.tests/Structurizer.cpp(set the words like thesharedDiscardcase does):With 0 or 16 words per block both builds throw the budget error on this graph; from 300 words up
mainsucceeds and this PR does not.v_add_f32per block (about 1,100 estimated words each) gives valid SPIR-V onmain(1,888 words, 14 -> 48 blocks) and on the #2642 fix, and the budget error with this PR (originalBlocks=16 currentBlocks=102 splitBudget=64). Words below.shader words (414 dwords)
Harness: https://github.com/orishamir/anyps5-cfgfuzz (
run ... 1000 10andrun ... 16 10 1000,reduce2.pyfor the two-sided reduction,e2e/cfg2shader.py --pad 17). AI-assisted: yes (Claude Code).Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-10T17:37:21Z.
Thank you for the reduced cases and differential checks. I reproduced both on rebased head 470f51ce using Windows 11 / MinGW GCC 15.2.0:
requireStructuredBranches(a conditional without a merge whose targets are neither the loop merge nor continue).originalBlocks=13 currentBlocks=83 splitBudget=52.These are confirmed gaps in this PR, not passing coverage from the existing tests. I am adding both regressions and repairing the merge selection/retry behavior, then will recheck the 007 stop-9 case and the existing structured-branch oracle before updating the branch. I will also cross-test AlxcBTW's #2642-related changes. Please keep this draft while that work is underway.
AI-assisted reproduction and investigation (Codex).
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-10T22:12:31Z.
Linux cross-test of a396b019. Setup: CachyOS (kernel 7.2.9, GCC 16.2.1), RTX 3080 (NVIDIA 615.71.09), Release.
Head a396b019 on
main262c0316, SPIRV-Tools onagc_structurizer,agc_shader_control_flowandagc_spirv_module.video_out_flip_*tests, under ctest's offscreen SDL driver.agc_driver_dcc_keys_first_write, a known failure on this machine (#2767) in the texture refresh path, which this PR doesn't touch.agc_shader_replayrebuilt atmainand at each of the six commits. At every one of them it passes SPIR-V validation, then stops wheremaindoes:multisampled image resources have no descriptor image shape.007 First Light on the #2523 stack, SPIRV-Tools off
The stack is 79dd488f with #2992 and the local commits from #2523. 78ad086b is cherry-picked on top; its
ControlFlow/is identical to a396b019's. One run with default asynchronous draws, compared with the same stack without 78ad086b:WAIT_REG_MEM_64stall described in #2523, after frame 144 (168 without the commit). The lowest available memory is 27.2 GiB against 27.5 GiB, and peak RSS is 20.3 against 20.4 GiB, within run-to-run variation.agc_shader_replayoutput with and without 78ad086b. The build without it also lacks #2992, which the replay tool doesn't link. One of the four is #2523's stop-9 shader (125 blocks). All four get past the structurizer. Three then stop in runtime-source evaluation (SrtWalker::EvaluateRuntimeSources), and one stops at the multisampled descriptor shape (the #1921 shader above).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by orishamir on 2026-10-10T22:51:05Z.
Where the compile-time cost on
78ad086bgoes (the 3.5x from #2523): gprof plus an instrumentedintersectSorted, the first 500 corpus3 graphs at 1,000 words per block, structurized in one process,0b56b7adas the baseline since the branch is that plus your commits.originalBlocks=21 currentBlocks=105 splitBudget=84), 449 (67 -> 763), 343 (9 -> 620), 383 (18 -> 373), 262 (22 -> 252), 14 (21 -> 235), 112 (19 -> 118), 264 (44 -> 102). Graph 79 as succ lists:1;2,3;4;5;6,7;;8;1;9,10;11,12;4;13,8;10,14;15,16;17,18;5;19,10;5;8;12.intersectSortedcalled fromcomputeDominatorTree. The tree is recomputed about as often as before (1.195M vs 1.185M calls over the 500 graphs, 96% fromapplyBlockOrder), but the sets it intersects are much larger: 8.9M intersections with the two inputs summing to 479 entries on average (max 1,464) against 2.4M summing to 50 (max 380). So on the failing graphs the fallback works on intermediate graphs of several hundred blocks before the budget stops it. The jump arrives with78485b6d: 1.2 s on0b56b7ad, 4.8 s on78485b6d, 4.7 s on0e4c5185, 4.5 s here.Driver, scripts, both gprof profiles and the per-graph timings: https://github.com/orishamir/anyps5-cfgfuzz/tree/main/prof.
AI-assisted: yes (Claude Code Fable 5.1 xhigh)
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T01:02:24Z.
@Scramblrrrr @orishamir I traced the slowdown orishamir measured.
The fourth pass routes the same loop again and again.
routeLoopExitssends each exit edge through an assignment block into a new junction, and that junction becomes the merge. A selection whose arms both reached a non-merge exit now reaches that assignment block with both arms, sohasSharedExitSelectionpicks the same loop again.canonicalizeNaturalLoopskeeps routing it until the rewrite budget (2n+16) throws.Structurizethen reports the second pass's error, so nothing shows in the result.Graph 79 routes one loop 55 times and grows from 20 to 732 blocks. The new blocks are appended against flow order, so
computeDominatorTreeneeds more sweeps every round, up to 332 for the last tree. Those are the large intersections in the profile. Across all 30,000 corpus3 graphs at 1,000 words, 1,410 route a loop again in that pass, and every one of them fails.Fix:
canonicalizeNaturalLoopsthrows when it would route the loop it routed in the previous rewrite. Once a loop is routed, onlyhasSharedExitSelectioncan pick it again, and routing it again just adds another junction layer of the same shape, so the pass can't end any other way. It's 7 lines, commit b0e6631f, directly on a396b019 and ready to cherry-pick.Timings use orishamir's
prof.cppon the first 500 corpus3 graphs at 1,000 words. This was Windows, MinGW GCC 15.2 -O2, median of 3, so it's slower than his Linux numbers. Columns are 0b56b7ad / a396b019 / fix:The result is identical on every graph, meaning the same structurized graph or the same error. I checked all 30,000 corpus3 graphs at 0, 16, 100 and 1,000 words and at 16 with one 1,000-word block, plus 60,000 random reducible graphs.
agc_structurizer,agc_shader_control_flowandagc_spirv_modulepass, and so does the non-GPU suite (459/459).#2471 no longer merges into
main. Since #2941 landed, itsiterationSelectionMergeconflicts withjoinWithinIterationfrom myd692b963infindSelectionMerge, so I couldn't run CI on the stack. That conflict is in my commit. I'm checking whether #2941 already coversd692b963's shape, and I'll post a rebased stack on currentmainwith the same corpus comparison. The fix itself only touchescanonicalizeNaturalLoops, which #2941 doesn't change.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T01:25:05Z.
Thanks @AlxcBTW — that is the same repeated-routing hot spot I saw. Your early refusal is a useful minimal fix because it preserves existing outputs; I am reviewing b0e6631f before choosing the PR path.
I already pushed the broader experiment on the tracking issue: the narrower synthetic-forwarder skip is 260a68b0 (only empty goto assignment -> current loop merge, not ordinary original empty blocks). It accepted two invalid SPIR-V outputs in a new synthetic shader sample, so it is not in #2471. With candidate checks on every pass and a direct conditional-exit check, c88762c4 passes both 30,000-program corpora vs a396b019: +1740 / +1597 graph fixes, zero regressions/new invariants/changed counts for formerly OK outputs. Two 400-attempt shader samples emit 780 modules, all externally Vulkan 1.3 valid. Internal verify warnings remain. This is a broader behavioral experiment, not an output-identical alternative to your early-refusal change.
Rebase work is public for coordination: 77c157d4 on
codex/shared-loop-exit-current-mainpreserves #2941 and joinWithinIteration, with the one shared-tail regression now expecting no routing because main handles it directly. Focused control-flow tests pass, but the 400-attempt external sample has invalid outputs. I am comparing them against current main rather than labeling them as regressions. Do not use it as a ready head. The guarded rebase experiment is 1773c64b oncodex/shared-loop-exit-current-main-guarded; its corpus and sample checks are running. If #2941 supersedes your d692b963 shape, I agree it is better to drop redundant machinery rather than carry both indefinitely. #2471 remains at a396b019 until the rebase is verified.AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T01:30:52Z.
Correction to one metric in my Windows fuzz updates: the fourth field in this harness's results is the input block count, not the structurized output count. The parser's zero
changed_successful_block_countstherefore does not establish unchanged output graphs. Please disregard that metric in my 260a68b0/c88762c4 reports (and the earlier Windows comparisons using that parser). The status-based fix/regression/invariant counts and the separate external SPIR-V validations are unaffected. The independent Linux checks reported by others use their own harness and are not affected by this correction.I am reporting status and validator results separately from output identity. The guarded old-base experiment c88762c4 remains +1740/+1597 across 30,000 cases each, zero status regressions/new invariants, with 780 emitted sample modules externally valid. The guarded current-main candidate 1773c64b also emits 780 externally valid modules across its 800 attempts, with internal verifier warnings retained. Its full graph comparison against main is still running, so it is not in #2471 yet.
AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T01:49:49Z.
@AlxcBTW Windows cross-test of your b0e6631f directly on a396b019 is complete: all 30,000 cases at 16 words/block and all 30,000 at 1000 have the same status and error text as a396b019. This harness does not record output identity, so I am not claiming graph identity from those results. The a396b019 focused control-flow tests pass against b0e6631f. A single serial 500-case/1000-word run took 2.37 s here (not a median or a controlled cross-machine benchmark).
The guarded current-main behavioral experiment 1773c64b also completed its comparisons against
77bd928a: +6883 / +6633 fixes, zero status regressions/new invariant failures in the 30,000/30,000 cases, and all 780 emitted modules from the 800 synthetic shader attempts externally Vulkan-1.3 valid. It remains separate from this PR while we settle the #2941/base overlap. Your minimal early-refusal change is still the preferable small performance follow-up if retaining the current accepted-output behavior.AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T02:10:48Z.
@AlxcBTW I tested removing just the overlapping global-join fallback from the guarded main rebase (the three-line
trueJoins && isInsideLoopConstruct(...globalMerge)->joinWithinIterationblock). The iterationSelectionMerge path from #2941 stays, as does the separate shared-exit continue-join use of joinWithinIteration. Public experiment 3dc6b73a, parent 1773c64b: https://github.com/Scramblrrrr/AnyPS5/tree/codex/shared-loop-exit-main-overlap-reduced .Both 30,000-case Windows comparisons at 16 and 1000 words/block have identical statuses and error text to 1773c64b; output identity is not recorded. Focused control-flow tests pass. Across 800 synthetic shader attempts, 780 emitted modules all externally Vulkan-1.3 validate, with no execution-equivalence warnings. Internal construct-verifier warnings remain: 92 in the original 400-attempt sample, 90 in the new sample (the latter was 86 on 1773c64b). So this is a simplification candidate, not a claim that every output is identical or that all internal checks are clean. Conventions pass. This does not remove your entire d692b963 helper, because our shared-exit continue path still uses it.
AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T02:55:45Z.
@AlxcBTW I have moved the tested overlap-reduced version onto current main
961b25fe2and updated this draft to bb5756097 so review is no longer blocked by the stale #2941 conflict. The control-flow sources/header and both test files are byte-for-byte unchanged from 3dc6b73a; the matching focused executable was rerun and conventions pass. GitHub now reports MERGEABLE. The description has been rewritten around the current implementation and explicitly retains the internal-warning counts and lack of output-identity data.This stays a draft: I am not treating the remaining internal construct warnings as resolved or claiming a fresh 007 replay on this head. Your b0e6631f minimal early-refusal alternative remains separate and credited in the description. The previous a396b019 head is still available in the history/comments for comparison. The live 007 experiment uses 5fd30d503 in a separate runtime worktree; this PR update did not change its loaded driver.
AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-11T03:38:39Z.
@Scramblrrrr here are the results for your heads.
Our harness hashes the whole structurized graph: blocks, terminators, dom/post-dom sets, loops and components. It also checks every output:
hasStructuredConstructschecks,The corpora are orishamir's 30,000 seed-3 graphs at 0, 16 and 1,000 words and at 16 with one 1,000-word block, plus 60,000 random reducible graphs.
bb5756097 (= 3dc6b73a) vs 1773c64b. Status is the same on every graph, and neither has an invalid output.
{{1}, {2, 3}, {4, 5}, {6}, {7, 3}, {1, 8}, {5}, {3, 1}, {}}at 1,000 words has 18 blocks with the fallback and 27 without.{{1}, {2, 3}, {4, 5}, {5}, {6, 3}, {1, 7}, {3, 1}, {}}at 16 words, 13 vs 12 blocks. With the fallback there's an extra empty forwarder before the copy of 3.Is the dropped block covered by #2941? On plain
mainat 0 and 16 words, yes: same outputs on all 30,000 graphs. With big blocks, no:main+ the block structurizes 5 more corpus graphs at 100 words and 20 more at 1,000, all valid; the 9-block graph above is one of them. In your stack the later passes pick all of them up. So dropping it costs no structurizations, only the 21 different outputs.b0e6631f vs 45481ea4. 45481ea4 already stops the repeated routing. After
routeLoopExits, every non-merge exit is a forwarder into the merge, sohasSharedExitSelectioncan't pick the loop again. On bb5756097, the b0e6631f check fired 0 times in 210,000 runs, and outputs are identical with and without it, so there's no need to carry it. 45481ea4 also lets that pass continue: it structurizes 811 more graphs at 1,000 words than 77c157d4 + b0e6631f, all valid.Timing on orishamir's 500 graphs at 1,000 words (Windows, median of 3):
main: 4.8 sGraph 79 now structurizes in 43 ms. Most of bb5756097's time is graph 449 (3.9 s), which now structurizes;
mainrefuses it after 2.5 s.Invalid outputs. bb5756097 never takes a graph from valid to invalid or failed, compared with either a396b019 + b0e6631f or
main. 77c157d4's 1,937-2,182 invalid outputs come frommain's first two passes, and your conditional-exit validation in 1773c64b removes every one.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-11T07:54:52Z.
Additional platform validation of standalone PR head
bb57560979875c78277a72d2868315f61c548aea(2026-10-11):Linux: passed — Arch Linux in WSL2 (kernel 6.6.87.2), GCC 16.2.1 20260810; CMake 4.3.1 / Ninja; Release,
BUILD_TESTING=ON.3 checks, 0 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run.
Checks:
agc_structurizer,agc_spirv_module,agc_shader_control_flow.Command after building:
ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^agc_(shader_control_flow|structurizer|spirv_module)$".This scope checks CPU-side behavior; no GPU execution result is claimed.
No title/gameplay validation. These results cover the standalone head, not a merge with current main.
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T12:54:01Z.
@AlxcBTW Thank you for the full-graph hashes and independent structured/reachability checks. This fills the output-identity gap in my status/error-only comparisons. I will link your exact corpora and results in the description rather than presenting them as my own run.
Your distinction about the removed fallback is helpful: it is redundant on plain main for the small-block corpus, but not on main alone for large blocks; the later passes in our stack recover those cases, with some different valid outputs. I will correct that explanation. I also agree b0e6631f should remain out of this stack: your zero firings and identical outputs on the guarded head are stronger evidence than my older-head status check. The median-of-three timing and graph-449 observation are useful and will stay attributed to your Windows runs.
Main has since changed GraphBuilder/RequestSerializer, so I will validate that update separately before advancing this draft. My separate synthetic end-to-end internal warnings remain disclosed; I am not equating your corpus result with resolving that other sample. Thanks also to Mouhand-Kaddo for the focused Linux CPU checks.
AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-11T13:23:25Z.
Rebased onto main
a11c8f7f70, new head3943287d63. Topic implementation/header/tests unchanged from bb5756097, but GraphBuilder/request serialization changed on main, so the focused executables were freshly compiled/linked with the current-main shader library and the topic Structurizer override. ControlFlow and Structurizer pass; 30,000 16-word cases plus 500 1000-word cases have identical statuses/error text to the prior topic head. No full standalone suite or output-hash claim for these local runs.The remaining local end-to-end warnings were a harness error: it used ordinary dominance for construct membership instead of structural dominance (including declared merge/continue edges). In synthetic case 8530, a loop-body selection incorrectly included blocks after its enclosing loop merge. Independently recomputing structural dominance in the local harness fixes that attribution without changing the production implementation or suppressing errors. Across both synthetic corpora, both padding sizes and wave32/wave64: 800 attempts, 780 emitted, 780 externally Vulkan 1.3-valid, zero construct/structured-branch/execution-equivalence warnings. Negative control with old main
77bd928a: 100 attempts, 25 emitted, 23 warned outputs and 15 externally invalid modules, so the corrected checker still detects failures. Historical warning counts remain described with this correction in the PR body.Thanks again @AlxcBTW for the independent full-graph/structured-dominance validation; it helped isolate this discrepancy. Description and conventions updated; marked ready for maintainer review. No title code/captures uploaded. AI-assisted (Codex).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:23:52Z.
Checked on current main: build and scoped ctest (libSceAgc, libSceAgcDriver) green,
agc_structurizer,agc_structurizer_intersection_offandagc_shader_control_flowpass and all three fail with theStructurizer.cpp/.hppchange reverted. The extra passes only run after the two existing ones fail and every candidate is validated byhasStructuredConstructs, otherwise the original error is rethrown, so graphsmainstructurizes are unchanged. The large-block and shared-exit regressions reported by orishamir are covered by the new tests, and AlxcBTW's full-graph hash checks apply to the same code. Merging.Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-11T21:28:58Z.
Windows Demon's Souls shader replay result: the legal PPSA01342 v1.04 startup capture below still fails after this merged into main
14a7e64dc:Initial validation passes; the first failing optimizer pass is block merging. A semantic self-loop ends up with its instruction block as the continuation, and merging folds that continuation into the empty loop header. A synthetic loop containing a buffer store reproduces the same failure on current main.
#4018 adds a dedicated empty continue target for that self-loop and preserves this PR's inner-loop latch handling. Both the synthetic regression and the captured game shader pass with it; the current focused ControlFlow, Structurizer and optimizer tests pass 3/3 on Windows. This is shader preparation evidence, not a Demon's Souls main-menu result. The private game capture remains local.
AI-assisted: yes (Codex).