Fix for Call of Duty Vanguard to get to first mission screen #1961

Open
github-bot wants to merge 17 commits from github-bot/gh-1961 into main AGit
Owner

@⁠chaitan3 on GitHub · 2026-10-28 13:43 UTC · original
chaitan3:codv_new_debug → main · +1207 −160 · 30 files · 17 commits · open

This branch fixes the memory and descriptor-tracking failures that stopped
Call of Duty: Vanguard while loading the first campaign mission on a 16 GiB
GPU. It is stacked on the cache work from #937 and the sparse
BDA page table from #1270.

Memory and caches:

  • Start texture/buffer collection 256 MiB below the device budget instead of
    only after it is exhausted, and force collection at submission boundaries.
  • Allow forced collections to evict recently touched clean textures during a
    loading burst, with larger per-frame eviction budgets.
  • Relax allocation-failure eviction to the current LRU tick.
  • Drop large image-heap tables that no recent draw acquired so their pinned
    images can be reclaimed.
  • Move guest buffer mirrors to host-visible memory and stage large dirty
    texture downloads in a dedicated buffer.
  • Widen per-page write-watcher counters from 7 to 15 bits.
  • Keep the #1271 allocation-failure eviction/retry path.

Shaders:

  • Recover uniform conditions from scalar lane-mask branches when lowering
    nested sampler-descriptor phis.
  • Plan lane-selected image descriptor tables (V_READLANE of per-lane buffer
    loads) as indexed image heaps so the GPU selects the descriptor slot.
  • Fall back to the true-path sampler variant when a sampler is selected by
    genuinely lane-varying state.

Result:
The game reaches the first campaign intro ("HAMBURG 1945") and continues
running at roughly 15.2 GiB VRAM.

Known limitation - this is a hack:
The buffer/texture cache eviction and the transfer of guest buffer mirrors to
host memory are a workaround, not a proper fix. They trade VRAM for PCIe
traffic, re-uploads and eviction churn. A proper solution needs guest-memory
import/zero-copy for buffers, a real residency and eviction policy for images,
and GPU-side selection for lane-varying descriptors.

PS: Not sure from all the cache commits which are necessary to get to the first mission screen as I tried a bunch of commits to get it to that stage.

**@⁠chaitan3** on GitHub · 2026-10-28 13:43 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961) `chaitan3:codv_new_debug` → `main` · +1207 −160 · 30 files · 17 commits · open This branch fixes the memory and descriptor-tracking failures that stopped Call of Duty: Vanguard while loading the first campaign mission on a 16 GiB GPU. It is stacked on the cache work from #937 and the sparse BDA page table from #1270. Memory and caches: - Start texture/buffer collection 256 MiB below the device budget instead of only after it is exhausted, and force collection at submission boundaries. - Allow forced collections to evict recently touched clean textures during a loading burst, with larger per-frame eviction budgets. - Relax allocation-failure eviction to the current LRU tick. - Drop large image-heap tables that no recent draw acquired so their pinned images can be reclaimed. - Move guest buffer mirrors to host-visible memory and stage large dirty texture downloads in a dedicated buffer. - Widen per-page write-watcher counters from 7 to 15 bits. - Keep the #1271 allocation-failure eviction/retry path. Shaders: - Recover uniform conditions from scalar lane-mask branches when lowering nested sampler-descriptor phis. - Plan lane-selected image descriptor tables (V_READLANE of per-lane buffer loads) as indexed image heaps so the GPU selects the descriptor slot. - Fall back to the true-path sampler variant when a sampler is selected by genuinely lane-varying state. Result: The game reaches the first campaign intro ("HAMBURG 1945") and continues running at roughly 15.2 GiB VRAM. Known limitation - this is a hack: The buffer/texture cache eviction and the transfer of guest buffer mirrors to host memory are a workaround, not a proper fix. They trade VRAM for PCIe traffic, re-uploads and eviction churn. A proper solution needs guest-memory import/zero-copy for buffers, a real residency and eviction policy for images, and GPU-side selection for lane-varying descriptors. PS: Not sure from all the cache commits which are necessary to get to the first mission screen as I tried a bunch of commits to get it to that stage.
PthreadRwlockDestroy treated a null backing object as unimplemented and
aborted. A statically-initialized rwlock that was never locked, or one
that has already been destroyed, has no backing object, so destroying it
is a no-op. PthreadMutexDestroy already tolerates this; make the rwlock
path match.

Call of Duty: Vanguard hits this during startup and would otherwise abort
before reaching the frontend.
When the user opts into host networking (--network-connected), report a
signed-in NP user instead of a signed-out one. Games that require PSN
sign-in otherwise stop at a "connection failed" dialog rather than
falling back to their offline menus.

Call of Duty: Vanguard now proceeds through its online-services
connection attempt to the offline main menu (and campaign) instead of
stopping at the PSN error dialog.
Resource tracking only recognized a single two-arm diamond when lowering a Phi descriptor word. Sampler handles selected through nested structured merges (such as branchy constant-buffer records) kept the native Phi, failed runtime-value validation, and aborted with "GetSamplerResource dword 0 is not a valid runtime value".

Follow the structured CFG's merge_block to identify the controlling conditional branch, partition operands by arm with a bounded reachability walk, and lower each arm recursively into SelectU32. The existing diamond path is reused as a fallback and now lowers its arms too. Uniformity is still enforced through ValidateRuntimeValue on the branch condition, so lane-varying selections remain rejected.

Add a regression test with a two-level merge over memory-resident S# leaves: the uniform case lowers to a Select and the LaneId-based case still fails.
The decoder had V_LSHLREV_B64 (0x2ff) and V_LSHRREV_B64 (0x300) but rejected 0x301, so any shader containing a 64-bit arithmetic shift failed the CFG build with "VOP3 opcode is not implemented". Vanguard's mission pixel shaders use it for 64-bit index/address arithmetic (captured words d7010007 00020498 at pc 0x228).

Add the opcode to the enum and the VOP3 map, count it as a two-source op, and translate it to ShiftRightArithmetic64 with reversed operands, matching the existing B64 shifts. Extend the native U64 translation test with both a synthetic encoding and the exact captured encoding.
Call of Duty: Vanguard mounts its campaign pack, enumerates it, then calls sceAppContentAddcontUnmount. It later resolves the campaign fastfiles and mission .xsub files through the /addcont0 mount point. Removing the mount turns those reads into ENOENT, and the game restarts itself with DEV ERROR 6036.

Keep the filesystem mount and the mount bookkeeping alive so later reads succeed. A subsequent mount request returns the existing mount point instead of allocating another slot.

This is a workaround: unmount is effectively deferred for the process lifetime. It is sufficient for titles with a single additional-content pack; honoring the unmount while retaining the mount point (for example with reference tracking or a grace period) would be the complete fix.
- Pressure is judged by the cache's own bytes. Device-wide usage also counts
  the images spilled to host memory, which on a 6 GB card kept the collector in
  its aggressive mode forever, recreating ~100 buffers a second.
- An aged dirty buffer is always downloaded and dropped. Retaining it left its
  GPU-written bytes owning the pages, and images sharing those pages went black.
- Entries age in presented frames, not collector runs: the collector runs once
  per guest submission, and a title can submit a hundred times a frame.
  GraphicContext counts presented frames; the LRU clock adds one step per 512
  collector runs so a stretch without presents still ages.
- The cache tests present frames to age their entries, and the dirty-GC test
  follows the new policy.

(cherry picked from commit a4c60d20d4)
The texture collector could not keep a 4K title in a 6 GB card. Measured on
Spider-Man:

- Entries age in presented frames. Counted in collector runs, one per guest
  submission, an age of 8 evicted textures inside the frame that used them, to
  recreate them the next: 11 000 image creations a second at the title menu.
  An image used in the frame being recorded is never a candidate. Title menu:
  1 fps to 30 fps.
- Pressure is judged by the cache's own image bytes. Device-wide usage counts
  the images the cache spilled to host memory and never falls.
- Under pressure, eviction is budgeted per frame in bytes actually freed, in
  proportion to the excess (a quarter of it over the critical mark, an eighth
  over the pressure mark, at least 64 or 16 MiB, at most 1 024 images a
  frame). A budget per run churned; a small fixed count was spent on images the
  collector then skipped.
- Under pressure a GPU-written tiled image is written back, detiled, and
  evicted like any other, within 256 MiB of write-back a frame (an image that
  does not fit what is left waits for the next frame, unless it is the first).
  They were never
  evicted before: 3 500 of every 4 000 candidates, so the cache grew to 13.5 GB
  and the NVIDIA driver crashed in present. A streaming burst now returns to the
  threshold within nine frames.
- The collector test helper starts each scenario with an empty frame budget.

(cherry picked from commit 4b728c656e)
TextureCache::DeleteImage and BufferCache::DeleteBuffer destroyed their resource at once when no
guest command buffer was active, which is where a guest memory unmap runs. Command buffers
submitted just before could still be sampling the destroyed images.

CommandScheduler::DeferRelease queues an operation without requiring an active command buffer; it
runs once the GPU has finished the current tick. Both caches release through it, and keep a
resource that was bound again in a tick the GPU has not finished.

(cherry picked from commit 291f4bd446)
The BDA page table has one 8-byte entry per 16 KiB page of the whole guest
address space (1 TiB plus the 512 GiB extended range), so it takes 768 MiB
of device memory up front. Games map a few tens of GiB of that space, so
almost all of the table stays zero; on a 4 GB GPU it is a fifth of VRAM.

Where the device supports sparse residency with non-resident reads
returning zero, create the table as a sparse buffer and bind 1 MiB chunks
(each covering 2 GiB of guest addresses) when a game buffer is registered
in them. Unbound entries read as zero, which the shaders already treat as
an unmapped page, so the shader side is unchanged. New chunks are zeroed
before the entries are written, and binding waits for the queue to go idle
so a running shader never sees a chunk before it is cleared; binds only
happen the first few times the guest maps memory in a new region.

Devices without sparse residency keep the fully resident table.

Astro Bot, RTX 3050 Laptop 4 GB: process VRAM use per nvidia-smi at the
same point drops from 2991 MiB to 2413 MiB.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit a042eddb2f)
Work recorded before EnsureResident but submitted after the bind could
read entries in a freshly bound chunk before the zero fill recorded after
it ran, and use whatever the memory held as a device address. Clear each
new chunk through a temporary buffer in a submission of its own before
binding it, so the table only ever exposes zeros or real entries. This
also removes the need to idle the queue before binding.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 4301dad641)
The translator models scalar `S_AND_B64 VCC, EXEC, mask` tests as per-lane
bit tests, so descriptor phis behind those branches failed runtime-value
validation even though the branch is wave-uniform. Recover the scalar
predicate from the canonical lane-bit-test shape, and use it for nested
descriptor phi lowering.

When a sampler descriptor is selected by genuinely lane-varying state
(such as a per-pixel float comparison reduced by the hardware branch), the
host walker cannot evaluate the choice. Fall back to the true-path variant
with a warning instead of aborting shader compilation.
A pixel shader can assemble an image descriptor by reading a per-lane
record from a buffer and broadcasting it with V_READLANE. Resource
tracking saw the scalar ReadLane values as non-runtime descriptors and
aborted.

Recognize ReadLane (and a guarded Select around it) whose source is a
per-lane LoadBufferU32x4 record, and plan it as an indexed descriptor
table so the GPU selects the slot from the guest table. Materialize an
indexed image heap using the buffer's record stride instead of assuming
DWORD probes.
Run the texture and buffer collectors from submission and allocation
pressure, evict clean buffers and unused clean images, and force the
caches past their per-cache marks when device usage reaches the budget.
Last-resort allocation-failure path: write back and evict older idle
images, finish the GPU work, and retry the image up to three times.
This can churn textures and stall the GPU thread; it is intended as a
low-VRAM fallback, not a general eviction policy.
Keep a 256 MiB watermark below the device budget and collect at
submission boundaries before an allocation is already at risk. Forced
collections may evict recently touched textures and use larger per-frame
budgets, since a loading burst touches its whole working set every frame.

Drop large image-heap tables that no recent draw acquired so their pinned
images can be reclaimed, and relax allocation-failure eviction to the
current LRU tick.
The game can place more than 127 small textures in one guest page, which
overflowed the 7-bit watcher count. Use a 15-bit counter; the page table
grows from one to two bytes per page.
Guest buffers duplicate host memory, and on a 16 GiB card they competed
with the texture working set. Allocate them in host-visible memory and
leave device-local space for images.

Large dirty textures can exceed the shared download ring's mapped range;
stage those in a dedicated buffer instead of aborting, matching the
buffer-download path.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:10:10 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Review in Change Stack →

Walkthrough

The changes add pressure-based GPU cache collection, sparse buffer residency, and allocation-time eviction. Shader compilation gains a 64-bit arithmetic-right-shift opcode and expanded descriptor tracking. Runtime library changes affect rwlock destruction, add-on content unmounting, and NP-manager responses.

Suggested reviewers: nmzik, shadowbeat070, senaxx

Priority: Normal

Change: Bug fix

Merge Risk: Moderate · up to ad6d6

This change moves Call of Duty: Vanguard toward the first mission, but it introduces GPU resource-lifetime hazards, shader-descriptor test conflicts, and global behavior changes in add-on mounts and NP state. These could cause crashes, wrong rendering, or broken online flows in other titles. Fix the eviction lifetime and test or descriptor-merge issues before merging.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 11.84% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names Call of Duty: Vanguard and the goal of reaching the first mission screen, which matches the stated objective. It is specific, but it does not name the main technical changes (memory ca…
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.
Description check Passed The pull request description directly matches the changeset. It covers GPU cache eviction, sparse residency, memory pressure handling, descriptor tracking, shader updates, and the reported Vanguard lo…
Full details: Title check

Explanation

The title names Call of Duty: Vanguard and the goal of reaching the first mission screen, which matches the stated objective. It is specific, but it does not name the main technical changes (memory cache collection, descriptor tracking, shader lane-mask handling). The title is a fair summary of the developer-facing goal, so it passes.

Full details: Description check

Explanation

The pull request description directly matches the changeset. It covers GPU cache eviction, sparse residency, memory pressure handling, descriptor tracking, shader updates, and the reported Vanguard loading result.

Full details: Docstring Coverage

Explanation

Docstring coverage is 11.84% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 76 functions across 28 files. (2 skipped: 2 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-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#issuecomment-6470889304) <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1961?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 --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> The changes add pressure-based GPU cache collection, sparse buffer residency, and allocation-time eviction. Shader compilation gains a 64-bit arithmetic-right-shift opcode and expanded descriptor tracking. Runtime library changes affect rwlock destruction, add-on content unmounting, and NP-manager responses. **Suggested reviewers:** `nmzik`, `shadowbeat070`, `senaxx` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <strong>Priority: <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/priority-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Normal</strong> <!-- change_assessment_commit:"ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3" --> **Change:** Bug fix <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/risk-normal-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Moderate</strong> · up to <code>ad6d6</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `ad6d6` --> <!-- final_review_risk_coverage:{"sourceCommitId":"ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3","coveredCommitId":"ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3","kind":"reviewed"} --> This change moves Call of Duty: Vanguard toward the first mission, but it introduces GPU resource-lifetime hazards, shader-descriptor test conflicts, and global behavior changes in add-on mounts and NP state. These could cause crashes, wrong rendering, or broken online flows in other titles. Fix the eviction lifetime and test or descriptor-merge issues 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-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 11.84% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names Call of Duty: Vanguard and the goal of reaching the first mission screen, which matches the stated objective. It is specific, but it does not name the main technical changes (memory ca… | | 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. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The pull request description directly matches the changeset. It covers GPU cache eviction, sparse residency, memory pressure handling, descriptor tracking, shader updates, and the reported Vanguard lo… | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> **Explanation** The title names Call of Duty: Vanguard and the goal of reaching the first mission screen, which matches the stated objective. It is specific, but it does not name the main technical changes (memory cache collection, descriptor tracking, shader lane-mask handling). The title is a fair summary of the developer-facing goal, so it passes. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> **Explanation** The pull request description directly matches the changeset. It covers GPU cache eviction, sparse residency, memory pressure handling, descriptor tracking, shader updates, and the reported Vanguard loading result. </dd> </dl> </details> </dd> </dl> </details> <details> <summary><strong>Full details: Docstring Coverage</strong></summary> <dl> <dd> **Explanation** Docstring coverage is 11.84% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 76 functions across 28 files. (2 skipped: 2 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=1961)! 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 -->
@ -327,0 +373,4 @@
m_memory_tracker.UntrackMemory(buffer.CpuAddress(), buffer.Size());
Unregister(id);
ReleaseBuffer(id);
}
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Major · Stability & Availability · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
rg -nP '\blast_use_tick\b' --type=cpp -C2
rg -nP 'GetBdaPageTableBuffer\s*\(' --type=cpp -C4

Repository: KytyPS5/KytyPS5

Length of output: 5763


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- bufferCache deletion and BDA-related definitions ---'
nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '130,190p;320,390p;520,630p;680,820p'
printf '%s\n' '--- bufferCache declarations and callers ---'
rg -n -F --glob '*.{cpp,h}' -e 'DeleteBufferForAllocation' -e 'DeleteBuffer(' -e 'ReleaseBuffer(' -e 'Register(' -e 'Unregister(' -e 'PrepareBda' -e 'BdaPagetable' src/graphics/host_gpu/renderer
printf '%s\n' '--- descriptor BDA binding context ---'
nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '1015,1090p'
printf '%s\n' '--- scheduler deferred-release contract ---'
rg -n -F --glob '*.{cpp,h}' -e 'DeferRelease' -e 'CurrentTick' -e 'IsFree' src/graphics/host_gpu/renderer src/graphics/host_gpu | head -200

Repository: KytyPS5/KytyPS5

Length of output: 33950


Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- BDA registration and unregistration ---'
nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '80,145p;430,510p'
printf '%s\n' '--- PrepareBda and render call sites ---'
nl -ba src/graphics/host_gpu/renderer/renderContext.cpp | sed -n '90,155p'
nl -ba src/graphics/host_gpu/renderer/renderCompute.cpp | sed -n '330,420p;485,525p'
nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '840,890p'
printf '%s\n' '--- BDA-related symbols and buffer acquisition paths ---'
rg -n -F --glob '*.{cpp,h}' -e 'QueueBdaSync' -e 'TakeBdaSync' -e 'SynchronizeBuffersInRange' -e 'BdaPagetable' -e 'BufferDeviceAddress' -e 'ObtainBuffer(' -e 'ObtainBufferForImage(' src/graphics/host_gpu/renderer | head -240

Repository: KytyPS5/KytyPS5

Length of output: 24439


Script executed:

#!/bin/bash
set -e
nl -ba src/graphics/host_gpu/renderer/commandScheduler.cpp | sed -n '200,265p;315,335p'
nl -ba src/graphics/host_gpu/renderer/commandScheduler.h | sed -n '35,60p'

Repository: KytyPS5/KytyPS5

Length of output: 5000


Defer allocation-path buffer release until the current tick completes.

PrepareBda synchronizes BDA ranges but does not update last_use_tick. A BDA shader can therefore use a registered buffer while its recorded tick remains free. EvictCleanForAllocation then calls ReleaseBuffer, which can erase the buffer before that GPU work completes.

Proposed fix
--- "a/src/graphics/host_gpu/renderer/cache/bufferCache.cpp"
+++ "b/src/graphics/host_gpu/renderer/cache/bufferCache.cpp"
@@ -368,12 +368,11 @@
 	return freed;
 }
 
 void BufferCache::DeleteBufferForAllocation(BufferId id) {
 	auto& buffer = m_slot_buffers[id];
 	m_memory_tracker.UntrackMemory(buffer.CpuAddress(), buffer.Size());
-	Unregister(id);
-	ReleaseBuffer(id);
+	DeleteBuffer(id);
 }
 
 BufferId BufferCache::FindBuffer(uint64_t vaddr, uint64_t size) {
 	if (vaddr == 0) {
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.

void BufferCache::DeleteBufferForAllocation(BufferId id) {
	auto& buffer = m_slot_buffers[id];
	m_memory_tracker.UntrackMemory(buffer.CpuAddress(), buffer.Size());
	DeleteBuffer(id);
}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432300) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Stability & Availability** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash #!/bin/bash rg -nP '\blast_use_tick\b' --type=cpp -C2 rg -nP 'GetBdaPageTableBuffer\s*\(' --type=cpp -C4 ``` Repository: KytyPS5/KytyPS5 Length of output: 5763 --- Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- bufferCache deletion and BDA-related definitions ---' nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '130,190p;320,390p;520,630p;680,820p' printf '%s\n' '--- bufferCache declarations and callers ---' rg -n -F --glob '*.{cpp,h}' -e 'DeleteBufferForAllocation' -e 'DeleteBuffer(' -e 'ReleaseBuffer(' -e 'Register(' -e 'Unregister(' -e 'PrepareBda' -e 'BdaPagetable' src/graphics/host_gpu/renderer printf '%s\n' '--- descriptor BDA binding context ---' nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '1015,1090p' printf '%s\n' '--- scheduler deferred-release contract ---' rg -n -F --glob '*.{cpp,h}' -e 'DeferRelease' -e 'CurrentTick' -e 'IsFree' src/graphics/host_gpu/renderer src/graphics/host_gpu | head -200 ``` Repository: KytyPS5/KytyPS5 Length of output: 33950 --- Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- BDA registration and unregistration ---' nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '80,145p;430,510p' printf '%s\n' '--- PrepareBda and render call sites ---' nl -ba src/graphics/host_gpu/renderer/renderContext.cpp | sed -n '90,155p' nl -ba src/graphics/host_gpu/renderer/renderCompute.cpp | sed -n '330,420p;485,525p' nl -ba src/graphics/host_gpu/renderer/pipeline/descriptors.cpp | sed -n '840,890p' printf '%s\n' '--- BDA-related symbols and buffer acquisition paths ---' rg -n -F --glob '*.{cpp,h}' -e 'QueueBdaSync' -e 'TakeBdaSync' -e 'SynchronizeBuffersInRange' -e 'BdaPagetable' -e 'BufferDeviceAddress' -e 'ObtainBuffer(' -e 'ObtainBufferForImage(' src/graphics/host_gpu/renderer | head -240 ``` Repository: KytyPS5/KytyPS5 Length of output: 24439 --- Script executed: ```bash #!/bin/bash set -e nl -ba src/graphics/host_gpu/renderer/commandScheduler.cpp | sed -n '200,265p;315,335p' nl -ba src/graphics/host_gpu/renderer/commandScheduler.h | sed -n '35,60p' ``` Repository: KytyPS5/KytyPS5 Length of output: 5000 --- </dd> </dl> </details> **Defer allocation-path buffer release until the current tick completes.** `PrepareBda` synchronizes BDA ranges but does not update `last_use_tick`. A BDA shader can therefore use a registered buffer while its recorded tick remains free. `EvictCleanForAllocation` then calls `ReleaseBuffer`, which can erase the buffer before that GPU work completes. <details> <summary>Proposed fix</summary> <dl> <dd> ```diff --- "a/src/graphics/host_gpu/renderer/cache/bufferCache.cpp" +++ "b/src/graphics/host_gpu/renderer/cache/bufferCache.cpp" @@ -368,12 +368,11 @@ return freed; } void BufferCache::DeleteBufferForAllocation(BufferId id) { auto& buffer = m_slot_buffers[id]; m_memory_tracker.UntrackMemory(buffer.CpuAddress(), buffer.Size()); - Unregister(id); - ReleaseBuffer(id); + DeleteBuffer(id); } BufferId BufferCache::FindBuffer(uint64_t vaddr, uint64_t size) { if (vaddr == 0) { ``` </dd> </dl> </details> <!-- suggestion_start --> <details> <summary>Committable suggestion</summary> <dl> <dd> > <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg" width="20" height="20" align="absmiddle" alt=""></picture> **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 void BufferCache::DeleteBufferForAllocation(BufferId id) { auto& buffer = m_slot_buffers[id]; m_memory_tracker.UntrackMemory(buffer.CpuAddress(), buffer.Size()); DeleteBuffer(id); } ``` </dd> </dl> </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:72e1a309528c18f0586dc563 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -410,0 +463,4 @@
m_graphics.GetDeviceMemoryUsage() + AllocationHeadroom >=
m_graphics.GetTotalMemoryBudget()) {
(void)EvictCleanForAllocation(64ull << 20u);
}
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Minor · Performance & Scalability · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
rg -nP 'GraphicContext::(GetDeviceMemoryUsage|GetTotalMemoryBudget|GetHeapUsage)\s*\(' --type=cpp -A25

Repository: KytyPS5/KytyPS5

Length of output: 4769


Script executed:

set -o pipefail
printf '%s\n' '--- vma.cpp:80-155 ---'
nl -ba src/graphics/host_gpu/vma.cpp | sed -n '80,155p'
printf '%s\n' '--- MemoryUsage declarations and mappings ---'
rg -n -F --glob '*.{h,hpp,cpp,cc}' -e 'enum class MemoryUsage' -e 'MemoryUsage::Upload' -e 'VMA_MEMORY_USAGE_AUTO_PREFER_HOST' src
printf '%s\n' '--- bufferCache allocation and eviction ---'
rg -n -F --glob 'bufferCache.{h,cpp}' -e 'CreateBuffer' -e 'EvictCleanForAllocation' -e 'MemoryUsage::Upload' -e 'Allocate' src/graphics/host_gpu/renderer/cache
nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '420,500p'

Repository: KytyPS5/KytyPS5

Length of output: 10298


Script executed:

printf '%s\n' '--- streamBuffer.cpp ---'
nl -ba src/graphics/host_gpu/renderer/cache/streamBuffer.cpp | sed -n '1,80p'
printf '%s\n' '--- eviction implementation ---'
nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '330,380p'
printf '%s\n' '--- Buffer allocation declaration/implementation ---'
rg -n -F --glob 'streamBuffer.{h,cpp}' -e 'class Buffer' -e 'Buffer::Buffer' -e 'MemoryUsage usage' -e 'CreateBuffer'

Repository: KytyPS5/KytyPS5

Length of output: 6465


Align buffer eviction with the measured heap.

On discrete GPUs, GetDeviceMemoryUsage() and GetTotalMemoryBudget() include only device-local heaps. MemoryUsage::Upload requests host-visible memory. If Vulkan places these buffers in a non-device-local heap, EvictCleanForAllocation(64ull << 20u) frees memory that the pressure gate does not measure. Repeated CreateBuffer calls can then evict clean buffers without reducing device-local pressure, causing unnecessary re-uploads.

Use the allocation's actual heap when deciding whether eviction can relieve pressure, or include the upload heap in the pressure metric.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432351) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor** · **Performance & Scalability** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash #!/bin/bash rg -nP 'GraphicContext::(GetDeviceMemoryUsage|GetTotalMemoryBudget|GetHeapUsage)\s*\(' --type=cpp -A25 ``` Repository: KytyPS5/KytyPS5 Length of output: 4769 --- Script executed: ```bash set -o pipefail printf '%s\n' '--- vma.cpp:80-155 ---' nl -ba src/graphics/host_gpu/vma.cpp | sed -n '80,155p' printf '%s\n' '--- MemoryUsage declarations and mappings ---' rg -n -F --glob '*.{h,hpp,cpp,cc}' -e 'enum class MemoryUsage' -e 'MemoryUsage::Upload' -e 'VMA_MEMORY_USAGE_AUTO_PREFER_HOST' src printf '%s\n' '--- bufferCache allocation and eviction ---' rg -n -F --glob 'bufferCache.{h,cpp}' -e 'CreateBuffer' -e 'EvictCleanForAllocation' -e 'MemoryUsage::Upload' -e 'Allocate' src/graphics/host_gpu/renderer/cache nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '420,500p' ``` Repository: KytyPS5/KytyPS5 Length of output: 10298 --- Script executed: ```bash printf '%s\n' '--- streamBuffer.cpp ---' nl -ba src/graphics/host_gpu/renderer/cache/streamBuffer.cpp | sed -n '1,80p' printf '%s\n' '--- eviction implementation ---' nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '330,380p' printf '%s\n' '--- Buffer allocation declaration/implementation ---' rg -n -F --glob 'streamBuffer.{h,cpp}' -e 'class Buffer' -e 'Buffer::Buffer' -e 'MemoryUsage usage' -e 'CreateBuffer' ``` Repository: KytyPS5/KytyPS5 Length of output: 6465 --- </dd> </dl> </details> **Align buffer eviction with the measured heap.** On discrete GPUs, `GetDeviceMemoryUsage()` and `GetTotalMemoryBudget()` include only device-local heaps. `MemoryUsage::Upload` requests host-visible memory. If Vulkan places these buffers in a non-device-local heap, `EvictCleanForAllocation(64ull << 20u)` frees memory that the pressure gate does not measure. Repeated `CreateBuffer` calls can then evict clean buffers without reducing device-local pressure, causing unnecessary re-uploads. Use the allocation's actual heap when deciding whether eviction can relieve pressure, or include the upload heap in the pressure metric. <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:82aafab5d3663d0c9459c666 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -210,0 +261,4 @@
victims.push_back(id);
bytes += image->AccountedSize();
return bytes >= EVICT_TARGET;
});
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Major · Stability & Availability · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
rg -nP 'ForEachItemBelow' -C12 --type=cpp -g '*lru*' -g '*Lru*' -g '*LeastRecently*'
fd -i 'lru' --exec sed -n '1,200p' {}

Repository: KytyPS5/KytyPS5

Length of output: 13271


Script executed:

#!/bin/bash
set -o pipefail
printf '%s\n' '--- relevant definitions and references ---'
rg -n -F --glob '*.cpp' --glob '*.h' \
  -e 'EvictForAllocationFailure' \
  -e 'EvictForAllocation(' \
  -e 'FindImage' \
  -e 'FindTexture' \
  -e 'tick_accessed_last' \
  -e 'IsFree(' \
  -e 'CurrentTick()' \
  -e 'Finish()' \
  src/graphics/host_gpu/renderer/cache src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 240

printf '%s\n' '--- textureCache.cpp relevant blocks ---'
nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '150,330p'
printf '%s\n' '--- textureCache declarations ---'
rg -n -C 8 -F --glob '*.h' \
  -e 'EvictForAllocationFailure' \
  -e 'EvictForAllocation' \
  -e 'FindImage' \
  -e 'FindTexture' \
  -e 'tick_accessed_last' \
  src/graphics/host_gpu/renderer/cache src/graphics/host_gpu/renderer
printf '%s\n' '--- scheduler/image cleanup definitions ---'
rg -n -C 12 -F --glob '*.cpp' --glob '*.h' \
  -e 'SafeToDownload' \
  -e 'Unregister' \
  -e 'registered = false' \
  -e 'TryFree' \
  -e 'Finish()' \
  src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 260

Repository: KytyPS5/KytyPS5

Length of output: 42843


Script executed:

#!/bin/bash
set -o pipefail
printf '%s\n' '--- references ---'
rg -n -F --glob '*.cpp' --glob '*.h' \
  -e 'EvictForAllocationFailure' -e 'EvictForAllocation(' \
  -e 'FindImage' -e 'FindTexture' -e 'tick_accessed_last' \
  -e 'IsFree(' -e 'CurrentTick()' -e 'Finish()' \
  src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 300
printf '%s\n' '--- texture cache ---'
nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '150,330p'
printf '%s\n' '--- declarations ---'
rg -n -C 10 -F --glob '*.h' \
  -e 'EvictForAllocationFailure' -e 'EvictForAllocation' \
  -e 'FindImage' -e 'FindTexture' -e 'tick_accessed_last' \
  src/graphics/host_gpu/renderer/cache src/graphics/host_gpu/renderer
printf '%s\n' '--- release and cleanup ---'
rg -n -C 12 -F --glob '*.cpp' --glob '*.h' \
  -e 'SafeToDownload' -e 'Unregister' -e 'registered = false' \
  -e 'TryFree' -e 'Finish()' \
  src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 320

Repository: KytyPS5/KytyPS5

Length of output: 42107


Exclude current-tick images from allocation-failure eviction.

FindImage records the current scheduler tick. The fallback can select that image because ForEachItemBelow(clock) includes entries whose tick equals clock. It then unregisters the image before deferred release, so the current command can lose its resolved image. Finish() waits only through the previous tick.

Suggested fix
 		auto* image = m_slot_images.try_get(id);
 		if (image == nullptr || !image->registered || image->depth_id ||
 		    image->info.IsDepth() ||
 		    image->heap_refs.load(std::memory_order_relaxed) != 0u ||
-		    image->binding.is_bound || image->binding.is_target) {
+		    image->binding.is_bound || image->binding.is_target ||
+		    image->tick_accessed_last >= m_scheduler.CurrentTick()) {
 			return false;
 		}
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.

	m_lru_cache.ForEachItemBelow(clock, [&](ImageId id) {
		if (id == keep) {
			return false;
		}
		auto* image = m_slot_images.try_get(id);
		if (image == nullptr || !image->registered || image->depth_id ||
		    image->info.IsDepth() ||
		    image->heap_refs.load(std::memory_order_relaxed) != 0u ||
		    image->binding.is_bound || image->binding.is_target ||
		    image->tick_accessed_last >= m_scheduler.CurrentTick()) {
			return false;
		}
		if (image->IsGpuModified() && image->SafeToDownload()) {
			if (downloaded + image->info.data.size > DOWNLOAD_BUDGET) {
				return false;
			}
			downloaded += image->info.data.size;
		}
		victims.push_back(id);
		bytes += image->AccountedSize();
		return bytes >= EVICT_TARGET;
	});
**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432366) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Stability & Availability** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash #!/bin/bash rg -nP 'ForEachItemBelow' -C12 --type=cpp -g '*lru*' -g '*Lru*' -g '*LeastRecently*' fd -i 'lru' --exec sed -n '1,200p' {} ``` Repository: KytyPS5/KytyPS5 Length of output: 13271 --- Script executed: ```bash #!/bin/bash set -o pipefail printf '%s\n' '--- relevant definitions and references ---' rg -n -F --glob '*.cpp' --glob '*.h' \ -e 'EvictForAllocationFailure' \ -e 'EvictForAllocation(' \ -e 'FindImage' \ -e 'FindTexture' \ -e 'tick_accessed_last' \ -e 'IsFree(' \ -e 'CurrentTick()' \ -e 'Finish()' \ src/graphics/host_gpu/renderer/cache src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 240 printf '%s\n' '--- textureCache.cpp relevant blocks ---' nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '150,330p' printf '%s\n' '--- textureCache declarations ---' rg -n -C 8 -F --glob '*.h' \ -e 'EvictForAllocationFailure' \ -e 'EvictForAllocation' \ -e 'FindImage' \ -e 'FindTexture' \ -e 'tick_accessed_last' \ src/graphics/host_gpu/renderer/cache src/graphics/host_gpu/renderer printf '%s\n' '--- scheduler/image cleanup definitions ---' rg -n -C 12 -F --glob '*.cpp' --glob '*.h' \ -e 'SafeToDownload' \ -e 'Unregister' \ -e 'registered = false' \ -e 'TryFree' \ -e 'Finish()' \ src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 260 ``` Repository: KytyPS5/KytyPS5 Length of output: 42843 --- Script executed: ```bash #!/bin/bash set -o pipefail printf '%s\n' '--- references ---' rg -n -F --glob '*.cpp' --glob '*.h' \ -e 'EvictForAllocationFailure' -e 'EvictForAllocation(' \ -e 'FindImage' -e 'FindTexture' -e 'tick_accessed_last' \ -e 'IsFree(' -e 'CurrentTick()' -e 'Finish()' \ src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 300 printf '%s\n' '--- texture cache ---' nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '150,330p' printf '%s\n' '--- declarations ---' rg -n -C 10 -F --glob '*.h' \ -e 'EvictForAllocationFailure' -e 'EvictForAllocation' \ -e 'FindImage' -e 'FindTexture' -e 'tick_accessed_last' \ src/graphics/host_gpu/renderer/cache src/graphics/host_gpu/renderer printf '%s\n' '--- release and cleanup ---' rg -n -C 12 -F --glob '*.cpp' --glob '*.h' \ -e 'SafeToDownload' -e 'Unregister' -e 'registered = false' \ -e 'TryFree' -e 'Finish()' \ src/graphics/host_gpu/renderer src/graphics/host_gpu | head -n 320 ``` Repository: KytyPS5/KytyPS5 Length of output: 42107 --- </dd> </dl> </details> **Exclude current-tick images from allocation-failure eviction.** `FindImage` records the current scheduler tick. The fallback can select that image because `ForEachItemBelow(clock)` includes entries whose tick equals `clock`. It then unregisters the image before deferred release, so the current command can lose its resolved image. `Finish()` waits only through the previous tick. <details> <summary>Suggested fix</summary> <dl> <dd> ```diff auto* image = m_slot_images.try_get(id); if (image == nullptr || !image->registered || image->depth_id || image->info.IsDepth() || image->heap_refs.load(std::memory_order_relaxed) != 0u || - image->binding.is_bound || image->binding.is_target) { + image->binding.is_bound || image->binding.is_target || + image->tick_accessed_last >= m_scheduler.CurrentTick()) { return false; } ``` </dd> </dl> </details> <!-- suggestion_start --> <details> <summary>Committable suggestion</summary> <dl> <dd> > <picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg" width="20" height="20" align="absmiddle" alt=""></picture> **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 m_lru_cache.ForEachItemBelow(clock, [&](ImageId id) { if (id == keep) { return false; } auto* image = m_slot_images.try_get(id); if (image == nullptr || !image->registered || image->depth_id || image->info.IsDepth() || image->heap_refs.load(std::memory_order_relaxed) != 0u || image->binding.is_bound || image->binding.is_target || image->tick_accessed_last >= m_scheduler.CurrentTick()) { return false; } if (image->IsGpuModified() && image->SafeToDownload()) { if (downloaded + image->info.data.size > DOWNLOAD_BUDGET) { return false; } downloaded += image->info.data.size; } victims.push_back(id); bytes += image->AccountedSize(); return bytes >= EVICT_TARGET; }); ``` </dd> </dl> </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:689e755695e09e1daa987a4c --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -710,0 +783,4 @@
const auto condition = first->Arg(0).Resolve();
return ValidateRuntimeValue(m_program, condition, RuntimeValueType::Integer) ? condition
: Value {};
};
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Minor · Functional Correctness · Quick win

Supported by static analysis

Script executed:

set -eu
printf '%s\n' '--- diff for ResourceTracking.cpp ---'
git diff --unified=80 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
printf '%s\n' '--- relevant source ---'
nl -ba src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp | sed -n '650,840p'
printf '%s\n' '--- shared_predicate references ---'
rg -n -F -- 'shared_predicate' src/graphics/shader/recompiler
printf '%s\n' '--- SelectU32 references in ResourceTracking.cpp ---'
rg -n -F -- 'SelectU32' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
printf '%s\n' '--- EXEC/WQM references in ResourceTracking.cpp ---'
rg -n -e 'EXEC|WQM|exec|wqm' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp

Repository: KytyPS5/KytyPS5

Length of output: 43435


Script executed:

set -eu
printf '%s\n' '--- lane-mask and condition lowering references ---'
rg -n -e 'ConditionRef' -e 'LaneId' -e 'S_AND_B64' -e 'VCC' -e 'EXEC' src/graphics/shader/recompiler | sed -n '1,260p'
printf '%s\n' '--- SelectU32 constructions outside ResourceTracking.cpp ---'
rg -n -F -- 'ValueOpcode::SelectU32' src/graphics/shader/recompiler --glob '*.cpp' --glob '*.h' | sed -n '1,260p'
printf '%s\n' '--- relevant IR/value declarations ---'
rg -n -e 'enum class ValueOpcode' -e 'SelectU32' src/graphics/shader/recompiler/ir src/graphics/shader/recompiler | sed -n '1,220p'

Repository: KytyPS5/KytyPS5

Length of output: 35964


Script executed:

set -eu
printf '%s\n' '--- Translate.cpp mask and condition code ---'
nl -ba src/graphics/shader/recompiler/frontend/translate/Translate.cpp | sed -n '560,810p'
printf '%s\n' '--- Scalar.cpp S_AND_B64 and branch dispatch ---'
nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '90,135p'
nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '250,290p'
printf '%s\n' '--- Control.cpp mask save/restore code ---'
nl -ba src/graphics/shader/recompiler/frontend/translate/Control.cpp | sed -n '1,105p'
printf '%s\n' '--- ConditionRef backend and IR validation ---'
nl -ba src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp | sed -n '785,820p'
nl -ba src/graphics/shader/recompiler/ir/Program.cpp | sed -n '180,235p'

Repository: KytyPS5/KytyPS5

Length of output: 26299


Script executed:

set -eu
printf '%s\n' '--- S_U64_MASK definition and callers ---'
rg -n -F -- 'S_U64_MASK' src/graphics/shader/recompiler/frontend/translate
nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '1,90p'
nl -ba src/graphics/shader/recompiler/frontend/translate/Integer.cpp | sed -n '1,80p'
printf '%s\n' '--- VCC/EXEC state accessors and mask storage ---'
rg -n -e 'GetVcc|SetVcc|GetExec|SetExec|GetVccLo|SetVccLo|GetVccHi|SetVccHi|GetExecLo|SetExecLo|GetExecHi|SetExecHi' src/graphics/shader/recompiler/ir src/graphics/shader/recompiler/frontend/translate --glob '*.cpp' --glob '*.h'

Repository: KytyPS5/KytyPS5

Length of output: 28628


Script executed:

set -eu
nl -ba src/graphics/shader/recompiler/frontend/translate/Integer.cpp | sed -n '88,155p'
nl -ba src/graphics/shader/recompiler/frontend/translate/Translate.cpp | sed -n '110,180p'
nl -ba src/graphics/shader/recompiler/frontend/translate/Translate.cpp | sed -n '450,505p'

Repository: KytyPS5/KytyPS5

Length of output: 9799


Script executed:

set -eu
printf '%s\n' '--- scalar conditional select definitions ---'
rg -n -e 'ScalarSelect64' -e 'S_CSELECT_B32' -e 'ScalarSelect' src/graphics/shader/recompiler/frontend/translate src/graphics/shader/recompiler/ir
nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '290,380p'
nl -ba src/graphics/shader/recompiler/frontend/translate/Control.cpp | sed -n '240,380p'
printf '%s\n' '--- select factoring/simplification references ---'
rg -n -e 'BitwiseAnd.*Select' -e 'Select.*BitwiseAnd' -e 'SelectU32' src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp src/graphics/shader/recompiler/ir/passes/SsaRewrite.cpp src/graphics/shader/recompiler/ir/IREmitter.cpp

Repository: KytyPS5/KytyPS5

Length of output: 8951


Restrict shared_predicate to mask values proven nonzero when the predicate holds.

The current shape also matches scalar conditional selects. For example, S_CSELECT_B64 can write VCC as Select(SCC, runtime_value, 0) for both halves. If SCC is true while runtime_value is zero, VCC is zero, but shared_predicate returns SCC because the true arms are not immediate zero. This can select the wrong descriptor.

Accept only EXEC/WQM values, or otherwise prove that both true arms are nonzero whenever the shared predicate is true.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432382) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/amber-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Minor** · **Functional Correctness** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash set -eu printf '%s\n' '--- diff for ResourceTracking.cpp ---' git diff --unified=80 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp printf '%s\n' '--- relevant source ---' nl -ba src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp | sed -n '650,840p' printf '%s\n' '--- shared_predicate references ---' rg -n -F -- 'shared_predicate' src/graphics/shader/recompiler printf '%s\n' '--- SelectU32 references in ResourceTracking.cpp ---' rg -n -F -- 'SelectU32' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp printf '%s\n' '--- EXEC/WQM references in ResourceTracking.cpp ---' rg -n -e 'EXEC|WQM|exec|wqm' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 43435 --- Script executed: ```bash set -eu printf '%s\n' '--- lane-mask and condition lowering references ---' rg -n -e 'ConditionRef' -e 'LaneId' -e 'S_AND_B64' -e 'VCC' -e 'EXEC' src/graphics/shader/recompiler | sed -n '1,260p' printf '%s\n' '--- SelectU32 constructions outside ResourceTracking.cpp ---' rg -n -F -- 'ValueOpcode::SelectU32' src/graphics/shader/recompiler --glob '*.cpp' --glob '*.h' | sed -n '1,260p' printf '%s\n' '--- relevant IR/value declarations ---' rg -n -e 'enum class ValueOpcode' -e 'SelectU32' src/graphics/shader/recompiler/ir src/graphics/shader/recompiler | sed -n '1,220p' ``` Repository: KytyPS5/KytyPS5 Length of output: 35964 --- Script executed: ```bash set -eu printf '%s\n' '--- Translate.cpp mask and condition code ---' nl -ba src/graphics/shader/recompiler/frontend/translate/Translate.cpp | sed -n '560,810p' printf '%s\n' '--- Scalar.cpp S_AND_B64 and branch dispatch ---' nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '90,135p' nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '250,290p' printf '%s\n' '--- Control.cpp mask save/restore code ---' nl -ba src/graphics/shader/recompiler/frontend/translate/Control.cpp | sed -n '1,105p' printf '%s\n' '--- ConditionRef backend and IR validation ---' nl -ba src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp | sed -n '785,820p' nl -ba src/graphics/shader/recompiler/ir/Program.cpp | sed -n '180,235p' ``` Repository: KytyPS5/KytyPS5 Length of output: 26299 --- Script executed: ```bash set -eu printf '%s\n' '--- S_U64_MASK definition and callers ---' rg -n -F -- 'S_U64_MASK' src/graphics/shader/recompiler/frontend/translate nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '1,90p' nl -ba src/graphics/shader/recompiler/frontend/translate/Integer.cpp | sed -n '1,80p' printf '%s\n' '--- VCC/EXEC state accessors and mask storage ---' rg -n -e 'GetVcc|SetVcc|GetExec|SetExec|GetVccLo|SetVccLo|GetVccHi|SetVccHi|GetExecLo|SetExecLo|GetExecHi|SetExecHi' src/graphics/shader/recompiler/ir src/graphics/shader/recompiler/frontend/translate --glob '*.cpp' --glob '*.h' ``` Repository: KytyPS5/KytyPS5 Length of output: 28628 --- Script executed: ```bash set -eu nl -ba src/graphics/shader/recompiler/frontend/translate/Integer.cpp | sed -n '88,155p' nl -ba src/graphics/shader/recompiler/frontend/translate/Translate.cpp | sed -n '110,180p' nl -ba src/graphics/shader/recompiler/frontend/translate/Translate.cpp | sed -n '450,505p' ``` Repository: KytyPS5/KytyPS5 Length of output: 9799 --- Script executed: ```bash set -eu printf '%s\n' '--- scalar conditional select definitions ---' rg -n -e 'ScalarSelect64' -e 'S_CSELECT_B32' -e 'ScalarSelect' src/graphics/shader/recompiler/frontend/translate src/graphics/shader/recompiler/ir nl -ba src/graphics/shader/recompiler/frontend/translate/Scalar.cpp | sed -n '290,380p' nl -ba src/graphics/shader/recompiler/frontend/translate/Control.cpp | sed -n '240,380p' printf '%s\n' '--- select factoring/simplification references ---' rg -n -e 'BitwiseAnd.*Select' -e 'Select.*BitwiseAnd' -e 'SelectU32' src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp src/graphics/shader/recompiler/ir/passes/SsaRewrite.cpp src/graphics/shader/recompiler/ir/IREmitter.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 8951 --- </dd> </dl> </details> **Restrict `shared_predicate` to mask values proven nonzero when the predicate holds.** The current shape also matches scalar conditional selects. For example, `S_CSELECT_B64` can write `VCC` as `Select(SCC, runtime_value, 0)` for both halves. If `SCC` is true while `runtime_value` is zero, `VCC` is zero, but `shared_predicate` returns `SCC` because the true arms are not immediate zero. This can select the wrong descriptor. Accept only `EXEC`/`WQM` values, or otherwise prove that both true arms are nonzero whenever the shared predicate is true. <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:b9038f4eb2b5ae234b46933b --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -774,0 +967,4 @@
}
const auto value = LowerDescriptorValue(inst.Arg(true_arg));
return ValidateRuntimeValue(m_program, value) ? value : Value {};
}
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Major · Functional Correctness · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
# Check the fatal expectations against the approximation path.
rg -n -C3 'nonuniform sampler selection was accepted|nested lane-varying sampler selection was accepted' tests/ResourceTrackingTests.cpp
rg -n 'HasShaderMemoryWrites' src/graphics/shader/recompiler

Repository: KytyPS5/KytyPS5

Length of output: 1092


Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- ResourceTracking.cpp relevant declarations and functions ---'
sed -n '340,420p;900,1085p' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
printf '%s\n' '--- Program.cpp HasShaderMemoryWrites ---'
sed -n '205,255p' src/graphics/shader/recompiler/ir/Program.cpp
printf '%s\n' '--- MakeSource and approximation references ---'
rg -n -C8 -F -e 'm_approximate_sampler_select' -e 'MakeSource' src/graphics/shader/recompiler tests/ResourceTrackingTests.cpp
printf '%s\n' '--- Test fixture bodies ---'
sed -n '7540,7650p;8020,8140p' tests/ResourceTrackingTests.cpp
printf '%s\n' '--- Relevant diff ---'
git diff --unified=20 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp tests/ResourceTrackingTests.cpp

Repository: KytyPS5/KytyPS5

Length of output: 42477


Script executed:

#!/bin/bash
set -eu
printf '%s\n' '--- ConditionalSamplerPlan fixture and expectations ---'
sed -n '7510,7640p' tests/ResourceTrackingTests.cpp
printf '%s\n' '--- Exact approximation and source guard ---'
sed -n '940,975p;1048,1072p;1085,1118p' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp

Repository: KytyPS5/KytyPS5

Length of output: 9872


Align the sampler tests with the approximation path.

For sampler descriptors in shaders without memory writes, MakeSource enables m_approximate_sampler_select. When DescriptorCondition returns an empty value, both Phi lowerings select and validate the true-path sampler. The two affected tests still expect PlanAndTrack() to fail.

If this approximation is intended, update the tests to expect successful planning, true-path selection, and the one-time approximation log. Otherwise, restrict the approximation to preserve the rejection behavior. The fallback can select the wrong sampler on lanes that take the false path, but it is not silent because it emits a log.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432395) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash #!/bin/bash # Check the fatal expectations against the approximation path. rg -n -C3 'nonuniform sampler selection was accepted|nested lane-varying sampler selection was accepted' tests/ResourceTrackingTests.cpp rg -n 'HasShaderMemoryWrites' src/graphics/shader/recompiler ``` Repository: KytyPS5/KytyPS5 Length of output: 1092 --- Script executed: ```bash #!/bin/bash set -eu printf '%s\n' '--- ResourceTracking.cpp relevant declarations and functions ---' sed -n '340,420p;900,1085p' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp printf '%s\n' '--- Program.cpp HasShaderMemoryWrites ---' sed -n '205,255p' src/graphics/shader/recompiler/ir/Program.cpp printf '%s\n' '--- MakeSource and approximation references ---' rg -n -C8 -F -e 'm_approximate_sampler_select' -e 'MakeSource' src/graphics/shader/recompiler tests/ResourceTrackingTests.cpp printf '%s\n' '--- Test fixture bodies ---' sed -n '7540,7650p;8020,8140p' tests/ResourceTrackingTests.cpp printf '%s\n' '--- Relevant diff ---' git diff --unified=20 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp tests/ResourceTrackingTests.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 42477 --- Script executed: ```bash #!/bin/bash set -eu printf '%s\n' '--- ConditionalSamplerPlan fixture and expectations ---' sed -n '7510,7640p' tests/ResourceTrackingTests.cpp printf '%s\n' '--- Exact approximation and source guard ---' sed -n '940,975p;1048,1072p;1085,1118p' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 9872 --- </dd> </dl> </details> **Align the sampler tests with the approximation path.** For sampler descriptors in shaders without memory writes, `MakeSource` enables `m_approximate_sampler_select`. When `DescriptorCondition` returns an empty value, both Phi lowerings select and validate the true-path sampler. The two affected tests still expect `PlanAndTrack()` to fail. If this approximation is intended, update the tests to expect successful planning, true-path selection, and the one-time approximation log. Otherwise, restrict the approximation to preserve the rejection behavior. The fallback can select the wrong sampler on lanes that take the false path, but it is not silent because it emits a log. <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:014b6eccb720cfd82e451eb6 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -3214,6 +3539,7 @@ private:
indirect.table_offset = table_offset;
indirect.table_immediate = table_immediate;
indirect.table_stride = table_stride;
indirect.indexed = plan.table_indexed;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Major · Functional Correctness · Quick win

Supported by static analysis

Script executed:

#!/bin/bash
rg -n -C4 'a\.indexed != b\.indexed|shared_image_heap' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
rg -n -C2 'did not share their native image table|did not share its scalar use' tests/ResourceTrackingTests.cpp

Repository: KytyPS5/KytyPS5

Length of output: 2751


Script executed:

set -e
printf '%s\n' '--- InternSource ---'
sed -n '1288,1365p' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
printf '%s\n' '--- indexed assignment and materialization ---'
rg -n -C6 -F -e 'plan.table_indexed' -e 'MaterializeIndirectDescriptor' -e 'table_record_bytes' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
printf '%s\n' '--- tests ---'
sed -n '790,870p' tests/ResourceTrackingTests.cpp
printf '%s\n' '--- diff against specified merge base ---'
git diff --unified=12 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp tests/ResourceTrackingTests.cpp

Repository: KytyPS5/KytyPS5

Length of output: 43001


Allow indexed image sources to share the native heap.

InternSource still rejects different indexed values even when shared_image_heap is true. This prevents scalar and waterfall uses of the same image table from sharing one source. If the sources merge, preserve indexed in the merged descriptor so materialization keeps the indexed heap stride.

Suggested fix
-				    (!shared_image_heap && (a.table_offset != b.table_offset ||
+				    (!shared_image_heap && (a.table_offset != b.table_offset ||
 				                           a.table_immediate != b.table_immediate ||
-				                           a.table_stride != b.table_stride)) || a.indexed != b.indexed ||
+				                           a.table_stride != b.table_stride)) ||
+				    (!shared_image_heap && a.indexed != b.indexed) ||
 				    a.workgroup_axis != b.workgroup_axis ||
 				if (current.indirect_descriptor) {
+					current.indirect_descriptor->indexed |= descriptor.indirect_descriptor->indexed;
**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432410) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Quick win** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash #!/bin/bash rg -n -C4 'a\.indexed != b\.indexed|shared_image_heap' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp rg -n -C2 'did not share their native image table|did not share its scalar use' tests/ResourceTrackingTests.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 2751 --- Script executed: ```bash set -e printf '%s\n' '--- InternSource ---' sed -n '1288,1365p' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp printf '%s\n' '--- indexed assignment and materialization ---' rg -n -C6 -F -e 'plan.table_indexed' -e 'MaterializeIndirectDescriptor' -e 'table_record_bytes' src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp printf '%s\n' '--- tests ---' sed -n '790,870p' tests/ResourceTrackingTests.cpp printf '%s\n' '--- diff against specified merge base ---' git diff --unified=12 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp tests/ResourceTrackingTests.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 43001 --- </dd> </dl> </details> **Allow indexed image sources to share the native heap.** `InternSource` still rejects different `indexed` values even when `shared_image_heap` is true. This prevents scalar and waterfall uses of the same image table from sharing one source. If the sources merge, preserve `indexed` in the merged descriptor so materialization keeps the indexed heap stride. <details> <summary>Suggested fix</summary> <dl> <dd> ```diff - (!shared_image_heap && (a.table_offset != b.table_offset || + (!shared_image_heap && (a.table_offset != b.table_offset || a.table_immediate != b.table_immediate || - a.table_stride != b.table_stride)) || a.indexed != b.indexed || + a.table_stride != b.table_stride)) || + (!shared_image_heap && a.indexed != b.indexed) || a.workgroup_axis != b.workgroup_axis || ``` ```diff if (current.indirect_descriptor) { + current.indirect_descriptor->indexed |= descriptor.indirect_descriptor->indexed; ``` </dd> </dl> </details> <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:19396c8a4cdda831e9592e06 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -281,0 +296,4 @@
// alive so later reads succeed. A subsequent mount request returns the
// existing mount point instead of allocating another one.
LOGF("\t addcont unmount: keeping '%s' mounted (label '%s')\n", point.c_str(),
it->label.c_str());
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Major · Functional Correctness · Quick win

Release mount slots after unmount.

Each successful unmount retains its bookkeeping entry. After a game mounts and unmounts 64 distinct add-ons, the next distinct mount returns APP_CONTENT_ERROR_MOUNT_FULL. The repeatable --addcont option permits such catalogs (src/main.cpp:47–49). (raw.githubusercontent.com)

Restrict the retention workaround to affected titles, or otherwise reclaim slots while preserving the required Vanguard paths.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432422) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Quick win** **Release mount slots after unmount.** Each successful unmount retains its bookkeeping entry. After a game mounts and unmounts 64 distinct add-ons, the next distinct mount returns `APP_CONTENT_ERROR_MOUNT_FULL`. The repeatable `--addcont` option permits such catalogs (`src/main.cpp:47–49`). ([raw.githubusercontent.com](https://raw.githubusercontent.com/KytyPS5/KytyPS5/ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3/src/main.cpp)) Restrict the retention workaround to affected titles, or otherwise reclaim slots while preserving the required Vanguard paths. <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:5a27b80ab9e0ef7b8e90d657 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -3990,0 +3991,4 @@
// signed-in NP user. Without this, games that require PSN sign-in stop at a
// "connection failed" dialog instead of falling back to their offline menus.
static bool NpSignedInEnabled() {
return Config::IsNetworkConnected();
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Major · Functional Correctness · Heavy lift

Supported by static analysis

Script executed:

rg -n 'NpSignedInEnabled|IsNetworkConnected|HTTP_ERROR_TIMEOUT' src/libs/network.cpp src/emulator/config.* src/*.cpp

Repository: KytyPS5/KytyPS5

Length of output: 1300


Script executed:

set -eu
printf '%s\n' '--- current HTTP implementation ---'
sed -n '3200,3290p' src/libs/network.cpp
printf '%s\n' '--- current host-network and NP helpers ---'
sed -n '3760,3820p' src/libs/network.cpp
sed -n '3900,4020p' src/libs/network.cpp
printf '%s\n' '--- current NP request/state paths ---'
sed -n '4120,4330p' src/libs/network.cpp
sed -n '4550,4630p' src/libs/network.cpp
printf '%s\n' '--- base versus head for the relevant definitions ---'
git diff --unified=25 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/libs/network.cpp
printf '%s\n' '--- config declarations and title-specific options ---'
rg -n -F --glob '*.{cpp,h,hpp,md,json,yaml,yml,ini}' -e 'IsNetworkConnected' -e 'NetworkConnected' -e 'title' -e 'Vanguard' -e 'NpSignedInEnabled' src include docs README.md 2>/dev/null || true

Repository: KytyPS5/KytyPS5

Length of output: 41948


Script executed:

set -eu
printf '%s\n' '--- exact HTTP and NP availability blocks ---'
nl -ba src/libs/network.cpp | sed -n '3256,3274p;4435,4520p;3988,4000p'
printf '%s\n' '--- network configuration binding ---'
rg -n -F --glob '*.{cpp,h,hpp}' -e 'IsNetworkConnected' -e 'network_connected' -e 'networkConnected' -e 'Network' src 2>/dev/null | head -200
printf '%s\n' '--- configuration files and per-title game settings ---'
rg -n -F --glob '*.{cpp,h,hpp,json,ini,md,yaml,yml}' -e 'network' -e 'game settings' -e 'SetGameSettings' src launcher README.md 2>/dev/null | head -250
printf '%s\n' '--- title ID capture in network manager ---'
rg -n -F --glob 'src/libs/network.cpp' -e 'NpSetNpTitleId' -e 'NpTitleId' -e 'SystemContentParamSfoGetString' src/libs/network.cpp

Repository: KytyPS5/KytyPS5

Length of output: 24409


Do not advertise NP online state while HTTP remains a stub.

When host networking is enabled, NpCheckNpAvailability and NpCheckNpReachability complete successfully. Every valid request passed to HttpSendRequest is then marked and returned as HTTP_ERROR_TIMEOUT. Compared with the base revision, these checks previously returned signed-out, so titles could remain on their offline path. A title that uses successful NP checks to enter an HTTP flow can now take a path that fails at the HTTP call.

The Vanguard workaround intentionally enables this state globally. A title-specific opt-in is not established as a project requirement; the inspected configuration exposes only global network_connected control. Treat that scope change as a design decision, or keep NP availability consistent with the supported HTTP behavior.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432430) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Heavy lift** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/review-details.svg" width="16" height="16" align="absmiddle" alt=""></picture> Supported by static analysis</summary> <dl> <dd> Script executed: ```bash rg -n 'NpSignedInEnabled|IsNetworkConnected|HTTP_ERROR_TIMEOUT' src/libs/network.cpp src/emulator/config.* src/*.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 1300 --- Script executed: ```bash set -eu printf '%s\n' '--- current HTTP implementation ---' sed -n '3200,3290p' src/libs/network.cpp printf '%s\n' '--- current host-network and NP helpers ---' sed -n '3760,3820p' src/libs/network.cpp sed -n '3900,4020p' src/libs/network.cpp printf '%s\n' '--- current NP request/state paths ---' sed -n '4120,4330p' src/libs/network.cpp sed -n '4550,4630p' src/libs/network.cpp printf '%s\n' '--- base versus head for the relevant definitions ---' git diff --unified=25 1be1c6c4f928e52f740ae7f76841c1da74220e54 ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3 -- src/libs/network.cpp printf '%s\n' '--- config declarations and title-specific options ---' rg -n -F --glob '*.{cpp,h,hpp,md,json,yaml,yml,ini}' -e 'IsNetworkConnected' -e 'NetworkConnected' -e 'title' -e 'Vanguard' -e 'NpSignedInEnabled' src include docs README.md 2>/dev/null || true ``` Repository: KytyPS5/KytyPS5 Length of output: 41948 --- Script executed: ```bash set -eu printf '%s\n' '--- exact HTTP and NP availability blocks ---' nl -ba src/libs/network.cpp | sed -n '3256,3274p;4435,4520p;3988,4000p' printf '%s\n' '--- network configuration binding ---' rg -n -F --glob '*.{cpp,h,hpp}' -e 'IsNetworkConnected' -e 'network_connected' -e 'networkConnected' -e 'Network' src 2>/dev/null | head -200 printf '%s\n' '--- configuration files and per-title game settings ---' rg -n -F --glob '*.{cpp,h,hpp,json,ini,md,yaml,yml}' -e 'network' -e 'game settings' -e 'SetGameSettings' src launcher README.md 2>/dev/null | head -250 printf '%s\n' '--- title ID capture in network manager ---' rg -n -F --glob 'src/libs/network.cpp' -e 'NpSetNpTitleId' -e 'NpTitleId' -e 'SystemContentParamSfoGetString' src/libs/network.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 24409 --- </dd> </dl> </details> **Do not advertise NP online state while HTTP remains a stub.** When host networking is enabled, `NpCheckNpAvailability` and `NpCheckNpReachability` complete successfully. Every valid request passed to `HttpSendRequest` is then marked and returned as `HTTP_ERROR_TIMEOUT`. Compared with the base revision, these checks previously returned signed-out, so titles could remain on their offline path. A title that uses successful NP checks to enter an HTTP flow can now take a path that fails at the HTTP call. The Vanguard workaround intentionally enables this state globally. A title-specific opt-in is not established as a project requirement; the inspected configuration exposes only global `network_connected` control. Treat that scope change as a design decision, or keep NP availability consistent with the supported HTTP behavior. <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:d1d965bc7b955577055bd2dd --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -4275,2 +4308,4 @@
*account_id = 0;
if (NpSignedInEnabled()) {
*account_id = 0x00000000feedfaceull;
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:54 UTC · original

Major · Data Integrity & Integration · Quick win

Do not assign every user the same account ID.

When host networking is enabled, this returns the same account ID for every user_id. UserServiceGetLoginUserIdList can expose multiple local users in src/libs/libUserService.cpp Lines 88–101. A game that keys profiles by account ID will treat those users as the same account. Restrict the simulated account to the configured user, or provide distinct identities for supported users. (raw.githubusercontent.com)

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#discussion_r4401432442) <!-- coderabbit-ai-generated:v1 --> **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Data Integrity & Integration** · **Quick win** **Do not assign every user the same account ID.** When host networking is enabled, this returns the same account ID for every `user_id`. `UserServiceGetLoginUserIdList` can expose multiple local users in `src/libs/libUserService.cpp` Lines 88–101. A game that keys profiles by account ID will treat those users as the same account. Restrict the simulated account to the configured user, or provide distinct identities for supported users. ([raw.githubusercontent.com](https://raw.githubusercontent.com/KytyPS5/KytyPS5/ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3/src/libs/libUserService.cpp)) <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:7c8c9a471f6ec003423874d6 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-28 13:55 UTC · original · reviewed

Actionable comments posted: 9

Nitpick comments: 1
tests/ResourceTrackingTests.cpp: 1

8118-8119: Trivial · Maintainability & Code Quality · Quick win

Find the sample's MemoryInfo by its flags instead of by memory_info[0].

memory_info[0] is the first ReadConstBuffer load, not the ImageSampleRaw memory. The load lambdas call AddMemory before the sample does. The test passes only because the default sampler value is 0 and there is a single sampler. Store the MemoryFlags returned by AddMemory(sample, 0x1dd0u) and use its index instead.

🔇 Additional comments: 1
src/libs/network.cpp-4584-4584: 1

4584-4584: Major · Functional Correctness · Heavy lift

⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Keep account getters consistent with the signed-in state.

When this reports signed-in, NpGetAccountCountryA, NpGetAccountAge, and NpGetAccountLanguage2 still return np_error_signed_out at Lines 4332, 4350, and 4370. Games that query account details after sign-in cannot obtain them. Provide coherent signed-in responses for these getters, or keep the user signed out until those responses are available.


Review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 6c01401862 and ad6d62dd1a.

Files selected for processing: 30
  • src/graphics/guest_gpu/graphicsRun.cpp
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/pageManager.cpp
  • src/graphics/host_gpu/renderer/cache/bufferCache.cpp
  • src/graphics/host_gpu/renderer/cache/bufferCache.h
  • src/graphics/host_gpu/renderer/cache/streamBuffer.cpp
  • src/graphics/host_gpu/renderer/cache/streamBuffer.h
  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • src/graphics/host_gpu/renderer/cache/textureCache.h
  • src/graphics/host_gpu/renderer/commandScheduler.cpp
  • src/graphics/host_gpu/renderer/commandScheduler.h
  • src/graphics/host_gpu/renderer/image/image.cpp
  • src/graphics/host_gpu/renderer/image/image.h
  • src/graphics/host_gpu/renderer/pipeline/imageHeap.cpp
  • src/graphics/host_gpu/renderer/pipeline/imageHeap.h
  • src/graphics/host_gpu/renderer/renderContext.cpp
  • src/graphics/host_gpu/renderer/renderContext.h
  • src/graphics/presentation/window/swapchain.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h
  • src/graphics/shader/recompiler/frontend/decode/VectorAluOps.cpp
  • src/graphics/shader/recompiler/frontend/translate/Vector.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • src/kernel/pthread.cpp
  • src/libs/libAppContent.cpp
  • src/libs/network.cpp
  • tests/ResourceTrackingTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-28 13:55 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#pullrequestreview-5683779959) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 9** <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/brush-cleaning-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/brush-cleaning.svg" width="16" height="16" align="absmiddle" alt=""></picture> Nitpick comments: 1</summary><blockquote> <dl> <dd> <details> <summary>tests/ResourceTrackingTests.cpp: 1</summary><blockquote> <dl> <dd> `8118-8119`: **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/neutral-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Trivial** · **Maintainability & Code Quality** · **Quick win** **Find the sample's `MemoryInfo` by its flags instead of by `memory_info[0]`.** `memory_info[0]` is the first `ReadConstBuffer` load, not the `ImageSampleRaw` memory. The `load` lambdas call `AddMemory` before the sample does. The test passes only because the default `sampler` value is 0 and there is a single sampler. Store the `MemoryFlags` returned by `AddMemory(sample, 0x1dd0u)` and use its `index` instead. <!-- cr-comment:v1:f699a6f144e2d4e0bad9ae6a --> </dd> </dl> </blockquote></details> </dd> </dl> </blockquote></details> <details> <summary>🔇 Additional comments: 1</summary><blockquote> <dl> <dd> <details> <summary>src/libs/network.cpp-4584-4584: 1</summary><blockquote> <dl> <dd> `4584-4584`: **<picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/major-16.svg" width="16" height="16" align="absmiddle" alt=""></picture> Major** · **Functional Correctness** · **Heavy lift** ⚠️ **Unverified finding** Verification ran but could not confirm this finding. It is shown for review, not as a verified issue. **Keep account getters consistent with the signed-in state.** When this reports signed-in, `NpGetAccountCountryA`, `NpGetAccountAge`, and `NpGetAccountLanguage2` still return `np_error_signed_out` at Lines 4332, 4350, and 4370. Games that query account details after sign-in cannot obtain them. Provide coherent signed-in responses for these getters, or keep the user signed out until those responses are available. </dd> </dl> </blockquote></details> </dd> </dl> </blockquote></details> --- <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="16" height="16" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> - **Source mode**: Auto - **Repository**: [KytyPS5/KytyPS5](<https://github.com/KytyPS5/KytyPS5>) - **Branch**: [main](<https://github.com/KytyPS5/KytyPS5/tree/main>) - **File**: [.coderabbit.yaml](<https://github.com/KytyPS5/KytyPS5/blob/6c0140186250a9ac7ed50786b2426271750a7a20/.coderabbit.yaml>) - **Commit**: [6c01401](<https://github.com/KytyPS5/KytyPS5/commit/6c0140186250a9ac7ed50786b2426271750a7a20>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `962edc6a-b8ec-4108-948d-459133816d87` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> Reviewing files that changed from the base of the PR and between 6c0140186250a9ac7ed50786b2426271750a7a20 and ad6d62dd1a3fec51b7dd92cf7a776abb7b86dbd3. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 30</summary> <dl> <dd> * `src/graphics/guest_gpu/graphicsRun.cpp` * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/pageManager.cpp` * `src/graphics/host_gpu/renderer/cache/bufferCache.cpp` * `src/graphics/host_gpu/renderer/cache/bufferCache.h` * `src/graphics/host_gpu/renderer/cache/streamBuffer.cpp` * `src/graphics/host_gpu/renderer/cache/streamBuffer.h` * `src/graphics/host_gpu/renderer/cache/textureCache.cpp` * `src/graphics/host_gpu/renderer/cache/textureCache.h` * `src/graphics/host_gpu/renderer/commandScheduler.cpp` * `src/graphics/host_gpu/renderer/commandScheduler.h` * `src/graphics/host_gpu/renderer/image/image.cpp` * `src/graphics/host_gpu/renderer/image/image.h` * `src/graphics/host_gpu/renderer/pipeline/imageHeap.cpp` * `src/graphics/host_gpu/renderer/pipeline/imageHeap.h` * `src/graphics/host_gpu/renderer/renderContext.cpp` * `src/graphics/host_gpu/renderer/renderContext.h` * `src/graphics/presentation/window/swapchain.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h` * `src/graphics/shader/recompiler/frontend/decode/VectorAluOps.cpp` * `src/graphics/shader/recompiler/frontend/translate/Vector.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `src/kernel/pthread.cpp` * `src/libs/libAppContent.cpp` * `src/libs/network.cpp` * `tests/ResourceTrackingTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. </dd> </dl> </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=4640b2a0-7d2e-44d4-b0cc-f8a62043d3cf attempt=39b2845d-450b-46bf-83c2-f0d927e46330 batch=1/1 -->
Author
Owner

@⁠Nmzik on GitHub · 2026-10-29 17:40 UTC · original

@⁠chaitan3 Thanks! All non-shader commits have been cherry-picked (credited ofc)

**@⁠Nmzik** on GitHub · 2026-10-29 17:40 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1961#issuecomment-6504007246) @⁠chaitan3 Thanks! All non-shader commits have been cherry-picked (credited ofc)
This pull request has changes conflicting with the target branch.
  • src/graphics/host_gpu/pageManager.cpp
  • src/graphics/host_gpu/renderer/cache/bufferCache.cpp
  • src/graphics/host_gpu/renderer/cache/bufferCache.h
  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • src/graphics/host_gpu/renderer/cache/textureCache.h
  • src/graphics/host_gpu/renderer/image/image.h
  • src/graphics/host_gpu/renderer/pipeline/imageHeap.cpp
  • src/graphics/presentation/window/swapchain.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • src/kernel/pthread.cpp
  • src/libs/network.cpp
  • tests/shaderCfgTests.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/1961/head:github-bot/gh-1961'
git switch 'github-bot/gh-1961'

Merge

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