Astrobot raytracing #747

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

@⁠vanshrana369 on GitHub · 2026-09-21 08:59 UTC · original
vanshrana369:astrobot-raytracing → main · +6580 −1228 · 85 files · 80 commits · closed without merging

Add BVH ray-intersection decoding to fix Astro Bot crash

**@⁠vanshrana369** on GitHub · 2026-09-21 08:59 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747) `vanshrana369:astrobot-raytracing` → `main` · +6580 −1228 · 85 files · 80 commits · closed without merging Add BVH ray-intersection decoding to fix Astro Bot crash
# Conflicts:
#	src/graphics/host_gpu/renderer/renderDraw.cpp
#	src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp
#	src/loader/runtimeLinker.cpp
#	tests/ShaderRecompilerComputeTests.cpp
descriptors: a storage image bound at an explicit mip level can carry a
base/last level past MaxMip() (per-mip compute dispatches over a volume).
Widen the accepted mip range and treat it as a clamped single-level view
instead of aborting with "unsupported texture mip view". Also bind a 1x1
null depth image when a depth-comparison (shadow) fetch lands on a
non-depth guest format, so the Dref sample stays valid on desktop Vulkan
instead of losing the device.

libJson2: resolve an absent object key to a read-only boolean-false
instead of a null value. Retail data omits optional boolean flags from a
serialised object; the engine reads such a flag straight back and, in a
checked build, asserts its type is boolean before use (Astro Bot
Module/Network/Json.cpp:399, key "applyToAll"). On real hardware the
omitted flag reads as false.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
- ImageOps: decode the PlayStation gradient-adjust ("_a") derivative and
  coarse-derivative MIMG sample variants (0xa2/0xa3/0xaa/0xab/0xb2/0xb3/
  0xba/0xbb, 0xe6, 0xe8-0xef). Team Asobi shaders emit these; they route
  through the existing explicit-LOD sample path, with Adjust only steering
  sampler dword3 canonicalization. Was "MIMG opcode 0xe6 is not implemented".

- pipelineCache: wire SrtRuntime::read_memory to a raw (non-GPU-clean-gated)
  backing reader. PR #500 added the field but left it null, so the SRT
  evaluator could not resolve a descriptor the shader builds from SRT
  dwords. SRTs are CPU-written / GPU-read-only, so a plain backing read is
  both correct and always available.

- pm4: acknowledge indirect SH regs SPI_SHADER_PGM_RSRC1_ES / RSRC2_ES
  (0xCA/0xCB) like RSRC4_GS -- the emulator sizes the export stage from the
  recompiled shader, so the guest's resource words are advisory.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Team Asobi compute shaders (Astro Bot PPSA21564, hash 0x78af8e269b528b5c)
assemble a 4-dword sampler S# in registers with CompositeConstructU32x4 and
then index it. The bind-time SRT evaluator only understood the 2-wide
(U32x2 / U64) composites, so GetSamplerResource dword 2 came back "not a
valid runtime value: CompositeExtractU32x4 cannot be evaluated before the
draw" (ResourceTracking.cpp:173). Teach IsRuntimeUniformOp, the dependency
walk and EvaluateExtract about the U32x4 composite, same shape as the
existing U32x2 handling.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
PS5 shader compilers leave a sampler S#'s anisotropy / LOD-clamp /
border-index dwords (2-3) holding a stale wave mask from an earlier
S_AND_SAVEEXEC / V_CMP-to-SGPR, because the hardware sampler ignores
those fields for the fetch. That mask is not a runtime-evaluable value,
so SRT planning aborted with "GetSamplerResource dword 2 is not a valid
runtime value" (Astro Bot PPSA21564, compute hash 0x78af8e269b528b5c).
Add a pre-BuildSrtPlan pass that rewrites a sampler dword 2-3 to zero
when it traces (through composite extracts / identity / phi) to a Ballot
or AnyLane result; dwords 0-1 stay strict so a real bad descriptor still
fails loudly.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Soft ladder (PPSA21564). Astro Bot GI/lighting compute kernels assemble a
buffer V# from a loop-carried / runtime-dynamic SRT pointer
(GetAddressResource(Phi(strided pointer accumulator))) that neither
PR #500's WaterfallDescriptor pass nor the bind-time SRT evaluator can
resolve. KytyPS5 has no bindless (srt_flatbuf / BDA) descriptor path yet,
so MaterializeResources for these dispatches will not complete.

ReportMaterialization now returns false for a compute stage in that case
(a graphics stage still aborts loudly); GetComputeProgram returns an empty
ShaderProgram and GraphicsRenderDispatchDirect skips the dispatch, the
same way it already handles a null CS address. The real fix is a
shadPS4-style flat-SRT bindless model.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Soft ladder (PPSA21564). Astro Bot compute 0x9981352e6e838002 writes a
loop induction variable (min(iter, 0x3c) phi) into sampler S# dword 3.
CanonicalizeSamplerScratchDwords only rewrites dwords that trace to a
wave mask; this one traces to a UMin32 / IAdd32 counter. Dwords 2-3 are
the anisotropy / LOD-clamp / border-index fields the hardware sampler
ignores for the fetch, so on a validation failure for a non-immediate
sampler dword >= 2, zero it and retry rather than abort. Dwords 0-1 and
every image / buffer / address dword stay strict.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Soft ladder (PPSA21564). A few Astro Bot GI/lighting compute kernels fail
CFG structurization, fall back to the linear dispatcher, and assemble
bindless descriptors from loop-carried SRT pointers that get degraded to
zero. So bound, the GPU faults (VK_ERROR_DEVICE_LOST at commandScheduler
.cpp:388, first fully-lit title-screen frame, ~submit 6500). Hand back a
null module for a dispatcher-fallback Compute/Pixel/Mesh shader whose
SPIR-V exceeds 40000 words so the caller skips it.

Gated on dispatcher_fallback: Demon's Souls also compiles very large
(260k-650k word) compute shaders, but they emit structured SPIR-V and
never take the dispatcher path, so this leaves them untouched -- verified
Demon's Souls has zero dispatcher-fallback shaders. Real fix: a
shadPS4-style flat-SRT / BDA bindless descriptor model.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Soft ladder (PPSA21564). When an un-materialisable GI compute dispatch is
dropped, the progress label it was going to write never advances, and the
graphics CP re-suspends on a WAIT_REG_MEM for that label every ~100 ms
forever -- the guest log fills with "Equeue wait timedout:
Gpu::EopEqCompute" and the graphics queue eventually device-loses
(commandScheduler.cpp:388). Track each WAIT_REG_MEM address; once its
value has not changed for 4 s, advance the CP past the packet instead of
suspending again. Any change to the value restarts the clock, so a
genuinely slow but live fence is never forced. Real fix: resolve the
bindless GI descriptors so nothing is dropped.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Astro Bot PPSA21564 title-screen shaders emit wave32 forms the SOP1 table
only had in wave64:

- S_WQM_B32 (SOP1 0x09): new WqmU32 IR opcode, per-4-bit "any set -> all
  set" expansion in SPIR-V, constant-folded like WqmU64.
- S_OR / S_XOR / S_ANDN2 _SAVEEXEC_B32 (SOP1 0x3d-0x3f): reuse the
  S_SAVEEXEC helper (S_ORN2_SAVEEXEC_B32 0x40 was already upstream); its
  32-bit path grows a LogicalXor case.
- S_CBRANCH_CDBG{SYS,USER,_OR_USER,_AND_USER} (SOPP 0x17-0x1a): the CDBG
  mode bits are always zero on a non-debug target, so decode as S_NOP
  instead of rejecting the shader.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Soft ladder, gated hard on TITLE_ID == PPSA21564. Astro Bot's title-screen
GI/lighting compute kernels build bindless descriptors from loop-carried
SRT pointers; the ones that cannot be materialised are already dropped,
but a few more compile a valid, very large module that still faults the
GPU on the first fully-lit frame (VK_ERROR_DEVICE_LOST,
commandScheduler.cpp:388, submit ~6500). For Astro Bot only, hand back a
null compute module when the emitted SPIR-V exceeds 40000 words so the
frame completes without their contribution.

Every other title is untouched -- Demon's Souls legitimately compiles
250k-650k-word structured compute shaders and keeps rendering them. The
real fix is bind-time dynamic-SRT resolution (shadPS4-style flat-SRT /
BDA bindless).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This reverts commit b0d67b331dae895ea0a2a29d7bfa8a6e8c546b41.
This reverts commit 604106c85d.
Wiring SrtRuntime::read_memory for every title changed descriptor
resolution for shaders whose SRT raw-reads previously returned false and
were handled by a fallback path -- Demon's Souls then hung in the intro.
PR #500 deliberately shipped this field NULL. Restrict the reader to Astro
Bot (which needs it to resolve a buffer V# it builds from SRT dwords);
every other title keeps PR #500's behaviour. The real fix is bind-time
dynamic-SRT resolution, after which the reader is correct for all titles.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
The compute-only drop left Astro Bot's oversized GI pixel (0x6996d4e2...,
127k words) and mesh (192-197k words) kernels running with degraded
state; they fault the GPU at the first fully-lit title-screen frame
(EopWrite device loss, submit ~6572). Drop an oversized Compute/Pixel/
Mesh module for this title, and skip a draw in renderDraw whose pixel or
mesh program was dropped (DrawHasDroppedProgram). Both gated hard on
TITLE_ID == PPSA21564 -- no other title's shaders or draws are affected.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
depthRenderTarget: Prospero StencilOp kOnes (0x02) has no direct Vulkan
op; from a zeroed marker bit under the write mask eInvert (0 -> 1)
matches, which is what the graphics tutorial stencil sample
(07-stencil_testing) expects. The bitwise ops kAnd/kOr/kNand/kNor/kXnor
(0x0a-0x0f) approximate to eReplace rather than aborting the title.

libJson2: bring the full 90-NID surface from port/main-pr500gfx
(Object/Array iterators, String ops, Value copy-ctor / getUInteger /
set variants, referValue). The prior 68-NID subset left ~22 imports
unregistered; a title calling one gets an unresolved-stub poison value.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
libJson2: nlohmann parse with ignore_comments=true. Retail PS5 JSON assets
(Astro Bot room / material descriptors) carry // and /* */ comments;
strict parsing discarded the whole document, after which every key read
back absent and the engine's checked-build type asserts trapped
(Module/Network/Json.cpp:272 / :399) -- the RoomLoad_ATQT crash on
NEW GAME.

depthRenderTarget: when depth/stencil test is enabled but every DB address
register is zero and the draw is not a clear/copy, drop the depth state.
Astro Bot's title screen leaves DB_DEPTH_CONTROL.z_enable set on a 4K
composite pass with all DB addresses cleared; a stale DB_Z_INFO /
DB_DEPTH_SIZE otherwise manufactures a phantom, mismatched-size depth
attachment that shrinks the render area and leaves the frame uncleared.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
In the bind-time SRT evaluator, a V#/T# whose base pointer folds to null
is an unbound optional descriptor slot; a read through it returns all-zero
on real hardware rather than faulting. Return 0 instead of failing the
whole materialisation (which drops the dispatch). Cuts Astro Bot
PPSA21564 dropped GI/lighting dispatches ~76k -> ~51k per session; the
rest are still loop-carried bindless pointers (the flat-SRT item).
Correct emulation, not a soft-ladder.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
A stale depth target left bound from an earlier, smaller pass shrank the
render area for a larger colour pass -- Astro Bot's title screen keeps a
1920x1080 depth attachment on a 3840x2160 composite pass, so rendering
clamped to a 1080p corner and the rest of the frame kept whatever was
there before ("only a square is cleared"). The guest cannot pair
mismatched attachment sizes, so treat the depth as unbound when it is
smaller than the colour attachments.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
SET_PREDICATION with PRED_OP = Z_PASS_COUNT (0x01) was unhandled and
aborted the title (graphics tutorial 10-agc_occlusion_queries). Host
occlusion queries are not implemented and results are already reported as
always-visible, so never predicate the following draws away. This only
stops the crash; real occlusion-query culling still needs the full
query-pool implementation.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Cherry-pick of almo-port e102e02b onto the PR#500 renderer. Conflicts
resolved against this branch's collapsed CommandScheduler (BeginNext is
CheckActive()+BeginCommand(), no BindCurrent) and the crash-stopper
zpass predication case from 2bd9152e (now replaced by the real reader).

- CommandScheduler owns a 2048-slot vk::QueryPool (occlusion). The guest's
  PixelPipeStatDump begin/end dump pair (TriggerEvent 0x39, 8 bytes apart)
  maps onto beginQuery / draw / endQuery around the one occlusion-tested
  draw the guest brackets. SampleOcclusion() records it; results read back
  after the tick and written into the OcclusionQueryResults block.
- Pool reset per recording in BeginCommand (outside any render pass);
  results drained in BeginNext / FlushAndWait / Finish before reuse.
  CommandBuffer::EndRendering force-closes a still-open query so it never
  outlives its render pass instance. Precise queries where
  occlusionQueryPrecise is supported.
- SetPredication zpass (op 0x01) now reads the real begin/end counts and
  honours kSkipIfVisible / kSkipIfNotVisible; wait_op == 0
  (kWaitForQueryResults) forces a flush first. op 0x02 (primcount) stays
  unpredicated.
- KYTY_OCCLUSION_QUERIES=0: publish always-visible via TryWriteBacking so
  an unmapped result block during level load no-ops instead of faulting.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
My First Gran Turismo (PPSA24156) probes for a set of optional
steering-wheel driver PRXs (pdiWheel_0.prx, ...) that aren't valid
SELF/ELF images for this session and were never meant to load. Upstream
RuntimeLinker::LoadProgram() turned that into a fatal EXIT():

    elf is not valid: .../pdiWheel_0.prx  runtimeLinker.cpp:1492

On real hardware this is just a load failure the title handles. Match
the almo-port behaviour:

- LoadProgram(): return nullptr on an invalid ELF instead of EXIT().
- PreloadAdjacentPrograms(): skip a module that failed to load.
- KernelLoadStartModule(): report KERNEL_ERROR_ENOEXEC to the guest.
- emulator.cpp LoadElf(): keep a null return fatal for the primary
  game executable only (EXIT_IF).

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Env-gated (KYTY_SRT_DIAG=1), zero cost otherwise. On the "a descriptor
source did not evaluate" drop it logs the descriptor dword's opcode tree,
the deepest instruction whose bind-time evaluation returned false, and --
when that is a loop Phi -- each incoming edge's constness/value. Also
reports the shader's buffer/image/sampler counts so the failing source
can be classified.

Used to pin Astro Bot PPSA21564's 8 dropped GI/lighting compute kernels:
all fail identically on a loop-carried pointer Phi (init = SRT[N]+0x80,
carried edge += a non-constant 64-bit stride) feeding a descriptor V#/T#
base -- a bindless descriptor array walked in a loop.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
v_movrels_b32 was translated as a select ladder over every vector register
in range: `select(m0==1, v[base+1], select(m0==2, v[base+2], ...))`. Astro
Bot's composite / tonemap pixel shaders use it over ~40 registers, ~100
times each, which is most of what pushes them past the module size limit
and gets the draw dropped (black / ghosted logo).

New variadic IR op IndexedVectorLoad(index, v0, v1, ...): the SPIR-V
backend builds the candidates as one array value, stores it into a
Function-local variable and indexes it with a bounds-clamped
OpAccessChain (an index past the enumerated range falls back to element 0,
matching the ladder). One composite construct + one store + one load
instead of N selects.

Gated to PPSA21564 via CompileOptions::lower_wide_movrels: enabling it for
every title regressed Demon's Souls (a wide v_movrels in an early draw
device-loses, root cause still open). Narrow v_movrels (< 16 registers)
keep the ladder everywhere -- it is small and has proven behaviour when a
lane's source register was never written.

Effect on Astro Bot's title screen: PS 0xef31694e 62445->~38k,
0x92b1436c 56173->~38k, 0x7904c41b 58337->~39k words -- those three now
compile and run. Larger shaders (0x19a5f9ae, the mesh shaders) still
exceed the cap for unrelated reasons.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Json::Parser::parse was handing nlohmann a strict parse, so any document
it rejected was discarded whole -- after which every key on it reads back
absent and Astro Bot's checked-build type asserts (Module/Network/Json.cpp
:272 / :399) trap.

Two retail-asset shapes the PS5 parser accepts and nlohmann does not:

- Trailing commas before `}` / `]`. Stripped (string-aware) and retried.
- A bare unquoted top-level scalar. Astro Bot parses UI ids this way
  (`ui_title_03`, `ui_setting`, `ui_message_dialog2_save_and_load`); with
  no JSON container / quote / keyword lead-in the trimmed span is taken as
  a string value.

Also logs the head of a document that still fails, so the next one is
identifiable.

Astro Bot: 4 discarded documents on the title-screen path -> 0.

Co-Authored-By: Claude Opus 5 <[email protected]>
Two independent recompiler fixes, both DS-verified (Character Creation
renders, no device loss):

- DiscardResourcePlanningInputs, cherry-picked from Almo7aya/KytyPS5
  8c35a628. After the CPU ResourcePlan is extracted and specialization is
  applied, detach the descriptor-planning operands so DCE can reclaim
  them, and bind the flattened SRT only when emitted code reads it.
  Astro Bot: 0x19a5f9ae 104658->98789, 0x6996d4e2 95894->91683 words.

- A helper invocation is not a live guest lane, but it was included in the
  wave-level OpGroupNonUniformBallot that backs s_cbranch_execnz /
  execz / vccnz / vccz. A helper never clears its EXEC bit, so a loop
  tested across the whole wave can never exit. Mask helpers out of every
  ballot in a pixel shader via a gl_HelperInvocation input.

The second is correct on its own but is not sufficient for Astro Bot's
looping composite pixel shaders, which still hang the GPU when submitted
(pixel shaders with loops > 0 device-lose; the loops == 0 ones run fine).

Co-Authored-By: Claude Opus 5 <[email protected]>
# Conflicts:
#	src/graphics/shader/recompiler/frontend/translate/Scalar.cpp
#	src/graphics/shader/recompiler/frontend/translate/Translate.cpp
#	tests/ShaderRecompilerComputeTests.cpp
MIMG opcode 0xe6 was mapped to a made-up image_sample gradient variant
("image_sample_d_cl_o_a_0xe6" -- the name carried the raw opcode because it
was a guess). Per the RDNA2 ISA MIMG opcode table, 230 is
IMAGE_BVH_INTERSECT_RAY (32-bit node pointer) and 231 is
IMAGE_BVH64_INTERSECT_RAY (64-bit); neither uses a sampler, and their SGPR
operand is a 128-bit BVH T#, not an image T#.

The misdecode is why Astro Bot (PPSA21564) drops eight compute kernels every
frame. Read as an image sample, the BVH T# went through image-descriptor
resolution, and its base is a loop-carried BVH node pointer, so it could never
resolve before the dispatch -- "a descriptor source did not evaluate", dispatch
skipped. Those eight kernels are exactly the eight in that title that contain
opcode 0xe6, and nothing else does.

Decode them properly: address register counts follow ISA Table 48 (11 for the
32-bit pointer, 12 for the 64-bit one, three fewer when A16 packs direction and
inverse direction into halves), and the decoded form matches the encoding
restrictions the ISA places on these ops (R128=1, DIM=0, DMASK=0xf).

Traversal itself is not emitted yet, so they are still reported unsupported --
but as an unimplemented BVH op rather than as an image sample, which keeps the
BVH T# out of image-descriptor resolution entirely.

Co-Authored-By: Claude Opus 5 <[email protected]>
Transcribes docs/design/bvh-ray-intersection.md: BVH T# base extraction, node
addressing, the shared-exponent box node (bit-field reads, implicit child
pointers from the running child-kind sum, bound decompression), the ray/box
slab test and the distance sort.

Emitted as IR rather than SPIR-V builder calls -- GetAddressResource plus
LoadAddressU32 already give per-lane 64-bit addressed reads, so the node fetch
is sixteen loads issued in dwordx4-shaped groups (an address load carries at
most four components of metadata, and the node address is per-lane so it cannot
use the wider scalar-address form).

Effect so far: the eight ray-tracing kernels in Astro Bot now decode and
translate, and their BVH T#s no longer enter image-descriptor resolution --
the shader's image descriptor count drops from 19 to 17. They still do not
reach SPIR-V emission, because those kernels also build BUFFER descriptors from
memory at a loop-carried address ("source=22/31 dword=0/4"), which bind-time
resolution cannot evaluate either. That is a separate blocker of similar shape
and has to be solved before any of this executes.

So the traversal itself is unverified: nothing has run it yet. Triangle leaves
report a miss pending the leaf format, which keeps traversal terminating rather
than following an undecoded leaf.

Co-Authored-By: Claude Opus 5 <[email protected]>
A scalar buffer read whose V# is assembled from a loop-carried value has no
descriptor that can be resolved before the draw -- the address only exists once
the loop is running. Astro Bot's ray-tracing kernels hit this fetching
per-instance geometry descriptors while walking a BVH, and the dispatch was
skipped for it.

An untyped scalar buffer read through such a V# is just base + offset, so lower
it to a raw address load and drop the descriptor. The rewrite only fires where
resolution would have failed and the dispatch would have been skipped anyway,
so it cannot make a working shader worse.

Fires on exactly the eight ray-tracing kernels in that title, four reads each,
and on nothing else in a full title-screen run. Those kernels still do not
reach SPIR-V emission -- at least one further descriptor source in them is
still unresolvable -- so this is a step, not the fix.

NOT DS-verified: this pass is all-titles and needs a Demon's Souls run through
Character Creation before it goes anywhere near main.

Co-Authored-By: Claude Opus 5 <[email protected]>
A flat SRT slot is read once before the draw, so it only works when the whole
read can be evaluated then. The walker required only that the offset be an
immediate -- but if the base address is carried around a loop, a pointer the
shader walks, there is no address to read from yet. Giving such a read a slot
only guarantees evaluation fails later and the dispatch is dropped, which is
how Astro Bot lost its ray-tracing kernels: they walk a BVH, so their node and
descriptor reads all hang off a loop-carried pointer.

Leave those as runtime reads instead, which is what they are.

Four of the eight ray-tracing kernels in that title now compile to SPIR-V for
the first time; "a descriptor source did not evaluate" no longer fires at all.
They are still dropped afterwards, but by the oversized-shader cap -- a
separate, already-understood codegen problem -- rather than by descriptor
resolution.

NOT DS-verified: this changes the SRT plan layout for any shader that reads
through a loop-carried pointer, so it needs a Demon's Souls run through
Character Creation before it goes near main.

Co-Authored-By: Claude Opus 5 <[email protected]>
The cap was added when these shaders ran on descriptors that could not resolve,
so submitting them lost the device. Size was never the real problem -- Demon's
Souls compiles 250k-650k-word compute shaders on the same path and keeps them.

With loop-carried reads kept out of the flat SRT plan the descriptors resolve,
and the ray-tracing kernels (269k-309k words) submit with no device loss and no
skipped dispatches. The title-screen logo renders correctly instead of as a
smeared block, and enabling mesh as well fixes the lettering geometry.

Pixel stays capped: those shaders are still oversized for a different reason
(per-instruction codegen bloat) and have not been re-tested since.

Co-Authored-By: Claude Opus 5 <[email protected]>
An absent key returned boolean-false. That was added because an engine reading
an omitted flag asserted on the value's type -- but the real problem then was
the parser discarding whole documents, so keys that were present read back
absent too. Once parsing was fixed, boolean-false became actively harmful.

An engine that keeps a default in place while the lookup reads null now sees a
real boolean instead and overwrites its default with it, which trips the type
assert on the first non-boolean field it reads. Astro Bot hits this on
`priority`, a key only two of several hundred entries in its level settings
actually carry: the checked build asserts and traps on int 0x41, which is what
was killing it a few seconds after NEW GAME.

Both asserts it was meant to work around are gone with the parser fixed, and
the title now loads a room and renders gameplay.

Co-Authored-By: Claude Opus 5 <[email protected]>
Hardware clips each attachment to its own bounds, but a Vulkan pass has a
single render area, so a mismatched pair loses whatever falls outside the
smaller one. The existing guard only covered a depth target smaller than the
colour attachments; the reverse costs just as much.

Astro Bot pairs a 1024x1024 colour surface -- bound through two slots with
complementary channel masks, 0x3 and 0xc -- with a full 1920x1080 depth
attachment. The render area clamped to 1024x1024, so depth was written only in
that corner and the rest of the frame kept whatever had been there before: the
"only a square is cleared" artifact, measured at exactly 1024x1024 in a 1080p
frame.

Treat any size mismatch the same way, since the guest cannot actually pair
attachments of different sizes.

Note this is wider than the case it was found for: a depth target *larger* than
the colour attachments now gets unbound too, where before it stayed bound and
simply went partly unwritten. Demon's Souls hits that path once during
Character Creation and still renders correctly with no errors in the log, but
it does mean the pass loses depth testing rather than keeping a partial buffer.

Co-Authored-By: Claude Opus 5 <[email protected]>
DPP cross-lane fetches (v_mov_b32_dpp and friends) are how guest pixel
shaders swizzle a neighbouring lane's value for manual derivative /
cross-lane reconstruction. The DPP source-lane-active check ran its
ballot through the same helper-invocation mask used for loop
termination, so a real edge pixel's DPP read of a helper lane (which
holds valid data during whole-quad-mode, exactly at primitive edges)
came back forced-inactive -> zeroed instead of the neighbour's value.
That's the per-triangle-edge faceting/wireframe look on Astro Bot.

Only this one Ballot() call site drops the helper mask; every other
caller (loop-termination AnyLane/BranchCondition, EXEC/VCC-as-data,
ReadFirstLane, ds-append) is untouched and keeps excluding helpers.

Fix by EmK530 (github.com/defektu), cherry-picked from
650e6757f4

Co-Authored-By: EmK530 <[email protected]>
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Every pixel shader over the 40000-word cap is handed back as a null module,
and DrawHasDroppedProgram then skips every draw that used it -- on screen
that reads as large chunks of missing geometry. A recent run drops at least
16 of them (43k-114k words), and the old 16-message log limit hid the real
count.

The cap is the last piece of the compute-era soft ladder: compute was
un-capped once loop-carried SRT reads resolved properly, and the same may
now hold for pixel. Expose the threshold as KYTY_PS_OVERSIZE_CAP (0 = no
drop) so both behaviours can be compared on one binary, and log every drop
with a running count instead of stopping at 16.

Co-Authored-By: Claude Opus 5 <[email protected]>
Any validation-type debug-messenger error currently aborts the emulator.
That is right for a clean run, but it makes --gpu-assisted-validation
unusable for hunting a specific GPU fault: the first unrelated finding
ends the session before the interesting one is reached. Astro Bot trips a
wave-lockstep LDS race in a compute shader long before the pixel shader
that actually faults.

KYTY_VALIDATION_FATAL=0 downgrades validation errors to log lines so a run
can be driven past known findings. Unset keeps today's abort behaviour.

Co-Authored-By: Claude Opus 5 <[email protected]>
A depth-comparison sample against a non-depth image is illegal on desktop
Vulkan and loses the device (VUID-vkCmd*-None-06479). ResolveTexture already
substitutes a 1x1 depth null image when the guest format cannot do depth
comparison, but two earlier fallbacks returned before that policy ran and
bound a colour null texture regardless of resource.depth_compare: the
null-descriptor path and the unrepresentable-footprint path.

Astro Bot (PPSA21564) hits this with its shadow slot. GPU-assisted validation
reports 20 violations, all on the same descriptor -- Set 0, Binding 74,
variable image_24, VK_FORMAT_R32_SFLOAT -- and the pixel shader that samples
it (hash 098883a6f393aa10, 18 image_sample_c_lz) is the one bisected as the
cause of the VK_ERROR_DEVICE_LOST at masterSemaphore.cpp:53.

Pass resource.depth_compare through at both sites. Storage images are never
depth-compared, so the storage branch stays colour.

Co-Authored-By: Claude Opus 5 <[email protected]>
The depth-format policy in ResolveTexture runs on the guest descriptor,
before the texture cache lookup. FindImage can still hand back an existing
colour image for that address -- the title re-used the memory as a colour
surface, or an earlier non-compare binding registered it that way -- and the
final else branch then bound a colour view even though resource.depth_compare
is set. That is the Dref-against-colour case the policy was written to
prevent (VUID-vkCmd*-None-06479), just reached by a path the policy cannot
see.

Astro Bot's shadow slot lands here: GPU-assisted validation reports it as a
real R32_SFLOAT texture at Set 0, Binding 74, not a null one, so the earlier
null-texture fallbacks never applied.

Apply the same fallback after the cache lookup: if a depth-compare resource
resolved to a non-depth image, bind the 1x1 depth null image instead.

Co-Authored-By: Claude Opus 5 <[email protected]>
KYTY_PS_OVERSIZE_CAP alone can only keep shaders *below* a threshold, so a
bisection can add oversized shaders one at a time but never run one on its
own. KYTY_PS_UNDERSIZE_CAP drops pixel shaders below its value, and the pair
keeps exactly one size band alive.

Used to isolate Astro Bot's faulting draw: UNDERSIZE=93000 with CAP=99000
leaves only hash 098883a6f393aa10 (93618 words) and still loses the device,
so the fault is that draw specifically, not two oversized shaders competing
for resources.

Co-Authored-By: Claude Opus 5 <[email protected]>
A lost device says nothing about what went wrong on its own, and GPU-assisted
validation shuts itself down once the device is already gone -- its own fence
wait fails -- so it never names the faulting operation. VK_EXT_device_fault is
the one source that can, when the driver implements it.

Enable the extension when it is present, and dump the reported fault addresses
and vendor detail from MasterSemaphore::Wait before aborting.

Tested against Astro Bot's device loss on an RTX 5060 Ti: the extension is
exposed and deviceFault is true, but the NVIDIA driver returns an empty
description with no address or vendor records, so it does not help there.
Kept anyway -- it costs nothing when unsupported and Mesa/AMD do report.

Co-Authored-By: Claude Opus 5 <[email protected]>
Neither GPU-assisted validation nor VK_EXT_device_fault says anything useful
on NVIDIA when a device is lost -- GPU-AV shuts itself down once the device is
already gone, and the driver returns an empty fault record. VK_NV_device_
diagnostic_checkpoints does work: the driver keeps the markers the GPU last
passed, so tagging every draw with its pixel shader hash identifies the draw
in flight at the moment of the loss.

KYTY_NV_DIAGNOSTICS=1 opts in (the extensions cost performance on every
submit). renderDraw then emits a checkpoint per draw and MasterSemaphore::Wait
dumps the markers alongside the fault report.

On Astro Bot this independently confirms the bisection: both reported
checkpoints carry ps_hash 0x098883a6f393aa10, the same shader
KYTY_PS_UNDERSIZE_CAP isolated as the one that loses the device.

Co-Authored-By: Claude Opus 5 <[email protected]>
The pool was created lazily from SampleOcclusion, which only runs inside a
render pass -- and vkCmdResetQueryPool is illegal there. A pool born that way
missed its recording's reset, so the very first vkCmdBeginQuery ran against an
unreset query: undefined results, and validation reports
'query not reset. After query pool creation, each query must be reset'.

Create it on the reset path instead, which BeginCommand always runs outside a
render pass. Every pool is then reset before its first use.

Verified on Astro Bot with --vulkan-validation: the error is gone, and no
occlusion sample falls back to the always-visible path any more.

Co-Authored-By: Claude Opus 5 <[email protected]>
Every guest s_barrier lowered to OpControlBarrier with a Workgroup execution
and memory scope. Vulkan only permits that scope in stages that actually have
a workgroup -- compute, mesh and tessellation control -- so an s_barrier in a
vertex shader (GCN uses one for the LS->HS handoff) produced invalid SPIR-V:
VUID-StandaloneSpirv-OpControlBarrier-04682, plus the matching memory-scope
and Workgroup-storage complaints.

Pick the scope from the stage: Workgroup for compute and mesh, Subgroup
elsewhere. A subgroup barrier is legal in every execution model and still
orders the wave, which is all a single-wave stage can mean by it.

Astro Bot's vertex shader d4bac36b6b1f31c5 tripped this; with the fix the
violation is gone from a --vulkan-validation run.

Co-Authored-By: Claude Opus 5 <[email protected]>
CFG::Structurize can report success and still leave a conditional branch with
no merge block. The emitter then writes OpBranchConditional with no
OpSelectionMerge ahead of it, which is invalid SPIR-V -- spirv-val rejects it
with 'Selection must be structured'. Nothing catches this unless
--shader-validation is on, so the module ships and the driver may do anything
with it. Astro Bot's GI compute kernels are all built this way: eight modules
in one run.

Add the check, gated behind KYTY_STRICT_STRUCTURED=1. When it fires the
program takes the existing dispatcher fallback, which handles unstructured
control flow correctly: a validation run then reports zero spirv-val errors,
down from nine.

It is opt-in because the fallback rewrites the whole program as a state
machine, and routing six shaders through it costs roughly 65x frame time on
Astro Bot (frame 1652 -> 25 over the same wall clock). Default behaviour and
speed are unchanged. The real fix is to give Structurize the merge blocks it
is failing to compute, after which this guard should never fire.

Co-Authored-By: Claude Opus 5 <[email protected]>
The size cap can only keep shaders below a threshold, so one bad shader
sitting between two good ones cannot be dropped on its own -- dropping the
band around it deletes geometry that would have rendered fine. Astro Bot is
exactly that: of the three oversized pixel shaders only 098883a6f393aa10
loses the device, but the cap needed to exclude it also excludes the other
two, and with them the ship, the characters and the memory-card bodies.

KYTY_PS_SKIP_HASH takes a comma-separated hex list and hands back a null
module for those shaders, so the size cap can be turned off entirely while a
single known-bad draw stays out.

Co-Authored-By: Claude Opus 5 <[email protected]>
Only the mesh and compute stages read their wave size from the guest
registers; every other stage fell back to the wave64 default. RDNA2 runs
most pixel shaders in wave32, so their whole EXEC/VCC lane-mask model was
built at the wrong width: an SGPR holding a saved mask was read as a
register pair, and a wave-level branch test combined two halves where the
hardware has one.

Astro Bot's composite pixel shader 098883a6f393aa10 hangs the GPU on that.
It runs a waterfall loop that retires the lanes sharing an index on every
pass; with the mask a wave apart, the retiring write lands on the wrong
lanes, no lane ever clears, and the loop never ends. The wait on the
timeline semaphore then sits for the whole TDR budget before Windows
resets the device, which surfaced as VK_ERROR_DEVICE_LOST with nothing in
the fault report.

Read SPI_PS_IN_CONTROL.PS_W32_EN instead, and key the pipeline on it since
it changes the code that gets generated.

Co-Authored-By: Claude Opus 5 <[email protected]>
A hung shader and an illegal access both surface as VK_ERROR_DEVICE_LOST,
and on NVIDIA the fault report is empty either way. The elapsed wait tells
them apart: a hang holds the wait for the whole TDR budget, an access
tears the device down at once.

Co-Authored-By: Claude Opus 5 <[email protected]>
KYTY_LOOP_FUEL gives every invocation a total loop-iteration budget; once
it is spent each loop is forced onto its exit edge. If a device stops
being lost under a budget, the cause was a loop that never terminated, and
KYTY_LOOP_FUEL_MASK then narrows it to a single loop header. Off by
default and emits nothing when unset.

Co-Authored-By: Claude Opus 5 <[email protected]>
The ladder existed because Astro Bot's large composite pixel shaders lost
the device at the first fully-lit frame. That was the wave32 pixel shaders
being translated as wave64, and handing back a null module only hid it:
every draw using one of those shaders was skipped, which read on screen as
large chunks of missing geometry.

With the wave size read from SPI_PS_IN_CONTROL the title runs the same
scenes with nothing dropped, so the ladder and its KYTY_PS_OVERSIZE_CAP /
KYTY_PS_UNDERSIZE_CAP / KYTY_PS_SKIP_HASH escape hatches go with it.

Co-Authored-By: Claude Opus 5 <[email protected]>
Astro Bot's pixel shader f5b7a18248aa326d selects between two sampler
descriptors depending on control flow, so dword 0 of the S# arrives as a
phi of two ReadConst slots. A binding resolves to exactly one descriptor,
so the choice cannot be represented and resource tracking aborted the
title outright.

Take the first arm when -- and only when -- every arm of the phi is itself
a descriptor the host can evaluate; an unresolved one still aborts loudly.
An S# carries filter and addressing state and no address, so the cost is
wrong filtering on the pixels that wanted the other sampler, against
losing the run. It says so once per shader rather than going quiet.

The real fix is to bind the alternatives as a sampler array and index it,
which needs the descriptor layout, the emitter and the bind path together.

Co-Authored-By: Claude Opus 5 <[email protected]>
Resolves 15 conflicting files against main's ~23-commit refactor:
- SPIR-V enum system: hand-rolled constants -> Khronos spv:: header
  (SPIRV-Headers), with AddFunction/Type moving from brace-init-list
  calls to plain variadic ones.
- PreparedBindings.program/.snapshot -> PreparedBindings.runtime
  (ShaderStageRuntime*), consolidating program+resources.
- Resolve{Render,Depth}Target dropped their submit_id parameter.
- ValueEmitContext's giant switch-based EmitValueFlow was split into
  per-opcode Emit<Name> functions dispatched via an X-macro
  (ValueOpcodes.inc); ported our IndexedVectorLoad/AnyLane/WqmU32
  cases into that shape as new standalone functions.
- DefineInputs/DefineOutputs merged the old two-pass
  allocate-then-annotate flow into one per-input pass.

Carried forward across the refactor: PPSA21564 pixel-shader-cap
ladder, the KYTY_STRICT_STRUCTURED/KYTY_LOOP_FUEL debug guards, the
IndexedVectorLoad (v_movrels_b32) lowering, the helper-invocation
ballot mask (and its a5b874e9 DPP-ballot exception), the vertex-shader
subgroup-barrier fallback, TBuffer packed-bitfield stores, and the
BVH ray-intersection prep work.

tests/ShaderRecompilerComputeTests.cpp updated for the same API moves
(PreparedBindings.runtime, Resolve*Target signature, GpuResourceManager
removal, provoking_vtx_last pipeline param) plus one test restored that
existed at the merge base but had gone missing from our branch history
(provoking-vertex + blend-pipeline cache checks).

Verified: kyty_emulator, shader_recompiler_compute_tests, and the Qt6
launcher all build and link clean (KYTY_BUILD_LAUNCHER=ON, Qt 6.10.3).
326/328 compute+graphics shader test cases pass. Two known-preexisting
failures traced to origin/main's own SRT/resource-materialization code
(untouched by any of our commits, confirmed via targeted SPIR-V
disassembly), not to anything in this merge:
- ScalarMemoryLoadVariants, ScalarLoadSignedImmediateOffsetAddsSoffset:
  SrtWalker treats a plain S_LOAD (LoadAddressU32) as SRT-flattenable
  whenever its base address is compile-time-uniform, baking a stale
  compile-time value into flattened_srt instead of emitting a real
  runtime buffer read -- conflates "address is uniform" with "the
  memory contents are a compile-time constant".
- ImageLoadFmaskUsesNativeSampleMapping: EXIT_IF(index >=
  program.info.images.size()) in ResourceMaterialization.cpp:1198.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
- ResourceMaterialization.cpp: NativeImageKeyArg crashed with
  EXIT_IF(index >= program.info.images.size()) whenever it ran on the
  FMASK UINT32_MAX remap sentinel, since ApplyResourceSpecialization's
  dead GetImageResource survives until EliminateDeadCode runs. This
  was the exact crash behind the ImageLoadFmaskUsesNativeSampleMapping
  test failure; special-casing the sentinel fixes it.
- tests/ShaderRecompilerComputeTests.cpp:
  - CheckDepthSliceGrowth never called context.ShutdownGpu(), so
    RenderContext::InitializeGpu() would abort the next test that
    shares the renderer (a pre-existing gap that never got exercised
    because the merge conflicts blocked the suite from reaching it).
  - The provoking-vertex pipeline-cache test's third vertex used a
    white (1,1,1,1) color where it needed a distinct 0.25f component,
    so the last-provoking-vertex assertion (0x3e800000) never matched.
- ShaderRecompiler.cpp: KYTY_STRICT_STRUCTURED="" (empty, but set)
  read as v[0] != '0' == true and silently enabled the ~65x-slower
  dispatcher-fallback path.
- libJson2.cpp: the trailing-comma scanner's escape tracking cleared
  `escaped` before testing it against the current character, so an
  escaped quote inside a string ended string-tracking early, letting
  later commas inside string data get corrupted into spaces. Also
  bounded the discarded-document log preview by the actual buffer
  size instead of trusting %.80s to stop at a NUL that may not exist.
- tile.cpp: TileGetTextureTotalSize called EXIT (fatal) on an
  unsupported 3D tiled layout instead of returning false, even though
  every caller already handles a false return.

Left three CodeRabbit findings unaddressed pending more digging (not
obviously safe "quick wins" despite the label): the renderCompute.cpp
and renderDraw.cpp suggestions to gate two PPSA21564 workarounds more
narrowly, and the RayTracing.cpp BVH node-kind check (that path is
already flagged untested/unverified upstream). Also left the
SrtWalker.cpp phi-classification suggestion (a performance nitpick,
not a correctness bug) and the depthRenderTarget.cpp kOnes/eInvert
stencil-op semantics finding (flagged by CodeRabbit itself as a heavy
lift) for separate follow-up.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
PPSA21564 packs its streamed textures into a pool: each one gets a 128KB slot
holding its header and the levels loaded so far, with the next texture starting
immediately behind it. Deriving a surface footprint from the full mip count then
walks past what belongs to this texture and pulls in its neighbours, which is
what the per-tile colour noise on screen was - other textures' blocks, and the
zero-filled headers between them, decoded as if they were our own pixels. A
5.6 MB range measured this way was covered, end to end, by 44 unrelated files.

Take the resident level from the T# MIN_LOD field where the title sets it, and
where it does not, read it off the data: a BC7 block whose first byte is zero
cannot be a legal block, so a level that samples back mostly zeroes is memory
nobody wrote. Scan every level rather than stopping at the first clean one -
the coarsest levels of an overrunning surface land on a neighbour and look
perfectly valid.

Both halves are needed. Skipping the upload leaves those levels undefined, and
the shader still samples them, so the image view has to start at the resident
level too. MIN_LOD_WARN is deliberately not used: it is a feedback threshold
rather than a residency boundary, and clamping to it blacks out levels that are
present.

Co-Authored-By: Claude Opus 5 <[email protected]>
NoteAtlasUpload was WIP diagnostic code left in by mistake: it re-read every
newly uploaded BC7/BC7_SRGB atlas from guest memory and appended a line to a
hardcoded J:/tmp/atlas_up.txt on every process running this build, on top of
the guest-memory scan FindResidentBaseLevel already does for the same
purpose. Remove the function, its call in InitializeImage, and the now-dead
<cstdio> include.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Two gaps in the mip-residency change (CodeRabbit review of PR #558):

- TextureCache::FindImage() reused a cached image's resident_base_level
  forever once FindResidentBaseLevel() set it once. Streaming only adds
  finer mips over time, so a cache hit whose fresh descriptor now reports a
  lower (more complete) base level left the newly-resident mips uploaded
  never: adopt the lower value on SameBacking() and mark the image buffer
  modified so InitializeImage() actually re-uploads them.

- TextureBuildGpuTileInfos() skipped a tile that failed FitsBufferRange()
  with `continue` instead of rejecting the transfer. Every level from
  base_level up is already the guest's resident range, so a tile that still
  does not fit there is corruption, not expected partial residency; silently
  dropping it also leaves tile_infos one entry short of the caller's
  (untouched) regions vector, which Image::Upload() consumes separately.
  Restore return false.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:31:24 +00:00
github-bot closed this pull request 2026-11-26 09:31:24 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-09-21 09:13 UTC · original · edited 2026-09-21 09:16 UTC

Review Change StackReview Change Stack

Understand this PR’s impact

Explore downstream dependencies and potential security impact with Blast Radius.

View blast radius →

📝 Walkthrough

Walkthrough

The change updates runtime loading, guest GPU memory synchronization, host rendering, Vulkan diagnostics, texture metadata, occlusion queries, shader resource tracking, shader translation, SPIR-V generation, JSON APIs, and regression tests. It adds indirect-image and waterfall-descriptor handling, BVH ray-intersection translation, wave-wide operations, formatted stores, pixel interpolation updates, and explicit failure diagnostics.

Suggested reviewers: nmzik

Priority: ⬇️ Low

Change: Feature

Merge Risk: 🟠 High · up to f9c1e

Rendering and ray-tracing paths can produce stale or incorrect output, and one depth-binding path can terminate the emulator. These issues should be fixed before merging.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 202 functions across 50 files. (35 skipped… Write docstrings for the functions missing them to satisfy the coverage threshold.
Description check ❓ Inconclusive No pull request description was provided, so the changeset intent and scope are not documented. Add a concise description that summarizes the ray-tracing support and the related graphics, shader-recompiler, memory-synchronization, and test changes.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title identifies the ray-tracing work, which is a substantial part of the changeset. It is concise and specific enough for pull request history.
Full details: Docstring Coverage

Explanation

Docstring coverage is 9.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 202 functions across 50 files. (35 skipped: 3 unsupported, 32 over the file limit.)


Comment @coderabbitai help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#issuecomment-5758104246) · edited 2026-09-21 09:16 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/747#gh-light-mode-only"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg" alt="Review Change Stack" width="202" height="32"></a><a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/747#gh-dark-mode-only"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg" alt="Review Change Stack" width="202" height="32"></a> **Understand this PR’s impact** Explore downstream dependencies and potential security impact with Blast Radius. [View blast radius →](<https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/747?view=blast-radius>) <!-- review_stack_entry_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## Walkthrough The change updates runtime loading, guest GPU memory synchronization, host rendering, Vulkan diagnostics, texture metadata, occlusion queries, shader resource tracking, shader translation, SPIR-V generation, JSON APIs, and regression tests. It adds indirect-image and waterfall-descriptor handling, BVH ray-intersection translation, wave-wide operations, formatted stores, pixel interpolation updates, and explicit failure diagnostics. **Suggested reviewers:** `nmzik` </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"f9c1e3faed51b5ed5b6a719673c0cf3cced58281" --> **Change:** Feature <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _🟠 High_ · up to `f9c1e` <!-- final_review_risk_coverage:{"sourceCommitId":"f9c1e3faed51b5ed5b6a719673c0cf3cced58281","coveredCommitId":"f9c1e3faed51b5ed5b6a719673c0cf3cced58281","kind":"reviewed"} --> Rendering and ray-tracing paths can produce stale or incorrect output, and one depth-binding path can terminate the emulator. These issues should be fixed before merging. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 3 | ❌ 2</summary> ### ❌ Failed checks (1 warning, 1 inconclusive) | Check name | Status | Explanation | Resolution | | :----------------: | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | Docstring coverage is 9.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 202 functions across 50 files. (35 skipped… | Write docstrings for the functions missing them to satisfy the coverage threshold. | | Description check | ❓ Inconclusive | No pull request description was provided, so the changeset intent and scope are not documented. | Add a concise description that summarizes the ray-tracing support and the related graphics, shader-recompiler, memory-synchronization, and test changes. | <details> <summary>✅ Passed checks (3 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :--------------------------------------------------------------------------------------------------------------------------------------------------- | | 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. | | Title check | ✅ Passed | The title identifies the ray-tracing work, which is a substantial part of the changeset. It is concise and specific enough for pull request history. | </details> <details> <summary>Full details: Docstring Coverage</summary> **Explanation** Docstring coverage is 9.90% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 202 functions across 50 files. (35 skipped: 3 unsupported, 32 over the file limit.) </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- tips_start --> --- <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
@ -1122,1 +1261,4 @@
}
if (image.info.resident_base_level == 0) {
image.info.resident_base_level = FindResidentBaseLevel(image.info);
}
Author
Owner

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

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Cache the resident-scan result so FindResidentBaseLevel runs once per image.

FindResidentBaseLevel returns 0 for a fully resident BC7 texture. The guard resident_base_level == 0 cannot distinguish "not scanned yet" from "scanned, base is 0", so the scan repeats on every InitializeImage call. RefreshImage calls InitializeImage on each CPU-dirty refresh, so a streaming BC7 texture repeats up to 2048 TryReadBacking probes per mip level on every refresh.

Record a separate "scanned" flag on Image and gate the scan on it.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701477) _🚀 Performance & Scalability_ | _🟠 Major_ | _⚡ Quick win_ **Cache the resident-scan result so `FindResidentBaseLevel` runs once per image.** `FindResidentBaseLevel` returns `0` for a fully resident BC7 texture. The guard `resident_base_level == 0` cannot distinguish "not scanned yet" from "scanned, base is 0", so the scan repeats on every `InitializeImage` call. `RefreshImage` calls `InitializeImage` on each CPU-dirty refresh, so a streaming BC7 texture repeats up to 2048 `TryReadBacking` probes per mip level on every refresh. Record a separate "scanned" flag on `Image` and gate the scan on it. <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:57cc593588922c266fb06171 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -1191,0 +1338,4 @@
}
UploadStencil(image, *source, source_offset);
image.ClearStencilModified();
}
Author
Owner

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not clear the stencil-modified flag when UploadStencil skips the upload.

UploadStencil returns early without uploading when the tile mode is linear or when pitch * rows != slice_size (lines 1168-1175). RefreshImage then calls image.ClearStencilModified() unconditionally. The pending stencil modification is discarded, and the image keeps stale stencil contents until the guest writes the stencil range again.

Return a status from UploadStencil and clear the flag only on a completed upload.

🐛 Proposed fix
 	if (image.IsStencilModified()) {
 		const auto [source, source_offset] =
 		    m_buffer_cache.ObtainBufferForImage(image.info.stencil.address, image.info.stencil.size);
 		if (source == nullptr) {
 			EXIT("TextureCache: failed to obtain stencil upload source\n");
 		}
-		UploadStencil(image, *source, source_offset);
-		image.ClearStencilModified();
+		if (UploadStencil(image, *source, source_offset)) {
+			image.ClearStencilModified();
+		}
 	}

Change UploadStencil to return bool: false on the skip path at lines 1168-1175, true after image.Upload(...). Update the declaration in src/graphics/host_gpu/renderer/cache/textureCache.h line 160.

📝 Committable suggestion

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

	if (image.IsStencilModified()) {
		const auto [source, source_offset] =
		    m_buffer_cache.ObtainBufferForImage(image.info.stencil.address, image.info.stencil.size);
		if (source == nullptr) {
			EXIT("TextureCache: failed to obtain stencil upload source\n");
		}
		if (UploadStencil(image, *source, source_offset)) {
			image.ClearStencilModified();
		}
	}
**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701486) _🗄️ Data Integrity & Integration_ | _🟠 Major_ | _⚡ Quick win_ **Do not clear the stencil-modified flag when `UploadStencil` skips the upload.** `UploadStencil` returns early without uploading when the tile mode is linear or when `pitch * rows != slice_size` (lines 1168-1175). `RefreshImage` then calls `image.ClearStencilModified()` unconditionally. The pending stencil modification is discarded, and the image keeps stale stencil contents until the guest writes the stencil range again. Return a status from `UploadStencil` and clear the flag only on a completed upload. <details> <summary>🐛 Proposed fix</summary> ```diff if (image.IsStencilModified()) { const auto [source, source_offset] = m_buffer_cache.ObtainBufferForImage(image.info.stencil.address, image.info.stencil.size); if (source == nullptr) { EXIT("TextureCache: failed to obtain stencil upload source\n"); } - UploadStencil(image, *source, source_offset); - image.ClearStencilModified(); + if (UploadStencil(image, *source, source_offset)) { + image.ClearStencilModified(); + } } ``` Change `UploadStencil` to return `bool`: `false` on the skip path at lines 1168-1175, `true` after `image.Upload(...)`. Update the declaration in `src/graphics/host_gpu/renderer/cache/textureCache.h` line 160. </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (image.IsStencilModified()) { const auto [source, source_offset] = m_buffer_cache.ObtainBufferForImage(image.info.stencil.address, image.info.stencil.size); if (source == nullptr) { EXIT("TextureCache: failed to obtain stencil upload source\n"); } if (UploadStencil(image, *source, source_offset)) { image.ClearStencilModified(); } } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:b3e20642e30cb1501104c92a --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -103,0 +209,4 @@
(void)Libs::LibKernel::Memory::TryWriteBacking(dst_addr, &value, sizeof(value));
m_occlusion_begin_addr = is_end ? 0 : dst_addr;
return true;
}
Author
Owner

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Write the complete result block on the untrusted path.

The OcclusionQueryResults block holds one begin/end pair per DB, 16 pairs total. The trusted begin path writes all 16 begin slots (lines 252-255), and ResolveOcclusion writes all 32 qwords (lines 291-294). The KYTY_OCCLUSION_QUERIES=0 path writes only one qword at dst_addr.

DB1 through DB15 keep whatever the block held before. Their ready bit is never set and their counters are stale. A guest that sums end-minus-begin across DBs then reads an arbitrary total instead of "visible", which is the outcome this path exists to guarantee.

Write the whole block, matching the layout the other two paths use.

🐛 Proposed fix
 	if (!OcclusionQueriesTrusted()) {
 		// KYTY_OCCLUSION_QUERIES=0: publish a "visible" result for every occlusion-tested
 		// primitive (begin counter 0, end counter large) instead of leaving the guest to read
 		// stale memory. Disables occlusion culling; never wrongly culls on-screen geometry.
 		// begin/end dumps land 8 bytes apart on the same block. Use the safe guest writer --
 		// a result block that is not mapped yet during loading must not fault.
 		const bool     is_end = m_occlusion_begin_addr != 0 && dst_addr == m_occlusion_begin_addr + 8;
-		const uint64_t value =
-		    is_end ? (kOcclusionReadyBit | (uint64_t {1} << 40u)) : kOcclusionReadyBit;
-		(void)Libs::LibKernel::Memory::TryWriteBacking(dst_addr, &value, sizeof(value));
+		const uint64_t value =
+		    is_end ? (kOcclusionReadyBit | (uint64_t {1} << 40u)) : kOcclusionReadyBit;
+		const uint64_t other = kOcclusionReadyBit;
+		for (uint32_t db = 0; db < 16u; db++) {
+			const uint64_t slot_value = (db == 0u) ? value : other;
+			(void)Libs::LibKernel::Memory::TryWriteBacking(dst_addr + db * 16u, &slot_value,
+			                                               sizeof(slot_value));
+		}
 		m_occlusion_begin_addr = is_end ? 0 : dst_addr;
 		return true;
 	}
📝 Committable suggestion

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

	if (!OcclusionQueriesTrusted()) {
		// KYTY_OCCLUSION_QUERIES=0: publish a "visible" result for every occlusion-tested
		// primitive (begin counter 0, end counter large) instead of leaving the guest to read
		// stale memory. Disables occlusion culling; never wrongly culls on-screen geometry.
		// begin/end dumps land 8 bytes apart on the same block. Use the safe guest writer --
		// a result block that is not mapped yet during loading must not fault.
		const bool     is_end = m_occlusion_begin_addr != 0 && dst_addr == m_occlusion_begin_addr + 8;
		const uint64_t value =
		    is_end ? (kOcclusionReadyBit | (uint64_t {1} << 40u)) : kOcclusionReadyBit;
		const uint64_t other = kOcclusionReadyBit;
		for (uint32_t db = 0; db < 16u; db++) {
			const uint64_t slot_value = (db == 0u) ? value : other;
			(void)Libs::LibKernel::Memory::TryWriteBacking(dst_addr + db * 16u, &slot_value,
			                                               sizeof(slot_value));
		}
		m_occlusion_begin_addr = is_end ? 0 : dst_addr;
		return true;
	}
**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701533) _🎯 Functional Correctness_ | _🟠 Major_ | _⚡ Quick win_ **Write the complete result block on the untrusted path.** The `OcclusionQueryResults` block holds one begin/end pair per DB, 16 pairs total. The trusted begin path writes all 16 begin slots (lines 252-255), and `ResolveOcclusion` writes all 32 qwords (lines 291-294). The `KYTY_OCCLUSION_QUERIES=0` path writes only one qword at `dst_addr`. DB1 through DB15 keep whatever the block held before. Their ready bit is never set and their counters are stale. A guest that sums end-minus-begin across DBs then reads an arbitrary total instead of "visible", which is the outcome this path exists to guarantee. Write the whole block, matching the layout the other two paths use. <details> <summary>🐛 Proposed fix</summary> ```diff if (!OcclusionQueriesTrusted()) { // KYTY_OCCLUSION_QUERIES=0: publish a "visible" result for every occlusion-tested // primitive (begin counter 0, end counter large) instead of leaving the guest to read // stale memory. Disables occlusion culling; never wrongly culls on-screen geometry. // begin/end dumps land 8 bytes apart on the same block. Use the safe guest writer -- // a result block that is not mapped yet during loading must not fault. const bool is_end = m_occlusion_begin_addr != 0 && dst_addr == m_occlusion_begin_addr + 8; - const uint64_t value = - is_end ? (kOcclusionReadyBit | (uint64_t {1} << 40u)) : kOcclusionReadyBit; - (void)Libs::LibKernel::Memory::TryWriteBacking(dst_addr, &value, sizeof(value)); + const uint64_t value = + is_end ? (kOcclusionReadyBit | (uint64_t {1} << 40u)) : kOcclusionReadyBit; + const uint64_t other = kOcclusionReadyBit; + for (uint32_t db = 0; db < 16u; db++) { + const uint64_t slot_value = (db == 0u) ? value : other; + (void)Libs::LibKernel::Memory::TryWriteBacking(dst_addr + db * 16u, &slot_value, + sizeof(slot_value)); + } m_occlusion_begin_addr = is_end ? 0 : dst_addr; return true; } ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (!OcclusionQueriesTrusted()) { // KYTY_OCCLUSION_QUERIES=0: publish a "visible" result for every occlusion-tested // primitive (begin counter 0, end counter large) instead of leaving the guest to read // stale memory. Disables occlusion culling; never wrongly culls on-screen geometry. // begin/end dumps land 8 bytes apart on the same block. Use the safe guest writer -- // a result block that is not mapped yet during loading must not fault. const bool is_end = m_occlusion_begin_addr != 0 && dst_addr == m_occlusion_begin_addr + 8; const uint64_t value = is_end ? (kOcclusionReadyBit | (uint64_t {1} << 40u)) : kOcclusionReadyBit; const uint64_t other = kOcclusionReadyBit; for (uint32_t db = 0; db < 16u; db++) { const uint64_t slot_value = (db == 0u) ? value : other; (void)Libs::LibKernel::Memory::TryWriteBacking(dst_addr + db * 16u, &slot_value, sizeof(slot_value)); } m_occlusion_begin_addr = is_end ? 0 : dst_addr; return true; } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:b20f794c269fb90a3be360fd --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -530,0 +565,4 @@
state.height);
}
depth.image_id = {};
}
Author
Owner

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Clear the depth image binding state when you unbind the depth target.

This branch clears depth.image_id only. The depth image stays in m_bound_images with binding.is_target == true, and binding.attachment_layout is never assigned because the block below at Line 569 is skipped.

CommitBindings then takes the image.binding.is_target branch for that image and executes EXIT_IF(layout == vk::ImageLayout::eUndefined). A draw that samples the same depth image it had bound as a depth target therefore aborts the emulator instead of proceeding without depth.

Reset the binding when you drop the target.

🐛 Proposed fix
 		depth.image_id = {};

Replace with:

		if (auto* image = cache.m_slot_images.try_get(depth.image_id); image != nullptr) {
			image->binding.is_target = false;
		}
		depth.image_id = {};
**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701541) _🩺 Stability & Availability_ | _🟠 Major_ | _⚡ Quick win_ **Clear the depth image binding state when you unbind the depth target.** This branch clears `depth.image_id` only. The depth image stays in `m_bound_images` with `binding.is_target == true`, and `binding.attachment_layout` is never assigned because the block below at Line 569 is skipped. `CommitBindings` then takes the `image.binding.is_target` branch for that image and executes `EXIT_IF(layout == vk::ImageLayout::eUndefined)`. A draw that samples the same depth image it had bound as a depth target therefore aborts the emulator instead of proceeding without depth. Reset the binding when you drop the target. <details> <summary>🐛 Proposed fix</summary> ```diff depth.image_id = {}; ``` Replace with: ```cpp if (auto* image = cache.m_slot_images.try_get(depth.image_id); image != nullptr) { image->binding.is_target = false; } depth.image_id = {}; ``` </details> <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:444f34091560db3b016ee10f --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -0,0 +1,276 @@
#include "graphics/shader/recompiler/frontend/translate/Translator.h"
#include <algorithm>
#include <array>
Author
Owner

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add #include <limits>.

Line 134 uses std::numeric_limits<float>::infinity(). The file includes only <algorithm> and <array>. The declaration is available only if Translator.h happens to pull <limits> in transitively.

🔧 Proposed fix
 `#include` <algorithm>
 `#include` <array>
+#include <limits>
📝 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.

#include <algorithm>
#include <array>
#include <limits>
**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701545) _📐 Maintainability & Code Quality_ | _🟡 Minor_ | _⚡ Quick win_ **Add `#include <limits>`.** Line 134 uses `std::numeric_limits<float>::infinity()`. The file includes only `<algorithm>` and `<array>`. The declaration is available only if `Translator.h` happens to pull `<limits>` in transitively. <details> <summary>🔧 Proposed fix</summary> ```diff `#include` <algorithm> `#include` <array> +#include <limits> ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion #include <algorithm> #include <array> #include <limits> ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:97056c4b01bdce1d5047d0fb --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -0,0 +258,4 @@
BvhNodeField(node, max_bit, BvhBoundBits), false);
}
hits[child] = BvhSlab(bmin, bmax, origin, inv_dir, extent, pointer);
}
Author
Owner

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Every box node is decoded as a shared-exponent box.

child_base, child_types, shared_exp, and the 18-bit bmin/bmax fields are read unconditionally, and BvhSlab runs on the decompressed result for any node with kind > 1. BvhChildUnits itself distinguishes kind 2 as a "big fp32 box" from kind 3 as a "big shared-exponent box", so the two layouts are known to differ. For a kind-2 node the bounds are full fp32 values, not 18-bit fields against a per-axis shared exponent, and BvhDecompressBound reinterprets them. The slab test then produces wrong hit distances and wrong child ordering, and traversal descends into the wrong subtree.

Restrict the shared-exponent path to the node kinds that use that layout, and return the miss sentinel for the kinds that are not yet decoded, in the same way triangle leaves are handled at Line 266.

**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701556) _🎯 Functional Correctness_ | _🟠 Major_ | _🏗️ Heavy lift_ **Every box node is decoded as a shared-exponent box.** `child_base`, `child_types`, `shared_exp`, and the 18-bit `bmin`/`bmax` fields are read unconditionally, and `BvhSlab` runs on the decompressed result for any node with `kind > 1`. `BvhChildUnits` itself distinguishes kind 2 as a "big fp32 box" from kind 3 as a "big shared-exponent box", so the two layouts are known to differ. For a kind-2 node the bounds are full fp32 values, not 18-bit fields against a per-axis shared exponent, and `BvhDecompressBound` reinterprets them. The slab test then produces wrong hit distances and wrong child ordering, and traversal descends into the wrong subtree. Restrict the shared-exponent path to the node kinds that use that layout, and return the miss sentinel for the kinds that are not yet decoded, in the same way triangle leaves are handled at Line 266. <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:bcce6c5ed7da35d6de6f9dc1 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -5,3 +5,3 @@
#include "loader/symbolDatabase.h"
#include <cstddef>
#include <algorithm>
Author
Owner

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
sed -n '1,20p' src/libs/libJson2.cpp
rg -n 'offsetof|std::memset|\bsize_t\b' src/libs/libJson2.cpp | head -30

Repository: KytyPS5/KytyPS5

Length of output: 1377


Include <cstddef> for offsetof. src/libs/libJson2.cpp uses offsetof at line 1237, but its include block does not include <cstddef>. Add the direct standard-header dependency.

🔧 Proposed fix
 `#include` <algorithm>
+#include <cstddef>
📝 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.

#include <algorithm>
#include <cstddef>
**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701557) _📐 Maintainability & Code Quality_ | _🟡 Minor_ | _⚡ Quick win_ <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash sed -n '1,20p' src/libs/libJson2.cpp rg -n 'offsetof|std::memset|\bsize_t\b' src/libs/libJson2.cpp | head -30 ``` Repository: KytyPS5/KytyPS5 Length of output: 1377 --- </details> **Include `<cstddef>` for `offsetof`.** `src/libs/libJson2.cpp` uses `offsetof` at line 1237, but its include block does not include `<cstddef>`. Add the direct standard-header dependency. <details> <summary>🔧 Proposed fix</summary> ```diff `#include` <algorithm> +#include <cstddef> ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion #include <algorithm> #include <cstddef> ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:b8cfcb1e45b5fdc8737d0028 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -939,2 +947,2 @@
self->impl = impl;
}
JsonObjectDtor(self);
JsonObjectCopyCtor(self, src);
Author
Owner

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

🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win

Guard JsonObjectAssign against self-assignment.

JsonObjectDtor(self) deletes every member and the map, then sets self->impl to nullptr. If self == src, JsonObjectCopyCtor then reads *JsonObjectImpl(src), which selects the const overload and returns the static empty map. The object becomes empty instead of unchanged, and all previous members are already destroyed.

🐛 Proposed fix
 static JsonObject* KYTY_SYSV_ABI JsonObjectAssign(JsonObject* self, const JsonObject* src) {
 	PRINT_NAME();
 
+	if (self == src) {
+		return self;
+	}
 	JsonObjectDtor(self);
 	JsonObjectCopyCtor(self, src);
 	return self;
 }
📝 Committable suggestion

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

	if (self == src) {
		return self;
	}
	JsonObjectDtor(self);
	JsonObjectCopyCtor(self, src);
**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701566) _🗄️ Data Integrity & Integration_ | _🟡 Minor_ | _⚡ Quick win_ **Guard `JsonObjectAssign` against self-assignment.** `JsonObjectDtor(self)` deletes every member and the map, then sets `self->impl` to `nullptr`. If `self == src`, `JsonObjectCopyCtor` then reads `*JsonObjectImpl(src)`, which selects the const overload and returns the static empty map. The object becomes empty instead of unchanged, and all previous members are already destroyed. <details> <summary>🐛 Proposed fix</summary> ```diff static JsonObject* KYTY_SYSV_ABI JsonObjectAssign(JsonObject* self, const JsonObject* src) { PRINT_NAME(); + if (self == src) { + return self; + } JsonObjectDtor(self); JsonObjectCopyCtor(self, src); return self; } ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion if (self == src) { return self; } JsonObjectDtor(self); JsonObjectCopyCtor(self, src); ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:d2e6fb0f99483524c7292d34 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -4455,0 +4353,4 @@
HW::UserConfig user_config{};
HW::Shader shaders{};
scheduler.Begin(registers, user_config, shaders);
context.InitializeGpu(nullptr);
Author
Owner

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Check which scheduler the texture cache and RenderContext use.
fd -t f 'context.cpp|render.h|textureCache.h' src/graphics/host_gpu/renderer | while IFS= read -r f; do
  rg -n -C4 'CommandScheduler|GetCommandScheduler|m_scheduler' "$f"
done

Repository: KytyPS5/KytyPS5

Length of output: 3088


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- candidate files ---'
fd -t f -e cpp -e h -e hpp . | rg '(^|/)(context|render|textureCache|ShaderRecompilerComputeTests)\.(cpp|h|hpp)$|ShaderRecompilerComputeTests\.cpp'
printf '%s\n' '--- test body and nearby scheduler use ---'
rg -n -C25 'CheckDepthSliceGrowth|GetTextureCache|GetCommandScheduler|CommandScheduler scheduler' tests/ShaderRecompilerComputeTests.cpp
printf '%s\n' '--- RenderContext scheduler and TextureCache construction ---'
rg -n -C8 'class RenderContext|RenderContext::|GetCommandScheduler|TextureCache\(' --glob '*.{h,hpp,cpp}' .

Repository: KytyPS5/KytyPS5

Length of output: 42382


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- CheckDepthSliceGrowth ---'
sed -n '4335,4458p' tests/ShaderRecompilerComputeTests.cpp
printf '%s\n' '--- RenderContext accessors ---'
rg -n -C4 'GetTextureCache|GetCommandScheduler' src/graphics/host_gpu/renderer/renderContext.h src/graphics/host_gpu/renderer/renderContext.cpp
printf '%s\n' '--- TextureCache scheduler use in FindImage path ---'
rg -n -C5 'm_scheduler' src/graphics/host_gpu/renderer/cache/textureCache.cpp | head -160

Repository: KytyPS5/KytyPS5

Length of output: 11335


Use the renderer-owned scheduler for this test.

TextureCache::FindImage uses the scheduler owned by RenderContext, but this function begins and finishes a separate CommandScheduler. Bind the test to the context scheduler instead:

auto &scheduler = context.GetCommandScheduler();
**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#discussion_r4060701579) _📐 Maintainability & Code Quality_ | _🟡 Minor_ | _⚡ Quick win_ <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash # Check which scheduler the texture cache and RenderContext use. fd -t f 'context.cpp|render.h|textureCache.h' src/graphics/host_gpu/renderer | while IFS= read -r f; do rg -n -C4 'CommandScheduler|GetCommandScheduler|m_scheduler' "$f" done ``` Repository: KytyPS5/KytyPS5 Length of output: 3088 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- candidate files ---' fd -t f -e cpp -e h -e hpp . | rg '(^|/)(context|render|textureCache|ShaderRecompilerComputeTests)\.(cpp|h|hpp)$|ShaderRecompilerComputeTests\.cpp' printf '%s\n' '--- test body and nearby scheduler use ---' rg -n -C25 'CheckDepthSliceGrowth|GetTextureCache|GetCommandScheduler|CommandScheduler scheduler' tests/ShaderRecompilerComputeTests.cpp printf '%s\n' '--- RenderContext scheduler and TextureCache construction ---' rg -n -C8 'class RenderContext|RenderContext::|GetCommandScheduler|TextureCache\(' --glob '*.{h,hpp,cpp}' . ``` Repository: KytyPS5/KytyPS5 Length of output: 42382 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- CheckDepthSliceGrowth ---' sed -n '4335,4458p' tests/ShaderRecompilerComputeTests.cpp printf '%s\n' '--- RenderContext accessors ---' rg -n -C4 'GetTextureCache|GetCommandScheduler' src/graphics/host_gpu/renderer/renderContext.h src/graphics/host_gpu/renderer/renderContext.cpp printf '%s\n' '--- TextureCache scheduler use in FindImage path ---' rg -n -C5 'm_scheduler' src/graphics/host_gpu/renderer/cache/textureCache.cpp | head -160 ``` Repository: KytyPS5/KytyPS5 Length of output: 11335 --- </details> **Use the renderer-owned scheduler for this test.** `TextureCache::FindImage` uses the scheduler owned by `RenderContext`, but this function begins and finishes a separate `CommandScheduler`. Bind the test to the context scheduler instead: ```cpp auto &scheduler = context.GetCommandScheduler(); ``` <!-- fingerprinting:phantom:medusa:komodo --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:e1a22eabc4cf15dfcf309ad6 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

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

Actionable comments posted: 9

🧹 Nitpick comments (2)
src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp (1)

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

Share one value-tree formatter between the diagnostic paths.

DescribeValueTree and RuntimeValidator::Describe (lines 226-261) implement the same formatting with different depth limits. The two copies already differ in behaviour. Extract one helper that takes the plan, the value, and a depth limit, then call it from both sites.

src/graphics/shader/recompiler/ir/passes/DeadCodeElimination.cpp (1)

23-57: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Use hash sets for dead and web membership tests.

RemoveDeadPhiWebs uses std::ranges::find over std::vector for every membership test. When a web reaches an external user, the members collected so far are discarded and each of them is traversed again by the outer loop. For a shader with a large phi web the pass becomes quadratic in the number of phis, and EliminateDeadCode re-runs it after every successful removal.

Replace the two vectors used for membership with std::unordered_set<Inst*>, and record phis that were proven external so the outer loop skips them.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: b34fa078-740e-45c3-aac1-429509ba101f

📥 Commits

Reviewing files that changed from the base of the PR and between ba55ba5dc5 and f9c1e3faed.

📒 Files selected for processing (85)
  • 3rdparty/xxHash
  • CMakeLists.txt
  • src/emulator.cpp
  • src/graphics/guest_gpu/command_processor/commandProcessor.h
  • src/graphics/guest_gpu/command_processor/pm4Handlers.cpp
  • src/graphics/guest_gpu/graphicsRun.cpp
  • src/graphics/guest_gpu/pm4.h
  • src/graphics/guest_gpu/tile.cpp
  • src/graphics/guest_gpu/tile.h
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/renderer/cache/bufferCache.cpp
  • 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/context.cpp
  • src/graphics/host_gpu/renderer/depthRenderTarget.cpp
  • src/graphics/host_gpu/renderer/depthRenderTarget.h
  • src/graphics/host_gpu/renderer/image/image.h
  • src/graphics/host_gpu/renderer/image/imageInfo.h
  • src/graphics/host_gpu/renderer/image/textureCommon.cpp
  • src/graphics/host_gpu/renderer/image/textureCommon.h
  • src/graphics/host_gpu/renderer/masterSemaphore.cpp
  • src/graphics/host_gpu/renderer/pipeline/descriptors.cpp
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/host_gpu/renderer/render.h
  • src/graphics/host_gpu/renderer/renderCompute.cpp
  • src/graphics/host_gpu/renderer/renderDraw.cpp
  • src/graphics/presentation/videoOut.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.h
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemoryHelpers.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp
  • src/graphics/shader/recompiler/frontend/decode/ImageOps.cpp
  • src/graphics/shader/recompiler/frontend/decode/ScalarAluOps.cpp
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.cpp
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h
  • src/graphics/shader/recompiler/frontend/translate/Control.cpp
  • src/graphics/shader/recompiler/frontend/translate/Memory.cpp
  • src/graphics/shader/recompiler/frontend/translate/RayTracing.cpp
  • src/graphics/shader/recompiler/frontend/translate/Scalar.cpp
  • src/graphics/shader/recompiler/frontend/translate/Translate.cpp
  • src/graphics/shader/recompiler/frontend/translate/Translate.h
  • src/graphics/shader/recompiler/frontend/translate/Translator.h
  • src/graphics/shader/recompiler/ir/IREmitter.cpp
  • src/graphics/shader/recompiler/ir/IREmitter.h
  • src/graphics/shader/recompiler/ir/Program.cpp
  • src/graphics/shader/recompiler/ir/ShaderIR.h
  • src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.cpp
  • src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc
  • src/graphics/shader/recompiler/ir/passes/BindingLayout.cpp
  • src/graphics/shader/recompiler/ir/passes/BindingLayout.h
  • src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp
  • src/graphics/shader/recompiler/ir/passes/DeadCodeElimination.cpp
  • src/graphics/shader/recompiler/ir/passes/DynamicBuffer.cpp
  • src/graphics/shader/recompiler/ir/passes/DynamicBuffer.h
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.h
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp
  • src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp
  • src/graphics/shader/recompiler/ir/passes/SrtWalker.h
  • src/graphics/shader/recompiler/ir/passes/WaterfallDescriptor.cpp
  • src/graphics/shader/recompiler/ir/passes/WaterfallDescriptor.h
  • src/graphics/shader/shader.cpp
  • src/graphics/shader/shader.h
  • src/graphics/shader/shaderPixelParameter.cpp
  • src/kernel/memory.cpp
  • src/kernel/memory.h
  • src/libs/libJson2.cpp
  • src/libs/libKernel.cpp
  • src/loader/redZonePatcher.cpp
  • src/loader/runtimeLinker.cpp
  • tests/ResourceTrackingTests.cpp
  • tests/ScalarProvenanceTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-09-21 09:13 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#pullrequestreview-5264860665) · **reviewed** **Actionable comments posted: 9** <details> <summary>🧹 Nitpick comments (2)</summary><blockquote> <details> <summary>src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp (1)</summary><blockquote> `67-101`: _📐 Maintainability & Code Quality_ | _🔵 Trivial_ | _⚡ Quick win_ **Share one value-tree formatter between the diagnostic paths.** `DescribeValueTree` and `RuntimeValidator::Describe` (lines 226-261) implement the same formatting with different depth limits. The two copies already differ in behaviour. Extract one helper that takes the plan, the value, and a depth limit, then call it from both sites. <!-- cr-comment:v1:e24991606146638d55d0810d --> </blockquote></details> <details> <summary>src/graphics/shader/recompiler/ir/passes/DeadCodeElimination.cpp (1)</summary><blockquote> `23-57`: _🚀 Performance & Scalability_ | _🔵 Trivial_ | _⚡ Quick win_ **Use hash sets for `dead` and `web` membership tests.** `RemoveDeadPhiWebs` uses `std::ranges::find` over `std::vector` for every membership test. When a web reaches an external user, the members collected so far are discarded and each of them is traversed again by the outer loop. For a shader with a large phi web the pass becomes quadratic in the number of phis, and `EliminateDeadCode` re-runs it after every successful removal. Replace the two vectors used for membership with `std::unordered_set<Inst*>`, and record phis that were proven external so the outer loop skips them. <!-- cr-comment:v1:23809dc160746d4e6b90dde1 --> </blockquote></details> </blockquote></details> --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml **Review profile**: CHILL **Plan**: Advanced **Run ID**: `b34fa078-740e-45c3-aac1-429509ba101f` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between ba55ba5dc541db1920c60f3e2f8dd0c6420dca8e and f9c1e3faed51b5ed5b6a719673c0cf3cced58281. </details> <details> <summary>📒 Files selected for processing (85)</summary> * `3rdparty/xxHash` * `CMakeLists.txt` * `src/emulator.cpp` * `src/graphics/guest_gpu/command_processor/commandProcessor.h` * `src/graphics/guest_gpu/command_processor/pm4Handlers.cpp` * `src/graphics/guest_gpu/graphicsRun.cpp` * `src/graphics/guest_gpu/pm4.h` * `src/graphics/guest_gpu/tile.cpp` * `src/graphics/guest_gpu/tile.h` * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/renderer/cache/bufferCache.cpp` * `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/context.cpp` * `src/graphics/host_gpu/renderer/depthRenderTarget.cpp` * `src/graphics/host_gpu/renderer/depthRenderTarget.h` * `src/graphics/host_gpu/renderer/image/image.h` * `src/graphics/host_gpu/renderer/image/imageInfo.h` * `src/graphics/host_gpu/renderer/image/textureCommon.cpp` * `src/graphics/host_gpu/renderer/image/textureCommon.h` * `src/graphics/host_gpu/renderer/masterSemaphore.cpp` * `src/graphics/host_gpu/renderer/pipeline/descriptors.cpp` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/graphics/host_gpu/renderer/render.h` * `src/graphics/host_gpu/renderer/renderCompute.cpp` * `src/graphics/host_gpu/renderer/renderDraw.cpp` * `src/graphics/presentation/videoOut.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `src/graphics/shader/recompiler/ShaderRecompiler.cpp` * `src/graphics/shader/recompiler/ShaderRecompiler.h` * `src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterHelpers.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterInstructions.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemoryHelpers.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp` * `src/graphics/shader/recompiler/frontend/decode/ImageOps.cpp` * `src/graphics/shader/recompiler/frontend/decode/ScalarAluOps.cpp` * `src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.cpp` * `src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h` * `src/graphics/shader/recompiler/frontend/translate/Control.cpp` * `src/graphics/shader/recompiler/frontend/translate/Memory.cpp` * `src/graphics/shader/recompiler/frontend/translate/RayTracing.cpp` * `src/graphics/shader/recompiler/frontend/translate/Scalar.cpp` * `src/graphics/shader/recompiler/frontend/translate/Translate.cpp` * `src/graphics/shader/recompiler/frontend/translate/Translate.h` * `src/graphics/shader/recompiler/frontend/translate/Translator.h` * `src/graphics/shader/recompiler/ir/IREmitter.cpp` * `src/graphics/shader/recompiler/ir/IREmitter.h` * `src/graphics/shader/recompiler/ir/Program.cpp` * `src/graphics/shader/recompiler/ir/ShaderIR.h` * `src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.cpp` * `src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc` * `src/graphics/shader/recompiler/ir/passes/BindingLayout.cpp` * `src/graphics/shader/recompiler/ir/passes/BindingLayout.h` * `src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp` * `src/graphics/shader/recompiler/ir/passes/DeadCodeElimination.cpp` * `src/graphics/shader/recompiler/ir/passes/DynamicBuffer.cpp` * `src/graphics/shader/recompiler/ir/passes/DynamicBuffer.h` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.h` * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp` * `src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp` * `src/graphics/shader/recompiler/ir/passes/SrtWalker.h` * `src/graphics/shader/recompiler/ir/passes/WaterfallDescriptor.cpp` * `src/graphics/shader/recompiler/ir/passes/WaterfallDescriptor.h` * `src/graphics/shader/shader.cpp` * `src/graphics/shader/shader.h` * `src/graphics/shader/shaderPixelParameter.cpp` * `src/kernel/memory.cpp` * `src/kernel/memory.h` * `src/libs/libJson2.cpp` * `src/libs/libKernel.cpp` * `src/loader/redZonePatcher.cpp` * `src/loader/runtimeLinker.cpp` * `tests/ResourceTrackingTests.cpp` * `tests/ScalarProvenanceTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/shaderCfgTests.cpp` </details> **Included review availability:** Your plan provides up to 10 included reviews per hour; 9 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status -->
Author
Owner

@⁠Nmzik on GitHub · 2026-10-01 14:11 UTC · original

closed in favor #558

**@⁠Nmzik** on GitHub · 2026-10-01 14:11 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/747#issuecomment-5933237562) closed in favor #558

Pull request closed

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