gpu: make guarded address ranges resident before the shader runs #1506

Open
github-bot wants to merge 2 commits from github-bot/gh-1506 into main AGit
Owner

@⁠NeySlim on GitHub · 2026-10-14 11:56 UTC · original
NeySlim:fix/bda-range-residency → main · +607 −0 · 9 files · 2 commits · open

Tested in God of War Ragnarok (PPSA08332, 05.005).

On the first boot, the first shot of the intro video (after "Sony Interactive Entertainment presents") plays as green and magenta blocks, and so does the God of War recap video started from the menu, until the next cut. Later shots are clean, and playing the recap a second time in the same session is clean too.

Cause: the Bink decoder runs on the GPU. Its DC prediction pass (CS 0x5c046e9ef798f2bc) reads a bit table with global_load_dword v19, v13, s[0:1], base from user data, offset ((row >> 5) + 8) << 4 with row = step - lane, behind an EXEC guard row < height (v_cmp_gt_u32 + s_and_saveexec). The page holding the table has no buffer in the buffer cache yet, so the BDA read returns 0 and sets a fault bit. The fault path creates the buffer after the dispatch, a few frames later. The key frame is predicted from a zero table and the P frames carry the error until the next key frame.

Change:

  • ExtractResourcePlan records, for each Global/Flat/ScalarAddress access whose base the host can evaluate, an upper bound of its 32-bit offset. The bound comes from the shape of the offset (add, mul, immediate shifts, and/min/max, or, bfe, lane id, a select whose condition is implied by the access predicate) or from an unsigned compare that the access predicate requires (the EXEC guard). Leaves are values the host already evaluates (user data, SRT reads). No proof means no range, and the access keeps the fault path.
  • MaterializeResources evaluates the bounds with the strict reader (no read outside the mapping). A result that does not fit in 32 bits gets no range, since the shader offset could wrap. The ranges go into ResourceSnapshot::address_ranges.
  • RenderExecutor::FindBuffers calls the new RenderContext::MakeAddressRangeResident for them, before the descriptor buffers: FindBuffer on the GPU-mapped parts of each range. Ranges above 256 MiB are skipped, like unbounded descriptor ranges.

This is not the GPU-side scalar load change that was reverted (5b68a26c, reverted in 1c301c9a because it hung the GPU on this same shader), and not #1344, which made those scalar loads resident: no load moves from the host to the GPU here. The vector load already uses BDA on main; the host only creates buffers before the dispatch for ranges it can bound from the access itself, and anything it cannot prove stays exactly as on main.

Limits: accesses through a 64-bit per-lane pointer, and offsets that cannot be bounded (loop counters, values read from memory), still go through the fault path and read 0 the first time.

Testing (Linux, Radeon 8060S, RADV 26.2.3):

  • New GPU test AddressRangeResidency (--address-range-residency-only): real direct memory and RenderContext, DispatchDirect of a shader shaped like the game's (s_load, row = step - lane, v_cmp_gt_u32, s_and_saveexec, SADDR global_load_dword, buffer_store). Without the change: "lane 9 read 0 instead of 4127".
  • New CPU test TestAddressRangesFollowAccessGuards (resource_materialization): exact range, no range without the guard, no range when the bound can overflow.
  • Mutations, one at a time: without the residency call (GPU test fails), without the guard facts (CPU and GPU fail), without the overflow check, the strict decrement or the implied select (CPU fails). Calling FindBuffer only on the end of the range is caught too, as the table straddles a cache page.
  • GPU suite, one case per process: 638 cases, the same 10 failures as main plus the new case passing. ctest: same failures as main on this GPU.
  • In game, first boot and recap from the menu: both videos are clean on the first view.

Not tested on Windows. The change has no platform-specific code.

Before (left) and after (right):

intro
recap

AI use

I used Claude Code to write the change and the tests and to run the measurements above. I reviewed the code and the results before opening the PR.

**@⁠NeySlim** on GitHub · 2026-10-14 11:56 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506) `NeySlim:fix/bda-range-residency` → `main` · +607 −0 · 9 files · 2 commits · open Tested in God of War Ragnarok (PPSA08332, 05.005). On the first boot, the first shot of the intro video (after "Sony Interactive Entertainment presents") plays as green and magenta blocks, and so does the God of War recap video started from the menu, until the next cut. Later shots are clean, and playing the recap a second time in the same session is clean too. Cause: the Bink decoder runs on the GPU. Its DC prediction pass (CS 0x5c046e9ef798f2bc) reads a bit table with `global_load_dword v19, v13, s[0:1]`, base from user data, offset `((row >> 5) + 8) << 4` with `row = step - lane`, behind an EXEC guard `row < height` (`v_cmp_gt_u32` + `s_and_saveexec`). The page holding the table has no buffer in the buffer cache yet, so the BDA read returns 0 and sets a fault bit. The fault path creates the buffer after the dispatch, a few frames later. The key frame is predicted from a zero table and the P frames carry the error until the next key frame. Change: - `ExtractResourcePlan` records, for each Global/Flat/ScalarAddress access whose base the host can evaluate, an upper bound of its 32-bit offset. The bound comes from the shape of the offset (add, mul, immediate shifts, and/min/max, or, bfe, lane id, a select whose condition is implied by the access predicate) or from an unsigned compare that the access predicate requires (the EXEC guard). Leaves are values the host already evaluates (user data, SRT reads). No proof means no range, and the access keeps the fault path. - `MaterializeResources` evaluates the bounds with the strict reader (no read outside the mapping). A result that does not fit in 32 bits gets no range, since the shader offset could wrap. The ranges go into `ResourceSnapshot::address_ranges`. - `RenderExecutor::FindBuffers` calls the new `RenderContext::MakeAddressRangeResident` for them, before the descriptor buffers: `FindBuffer` on the GPU-mapped parts of each range. Ranges above 256 MiB are skipped, like unbounded descriptor ranges. This is not the GPU-side scalar load change that was reverted (5b68a26c, reverted in 1c301c9a because it hung the GPU on this same shader), and not #1344, which made those scalar loads resident: no load moves from the host to the GPU here. The vector load already uses BDA on main; the host only creates buffers before the dispatch for ranges it can bound from the access itself, and anything it cannot prove stays exactly as on main. Limits: accesses through a 64-bit per-lane pointer, and offsets that cannot be bounded (loop counters, values read from memory), still go through the fault path and read 0 the first time. Testing (Linux, Radeon 8060S, RADV 26.2.3): - New GPU test `AddressRangeResidency` (`--address-range-residency-only`): real direct memory and `RenderContext`, `DispatchDirect` of a shader shaped like the game's (`s_load`, `row = step - lane`, `v_cmp_gt_u32`, `s_and_saveexec`, SADDR `global_load_dword`, `buffer_store`). Without the change: "lane 9 read 0 instead of 4127". - New CPU test `TestAddressRangesFollowAccessGuards` (resource_materialization): exact range, no range without the guard, no range when the bound can overflow. - Mutations, one at a time: without the residency call (GPU test fails), without the guard facts (CPU and GPU fail), without the overflow check, the strict decrement or the implied select (CPU fails). Calling `FindBuffer` only on the end of the range is caught too, as the table straddles a cache page. - GPU suite, one case per process: 638 cases, the same 10 failures as main plus the new case passing. ctest: same failures as main on this GPU. - In game, first boot and recap from the menu: both videos are clean on the first view. Not tested on Windows. The change has no platform-specific code. Before (left) and after (right): ![intro](https://github.com/NeySlim/KytyPS5/raw/media/gow-intro-video.jpg) ![recap](https://github.com/NeySlim/KytyPS5/raw/media/gow-recap-video.jpg) ## AI use I used Claude Code to write the change and the tests and to run the measurements above. I reviewed the code and the results before opening the PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:58:17 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-14 12:03 UTC · original · edited 2026-10-16 15:44 UTC

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 42975da8-9cb2-4a62-9a6d-d7473e00e86b
📥 Commits

Reviewing files that changed from the base of the PR and between 130dd657af34168edb97d199dbc32383ab2aa66f and 0a6c8eab2d.

📒 Files selected for processing: 2
  • src/graphics/host_gpu/renderer/renderContext.cpp
  • tests/ShaderRecompilerComputeTests.cpp

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

📝 Walkthrough

The shader recompiler plans bounded address ranges for eligible shader accesses and records evaluated ranges in runtime resources. The renderer makes mapped portions of those ranges resident before resolving buffer descriptors. Tests cover guarded accesses, offset bounds, and guarded global table loads.

Suggested reviewers: shadowbeat070

Priority: ➖ Normal

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 0a6c8

The change makes guarded GPU-mapped address ranges resident before shader dispatch, which fixes the reported video glitches. The supplied context shows no remaining merge-blocking risk. It was not tested on Windows.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 7 files. (1 skipped: … 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 and concisely describes the main change: making guarded GPU address ranges resident before shader execution.
Description check Passed The description directly explains the reported rendering issue, implementation, limitations, tests, and observed results for the address-range residency change.
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 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 7 files. (1 skipped: 1 too large.)

Resolution

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

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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-14 12:03 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506#issuecomment-6167894059) · edited 2026-10-16 15:44 UTC <!-- 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/1506?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 --> <!-- This is an auto-generated comment: review paused by coderabbit.ai --> > [!NOTE] > ## Reviews paused > > It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the `reviews.auto_review.auto_pause_after_reviewed_commits` setting. > > - Last reviewed commit: 0a6c8eab2d4a2122de4b4fab038084969de27e4a > > Use the following commands to manage reviews: > - `@coderabbitai resume` to resume automatic reviews. > - `@coderabbitai review` to trigger a single review. > > Use the checkboxes below for quick actions: > - [ ] <!-- {"checkboxId":"7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> ▶️ Resume reviews > - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review <!-- end of auto-generated comment: review paused by coderabbit.ai --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary><strong>ℹ️ Recent review info</strong></summary> <dl> <dd> <details> <summary><strong>⚙️ Run configuration</strong></summary> <dl> <dd> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `42975da8-9cb2-4a62-9a6d-d7473e00e86b` </dd> </dl> </details> <details> <summary><strong>📥 Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between 130dd657af34168edb97d199dbc32383ab2aa66f and 0a6c8eab2d4a2122de4b4fab038084969de27e4a. </dd> </dl> </details> <details> <summary><strong>📒 Files selected for processing: 2</strong></summary> <dl> <dd> * `src/graphics/host_gpu/renderer/renderContext.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </dd> </dl> </details> <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> The shader recompiler plans bounded address ranges for eligible shader accesses and records evaluated ranges in runtime resources. The renderer makes mapped portions of those ranges resident before resolving buffer descriptors. Tests cover guarded accesses, offset bounds, and guarded global table loads. **Suggested reviewers:** `shadowbeat070` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"0a6c8eab2d4a2122de4b4fab038084969de27e4a" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>⚪ Minimal</strong> · up to <code>0a6c8</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **⚪ Minimal** · up to `0a6c8` --> <!-- final_review_risk_coverage:{"sourceCommitId":"0a6c8eab2d4a2122de4b4fab038084969de27e4a","coveredCommitId":"0a6c8eab2d4a2122de4b4fab038084969de27e4a","kind":"reviewed"} --> The change makes guarded GPU-mapped address ranges resident before shader dispatch, which fixes the reported video glitches. The supplied context shows no remaining merge-blocking risk. It was not tested on Windows. <!-- 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-inconclusive-14-v2.svg" width="14" height="14" align="middle" alt="Inconclusive" title="Inconclusive"></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 inconclusive</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :--------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Inconclusive](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-inconclusive.svg) | Docstring coverage is 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 7 files. (1 skipped: … | 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 and concisely describes the main change: making guarded GPU address ranges resident before shader execution. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description directly explains the reported rendering issue, implementation, limitations, tests, and observed results for the address-range residency change. | | 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 15.38% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 26 functions across 7 files. (1 skipped: 1 too large.) **Resolution** Write docstrings for the functions missing them to satisfy the coverage threshold. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1506)! 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

@⁠coderabbitai[bot] on GitHub · 2026-10-14 12:03 UTC · original · edited 2026-10-14 22:22 UTC
On src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp line 1537 (outdated):

@@ -1243,6 +1534,7 @@ ResourcePlan ExtractResourcePlan(const Program& program) {
 	}
 	if (capture_indirect_reads || !plan.source_reads.empty())
 		plan.resource_tracking_complete &= !program.has_address_writes;
+	plan.address_ranges = AddressRangePlanner(program, Clone).Run();

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'requires_specialization_memory|capture_specialization_reads|MarkCleanReads|CleanRuntime|LoadBufferU32' src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
sed -n '1040,1120p;1355,1400p;1490,1560p;1695,1730p' src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
sed -n '950,975p' src/graphics/host_gpu/renderer/pipeline/descriptors.cpp

Repository: KytyPS5/KytyPS5

Length of output: 12544


🏁 Script executed:

set -e
file=src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
printf '%s\n' '--- planner and ExtractResourcePlan complete ranges ---'
nl -ba "$file" | sed -n '1030,1435p;1450,1575p'
printf '%s\n' '--- declarations and implementations of SrtWalker/CleanRuntime/MarkCleanReads ---'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'class SrtWalker' -e 'struct SrtWalker' -e 'SrtWalker::' -e 'CleanRuntime' -e 'MarkCleanReads' -e 'CommitBindings' src
printf '%s\n' '--- relevant definitions ---'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'struct SrtRuntime' -e 'class SrtRuntime' -e 'struct ResourcePlan' -e 'requires_specialization_memory' -e 'capture_specialization_reads' src/graphics
printf '%s\n' '--- tests and comparable usages ---'
rg -n -F --glob '*.{cpp,h}' -e 'AddressRangeResidency' -e 'TestAddressRangesFollowAccessGuards' -e 'LoadBufferU32' src tests 2>/dev/null || true
printf '%s\n' '--- base-versus-head diff for the target file ---'
git diff --no-ext-diff --unified=35 9e41d8320a2774b303fbad344c2347e8d0292e83 c8bfd94569dd16db428a4db70d87b89fa0eb4969 -- "$file"

Repository: KytyPS5/KytyPS5

Length of output: 42102


🏁 Script executed:

set -e
printf '%s\n' '--- exact MarkCleanReads and runtime validation ---'
nl -ba src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp | sed -n '130,235p;330,470p'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'ValidateRuntimeValue' -e 'CleanRuntime' -e 'class SrtWalker' -e 'struct SrtWalker' -e 'SrtWalker::Evaluate' -e 'SrtWalker::RefreshFlatBuffer' -e 'SrtReadCapture' src/graphics
printf '%s\n' '--- candidate SrtWalker definitions ---'
for f in $(rg -l -F --glob '*.cpp' --glob '*.h' -e 'class SrtWalker' -e 'struct SrtWalker' -e 'CleanRuntime' src/graphics); do
  echo "FILE $f"
  rg -n -F -C 8 -e 'class SrtWalker' -e 'struct SrtWalker' -e 'CleanRuntime' -e 'SrtWalker::Evaluate' -e 'SrtWalker::RefreshFlatBuffer' -e 'SrtReadCapture' "$f"
done
printf '%s\n' '--- exact downstream capture/commit guards ---'
rg -n -F -C 18 --glob '*.cpp' --glob '*.h' -e 'scalar resource reads cannot be proven disjoint' -e 'specialization_reads' src/graphics
printf '%s\n' '--- tests and resource-materialization callers ---'
rg -n -F -C 10 --glob '*.cpp' --glob '*.h' -e 'AddressRangeResidency' -e 'TestAddressRangesFollowAccessGuards' -e 'ExtractResourcePlan(' -e 'MaterializeResources(' src tests 2>/dev/null || true

Repository: KytyPS5/KytyPS5

Length of output: 45669


🏁 Script executed:

set -e
printf '%s\n' '--- SrtWalker runtime callbacks and evaluation ---'
nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp | sed -n '1,85p;480,710p;735,825p;1225,1305p'
printf '%s\n' '--- SrtWalker declarations and runtime flags ---'
nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.h | sed -n '1,145p'
printf '%s\n' '--- exact CommitBindings read/write interaction ---'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'scalar resource reads cannot be proven disjoint' -e 'prepared_bindings' src/graphics/host_gpu/renderer/pipeline
nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '925,985p'
printf '%s\n' '--- relevant source/test blocks for address ranges and LoadBufferU32 ---'
rg -n -F -C 18 --glob '*.cpp' -e 'CheckAddressRangeResidency' -e 'TestAddressRangesFollowAccessGuards' -e 'LoadBufferU32' tests src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp

Repository: KytyPS5/KytyPS5

Length of output: 41993


🏁 Script executed:

set -e
printf '%s\n' '--- RuntimeValidator implementation and raw-read acceptance ---'
rg -n -F -C 6 -e 'class RuntimeValidator' -e 'struct RuntimeValidator' -e 'RuntimeValidator(' -e 'LoadBufferU32' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp
nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp | sed -n '85,250p;250,480p'
printf '%s\n' '--- pipeline caller and binding commit flow ---'
nl -ba src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp | sed -n '235,265p;405,448p'
nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '940,1015p'
printf '%s\n' '--- address range test source around its assertions ---'
nl -ba tests/ShaderRecompilerComputeTests.cpp | sed -n '5270,5425p'

Repository: KytyPS5/KytyPS5

Length of output: 40967


🏁 Script executed:

set -e
printf '%s\n' '--- RefreshFlatBuffer and SRT read evaluation ---'
nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp | sed -n '1135,1240p'
printf '%s\n' '--- all specialization-reader construction sites ---'
rg -n -F -C 8 --glob '*.cpp' --glob '*.h' -e 'read_specialization_memory' -e 'SrtRuntime{' src tests
printf '%s\n' '--- base ExtractResourcePlan ordering ---'
git show 9e41d8320a2774b303fbad344c2347e8d0292e83:src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp | nl -ba | sed -n '1280,1415p' | tail -n 150

Repository: KytyPS5/KytyPS5

Length of output: 42508


Restore specialization flags after address-range planning.

AddressRangePlanner can clone a valid LoadBufferU32 used in an address-resource base or bounded offset. Clone then sets both specialization flags after MarkCleanReads has completed. This can make MaterializeResources return false when read_specialization_memory is null. If the stage has existing SRT reads, the late capture flag can also capture those reads and make CommitBindings abort for a pipeline with address writes. SrtWalker ranges(program, CleanRuntime(runtime)) can evaluate the cloned leaf when the callback exists, so the range plan does not require these flags to remain set.

Suggested fix
--- "a/src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp"
+++ "b/src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp"
@@ -1532,10 +1532,14 @@
 			if (image.written) MarkCleanReads(planned_reads, Source(plan, image.source));
 		}
 	}
 	if (capture_indirect_reads || !plan.source_reads.empty())
 		plan.resource_tracking_complete &= !program.has_address_writes;
+	const bool requires_specialization_memory = plan.requires_specialization_memory;
+	const bool capture_specialization_reads   = plan.capture_specialization_reads;
 	plan.address_ranges = AddressRangePlanner(program, Clone).Run();
+	plan.requires_specialization_memory = requires_specialization_memory;
+	plan.capture_specialization_reads   = capture_specialization_reads;
 	CompileSrtWalker(plan);
 	return plan;
 }
 

✅ Confirmed as addressed by @⁠NeySlim

**@⁠coderabbitai[bot]** on GitHub · 2026-10-14 12:03 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506#discussion_r4270486749) · edited 2026-10-14 22:22 UTC On `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` line 1537 (outdated): ```diff @@ -1243,6 +1534,7 @@ ResourcePlan ExtractResourcePlan(const Program& program) { } if (capture_indirect_reads || !plan.source_reads.empty()) plan.resource_tracking_complete &= !program.has_address_writes; + plan.address_ranges = AddressRangePlanner(program, Clone).Run(); ``` **🩺 Stability & Availability** | **🟠 Major** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash rg -n 'requires_specialization_memory|capture_specialization_reads|MarkCleanReads|CleanRuntime|LoadBufferU32' src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp sed -n '1040,1120p;1355,1400p;1490,1560p;1695,1730p' src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp sed -n '950,975p' src/graphics/host_gpu/renderer/pipeline/descriptors.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 12544 --- 🏁 Script executed: ```bash set -e file=src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp printf '%s\n' '--- planner and ExtractResourcePlan complete ranges ---' nl -ba "$file" | sed -n '1030,1435p;1450,1575p' printf '%s\n' '--- declarations and implementations of SrtWalker/CleanRuntime/MarkCleanReads ---' rg -n -F --glob '*.cpp' --glob '*.h' -e 'class SrtWalker' -e 'struct SrtWalker' -e 'SrtWalker::' -e 'CleanRuntime' -e 'MarkCleanReads' -e 'CommitBindings' src printf '%s\n' '--- relevant definitions ---' rg -n -F --glob '*.cpp' --glob '*.h' -e 'struct SrtRuntime' -e 'class SrtRuntime' -e 'struct ResourcePlan' -e 'requires_specialization_memory' -e 'capture_specialization_reads' src/graphics printf '%s\n' '--- tests and comparable usages ---' rg -n -F --glob '*.{cpp,h}' -e 'AddressRangeResidency' -e 'TestAddressRangesFollowAccessGuards' -e 'LoadBufferU32' src tests 2>/dev/null || true printf '%s\n' '--- base-versus-head diff for the target file ---' git diff --no-ext-diff --unified=35 9e41d8320a2774b303fbad344c2347e8d0292e83 c8bfd94569dd16db428a4db70d87b89fa0eb4969 -- "$file" ``` Repository: KytyPS5/KytyPS5 Length of output: 42102 --- 🏁 Script executed: ```bash set -e printf '%s\n' '--- exact MarkCleanReads and runtime validation ---' nl -ba src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp | sed -n '130,235p;330,470p' rg -n -F --glob '*.cpp' --glob '*.h' -e 'ValidateRuntimeValue' -e 'CleanRuntime' -e 'class SrtWalker' -e 'struct SrtWalker' -e 'SrtWalker::Evaluate' -e 'SrtWalker::RefreshFlatBuffer' -e 'SrtReadCapture' src/graphics printf '%s\n' '--- candidate SrtWalker definitions ---' for f in $(rg -l -F --glob '*.cpp' --glob '*.h' -e 'class SrtWalker' -e 'struct SrtWalker' -e 'CleanRuntime' src/graphics); do echo "FILE $f" rg -n -F -C 8 -e 'class SrtWalker' -e 'struct SrtWalker' -e 'CleanRuntime' -e 'SrtWalker::Evaluate' -e 'SrtWalker::RefreshFlatBuffer' -e 'SrtReadCapture' "$f" done printf '%s\n' '--- exact downstream capture/commit guards ---' rg -n -F -C 18 --glob '*.cpp' --glob '*.h' -e 'scalar resource reads cannot be proven disjoint' -e 'specialization_reads' src/graphics printf '%s\n' '--- tests and resource-materialization callers ---' rg -n -F -C 10 --glob '*.cpp' --glob '*.h' -e 'AddressRangeResidency' -e 'TestAddressRangesFollowAccessGuards' -e 'ExtractResourcePlan(' -e 'MaterializeResources(' src tests 2>/dev/null || true ``` Repository: KytyPS5/KytyPS5 Length of output: 45669 --- 🏁 Script executed: ```bash set -e printf '%s\n' '--- SrtWalker runtime callbacks and evaluation ---' nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp | sed -n '1,85p;480,710p;735,825p;1225,1305p' printf '%s\n' '--- SrtWalker declarations and runtime flags ---' nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.h | sed -n '1,145p' printf '%s\n' '--- exact CommitBindings read/write interaction ---' rg -n -F --glob '*.cpp' --glob '*.h' -e 'scalar resource reads cannot be proven disjoint' -e 'prepared_bindings' src/graphics/host_gpu/renderer/pipeline nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '925,985p' printf '%s\n' '--- relevant source/test blocks for address ranges and LoadBufferU32 ---' rg -n -F -C 18 --glob '*.cpp' -e 'CheckAddressRangeResidency' -e 'TestAddressRangesFollowAccessGuards' -e 'LoadBufferU32' tests src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 41993 --- 🏁 Script executed: ```bash set -e printf '%s\n' '--- RuntimeValidator implementation and raw-read acceptance ---' rg -n -F -C 6 -e 'class RuntimeValidator' -e 'struct RuntimeValidator' -e 'RuntimeValidator(' -e 'LoadBufferU32' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp | sed -n '85,250p;250,480p' printf '%s\n' '--- pipeline caller and binding commit flow ---' nl -ba src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp | sed -n '235,265p;405,448p' nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '940,1015p' printf '%s\n' '--- address range test source around its assertions ---' nl -ba tests/ShaderRecompilerComputeTests.cpp | sed -n '5270,5425p' ``` Repository: KytyPS5/KytyPS5 Length of output: 40967 --- 🏁 Script executed: ```bash set -e printf '%s\n' '--- RefreshFlatBuffer and SRT read evaluation ---' nl -ba src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp | sed -n '1135,1240p' printf '%s\n' '--- all specialization-reader construction sites ---' rg -n -F -C 8 --glob '*.cpp' --glob '*.h' -e 'read_specialization_memory' -e 'SrtRuntime{' src tests printf '%s\n' '--- base ExtractResourcePlan ordering ---' git show 9e41d8320a2774b303fbad344c2347e8d0292e83:src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp | nl -ba | sed -n '1280,1415p' | tail -n 150 ``` Repository: KytyPS5/KytyPS5 Length of output: 42508 --- </details> **Restore specialization flags after address-range planning.** `AddressRangePlanner` can clone a valid `LoadBufferU32` used in an address-resource base or bounded offset. `Clone` then sets both specialization flags after `MarkCleanReads` has completed. This can make `MaterializeResources` return `false` when `read_specialization_memory` is null. If the stage has existing SRT reads, the late capture flag can also capture those reads and make `CommitBindings` abort for a pipeline with address writes. `SrtWalker ranges(program, CleanRuntime(runtime))` can evaluate the cloned leaf when the callback exists, so the range plan does not require these flags to remain set. <details><summary>Suggested fix</summary> ```diff --- "a/src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp" +++ "b/src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp" @@ -1532,10 +1532,14 @@ if (image.written) MarkCleanReads(planned_reads, Source(plan, image.source)); } } if (capture_indirect_reads || !plan.source_reads.empty()) plan.resource_tracking_complete &= !program.has_address_writes; + const bool requires_specialization_memory = plan.requires_specialization_memory; + const bool capture_specialization_reads = plan.capture_specialization_reads; plan.address_ranges = AddressRangePlanner(program, Clone).Run(); + plan.requires_specialization_memory = requires_specialization_memory; + plan.capture_specialization_reads = capture_specialization_reads; CompileSrtWalker(plan); return plan; } ``` </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:05edb6a6c3a646e661aedcfe --> <!-- This is an auto-generated reply by CodeRabbit --> ✅ Confirmed as addressed by @⁠NeySlim <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-14 12:03 UTC · original · reviewed

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c319bd78-349b-4588-a42f-318d419770dc
📥 Commits

Reviewing files that changed from the base of the PR and between 9e41d8320a and c8bfd94569dd16db428a4db70d87b89fa0eb4969.

📒 Files selected for processing: 9
  • CMakeLists.txt
  • src/graphics/host_gpu/renderer/pipeline/descriptors.cpp
  • src/graphics/host_gpu/renderer/renderContext.cpp
  • src/graphics/host_gpu/renderer/renderContext.h
  • src/graphics/shader/recompiler/ir/ResourceSnapshot.h
  • src/graphics/shader/recompiler/ir/ShaderIR.h
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
  • tests/ResourceMaterializationTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-14 12:03 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506#pullrequestreview-5517557848) · **reviewed** **Actionable comments posted: 1** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `c319bd78-349b-4588-a42f-318d419770dc` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 9e41d8320a2774b303fbad344c2347e8d0292e83 and c8bfd94569dd16db428a4db70d87b89fa0eb4969. </details> <details> <summary>📒 Files selected for processing: 9</summary> * `CMakeLists.txt` * `src/graphics/host_gpu/renderer/pipeline/descriptors.cpp` * `src/graphics/host_gpu/renderer/renderContext.cpp` * `src/graphics/host_gpu/renderer/renderContext.h` * `src/graphics/shader/recompiler/ir/ResourceSnapshot.h` * `src/graphics/shader/recompiler/ir/ShaderIR.h` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` * `tests/ResourceMaterializationTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=051eda78-90d7-4315-8ea5-a3b0a7e7c046 attempt=83c4e629-eb99-458a-aa5b-13504b74ca90 batch=1/1 -->
Author
Owner

@⁠NeySlim on GitHub · 2026-10-14 22:22 UTC · original
On src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp line 1537 (outdated):

@@ -1243,6 +1534,7 @@ ResourcePlan ExtractResourcePlan(const Program& program) {
 	}
 	if (capture_indirect_reads || !plan.source_reads.empty())
 		plan.resource_tracking_complete &= !program.has_address_writes;
+	plan.address_ranges = AddressRangePlanner(program, Clone).Run();

Right, a LoadBufferU32 in a range base or limit set both flags after the capture pass. Range reads go through their own strict walker, so the flags are now restored after planning (99f5a2ea2). TestAddressRangesFollowAccessGuards has a buffered-limit case that fails without it.

**@⁠NeySlim** on GitHub · 2026-10-14 22:22 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506#discussion_r4276910460) On `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` line 1537 (outdated): ```diff @@ -1243,6 +1534,7 @@ ResourcePlan ExtractResourcePlan(const Program& program) { } if (capture_indirect_reads || !plan.source_reads.empty()) plan.resource_tracking_complete &= !program.has_address_writes; + plan.address_ranges = AddressRangePlanner(program, Clone).Run(); ``` Right, a LoadBufferU32 in a range base or limit set both flags after the capture pass. Range reads go through their own strict walker, so the flags are now restored after planning (99f5a2ea2). TestAddressRangesFollowAccessGuards has a buffered-limit case that fails without it.
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-14 22:22 UTC · original
On src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp line 1537 (outdated):

@@ -1243,6 +1534,7 @@ ResourcePlan ExtractResourcePlan(const Program& program) {
 	}
 	if (capture_indirect_reads || !plan.source_reads.empty())
 		plan.resource_tracking_complete &= !program.has_address_writes;
+	plan.address_ranges = AddressRangePlanner(program, Clone).Run();

@NeySlim, thanks for the fix. The supplied code restores both specialization flags after address-range planning, so range-only reads no longer enable specialization requirements or capture. The reported buffered-limit regression case covers the triggering path.


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

✅ Review thread resolved.

You are interacting with an AI system.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-14 22:22 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506#discussion_r4276913737) On `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` line 1537 (outdated): ```diff @@ -1243,6 +1534,7 @@ ResourcePlan ExtractResourcePlan(const Program& program) { } if (capture_indirect_reads || !plan.source_reads.empty()) plan.resource_tracking_complete &= !program.has_address_writes; + plan.address_ranges = AddressRangePlanner(program, Clone).Run(); ``` `@NeySlim`, thanks for the fix. The supplied code restores both specialization flags after address-range planning, so range-only reads no longer enable specialization requirements or capture. The reported buffered-limit regression case covers the triggering path. --- <!-- This is an auto-generated comment: tweet message by coderabbit.ai --> If you found this review helpful, would you consider giving us a shout-out on [X](https://twitter.com/intent/tweet?related=CodeRabbitAI&text=Address-range%20planning%20can%20clone%20%60LoadBufferU32%60%20nodes%20and%20corrupt%20specialization%20flags%E2%80%94causing%20materialization%20failures%20or%20pipeline%20aborts.%20Restore%20the%20flags%20after%20planning.%20Try%20%40coderabbitai%20%F0%9F%9B%A0%EF%B8%8F&url=https%3A%2F%2Fgithub.com%2FKytyPS5%2FKytyPS5%2Fpull%2F1506%23discussion_r4270486749)? Thank you for using CodeRabbit! <!-- end of auto-generated comment: tweet message by coderabbit.ai --> ✅ Review thread resolved. _You are interacting with an AI system._ <!-- This is an auto-generated reply by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-16 02:33 UTC · original · reviewed

🧹 Nitpick comments: 1
tests/ShaderRecompilerComputeTests.cpp: 1

5290-5290: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Test residency across two cache pages.

The table at base + 0x4000 keeps every guarded load within one cache page. A FindBuffer call that covers only the end of the range can therefore pass this test; the PR reports that this mutation survives. Place the table so its accessed entries cross a cache-page boundary. Then the lane checks will detect a missing buffer for either part of the range. (raw.githubusercontent.com)

Proposed test change
-    constexpr uint64_t table = base + 0x4000;
+    constexpr uint64_t table = base + 0x7fc0;

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c59cff09-e32e-42f1-991c-fdfba809be5b
📥 Commits

Reviewing files that changed from the base of the PR and between 99f5a2ea2b5cebedf9bc56049da99b8bbe735a5b and a58ae1b852b5a6439cbf561eeddc2f2e3b42f1f0.

📒 Files selected for processing: 6
  • CMakeLists.txt
  • src/graphics/host_gpu/renderer/pipeline/descriptors.cpp
  • src/graphics/shader/recompiler/ir/ShaderIR.h
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
  • tests/ResourceMaterializationTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-16 02:33 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506#pullrequestreview-5542339918) · **reviewed** <details> <summary>🧹 Nitpick comments: 1</summary><blockquote> <details> <summary>tests/ShaderRecompilerComputeTests.cpp: 1</summary><blockquote> `5290-5290`: **📐 Maintainability & Code Quality** | **🔵 Trivial** | **⚡ Quick win** **Test residency across two cache pages.** The table at `base + 0x4000` keeps every guarded load within one cache page. A `FindBuffer` call that covers only the end of the range can therefore pass this test; the PR reports that this mutation survives. Place the table so its accessed entries cross a cache-page boundary. Then the lane checks will detect a missing buffer for either part of the range. ([raw.githubusercontent.com](https://raw.githubusercontent.com/NeySlim/KytyPS5/fix/bda-range-residency/src/graphics/host_gpu/renderer/cache/bufferCache.h)) <details> <summary>Proposed test change</summary> ```diff - constexpr uint64_t table = base + 0x4000; + constexpr uint64_t table = base + 0x7fc0; ``` </details> <!-- cr-comment:v1:7075666551c7b5ea0d0051f8 --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `c59cff09-e32e-42f1-991c-fdfba809be5b` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 99f5a2ea2b5cebedf9bc56049da99b8bbe735a5b and a58ae1b852b5a6439cbf561eeddc2f2e3b42f1f0. </details> <details> <summary>📒 Files selected for processing: 6</summary> * `CMakeLists.txt` * `src/graphics/host_gpu/renderer/pipeline/descriptors.cpp` * `src/graphics/shader/recompiler/ir/ShaderIR.h` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` * `tests/ResourceMaterializationTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=d82254bb-a8b7-4efc-97ee-084aab257820 attempt=cfc95450-7b4b-4d91-be3d-a0f3ac624c6b batch=1/1 -->
Author
Owner

@⁠NeySlim on GitHub · 2026-10-16 03:31 UTC · original

Moved the table so the rows straddle a cache page (c383cabcc). The end-only FindBuffer mutation now fails at lane 29.

**@⁠NeySlim** on GitHub · 2026-10-16 03:31 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1506#issuecomment-6207449797) Moved the table so the rows straddle a cache page (c383cabcc). The end-only `FindBuffer` mutation now fails at lane 29.
This pull request has changes conflicting with the target branch.
  • src/graphics/shader/recompiler/ir/ShaderIR.h
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
  • tests/ResourceMaterializationTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1506/head:github-bot/gh-1506'
git switch 'github-bot/gh-1506'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1506'
git switch 'github-bot/gh-1506'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1506'
git switch 'github-bot/gh-1506'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1506'
git switch 'main'
git merge --squash 'github-bot/gh-1506'
git switch 'main'
git merge --ff-only 'github-bot/gh-1506'
git switch 'main'
git merge 'github-bot/gh-1506'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.