graphics: read unmapped guest memory as zeros in the SRT walk #1549

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

@⁠theantipopau on GitHub · 2026-10-16 02:59 UTC · original
theantipopau:shader-srt-null-read-zero → main · +12 −0 · 1 files · 2 commits · closed without merging

Same direction as #1365: the SRT walk evaluates loads the shader may never execute (e.g. through a null SRT table pointer, the Astro Bot startup shape in #1268/#1528). This gives the pipeline-cache SRT runtime an ordinary reader that zero-fills unmapped guest ranges via TryReadBacking instead of leaving raw host dereferences to fault. Additive, production-path only; no test expectations touched.

**@⁠theantipopau** on GitHub · 2026-10-16 02:59 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549) `theantipopau:shader-srt-null-read-zero` → `main` · +12 −0 · 1 files · 2 commits · closed without merging Same direction as #1365: the SRT walk evaluates loads the shader may never execute (e.g. through a null SRT table pointer, the Astro Bot startup shape in #1268/#1528). This gives the pipeline-cache SRT runtime an ordinary reader that zero-fills unmapped guest ranges via TryReadBacking instead of leaving raw host dereferences to fault. Additive, production-path only; no test expectations touched.
The walker evaluates loads the shader may never execute, e.g. through
a null SRT table pointer. Give the runtime an ordinary reader that
zero-fills unmapped ranges instead of leaving raw host dereferences to
fault (same direction as #1365).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:59:26 +00:00
github-bot closed this pull request 2026-11-26 09:59:26 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-16 03:02 UTC · original · edited 2026-10-18 23:07 UTC

Review in Change Stack →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 879a8d37-fea0-4841-9713-c20222912dbe
📥 Commits

Reviewing files that changed from the base of the PR and between 795cc0158d and c09d09c941.

📒 Files selected for processing: 1
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
📝 Walkthrough

The change adds ReadShaderScalarMemory to read guest backing memory. If the read fails, it fills the requested values with zero and returns true. ProgramCache::Get assigns this function as the runtime scalar-memory callback. The specialization-memory callback remains unchanged.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Bug fix

Merge Risk: 🟡 Moderate · up to 795cc

The new shader-table reader correctly returns zeros for unmapped memory. However, it also returns zeros for valid tables in private guest memory and can read stale data that the GPU has modified. Either case can cause shaders to bind the wrong resources and render incorrectly. Both reads should be fixed before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description check Passed The description accurately explains the SRT walk change and the zero-filling behavior for unmapped guest memory.
Title check Passed The title clearly and concisely states the main change: reading unmapped guest memory as zeros during the SRT walk.
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.
  • 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-16 03:02 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#issuecomment-6207062988) · edited 2026-10-18 23:07 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/1549?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: rate limited by coderabbit.ai --> > [!WARNING] > ## Review limit reached > > You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. > > **Next included review available in 5 minutes.** > > [Check out review usage here](https://app.coderabbit.ai/dashboard/review-capacity?orgId=d7cf2749-f181-4119-ba0c-ad79606afdfe). > > <details> > <summary><strong>View limit details</strong></summary> > <dl> > <dd> > > **Limit details:** You’ve used all 8 included reviews currently available. > > [Learn how review limits work](https://docs.coderabbit.ai/management/rate-limits). > > **Review configuration:** > > <details> > <summary><strong>⚙️ Run configuration</strong></summary> > <dl> > <dd> > > - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml > - **Review profile**: CHILL > - **Plan**: Advanced > - **Run ID**: `879a8d37-fea0-4841-9713-c20222912dbe` > > </dd> > </dl> > </details> > > <details> > <summary><strong>📥 Commits</strong></summary> > <dl> > <dd> > > Reviewing files that changed from the base of the PR and between 795cc0158daa83223dbb0a7a7840e8082d4696bd and c09d09c9410477064fc94fc63d413e14e1cdf6e2. > > </dd> > </dl> > </details> > > <details> > <summary><strong>📒 Files selected for processing: 1</strong></summary> > <dl> > <dd> > > * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` > > </dd> > </dl> > </details> > > </dd> > </dl> > </details> <!-- end of auto-generated comment: rate limited by coderabbit.ai --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> The change adds `ReadShaderScalarMemory` to read guest backing memory. If the read fails, it fills the requested values with zero and returns `true`. `ProgramCache::Get` assigns this function as the runtime scalar-memory callback. The specialization-memory callback remains unchanged. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"795cc0158daa83223dbb0a7a7840e8082d4696bd" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>🟡 Moderate</strong> · up to <code>795cc</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `795cc` --> <!-- final_review_risk_coverage:{"sourceCommitId":"795cc0158daa83223dbb0a7a7840e8082d4696bd","coveredCommitId":"795cc0158daa83223dbb0a7a7840e8082d4696bd","kind":"reviewed"} --> The new shader-table reader correctly returns zeros for unmapped memory. However, it also returns zeros for valid tables in private guest memory and can read stale data that the GPU has modified. Either case can cause shaders to bind the wrong resources and render incorrectly. Both reads should be fixed before merging. <!-- 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 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. | 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 | | :------------------------ | :--------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------------------------ | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description accurately explains the SRT walk change and the zero-filling behavior for unmapped guest memory. | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title clearly and concisely states the main change: reading unmapped guest memory as zeros during the SRT walk. | | 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> </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=1549)! 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-18 22:18 UTC · original · edited 2026-10-18 23:07 UTC
On src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp line 121 (outdated):

@@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values)
 	       Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes());
 }
 
+bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) {
+	// The walk evaluates loads the shader may never execute, e.g. through a null SRT
+	// table pointer, so unmapped guest memory reads as zeros instead of faulting the host.
+	if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) {

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Synchronize GPU-written data before the scalar read.

If the GPU has modified a scalar table, TryReadBacking copies its backing bytes without downloading the GPU-dirty bytes. The walker can then use stale values to select resources. TryReadBufferBacking performs that download when needed; use the synchronized read path for backing mappings while retaining the zero fallback for unmapped addresses. (raw.githubusercontent.com)

**@⁠coderabbitai[bot]** on GitHub · 2026-10-18 22:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#discussion_r4309004020) · edited 2026-10-18 23:07 UTC On `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` line 121 (outdated): ```diff @@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values) Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes()); } +bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) { + // The walk evaluates loads the shader may never execute, e.g. through a null SRT + // table pointer, so unmapped guest memory reads as zeros instead of faulting the host. + if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) { ``` **🗄️ Data Integrity & Integration** | **🟠 Major** | **🏗️ Heavy lift** **Synchronize GPU-written data before the scalar read.** If the GPU has modified a scalar table, `TryReadBacking` copies its backing bytes without downloading the GPU-dirty bytes. The walker can then use stale values to select resources. `TryReadBufferBacking` performs that download when needed; use the synchronized read path for backing mappings while retaining the zero fallback for unmapped addresses. ([raw.githubusercontent.com](https://raw.githubusercontent.com/KytyPS5/KytyPS5/main/src/kernel/memory.cpp)) <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:e44708e6b937ee18f2b02b40 --> <!-- This is an auto-generated reply by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-18 22:18 UTC · original · edited 2026-10-18 23:08 UTC
On src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp line 122 (outdated):

@@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values)
 	       Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes());
 }
 
+bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) {
+	// The walk evaluates loads the shader may never execute, e.g. through a null SRT
+	// table pointer, so unmapped guest memory reads as zeros instead of faulting the host.
+	if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) {
+		std::ranges::fill(values, 0u);

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

rg -n 'TryReadBacking' src
rg -n -A40 'bool .*TryReadBacking' src/kernel
rg -n 'Private' src/kernel/memoryAddressSpace.inc | head -60
git show 099de8dea62cbf17c8e06a6c24e72b38475d1566:src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp | sed -n '100,130p;340,370p'

Repository: KytyPS5/KytyPS5

Length of output: 17990


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- current scalar reader and runtime wiring ---'
rg -n -A35 -B12 -F -- 'ReadShaderScalarMemory' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp || true
rg -n -A18 -B12 -F -- 'read_memory' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp || true
printf '%s\n' '--- merge-base scalar/read callback and nearby runtime ---'
git show 099de8dea62cbf17c8e06a6c24e72b38475d1566:src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp | rg -n -A35 -B18 -e 'read_memory' -e 'read_specialization_memory' -e 'ReadShaderGuestMemory' || true
printf '%s\n' '--- address-space mapping implementation ---'
sed -n '900,1045p' src/kernel/memoryAddressSpace.inc
sed -n '210,285p' src/kernel/memoryAddressSpace.inc
printf '%s\n' '--- private/flexible mapping callers and GPU-related consumers ---'
rg -n -F -e 'KernelMapFlexibleMemory' -e 'KernelMapNamedFlexibleMemory' -e 'MappingType::Private' -e 'CopySparseMemory' -e 'TryReadSparseBacking' src --glob '*.{cpp,h,inc}' || true
printf '%s\n' '--- changed diff against merge base ---'
git diff --no-ext-diff --unified=35 099de8dea62cbf17c8e06a6c24e72b38475d1566 795cc0158daa83223dbb0a7a7840e8082d4696bd -- src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

Repository: KytyPS5/KytyPS5

Length of output: 28297


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- SrtRuntime declaration and callback dispatch ---'
rg -n -F -e 'struct SrtRuntime' -e 'read_memory' -e 'read_specialization_memory' src --glob '*.{cpp,h,inc}' || true
printf '%s\n' '--- flexible-memory implementation ---'
sed -n '2325,2415p' src/kernel/memory.cpp
printf '%s\n' '--- sparse/private read and GPU buffer-cache paths ---'
sed -n '450,565p' src/graphics/host_gpu/renderer/cache/bufferCache.cpp
sed -n '920,965p' src/kernel/memory.cpp
printf '%s\n' '--- private mapping and GPU resource interactions ---'
rg -n -F -e 'CopySparseMemory(' -e 'TryReadSparseBacking(' -e 'KernelMapFlexibleMemory(' -e 'KernelMapNamedFlexibleMemory(' -e 'IsGpuAddressRange(' -e 'HandleGpuFault(' src --glob '*.{cpp,h,inc}' || true

Repository: KytyPS5/KytyPS5

Length of output: 15571


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- SrtRuntime and ordinary-reader implementation ---'
sed -n '1,75p' src/graphics/shader/recompiler/ir/passes/SrtWalker.h
sed -n '1,70p' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp
sed -n '700,755p' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp
sed -n '1145,1190p' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp
printf '%s\n' '--- flexible memory owner and Map implementation ---'
rg -n -F -e 'class FlexibleMemory' -e 'struct FlexibleMemory' -e 'bool Map(' -e 'MapGpuRange(' -e 'GpuAccessMode' src/kernel --glob '*.{cpp,h,inc}' || true
printf '%s\n' '--- map-flexible caller context and flags/modes ---'
sed -n '2240,2378p' src/kernel/memory.cpp

Repository: KytyPS5/KytyPS5

Length of output: 19612


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- protection decoding and flexible Map declaration ---'
sed -n '60,140p' src/kernel/memory.cpp
sed -n '710,755p' src/kernel/memory.cpp
printf '%s\n' '--- flexible Map implementation ---'
sed -n '1675,1778p' src/kernel/memory.cpp
printf '%s\n' '--- address-space private commit and sparse private read ---'
sed -n '935,1002p' src/kernel/memoryAddressSpace.inc
sed -n '786,820p' src/kernel/memoryAddressSpace.inc

Repository: KytyPS5/KytyPS5

Length of output: 12110


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- private commit callers ---'
rg -n -A18 -B18 -F -e 'g_guest_address_space->Commit' -e '.Commit(' src/kernel/memory.cpp src/kernel --glob '*.{cpp,h,inc}' || true
printf '%s\n' '--- GPU mapping calls near private/virtual-memory operations ---'
rg -n -A12 -B12 -F -e 'MapGpuRange(' -e 'UnmapGpuRange(' -e 'KernelCommit' -e 'KernelMmap' -e 'KernelMprotect' src/kernel/memory.cpp || true
printf '%s\n' '--- virtual-range and memory API declarations ---'
rg -n -F -e 'Commit(' -e 'Protect(' -e 'MapMemory(' src/kernel/memory.h src/kernel/memory.cpp src/kernel/memoryAddressSpace.inc || true

Repository: KytyPS5/KytyPS5

Length of output: 33347


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- private committed range types and callers ---'
rg -n -A12 -B12 -F -e 'IsPrivateCommittedRangeType' -e 'VirtualRangeType::Code' -e 'VirtualRangeType::Data' -e 'AllocateGuestRuntimeMemory(' -e 'AllocateProgramMemory(' src/kernel/memory.cpp src/kernel/memory.h || true

Repository: KytyPS5/KytyPS5

Length of output: 16088


Read private guest mappings before zero-filling.

ReadShaderScalarMemory treats every TryReadBacking failure as an unmapped address. TryReadBacking does not read MappingType::Private ranges. The merge-base ordinary reader used a raw host read, so valid scalar SRT values in private GPU-mapped ranges can become zero.

Use CopySparseMemory, which handles private and backing mappings, and keep the zero-fill fallback for invalid ranges.

Suggested fix
--- "a/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp"
+++ "b/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp"
@@ -118,7 +118,7 @@
 bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) {
 	// The walk evaluates loads the shader may never execute, e.g. through a null SRT
 	// table pointer, so unmapped guest memory reads as zeros instead of faulting the host.
-	if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) {
+	if (!Libs::LibKernel::Memory::CopySparseMemory(address, values.data(), values.size_bytes())) {
 		std::ranges::fill(values, 0u);
 	}
 	return true;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

	if (!Libs::LibKernel::Memory::CopySparseMemory(address, values.data(), values.size_bytes())) {
		std::ranges::fill(values, 0u);

✅ Addressed in commit c09d09c

**@⁠coderabbitai[bot]** on GitHub · 2026-10-18 22:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#discussion_r4309004025) · edited 2026-10-18 23:08 UTC On `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` line 122 (outdated): ```diff @@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values) Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes()); } +bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) { + // The walk evaluates loads the shader may never execute, e.g. through a null SRT + // table pointer, so unmapped guest memory reads as zeros instead of faulting the host. + if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) { + std::ranges::fill(values, 0u); ``` **🎯 Functional Correctness** | **🟠 Major** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash rg -n 'TryReadBacking' src rg -n -A40 'bool .*TryReadBacking' src/kernel rg -n 'Private' src/kernel/memoryAddressSpace.inc | head -60 git show 099de8dea62cbf17c8e06a6c24e72b38475d1566:src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp | sed -n '100,130p;340,370p' ``` Repository: KytyPS5/KytyPS5 Length of output: 17990 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- current scalar reader and runtime wiring ---' rg -n -A35 -B12 -F -- 'ReadShaderScalarMemory' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp || true rg -n -A18 -B12 -F -- 'read_memory' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp || true printf '%s\n' '--- merge-base scalar/read callback and nearby runtime ---' git show 099de8dea62cbf17c8e06a6c24e72b38475d1566:src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp | rg -n -A35 -B18 -e 'read_memory' -e 'read_specialization_memory' -e 'ReadShaderGuestMemory' || true printf '%s\n' '--- address-space mapping implementation ---' sed -n '900,1045p' src/kernel/memoryAddressSpace.inc sed -n '210,285p' src/kernel/memoryAddressSpace.inc printf '%s\n' '--- private/flexible mapping callers and GPU-related consumers ---' rg -n -F -e 'KernelMapFlexibleMemory' -e 'KernelMapNamedFlexibleMemory' -e 'MappingType::Private' -e 'CopySparseMemory' -e 'TryReadSparseBacking' src --glob '*.{cpp,h,inc}' || true printf '%s\n' '--- changed diff against merge base ---' git diff --no-ext-diff --unified=35 099de8dea62cbf17c8e06a6c24e72b38475d1566 795cc0158daa83223dbb0a7a7840e8082d4696bd -- src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 28297 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- SrtRuntime declaration and callback dispatch ---' rg -n -F -e 'struct SrtRuntime' -e 'read_memory' -e 'read_specialization_memory' src --glob '*.{cpp,h,inc}' || true printf '%s\n' '--- flexible-memory implementation ---' sed -n '2325,2415p' src/kernel/memory.cpp printf '%s\n' '--- sparse/private read and GPU buffer-cache paths ---' sed -n '450,565p' src/graphics/host_gpu/renderer/cache/bufferCache.cpp sed -n '920,965p' src/kernel/memory.cpp printf '%s\n' '--- private mapping and GPU resource interactions ---' rg -n -F -e 'CopySparseMemory(' -e 'TryReadSparseBacking(' -e 'KernelMapFlexibleMemory(' -e 'KernelMapNamedFlexibleMemory(' -e 'IsGpuAddressRange(' -e 'HandleGpuFault(' src --glob '*.{cpp,h,inc}' || true ``` Repository: KytyPS5/KytyPS5 Length of output: 15571 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- SrtRuntime and ordinary-reader implementation ---' sed -n '1,75p' src/graphics/shader/recompiler/ir/passes/SrtWalker.h sed -n '1,70p' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp sed -n '700,755p' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp sed -n '1145,1190p' src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp printf '%s\n' '--- flexible memory owner and Map implementation ---' rg -n -F -e 'class FlexibleMemory' -e 'struct FlexibleMemory' -e 'bool Map(' -e 'MapGpuRange(' -e 'GpuAccessMode' src/kernel --glob '*.{cpp,h,inc}' || true printf '%s\n' '--- map-flexible caller context and flags/modes ---' sed -n '2240,2378p' src/kernel/memory.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 19612 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- protection decoding and flexible Map declaration ---' sed -n '60,140p' src/kernel/memory.cpp sed -n '710,755p' src/kernel/memory.cpp printf '%s\n' '--- flexible Map implementation ---' sed -n '1675,1778p' src/kernel/memory.cpp printf '%s\n' '--- address-space private commit and sparse private read ---' sed -n '935,1002p' src/kernel/memoryAddressSpace.inc sed -n '786,820p' src/kernel/memoryAddressSpace.inc ``` Repository: KytyPS5/KytyPS5 Length of output: 12110 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- private commit callers ---' rg -n -A18 -B18 -F -e 'g_guest_address_space->Commit' -e '.Commit(' src/kernel/memory.cpp src/kernel --glob '*.{cpp,h,inc}' || true printf '%s\n' '--- GPU mapping calls near private/virtual-memory operations ---' rg -n -A12 -B12 -F -e 'MapGpuRange(' -e 'UnmapGpuRange(' -e 'KernelCommit' -e 'KernelMmap' -e 'KernelMprotect' src/kernel/memory.cpp || true printf '%s\n' '--- virtual-range and memory API declarations ---' rg -n -F -e 'Commit(' -e 'Protect(' -e 'MapMemory(' src/kernel/memory.h src/kernel/memory.cpp src/kernel/memoryAddressSpace.inc || true ``` Repository: KytyPS5/KytyPS5 Length of output: 33347 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- private committed range types and callers ---' rg -n -A12 -B12 -F -e 'IsPrivateCommittedRangeType' -e 'VirtualRangeType::Code' -e 'VirtualRangeType::Data' -e 'AllocateGuestRuntimeMemory(' -e 'AllocateProgramMemory(' src/kernel/memory.cpp src/kernel/memory.h || true ``` Repository: KytyPS5/KytyPS5 Length of output: 16088 --- </details> **Read private guest mappings before zero-filling.** `ReadShaderScalarMemory` treats every `TryReadBacking` failure as an unmapped address. `TryReadBacking` does not read `MappingType::Private` ranges. The merge-base ordinary reader used a raw host read, so valid scalar SRT values in private GPU-mapped ranges can become zero. Use `CopySparseMemory`, which handles private and backing mappings, and keep the zero-fill fallback for invalid ranges. <details> <summary>Suggested fix</summary> ```diff --- "a/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp" +++ "b/src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp" @@ -118,7 +118,7 @@ bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) { // The walk evaluates loads the shader may never execute, e.g. through a null SRT // table pointer, so unmapped guest memory reads as zeros instead of faulting the host. - if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) { + if (!Libs::LibKernel::Memory::CopySparseMemory(address, values.data(), values.size_bytes())) { std::ranges::fill(values, 0u); } return true; ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (!Libs::LibKernel::Memory::CopySparseMemory(address, values.data(), values.size_bytes())) { std::ranges::fill(values, 0u); ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:64b4cf61ca10ccdedb475f8f --> <!-- This is an auto-generated reply by CodeRabbit --> ✅ Addressed in commit c09d09c
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-18 22:18 UTC · original · reviewed

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e40d44ce-9ba9-4961-b7a2-073938681b2f
📥 Commits

Reviewing files that changed from the base of the PR and between 42c20993e5436107fc307a70a2988e80314edfc6 and 795cc0158d.

📒 Files selected for processing: 1
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-18 22:18 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#pullrequestreview-5565310310) · **reviewed** **Actionable comments posted: 2** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `e40d44ce-9ba9-4961-b7a2-073938681b2f` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 42c20993e5436107fc307a70a2988e80314edfc6 and 795cc0158daa83223dbb0a7a7840e8082d4696bd. </details> <details> <summary>📒 Files selected for processing: 1</summary> * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=4e1d70e4-c3b5-422f-8bd4-502515679919 attempt=35e05231-f2cb-4df3-9764-3a58c28508ee batch=1/1 -->
Author
Owner

@⁠JazzzOk on GitHub · 2026-10-18 22:38 UTC · original · approved these changes

Approved in CodeRabbit Change Stack

**@⁠JazzzOk** on GitHub · 2026-10-18 22:38 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#pullrequestreview-5565377358) · **approved these changes** <sub>Approved in [CodeRabbit Change Stack](https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1549?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA)</sub>
Author
Owner

@⁠JazzzOk on GitHub · 2026-10-18 22:42 UTC · original · approved these changes

Approved in CodeRabbit Change Stack

**@⁠JazzzOk** on GitHub · 2026-10-18 22:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#pullrequestreview-5565389212) · **approved these changes** <sub>Approved in [CodeRabbit Change Stack](https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1549?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA)</sub>
Author
Owner

@⁠theantipopau on GitHub · 2026-10-18 23:07 UTC · original
On src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp line 122 (outdated):

@@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values)
 	       Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes());
 }
 
+bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) {
+	// The walk evaluates loads the shader may never execute, e.g. through a null SRT
+	// table pointer, so unmapped guest memory reads as zeros instead of faulting the host.
+	if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) {
+		std::ranges::fill(values, 0u);

Adopted in c09d09c9: scalar reads now use CopySparseMemory, which covers private mappings in addition to backing mappings and still reports unmapped ranges as failure (zero-fill preserved, never faults).

**@⁠theantipopau** on GitHub · 2026-10-18 23:07 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#discussion_r4309160745) On `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` line 122 (outdated): ```diff @@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values) Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes()); } +bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) { + // The walk evaluates loads the shader may never execute, e.g. through a null SRT + // table pointer, so unmapped guest memory reads as zeros instead of faulting the host. + if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) { + std::ranges::fill(values, 0u); ``` Adopted in c09d09c9: scalar reads now use CopySparseMemory, which covers private mappings in addition to backing mappings and still reports unmapped ranges as failure (zero-fill preserved, never faults).
Author
Owner

@⁠theantipopau on GitHub · 2026-10-18 23:07 UTC · original
On src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp line 121 (outdated):

@@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values)
 	       Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes());
 }
 
+bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) {
+	// The walk evaluates loads the shader may never execute, e.g. through a null SRT
+	// table pointer, so unmapped guest memory reads as zeros instead of faulting the host.
+	if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) {

Verified but deferring: GPU-dirty staleness predates this PR (scalar reads were previously a raw host memcpy with no GPU sync either), and switching this speculative walk to the synchronized path would add GPU-download stalls plus GPU-thread constraints to compilation. The zero-fill behavior for unmapped ranges — this PR's purpose — is unaffected either way. Happy to take synchronization as a separate follow-up if a stale-table miscompile is observed.

**@⁠theantipopau** on GitHub · 2026-10-18 23:07 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#discussion_r4309160824) On `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` line 121 (outdated): ```diff @@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values) Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes()); } +bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) { + // The walk evaluates loads the shader may never execute, e.g. through a null SRT + // table pointer, so unmapped guest memory reads as zeros instead of faulting the host. + if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) { ``` Verified but deferring: GPU-dirty staleness predates this PR (scalar reads were previously a raw host memcpy with no GPU sync either), and switching this speculative walk to the synchronized path would add GPU-download stalls plus GPU-thread constraints to compilation. The zero-fill behavior for unmapped ranges — this PR's purpose — is unaffected either way. Happy to take synchronization as a separate follow-up if a stale-table miscompile is observed.
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-18 23:08 UTC · original
On src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp line 122 (outdated):

@@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values)
 	       Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes());
 }
 
+bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) {
+	// The walk evaluates loads the shader may never execute, e.g. through a null SRT
+	// table pointer, so unmapped guest memory reads as zeros instead of faulting the host.
+	if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) {
+		std::ranges::fill(values, 0u);

@⁠theantipopau Thanks for the fix in c09d09c9. Using CopySparseMemory addresses the private-mapping concern while preserving the zero-fill fallback for unmapped ranges.


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-18 23:08 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#discussion_r4309163406) On `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` line 122 (outdated): ```diff @@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values) Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes()); } +bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) { + // The walk evaluates loads the shader may never execute, e.g. through a null SRT + // table pointer, so unmapped guest memory reads as zeros instead of faulting the host. + if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) { + std::ranges::fill(values, 0u); ``` @⁠theantipopau Thanks for the fix in `c09d09c9`. Using `CopySparseMemory` addresses the private-mapping concern while preserving the zero-fill fallback for unmapped ranges. --- <!-- 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=Scalar%20shader%20reads%20now%20use%20%60CopySparseMemory%60%2C%20covering%20private%20GPU%20mappings%20while%20preserving%20zero-fill%20for%20unmapped%20ranges.%20Try%20%40coderabbitai%20for%20actionable%20code%20reviews.%20%F0%9F%90%87%E2%9C%85&url=https%3A%2F%2Fgithub.com%2FKytyPS5%2FKytyPS5%2Fpull%2F1549%23discussion_r4309004025)? 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-18 23:08 UTC · original
On src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp line 121 (outdated):

@@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values)
 	       Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes());
 }
 
+bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) {
+	// The walk evaluates loads the shader may never execute, e.g. through a null SRT
+	// table pointer, so unmapped guest memory reads as zeros instead of faulting the host.
+	if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) {

@⁠theantipopau Thanks for the clarification. The GPU-dirty staleness is pre-existing, not a regression from this PR. Deferring synchronization is reasonable because it adds GPU-download stalls and GPU-thread constraints to the speculative walk.

Would you like me to open a follow-up GitHub issue?


✏️ Learnings added
Learnt from: theantipopau
Repo: KytyPS5/KytyPS5 PR: 1549
File: src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp:0-0
Timestamp: 2026-10-18T23:08:02.424Z
Learning: In src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp, the speculative SRT walk can evaluate scalar loads that the shader never executes. Using a GPU-synchronized read path for these loads adds GPU-download stalls and GPU-thread constraints to compilation. Treat synchronization as a separate design concern from zero-filling unmapped guest memory; do not require synchronization merely to implement zero-fill behavior.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-18 23:08 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#discussion_r4309165580) On `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` line 121 (outdated): ```diff @@ -115,6 +115,15 @@ bool ReadShaderGuestMemory(void*, uint64_t address, std::span<uint32_t> values) Libs::LibKernel::Memory::TryReadBufferBacking(address, values.data(), values.size_bytes()); } +bool ReadShaderScalarMemory(void*, uint64_t address, std::span<uint32_t> values) { + // The walk evaluates loads the shader may never execute, e.g. through a null SRT + // table pointer, so unmapped guest memory reads as zeros instead of faulting the host. + if (!Libs::LibKernel::Memory::TryReadBacking(address, values.data(), values.size_bytes())) { ``` @⁠theantipopau Thanks for the clarification. The GPU-dirty staleness is pre-existing, not a regression from this PR. Deferring synchronization is reasonable because it adds GPU-download stalls and GPU-thread constraints to the speculative walk. Would you like me to open a follow-up GitHub issue? --- <details> <summary>✏️ Learnings added</summary> ``` Learnt from: theantipopau Repo: KytyPS5/KytyPS5 PR: 1549 File: src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp:0-0 Timestamp: 2026-10-18T23:08:02.424Z Learning: In src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp, the speculative SRT walk can evaluate scalar loads that the shader never executes. Using a GPU-synchronized read path for these loads adds GPU-download stalls and GPU-thread constraints to compilation. Treat synchronization as a separate design concern from zero-filling unmapped guest memory; do not require synchronization merely to implement zero-fill behavior. ``` > Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure [review instructions](https://docs.coderabbit.ai/guides/review-instructions). You can manage existing learnings in the [app](https://app.coderabbit.ai/learnings). </details> _You are interacting with an AI system._ <!-- This is an auto-generated reply by CodeRabbit -->
Author
Owner

@⁠Nmzik on GitHub · 2026-10-21 19:42 UTC · original

Duplicate of #1365.

**@⁠Nmzik** on GitHub · 2026-10-21 19:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1549#issuecomment-6324945467) Duplicate of #1365.

Pull request closed

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