renderer: consume a compute dispatch as an HTile clear only when it writes exactly the live HTile range (Resident Evil Requiem device lost) #2502

Open
github-bot wants to merge 1 commit from github-bot/gh-2502 into main AGit
Owner

@⁠taklaciwiz-maker on GitHub · 2026-11-21 21:06 UTC · original
taklaciwiz-maker:re-htile-meta-clear → main · +23 −1 · 3 files · 1 commits · open

Refs #1929. Related to #1803.

Problem

Resident Evil Requiem (PPSA31246) loses the device a few seconds after "New Game"
(masterSemaphore.cpp:54 / vkQueueSubmit failed: ErrorDeviceLost). It does so on 39936ff (current main)
and also on a21fd80.

VK_NV_device_diagnostic_checkpoints names the last dispatch every time: compute shader
0x9f2abc22a7d31401. VK_EXT_device_fault reports only INSTRUCTION_POINTER_UNKNOWN addresses.
That points to a GPU timeout (TDR), not an invalid access.

Diagnosis

0x9f2abc22a7d31401 and the same-family shaders 0x845c937f706651ae and 0xf6a62fe6cb77cd95 are
persistent-thread, lock-free work queues:

  • 512 slots, with counters at +2048 (count), +2052 (participants), +2056 (head) and +2060 (tail).
  • Waves loop until count == 0, ticket >= L and participants == 0.
  • A separate fill dispatch zeroes the 2064-byte queue buffer before the queue runs.

GPU snapshots. I copied the first 4 KiB of every bound buffer into host-visible memory before each
dispatch of these shaders (temporary diagnostic, not in this PR). The queue buffer at 0x20009a0000
looked like this:

good:  buf1 rw addr=0x20009a0000 size=2064 d0-3=00000000 00000000 00000000 00000000 d512-515=00000000 00000000 00000000 00000000 slots_nonzero=0
hang:  buf1 rw addr=0x20009a0000 size=2064 d0-3=7c362511 7c362310 7c362311 7c32210f d512-515=7c362511 7c322110 7c2a1d0d 7c1a170a slots_nonzero=512

In the bad frames the counters hold pixel-like data, with participants ≈ 2·10⁹, so the exit condition
never holds and the whole dispatch spins. The same garbage comes back for about 11 consecutive dispatches,
then the queue is fine again. The shader translation is correct; the input is not.

Address trace of 0x20009a0000 (temporary diagnostic):

  • In a good frame, two writes come before the queue dispatch:
    • a 0x70-byte copy (0xe14ee3c14d5d49f5);
    • the queue reset, a fill of 0x810 bytes (0xdb8fe7867eaef1bc).
  • In a bad frame, neither of them runs. The memory was written just before by a 2 MiB buffer write at
    0x2000800000: the game reuses this transient memory.
  • No image write-back to that address happens at any time.

Cause. RenderExecutor::TryConsumeComputeMetaClear treats any dispatch whose written buffer base
equals a registered HTile address as a metadata clear, and drops it.

0x20009a0000 was the HTile base of a depth image that was still in the texture cache. The game had
already reused that memory for the queue, and both the reset fill and the copy were dropped. About
11 frames later the garbage collector evicted the old depth image, the m_surface_metas entry went away,
and the queue worked again. That matches the snapshots.

Change (3 files, +23/-1)

  • TextureCache::MetaRangeSize(address) returns the HTile size registered at address. It returns it
    only while the owning depth image is still registered and its HTile is still at that address;
    otherwise it returns 0.
  • TryConsumeComputeMetaClear consumes a written buffer as a metadata clear only when the descriptor
    size equals that HTile size. Any other dispatch runs normally.

Results

The game now reaches gameplay and plays without the hang:

  • Tested over several sessions, the longest about 11 minutes.
  • 5–12 FPS on RTX 5070 (driver 621.24) / Ryzen 5 7600X.
  • The temporary loop watchdog I had used to get past the hang is not needed any more.

Metadata-clear decisions in one session (temporary log; 14,666 matches against a live HTile base):

Shader Written size Live HTile size Count Decision
0xdb8fe7867eaef1bc (fill) 0x30000 / 0x8000 / 0x10000 same 4952 / 1861 / 630 consumed (real clears)
0xdb8fe7867eaef1bc (fill) 0x810 0x8000 164 kept: the queue reset that used to be dropped
0xdb8fe7867eaef1bc (fill) 0x4 0x30000 1062 kept
0x378063fc4a8d7b1b, 0xf02daf961fa8a688 0x200000 0x8000 1806 + 636 kept: 2 MiB buffers that used to be dropped and never filled
0x5003cb4fd7ed3c22 0x7f80 0x30000 1062 kept
0xe14ee3c14d5d49f5 (copy) 0x10 – 0x870000 0x8000 / 0x30000 ~2000 kept

Relation to #1803

#1803 tightens the same classification: only metadata is written, writes stay within the metadata size,
reads are small, there is no storage image and no raw-address access. Its "Known limitations" section
lists the remaining gap: an entry survives memory reuse, so a constant fill that fits inside the surface
is still consumed as a clear.

The Requiem hang is exactly that case: a 0x810-byte constant fill into memory that still has a live
0x8000-byte HTile entry. As I read #1803's rules, it would still drop this reset, but I have not run
#1803 itself.

#1803 also measured that real clears in Octopath Traveler II and Astro Bot "bind a bounded descriptor
exactly the size of the HTILE surface". All the clears I see in Requiem match that too. If #1803 lands
first, the same fix there would be to require size == metadata size instead of <= in
AddMetaClearTarget, and to ignore entries whose owning image is gone or whose HTile has moved.

Caveats

  • About 20 dispatches of the same fill shader wrote 0x8000 bytes at a base whose live HTile is larger
    (0x10000–0x48000). They may be clears of a smaller depth image that shares the HTile base, a case #1803
    also mentions.
    • With this change they run as normal dispatches, so the depth image's clear state is not set.
    • I saw no depth artifact I could attribute to it, but I can't rule it out.
    • A more precise rule would accept a size that equals the HTile size of any live depth image at that
      base.
  • A clear through an unbounded descriptor is no longer consumed. #1803 says some clear shaders use one. I
    did not see any in Requiem, and I can't test Octopath Traveler II or Astro Bot.
  • I tested only Requiem, on NVIDIA only.
  • Diagnostics used, not part of this PR: device-lost checkpoints and device fault, GPU buffer snapshots,
    an address watch trace and a meta-clear log. I can share them if they are useful.

🤖 Generated with Claude Code

**@⁠taklaciwiz-maker** on GitHub · 2026-11-21 21:06 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2502) `taklaciwiz-maker:re-htile-meta-clear` → `main` · +23 −1 · 3 files · 1 commits · open Refs #1929. Related to #1803. ## Problem Resident Evil Requiem (PPSA31246) loses the device a few seconds after "New Game" (`masterSemaphore.cpp:54` / `vkQueueSubmit failed: ErrorDeviceLost`). It does so on 39936ff (current main) and also on a21fd80. `VK_NV_device_diagnostic_checkpoints` names the last dispatch every time: compute shader `0x9f2abc22a7d31401`. `VK_EXT_device_fault` reports only `INSTRUCTION_POINTER_UNKNOWN` addresses. That points to a GPU timeout (TDR), not an invalid access. ## Diagnosis `0x9f2abc22a7d31401` and the same-family shaders `0x845c937f706651ae` and `0xf6a62fe6cb77cd95` are persistent-thread, lock-free work queues: - 512 slots, with counters at +2048 (count), +2052 (participants), +2056 (head) and +2060 (tail). - Waves loop until `count == 0`, `ticket >= L` and `participants == 0`. - A separate fill dispatch zeroes the 2064-byte queue buffer before the queue runs. **GPU snapshots.** I copied the first 4 KiB of every bound buffer into host-visible memory before each dispatch of these shaders (temporary diagnostic, not in this PR). The queue buffer at `0x20009a0000` looked like this: ``` good: buf1 rw addr=0x20009a0000 size=2064 d0-3=00000000 00000000 00000000 00000000 d512-515=00000000 00000000 00000000 00000000 slots_nonzero=0 hang: buf1 rw addr=0x20009a0000 size=2064 d0-3=7c362511 7c362310 7c362311 7c32210f d512-515=7c362511 7c322110 7c2a1d0d 7c1a170a slots_nonzero=512 ``` In the bad frames the counters hold pixel-like data, with `participants ≈ 2·10⁹`, so the exit condition never holds and the whole dispatch spins. The same garbage comes back for about 11 consecutive dispatches, then the queue is fine again. The shader translation is correct; the input is not. **Address trace of `0x20009a0000`** (temporary diagnostic): - In a good frame, two writes come before the queue dispatch: - a 0x70-byte copy (`0xe14ee3c14d5d49f5`); - the queue reset, a fill of 0x810 bytes (`0xdb8fe7867eaef1bc`). - In a bad frame, neither of them runs. The memory was written just before by a 2 MiB buffer write at `0x2000800000`: the game reuses this transient memory. - No image write-back to that address happens at any time. **Cause.** `RenderExecutor::TryConsumeComputeMetaClear` treats any dispatch whose written buffer base equals a registered HTile address as a metadata clear, and drops it. `0x20009a0000` was the HTile base of a depth image that was still in the texture cache. The game had already reused that memory for the queue, and both the reset fill and the copy were dropped. About 11 frames later the garbage collector evicted the old depth image, the `m_surface_metas` entry went away, and the queue worked again. That matches the snapshots. ## Change (3 files, +23/-1) - `TextureCache::MetaRangeSize(address)` returns the HTile size registered at `address`. It returns it only while the owning depth image is still registered and its HTile is still at that address; otherwise it returns 0. - `TryConsumeComputeMetaClear` consumes a written buffer as a metadata clear only when the descriptor size equals that HTile size. Any other dispatch runs normally. ## Results The game now reaches gameplay and plays without the hang: - Tested over several sessions, the longest about 11 minutes. - 5–12 FPS on RTX 5070 (driver 621.24) / Ryzen 5 7600X. - The temporary loop watchdog I had used to get past the hang is not needed any more. Metadata-clear decisions in one session (temporary log; 14,666 matches against a live HTile base): | Shader | Written size | Live HTile size | Count | Decision | |---|---|---|---|---| | `0xdb8fe7867eaef1bc` (fill) | 0x30000 / 0x8000 / 0x10000 | same | 4952 / 1861 / 630 | consumed (real clears) | | `0xdb8fe7867eaef1bc` (fill) | 0x810 | 0x8000 | 164 | **kept**: the queue reset that used to be dropped | | `0xdb8fe7867eaef1bc` (fill) | 0x4 | 0x30000 | 1062 | kept | | `0x378063fc4a8d7b1b`, `0xf02daf961fa8a688` | 0x200000 | 0x8000 | 1806 + 636 | **kept**: 2 MiB buffers that used to be dropped and never filled | | `0x5003cb4fd7ed3c22` | 0x7f80 | 0x30000 | 1062 | kept | | `0xe14ee3c14d5d49f5` (copy) | 0x10 – 0x870000 | 0x8000 / 0x30000 | ~2000 | kept | ## Relation to #1803 #1803 tightens the same classification: only metadata is written, writes stay within the metadata size, reads are small, there is no storage image and no raw-address access. Its "Known limitations" section lists the remaining gap: an entry survives memory reuse, so a constant fill that fits inside the surface is still consumed as a clear. The Requiem hang is exactly that case: a 0x810-byte constant fill into memory that still has a live 0x8000-byte HTile entry. As I read #1803's rules, it would still drop this reset, but I have not run #1803 itself. #1803 also measured that real clears in Octopath Traveler II and Astro Bot "bind a bounded descriptor exactly the size of the HTILE surface". All the clears I see in Requiem match that too. If #1803 lands first, the same fix there would be to require `size == metadata size` instead of `<=` in `AddMetaClearTarget`, and to ignore entries whose owning image is gone or whose HTile has moved. ## Caveats - About 20 dispatches of the same fill shader wrote 0x8000 bytes at a base whose live HTile is larger (0x10000–0x48000). They may be clears of a smaller depth image that shares the HTile base, a case #1803 also mentions. - With this change they run as normal dispatches, so the depth image's clear state is not set. - I saw no depth artifact I could attribute to it, but I can't rule it out. - A more precise rule would accept a size that equals the HTile size of *any* live depth image at that base. - A clear through an unbounded descriptor is no longer consumed. #1803 says some clear shaders use one. I did not see any in Requiem, and I can't test Octopath Traveler II or Astro Bot. - I tested only Requiem, on NVIDIA only. - Diagnostics used, not part of this PR: device-lost checkpoints and device fault, GPU buffer snapshots, an address watch trace and a meta-clear log. I can share them if they are useful. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Resident Evil Requiem (PPSA31246) reuses the memory of a cached depth image's HTile for a GPU work queue. Its reset fill was dropped as a metadata clear, the queue shader started with garbage counters and hung the GPU after New Game. Only a write whose size equals the HTile range of the still-registered owning image is now consumed.

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

@⁠coderabbitai[bot] on GitHub · 2026-11-21 21:11 UTC · original

Explain Change →

Walkthrough

TextureCache adds MetaRangeSize(uint64_t address), which returns the size of a live metadata range at the requested address or zero when no valid owner matches. TryConsumeComputeMetaClear now calls ClearMeta only when the returned range size is nonzero and exactly matches the descriptor size.

Suggested reviewers: nmzik, thecruz

Change: Bug fix

Merge Risk: Moderate · up to 38eef

The change stops a reset write that reuses HTile memory from being treated as a depth clear, which was causing the reported device loss in Resident Evil Requiem. Two edge cases remain. A reset write whose size exactly matches a live HTile could still be skipped. A genuine smaller depth clear could now be skipped, leaving stale depth contents. Both are narrow and unconfirmed, but they should be accepted or addressed before merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: compute dispatches are consumed as HTile clears only when they write exactly the live HTile range. It also names the Resident Evil Requiem device-lost symptom. The raw…
Description check Passed The description is closely related to the changeset. It explains the Requiem device-lost problem, the diagnosis that TryConsumeComputeMetaClear drops a queue reset dispatch, and the fix that adds a li…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: compute dispatches are consumed as HTile clears only when they write exactly the live HTile range. It also names the Resident Evil Requiem device-lost symptom. The raw summary confirms the change to TryConsumeComputeMetaClear, the new TextureCache::MetaRangeSize query, and the exact-size check. The title is specific and matches the changeset.

Full details: Description check

Explanation

The description is closely related to the changeset. It explains the Requiem device-lost problem, the diagnosis that TryConsumeComputeMetaClear drops a queue reset dispatch, and the fix that adds a live-HTile-size check in the three changed files. It also covers test results, caveats, and related PR #1803.

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-21 21:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2502#issuecomment-7069301886) <!-- 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/2502?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-buttons-v1/explain-change-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-buttons-v1/explain-change.svg" alt="Explain Change →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary><strong>Walkthrough</strong></summary> <dl> <dd> <br> TextureCache adds `MetaRangeSize(uint64_t address)`, which returns the size of a live metadata range at the requested address or zero when no valid owner matches. `TryConsumeComputeMetaClear` now calls `ClearMeta` only when the returned range size is nonzero and exactly matches the descriptor size. **Suggested reviewers:** `nmzik`, `thecruz` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> <!-- change_assessment_commit:"38eef9ff247b8b32eea418f29e5c9212f6c71be7" --> <!-- change_assessment_priority:{"version":1,"urgency":"p2","manual":false} --> **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>38eef</code></summary> <dl> <dd> <br> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `38eef` --> <!-- final_review_risk_coverage:{"sourceCommitId":"38eef9ff247b8b32eea418f29e5c9212f6c71be7","coveredCommitId":"38eef9ff247b8b32eea418f29e5c9212f6c71be7","kind":"reviewed"} --> The change stops a reset write that reuses HTile memory from being treated as a depth clear, which was causing the reported device loss in Resident Evil Requiem. Two edge cases remain. A reset write whose size exactly matches a live HTile could still be skipped. A genuine smaller depth clear could now be skipped, leaving stale depth contents. Both are narrow and unconfirmed, but they should be accepted or addressed before merge. <!-- 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</strong></summary> <dl> <dd> <br> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title names the main change: compute dispatches are consumed as HTile clears only when they write exactly the live HTile range. It also names the Resident Evil Requiem device-lost symptom. The raw… | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description is closely related to the changeset. It explains the Requiem device-lost problem, the diagnosis that TryConsumeComputeMetaClear drops a queue reset dispatch, and the fix that adds a li… | | 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. | <details> <summary><strong>Full details: Title check</strong></summary> <dl> <dd> <br> **Explanation** The title names the main change: compute dispatches are consumed as HTile clears only when they write exactly the live HTile range. It also names the Resident Evil Requiem device-lost symptom. The raw summary confirms the change to TryConsumeComputeMetaClear, the new TextureCache::MetaRangeSize query, and the exact-size check. The title is specific and matches the changeset. </dd> </dl> </details> <details> <summary><strong>Full details: Description check</strong></summary> <dl> <dd> <br> **Explanation** The description is closely related to the changeset. It explains the Requiem device-lost problem, the diagnosis that TryConsumeComputeMetaClear drops a queue reset dispatch, and the fix that adds a live-HTile-size check in the three changed files. It also covers test results, caveats, and related PR `#1803`. </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=2502)! 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> <br> - [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> <!-- tips_end -->
@ -79,0 +81,4 @@
// queue that is then never reset hangs the GPU, a larger buffer is never filled).
const auto base = descriptor.Base48();
const auto meta_size = cache.MetaRangeSize(base);
if (meta_size != 0 && descriptor.GetSize() == meta_size && cache.ClearMeta(base)) {
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-21 21:11 UTC · original

Minor · Data Integrity & Integration · Heavy lift

Keep the depth clear state when a smaller write is a genuine HTile clear.

When a write at a live HTile base does not match meta_size, TryConsumeComputeMetaClear returns without calling ClearMeta. ClearMeta is the only compute-path call that sets the HTile clear mask. A genuine clear of a smaller range therefore leaves the mask unset. The depth draw then skips the clear load and keeps the prior depth contents.

Require that a genuine HTile clear of a smaller range still sets the owning depth image's clear state. Choose the mechanism that preserves this state, for example a narrower clear-detection rule that does not drop real clears. Confirm that the chosen mechanism does not reintroduce the reuse hazard the size check prevents.


Major · Stability & Availability · Heavy lift

Size equality does not establish that a write is an HTile clear.

When a game frees a depth image's HTile memory while the depth image stays registered, a later write-only buffer of exactly the HTile size at the same base can pass this guard. The guard then calls ClearMeta, and the dispatch is consumed without running. A reset fill of this kind is then dropped, and the queue keeps its stale counters. That is the failure this change targets, and it still occurs for a same-size reuse.

The check must establish that the write is a genuine HTile clear. Size alone is insufficient. Choose the proof, such as tracking the reuse or checking the clear provenance, before consuming the dispatch.

**@⁠coderabbitai[bot]** on GitHub · 2026-11-21 21:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2502#discussion_r4655032396) <!-- 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** · **Data Integrity & Integration** · **Heavy lift** **Keep the depth clear state when a smaller write is a genuine HTile clear.** When a write at a live HTile base does not match `meta_size`, `TryConsumeComputeMetaClear` returns without calling `ClearMeta`. `ClearMeta` is the only compute-path call that sets the HTile clear mask. A genuine clear of a smaller range therefore leaves the mask unset. The depth draw then skips the clear load and keeps the prior depth contents. Require that a genuine HTile clear of a smaller range still sets the owning depth image's clear state. Choose the mechanism that preserves this state, for example a narrower clear-detection rule that does not drop real clears. Confirm that the chosen mechanism does not reintroduce the reuse hazard the size check prevents. <!-- fingerprinting:phantom:triton:okapi --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:bcb1bf1db779e8e06ba7b55f --> --- **<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** · **Heavy lift** **Size equality does not establish that a write is an HTile clear.** When a game frees a depth image's HTile memory while the depth image stays registered, a later write-only buffer of exactly the HTile size at the same base can pass this guard. The guard then calls `ClearMeta`, and the dispatch is consumed without running. A reset fill of this kind is then dropped, and the queue keeps its stale counters. That is the failure this change targets, and it still occurs for a same-size reuse. The check must establish that the write is a genuine HTile clear. Size alone is insufficient. Choose the proof, such as tracking the reuse or checking the clear provenance, before consuming the dispatch. <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:b739345e2ed07137d36fa98e --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-11-21 21:11 UTC · original · reviewed

Actionable comments posted: 2

Review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 39936ffa39 and 38eef9ff24.

Files selected for processing: 3

  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • src/graphics/host_gpu/renderer/cache/textureCache.h
  • src/graphics/host_gpu/renderer/renderCompute.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-11-21 21:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/2502#pullrequestreview-6008207809) · **reviewed** <!-- coderabbit-ai-generated:v1 --> **Actionable comments posted: 2** <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <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> <br> - **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/39936ffa39237997080f8d169370667ca63d12fa/.coderabbit.yaml>) - **Commit**: [39936ff](<https://github.com/KytyPS5/KytyPS5/commit/39936ffa39237997080f8d169370667ca63d12fa>) - **Layers**: Repository YAML - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `4d3f14f7-5bbc-4957-8c1c-d3f4cf4a9a18` </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> <br> Reviewing files that changed from the base of the PR and between 39936ffa39237997080f8d169370667ca63d12fa and 38eef9ff247b8b32eea418f29e5c9212f6c71be7. </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: 3</summary> <dl> <dd> <br> * `src/graphics/host_gpu/renderer/cache/textureCache.cpp` * `src/graphics/host_gpu/renderer/cache/textureCache.h` * `src/graphics/host_gpu/renderer/renderCompute.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=5743bf22-9e40-4121-af34-db77399a5104 attempt=a2970be9-646a-4240-aacf-2dc2024aee55 batch=1/1 -->
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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