renderer: tolerate stale descriptor-table slots #1119
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1119
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1119/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@NeySlim on GitHub · 2026-10-06 19:45 UTC · original
NeySlim:fix/stale-descriptor-slots→main· +92 −10 · 4 files · 3 commits · closed without mergingWhen an indirect image table is probed for its enumerated keys, slots past the table's live range hold stale or unrelated descriptors: the shader never selects them, but the host refused the table (
indirect image table ... has incompatible candidates), failed to read their backing (BufferCache: failed to read mapped guest image backing) or aborted on the scalar-read overlap check.This makes those slots harmless instead of fatal:
These are tolerance changes for bring-up rather than fixes of the underlying planning; happy to narrow any of them. #852 extends the incompatible-candidate diagnostics and #937 carries the zero-fill of unreadable backings, so this overlaps them in those two spots. Seen with God of War Ragnarök (PPSA08332) on Linux, RTX 4090.
@coderabbitai[bot] on GitHub · 2026-10-06 19:49 UTC · original · edited 2026-10-06 20:01 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
bd864c9e-207c-4b5b-9cff-d796b09544e2📥 Commits
Reviewing files that changed from the base of the PR and between
028d8c9489ande1fc0550f1.📒 Files selected for processing (2)
src/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 1 remain after this review.
📝 Walkthrough
Walkthrough
Image buffer acquisition uses a temporary upload buffer when staging allocation fails. If sparse backing cannot be read, the upload range is zero-filled. Image initialization skips upload when no source is available. Descriptor binding logs scalar-read overlaps with bound image, attachment, or metadata writes and continues. Indirect image materialization replaces specified unreadable, unnormalizable, or incompatible candidates with null descriptors.
Priority: ➖ Normal
Change: Bug fix
Merge Risk: ⚪ Minimal · up to
e1fc0No actionable merge-blocking issue was found in the selected changes; merge after normal checks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
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 helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-10-06 19:49 UTC · original · edited 2026-10-06 20:05 UTC
On
src/graphics/host_gpu/renderer/cache/bufferCache.cppline 501 (outdated):🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
Preserve sparse-read handling for oversized images.
If
Mapfails for an oversized image with unreadable, CPU-modified backing,ObtainBuffercan reachUploadCopies. That path reads the guest address withstd::memcpy, so the new zero-fill fallback does not apply and the process can fault. Populate the cached buffer through a sparse-read-safe path, or zero-fill unreadable ranges before returning it.✅ Addressed in commits
82514bftoe1fc055@coderabbitai[bot] on GitHub · 2026-10-06 19:49 UTC · original · edited 2026-10-06 20:06 UTC
On
src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppline 446 (outdated):🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: yuzu-emu/yuzu
Length of output: 2955
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 6843
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 20968
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 6255
Keep the stale-image probe out of
specialization_reads.When capture is enabled and the strict reader is available, this probe reaches
CaptureStrictRead, which records each successful 16-byte read. The descriptor checks callEXITif a recorded range overlaps a written shader buffer. Read this probe through the original strict reader so the readability check does not become a specialization dependency.🐛 Suggested fix
📝 Committable suggestion
✅ Addressed in commits
82514bftoe1fc055@coderabbitai[bot] on GitHub · 2026-10-06 19:49 UTC · original · reviewed
Actionable comments posted: 2
ℹ️ Review info
⚙️ Run configuration
044639d1-c66d-43af-b38d-46dd870f668c📥 Commits
Reviewing files that changed from the base of the PR and between
199d0a9d92and028d8c9489.📒 Files selected for processing (4)
src/graphics/host_gpu/renderer/cache/bufferCache.cppsrc/graphics/host_gpu/renderer/cache/textureCache.cppsrc/graphics/host_gpu/renderer/pipeline/descriptors.cppsrc/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.
@NeySlim on GitHub · 2026-10-06 19:57 UTC · original
On
src/graphics/host_gpu/renderer/cache/bufferCache.cppline 501 (outdated):Fixed in
82514bf: an image larger than the staging ring is now read withTryReadSparseBackinginto a one-off upload buffer (zero-filled on failure) that is released after the submission, so the cached-buffermemcpypath is no longer reached.@NeySlim on GitHub · 2026-10-06 19:57 UTC · original
On
src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppline 446 (outdated):Applied in
e1fc055: the probe reads through the uncaptured reader when the strict capture is installed, so it no longer lands inspecialization_reads.@coderabbitai[bot] on GitHub · 2026-10-06 20:05 UTC · original
On
src/graphics/host_gpu/renderer/cache/bufferCache.cppline 501 (outdated):@NeySlim, thanks for the fix. The supplied code usesTryReadSparseBackingfor the oversized-image fallback and zero-fills on failure. It defers release of the upload buffer until submission completes. This removes the flagged cached-buffermemcpypath from that fallback.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@coderabbitai[bot] on GitHub · 2026-10-06 20:06 UTC · original
On
src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cppline 446 (outdated):@NeySlim, thanks for the fix. The supplied code calls the original strict reader with its originaluserdata, so the probe no longer entersspecialization_reads.If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!
✅ Review thread resolved.
You are interacting with an AI system.
@Nmzik on GitHub · 2026-10-08 13:40 UTC · original
This is a hack!
@NeySlim on GitHub · 2026-10-08 14:02 UTC · original
Fair point, and closing it is the right call: it hid the errors instead of fixing them. I am tracking down why these tables get probed past their live range and why the candidates and backings disagree, and will only come back with fixes for those causes, each with a test.
Pull request closed