graphics: collect scalar reads without native recursion (Assassin's Creed Black Flag) #1967

Closed
github-bot wants to merge 4 commits from gh-pr/1967/head into gh-pr/1967/base
Owner

@⁠Nawid3333 on GitHub · 2026-10-29 04:55 UTC · original
Nawid3333:fix/scalar-read-stack → main · +156 −33 · 2 files · 4 commits · closed without merging

Tracker::CollectScalarRead walks every operand of the values it reaches with one native call per value, so its depth is the longest dependency chain of the shader. In Assassin's Creed Black Flag Resynced (PPSA28183), the walks at the loading screen go up to 2334 values deep (compute shader 0x38261e1654654fe6, 678 blocks). With one native frame per value, that overflows the stack of the thread that translates the shader (a std::jthread, 1 MiB by default on Windows), and the emulator exits with 0xC00000FD and no error message.

Game test (Assassin's Creed Black Flag Resynced, PPSA28183), Windows 11, RX 9070 XT: builds of main c528324d plus #1867, which fixes the earlier stop at sampled image descriptor 43 uses unsupported format 20, and a local input-script helper (not part of this PR) that presses the buttons through the first-launch menus.

  • Without this PR, every run exits with 0xC00000FD at the loading screen after the first-launch menus, about 5 minutes in. Crispy81 reported the same silent exit at the loading screen on #1792 (#1792).
  • With this PR, the game gets past the loading screen, plays the opening cinematic and reaches the Difficulty Tuning menu of a new game, with no error in three 15-minute runs. In a fourth run that confirms that menu, it starts loading the first mission (Animus loading screen) and then stops at a separate limit, image heaps exceed 65536 resident images (imageHeap.cpp:389).

To find the function, I used a local build that writes the return addresses on the stack when it overflows: almost all of them were nested CollectScalarRead calls under Tracker::Run, while a compute shader for an indirect dispatch was translated. A second local build logged the depth of every walk deeper than 256; the game has 59 of them, the deepest 2334.

Change: the walk keeps its pending operands on a std::vector. It visits them in the order of the recursion (the descriptor dwords of a scalar read, then its operands after the handle) and keeps the same visiting, visited and cycle rules, so it collects the same reads in the same order. #937 contains a similar explicit-stack CollectScalarRead as part of a larger Wolverine PR; this is only that walk, on current main.

Tests

  • deep scalar read dependencies (new, in resource_tracking_tests): a ReadConstBuffer sits behind 20000 FP additions and a one-input Phi that a global address uses as its low dword, so only this walk finds the read. TrackResources runs on a thread with a 1 MiB stack and must plan the read and replace its use with SRT slot 0. With c528324d's ResourceTracking.cpp, resource_tracking_tests exits with 0xC00000FD; with this PR it passes.
  • resource_tracking_tests and shader_cfg_tests pass on this branch on Windows (clang-cl); shader_cfg_tests also passes on c528324d.
  • CI (build and tests on Windows, Linux and macOS, including resource_tracking) passes on e104fb95, which merges main 4919fdb6 (the walk keeps 216bd28b's visited set and its order).

Fixes #2151: Ghost of Yōtei exits the same way (0xC00000FD) while it translates a 309-block compute shader; my measurements are in the comment below.

If you'd like this done differently, tell me and I'll change it.

Written with Claude Code (AI): it found the overflowing function, wrote the change, and ran the game and the tests on my PC (Windows 11); OpenAI Codex designed the test.

🤖 Generated with Claude Code

**@⁠Nawid3333** on GitHub · 2026-10-29 04:55 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1967) `Nawid3333:fix/scalar-read-stack` → `main` · +156 −33 · 2 files · 4 commits · closed without merging `Tracker::CollectScalarRead` walks every operand of the values it reaches with one native call per value, so its depth is the longest dependency chain of the shader. In Assassin's Creed Black Flag Resynced (PPSA28183), the walks at the loading screen go up to 2334 values deep (compute shader 0x38261e1654654fe6, 678 blocks). With one native frame per value, that overflows the stack of the thread that translates the shader (a `std::jthread`, 1 MiB by default on Windows), and the emulator exits with `0xC00000FD` and no error message. **Game test (Assassin's Creed Black Flag Resynced, PPSA28183), Windows 11, RX 9070 XT:** builds of main c528324d plus #1867, which fixes the earlier stop at `sampled image descriptor 43 uses unsupported format 20`, and a local input-script helper (not part of this PR) that presses the buttons through the first-launch menus. - Without this PR, every run exits with `0xC00000FD` at the loading screen after the first-launch menus, about 5 minutes in. Crispy81 reported the same silent exit at the loading screen on #1792 (https://git.gtahub.st/github/KytyPS5--KytyPS5/pulls/1792). - With this PR, the game gets past the loading screen, plays the opening cinematic and reaches the Difficulty Tuning menu of a new game, with no error in three 15-minute runs. In a fourth run that confirms that menu, it starts loading the first mission (Animus loading screen) and then stops at a separate limit, `image heaps exceed 65536 resident images` (`imageHeap.cpp:389`). To find the function, I used a local build that writes the return addresses on the stack when it overflows: almost all of them were nested `CollectScalarRead` calls under `Tracker::Run`, while a compute shader for an indirect dispatch was translated. A second local build logged the depth of every walk deeper than 256; the game has 59 of them, the deepest 2334. **Change:** the walk keeps its pending operands on a `std::vector`. It visits them in the order of the recursion (the descriptor dwords of a scalar read, then its operands after the handle) and keeps the same visiting, visited and cycle rules, so it collects the same reads in the same order. #937 contains a similar explicit-stack `CollectScalarRead` as part of a larger Wolverine PR; this is only that walk, on current main. **Tests** - `deep scalar read dependencies` (new, in `resource_tracking_tests`): a `ReadConstBuffer` sits behind 20000 FP additions and a one-input Phi that a global address uses as its low dword, so only this walk finds the read. `TrackResources` runs on a thread with a 1 MiB stack and must plan the read and replace its use with SRT slot 0. With c528324d's `ResourceTracking.cpp`, `resource_tracking_tests` exits with `0xC00000FD`; with this PR it passes. - `resource_tracking_tests` and `shader_cfg_tests` pass on this branch on Windows (clang-cl); `shader_cfg_tests` also passes on c528324d. - CI (build and tests on Windows, Linux and macOS, including `resource_tracking`) passes on e104fb95, which merges main 4919fdb6 (the walk keeps 216bd28b's visited set and its order). Fixes #2151: Ghost of Yōtei exits the same way (`0xC00000FD`) while it translates a 309-block compute shader; my measurements are in the comment below. If you'd like this done differently, tell me and I'll change it. Written with Claude Code (AI): it found the overflowing function, wrote the change, and ran the game and the tests on my PC (Windows 11); OpenAI Codex designed the test. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
CollectScalarRead walked every operand of the values it reached with one
native call per value, so its depth was the longest dependency chain of the
shader. A compute shader of Assassin's Creed Black Flag Resynced (PPSA28183)
goes about 2600 calls deep at the loading screen and overflows the 1 MiB
stack of the thread that translates it (0xC00000FD, no error message).

The walk now keeps its pending operands on a std::vector. It visits them in
the order of the recursion (descriptor dwords of a scalar read, then its
operands after the handle) and keeps the same visiting, visited and cycle
rules, so it collects the same reads in the same order.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The test hides a ReadConstBuffer behind 20000 FP additions and a one-input
Phi that a global address uses as its low dword, so only CollectScalarRead's
walk from that descriptor finds the read. TrackResources runs on a thread
with a 1 MiB stack, the Windows default, and must plan the read and replace
its use with SRT slot 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keeps the explicit-stack walk on top of 216bd28b: the visited set is now an
unordered_set checked before the cycle test, as on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:10:22 +00:00
github-bot closed this pull request 2026-11-26 10:10:22 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-29 05:03 UTC · original · edited 2026-10-30 19:48 UTC

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between d9a1023517 and e104fb951e.

Files selected for processing: 2
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • tests/ResourceTrackingTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

Walkthrough

CollectScalarRead now traverses typed planning-value dependencies with an explicit stack instead of recursive calls. The existing cycle checks, handle validation, descriptor-source collection, and immediate U32 offset rule remain. A new test builds a 20,000-operation dependency chain and checks resource planning on a 1 MiB worker-thread stack.

Suggested reviewers: nmzik

Priority: Normal

Change: Bug fix

Merge Risk: Minimal · up to e104f

The change preserves scalar-read planning order. No merge-blocking risk was identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: replacing native recursion in scalar-read collection. It also names the affected graphics area and relevant game case.
Description check Passed The description directly explains the stack-overflow problem, implementation change, test coverage, and observed results. It is fully related to the changeset.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Warning

Some tools did not complete. Review the errors below.

Cppcheck (2.22.0)
tests/ResourceTrackingTests.cpp

Cppcheck timed out; analysis of this file is incomplete

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-29 05:03 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1967#issuecomment-6488428879) · edited 2026-10-30 19:48 UTC <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1967?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. <details> <summary><strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Recent review info</strong></summary> <dl> <dd> <!-- review_info_content --> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary> <dl> <dd> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/4919fdb6e6e28f46f1f5df8cf931a7a0823cb93f/.coderabbit.yaml>) - **Commit**: [4919fdb](<https://github.com/KytyPS5/KytyPS5/commit/4919fdb6e6e28f46f1f5df8cf931a7a0823cb93f>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `84904c8b-a969-4834-9ef9-68ebb23bd11c` </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between d9a1023517d8cfbb68bfc1a2ba05175da3f403a5 and e104fb951e07cf430ceebb3dfd7412b09a0e1c59. </dd> </dl> </details> <details> <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 2</strong></summary> <dl> <dd> * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `tests/ResourceTrackingTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> `CollectScalarRead` now traverses typed planning-value dependencies with an explicit stack instead of recursive calls. The existing cycle checks, handle validation, descriptor-source collection, and immediate U32 offset rule remain. A new test builds a 20,000-operation dependency chain and checks resource planning on a 1 MiB worker-thread stack. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <strong>Priority: <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/priority-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Normal</strong> <!-- change_assessment_commit:"e104fb951e07cf430ceebb3dfd7412b09a0e1c59" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-unassessed-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minimal</strong> · up to <code>e104f</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `e104f` --> <!-- final_review_risk_coverage:{"sourceCommitId":"e104fb951e07cf430ceebb3dfd7412b09a0e1c59","coveredCommitId":"e104fb951e07cf430ceebb3dfd7412b09a0e1c59","kind":"reviewed"} --> The change preserves scalar-read planning order. No merge-blocking risk was identified. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 warning</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :----------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly identifies the main change: replacing native recursion in scalar-read collection. It also names the affected graphics area and relevant game case. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains the stack-overflow problem, implementation change, test coverage, and observed results. It is fully related to the changeset. | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 5 functions across 2 files. **Resolution** Write docstrings for the functions missing them to satisfy the coverage threshold. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- This is an auto-generated comment: all tool run failures by coderabbit.ai --> > [!WARNING] > Some tools did not complete. Review the errors below. > > <details> > <summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/wrench-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/wrench.svg" width="16" height="16" align="absmiddle" alt=""></picture> Cppcheck (2.22.0)</strong></summary> > <dl> > <dd> > > <details> > <summary><strong>tests/ResourceTrackingTests.cpp</strong></summary> > <dl> > <dd> > > Cppcheck timed out; analysis of this file is incomplete > > </dd> > </dl> > </details> > > </dd> > </dl> > </details> <!-- end of auto-generated comment: all tool run failures by coderabbit.ai --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1967)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠Nawid3333 on GitHub · 2026-10-29 05:23 UTC · original

The next stop after this PR, in case it helps with the image heap: after Difficulty Tuning the game shows the loading screen of the first mission, then exits with image heaps exceed 65536 resident images (imageHeap.cpp:389), about 12 minutes in.

A local diagnostic build (not part of this PR) logged the heap when it reached 65536 elements:

  • 65473 elements are referenced. Only 62 wait to be retired (released 62, retired 0, stale 0).
  • There are 2 tables with 11 views. One table (base 0x4065100000, 0xdb6800 bytes, 449344 descriptors of 32 bytes) has 10 views and 59875 of the elements. All 10 views use step 32 and no limit. They start at first = 0, 32, 64, 96, 128, 160 and 320 bytes; the four that start at 0 differ in their profile.
  • Seven of these views hold 7481 elements each and one holds 7476; the other two hold 25 and 7.

The large views cover the same table from start offsets at most 320 bytes apart and hold nearly the same number of elements, so it looks like the heap stores the same descriptors once per view (view.elements in ImageHeap::Intern). Each view also has its own slot array over the whole table (3594753 slots).

**@⁠Nawid3333** on GitHub · 2026-10-29 05:23 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1967#issuecomment-6488729866) The next stop after this PR, in case it helps with the image heap: after Difficulty Tuning the game shows the loading screen of the first mission, then exits with `image heaps exceed 65536 resident images` (`imageHeap.cpp:389`), about 12 minutes in. A local diagnostic build (not part of this PR) logged the heap when it reached 65536 elements: - 65473 elements are referenced. Only 62 wait to be retired (released 62, retired 0, stale 0). - There are 2 tables with 11 views. One table (base `0x4065100000`, `0xdb6800` bytes, 449344 descriptors of 32 bytes) has 10 views and 59875 of the elements. All 10 views use step 32 and no limit. They start at `first` = 0, 32, 64, 96, 128, 160 and 320 bytes; the four that start at 0 differ in their profile. - Seven of these views hold 7481 elements each and one holds 7476; the other two hold 25 and 7. The large views cover the same table from start offsets at most 320 bytes apart and hold nearly the same number of elements, so it looks like the heap stores the same descriptors once per view (`view.elements` in `ImageHeap::Intern`). Each view also has its own slot array over the whole table (3594753 slots).
Author
Owner

@⁠Nawid3333 on GitHub · 2026-11-01 23:20 UTC · original

Ghost of Yotei (PPSA26344) stops in the same recursion. It is the stop #1599 reports: 0xC00000FD while translating a large compute shader (about 308 blocks, 7 loops).

  • On main 893b03552 (RX 9070 XT, Windows 11): the game exits with 0xC00000FD while it translates CS 0xc7d37e2ca4c818a4 (309 blocks after structurization, 7 loops). The log ends at "native IR before resource tracking". A lab-only census of the return addresses on the overflowed stack finds 1191 frames in Tracker::CollectScalarRead.
  • With this PR merged into the same build: the shader goes through resource tracking and SPIR-V emission (139324 words), and the game runs on to its next stop. That stop is unrelated: !Allocate(layout, fresh_batch) at descriptorHeap.cpp:57, the error GTA V's RT mode reports in #829.
**@⁠Nawid3333** on GitHub · 2026-11-01 23:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1967#issuecomment-6565416695) Ghost of Yotei (PPSA26344) stops in the same recursion. It is the stop #1599 reports: 0xC00000FD while translating a large compute shader (about 308 blocks, 7 loops). - **On main 893b03552 (RX 9070 XT, Windows 11):** the game exits with 0xC00000FD while it translates CS `0xc7d37e2ca4c818a4` (309 blocks after structurization, 7 loops). The log ends at "native IR before resource tracking". A lab-only census of the return addresses on the overflowed stack finds 1191 frames in `Tracker::CollectScalarRead`. - **With this PR merged into the same build:** the shader goes through resource tracking and SPIR-V emission (139324 words), and the game runs on to its next stop. That stop is unrelated: `!Allocate(layout, fresh_batch)` at `descriptorHeap.cpp:57`, the error GTA V's RT mode reports in #829.
Author
Owner

@⁠Nawid3333 on GitHub · 2026-11-09 14:39 UTC · original

Superseded by 26ad49a66 in main, which collects the scalar reads on an explicit stack. This PR's test (20,000 FP dependencies hiding a scalar read, on a 1 MiB stack) passes on main f399d4818 on Windows. Closing this one.

**@⁠Nawid3333** on GitHub · 2026-11-09 14:39 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1967#issuecomment-6742795829) Superseded by 26ad49a66 in main, which collects the scalar reads on an explicit stack. This PR's test (20,000 FP dependencies hiding a scalar read, on a 1 MiB stack) passes on main f399d4818 on Windows. Closing this one.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.