Re engine bringup #1495

Open
github-bot wants to merge 138 commits from github-bot/gh-1495 into main AGit
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:16 UTC · original
shadowbeat070:re-engine-bringup → main · +48541 −2912 · 190 files · 138 commits · open

Many fixes, implementations and refactors to make all re engine games get in game and some are playable from beginning to end. Also fixed some miscellaneous bugs and performance issues.

Rebased onto the latest main (6aaa53329). Changes that main now covers were dropped, and the RE Engine descriptor heaps now go through main's image heap instead of our own bindless arrays.

Summary

Shader recompiler: decoding and opcode coverage

  • Every gather4 variant is decoded, and 1D gathers read the level they name.
  • VOPC SDWA modifiers are checked per source.
  • An a16 BVH intersection is decoded as a permanent miss, and a zero-length decode is refused.
  • F16 class compares in SDWA and the NGG GS VGPR layout are decoded.
  • Cache-policy bits are accepted on flat loads and stores.
  • Flat apertures are resolved from the whole high dword.
  • v_readlane reads the nearest live lane below when the named lane is inactive.
  • Relative moves that an index range proves unreachable are folded.

Shader recompiler: memory, coherence and BDA

  • Stores go through the BDA page table.
  • Buffer memory is ordered at s_barrier.
  • A glc dwordx2 is written as one 64-bit access. This was a RE3 boot TDR.
  • A float stored into a 10- or 11-bit buffer channel is encoded correctly.
  • Scalar reads are allowed from a written buffer when no earlier write can come before them.
  • Buffer bounds are left to robustBufferAccess2, and scalar dword indices are capped.
  • GPU-owned scalar data and written V#s stay on the GPU.
  • Compute loops exit after a BDA miss unless they may run a work queue. This was the RE9 lighting TDR.
  • Inactive-lane write masks that no lane can read are dropped.

Shader recompiler: descriptors, srt walk and bindless

  • A loop-carried descriptor is evaluated only when the loop leaves it unchanged.
  • Descriptors that a dispatch only learns about on the GPU are resolved.
  • Buffer V#s built by the GPU are decoded in the shader for stores and atomics.
  • The SRT walk evaluates more operations and names the one it can't evaluate.
  • Descriptor chains are walked without native recursion.
  • Dispatcher phis are copied in parallel, and a specialization that does not fit is refused.
  • Null descriptors and unread strides no longer force new permutations.
  • A materialization is committed only when the whole draw resolves, and the shader reports why it refused.
  • Materialization reads are cached and replayed, including shaders that read through the image heap.
  • The image heap serves the RE Engine descriptor heaps:
    • Heap tables are kept out of draw write conflicts.
    • Partly mapped heaps are served, and idle heap views are released.

Shader recompiler: stages and features

  • Mesh shaders emit clip, cull, point size and viewport outputs.
  • NGG mesh assembly is built from the GS registers, and a lowered NGG vertex stage is seeded.
  • A sample texel offset is folded into the coordinate, scaled to the sampled level.
  • Flat aliases of custom inputs are read, and flat copies of interpolated outputs are written.
  • The pixel shader exports its stencil reference, and exported stencil op values are replayed.
  • Tessellation:
    • Quad and isoline domains are emitted.
    • RE Engine strides and patch constants are reflected.
  • Any-hit calls the host cannot resolve accept every hit. This is a stub.

Shader recompiler: stability and speed optimizations

  • A shader the recompiler can't use is skipped instead of exiting.
  • Compute loops can be guarded with an optional per-invocation budget.
  • Dispatcher SPIR-V is capped, and a program that a draw proved unfoldable is rebuilt.
  • Structurized control flow is cached by body and backed by a file.
  • SPIR-V modules are simplified before the driver builds them.
  • Phi and memory-accessor queries in resource planning are memoized.
  • Materialization memo replays are faster.

Renderer: images and texture cache

  • Images are collected by presented frames, under a device memory budget.
  • Metadata clear state stays exact across slices, format switches and shader stores.
  • A stencil plane is kept with the depth target that owns it.
  • An overlap victim that nothing can reproduce is parked, then readmitted by layout.
  • Image identities are settled before views are acquired.
  • GPU writes are copied between same-layout images of different formats.
  • GPU-written images are downloaded into whole-surface raw reads.
  • Depth and colour images are copied directly, and a depth surface's other format is parked.
  • An image is marked maybe-dirty when an edge page is untracked.
  • Narrower texture reads get their own image at a shared address.
  • Between an image and a buffer at the same bytes, the newer write wins.
  • Device-local images are tiled in place with whole-dword stores, and the tiler path follows the buffer's actual memory.
  • The RE Engine buffer-copy kernel is served as an image copy.
  • Cached image mips and layers are compared separately.
  • An exact image match that a newer overlapping write has replaced is skipped.
  • Fast clears of every unpacked colour format are decoded.
  • Only the planes a storage view writes count as dispatch writes.
  • An equal-address image whose shared mips sit elsewhere is retired.
  • A one-row 2D image is synced from its 1D alias, including one with superseded padding.
  • Standard 64KB array and volume colour targets are allowed.
  • Guest image layouts are memoized per thread, a texture binding is laid out once, and image region queries are memoized until the page index changes.
  • The texture-cache lock is skipped on write faults no image covers.

Renderer memory, BDA and guest faults

  • Whole guest mappings are faulted in behind a BDA miss, and the fault walk is bounded.
  • Memory that dispatches reach through BDA is mapped and kept resident, including the mapping behind a BDA store pointer.
  • The BDA page table is backed by sparse memory and suballocated buffers.
  • GPU-written bytes are downloaded and guest memory is unmapped without draining the GPU.
  • Guest faults on GPU-written pages are served from the faulting thread, or from an in-flight hot write-back.
  • The per-page write-watcher count is widened to 15 bits.
  • Pages that a large dispatch left unchanged are released.
  • Buffers can be bound across unmapped holes.
  • Unmapped guest memory is tolerated under cached buffers and images.
  • The last dword of a buffer that ends mid-dword is exposed.
  • Cached buffers are aged in presented frames.

Renderer: draws, dispatches and pipelines

  • A dispatch or draw whose counts exceed the device limits is skipped.
  • A substitute is bound for a guest descriptor the host can't represent.
  • Indirect draws with a GPU-written count stay on the GPU.
  • Mesh indirect packets are drawn through a task shader.
  • Thread-dimension indirect dispatches are converted on the GPU.
  • A compute fill whose stride is wider than its element clears whole records.
  • Graphics pipelines are linked from shared libraries, with a pixel-only descriptor set.
  • Helper pipelines are built through the driver cache, and the executable is fingerprinted.
  • Dual-source blending is used only when export 0 reaches colour buffer 0.
  • The dynamic depth bounds are clamped to [0, 1].

Renderer and graphics: performance and synchronization changes

  • Long recordings are submitted early.
  • Fewer barriers are recorded between dispatches, and back-to-back buffer transfers share one barrier pair.
  • Per-draw binding work is trimmed, and identical pixel bindings are reused.
  • Command-processor writes are ordered behind the GPU work.
  • Queued guest submissions are merged into one Vulkan submit.
  • Blocked guest queues are polled briefly before sleeping.
  • Stream reservations are held until their consumer is recorded.
  • Prepared buffers are reset with the rest of the binding scratch.
  • A BDA sync is queued after its buffer registers and again when it unregisters.
  • The whole address is compared before the prefetch DMA is dropped.
  • An image download larger than the staging stream is split.
  • Freed images of the same shape are reused.
  • An image the guest reallocated larger is expanded within its requested data range.
  • The null buffer is zeroed when it is created.
  • Packed float formats are kept out of the 32-bit view class.
  • A RangeSet add that merges reuses its map node.

Kernel

  • umtx is added, and the kernel no longer aborts on guest misuse.
  • The renderer is told about guest protection changes.
  • Short guest sleeps spin within a per-thread budget.
  • Guest ranges are reserved before host threads start.
  • The address-space lock is taken shared for transient protects.

Loader

  • The red zone is protected in frame-pointer functions, including ones the unwind tables miss, and the analysis follows jump tables.
  • The unresolved-import stub log is budgeted per symbol.

common

  • The GPU and present threads run ahead of guest threads.
  • A fatal error forces the exit after 10 s and runs the emergency hooks once.
  • Linear images are read back by default.
  • The guest can render at a resolution other than the window.

Audio

  • AudioOut2 pushes and grains are paced against the output, and synchronous pushes block on the modelled queue.
  • Ambisonic AudioOut2 objects are decoded to stereo, and surround output is folded to stereo in the emulator.
  • ATRAC9 S32 output is scaled to full scale.
  • AJM skips live ids when an instance index wraps.

Saves and system

  • Save data matches a trailing % and sorts directory name searches by the requested key.
  • The save data dialog lets you pick saves from a list.
  • AMPR no longer caches resolved save data paths.

Games that this PR targets: RE/2/3/4/7/8/9, PRAGMATA, Onimusha, and a few small graphical fixes for Silent Hill 2/f

RE2/3/7 are confirmed playable from beginning to end with consistent 30-60 fps depending on the game.

All others get in game and run stably with no noticable graphical issues.

After the rebase, RE2 (ray tracing on), RE8, RE9, Onimusha, Dead Space, Silent Hill 2 and Silent Hill Townfall were re-tested on the final build.

All games were tested with Intel/NVIDIA Hardware.

PR follows contribution guidelines and the Windows build is verified.

**@⁠shadowbeat070** on GitHub · 2026-10-13 23:16 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495) `shadowbeat070:re-engine-bringup` → `main` · +48541 −2912 · 190 files · 138 commits · open Many fixes, implementations and refactors to make all re engine games get in game and some are playable from beginning to end. Also fixed some miscellaneous bugs and performance issues. Rebased onto the latest main (6aaa53329). Changes that main now covers were dropped, and the RE Engine descriptor heaps now go through main's image heap instead of our own bindless arrays. # Summary ## Shader recompiler: decoding and opcode coverage - Every gather4 variant is decoded, and 1D gathers read the level they name. - VOPC SDWA modifiers are checked per source. - An a16 BVH intersection is decoded as a permanent miss, and a zero-length decode is refused. - F16 class compares in SDWA and the NGG GS VGPR layout are decoded. - Cache-policy bits are accepted on flat loads and stores. - Flat apertures are resolved from the whole high dword. - v_readlane reads the nearest live lane below when the named lane is inactive. - Relative moves that an index range proves unreachable are folded. ## Shader recompiler: memory, coherence and BDA - Stores go through the BDA page table. - Buffer memory is ordered at s_barrier. - A glc dwordx2 is written as one 64-bit access. This was a RE3 boot TDR. - A float stored into a 10- or 11-bit buffer channel is encoded correctly. - Scalar reads are allowed from a written buffer when no earlier write can come before them. - Buffer bounds are left to robustBufferAccess2, and scalar dword indices are capped. - GPU-owned scalar data and written V#s stay on the GPU. - Compute loops exit after a BDA miss unless they may run a work queue. This was the RE9 lighting TDR. - Inactive-lane write masks that no lane can read are dropped. ## Shader recompiler: descriptors, srt walk and bindless - A loop-carried descriptor is evaluated only when the loop leaves it unchanged. - Descriptors that a dispatch only learns about on the GPU are resolved. - Buffer V#s built by the GPU are decoded in the shader for stores and atomics. - The SRT walk evaluates more operations and names the one it can't evaluate. - Descriptor chains are walked without native recursion. - Dispatcher phis are copied in parallel, and a specialization that does not fit is refused. - Null descriptors and unread strides no longer force new permutations. - A materialization is committed only when the whole draw resolves, and the shader reports why it refused. - Materialization reads are cached and replayed, including shaders that read through the image heap. - The image heap serves the RE Engine descriptor heaps: - Heap tables are kept out of draw write conflicts. - Partly mapped heaps are served, and idle heap views are released. ## Shader recompiler: stages and features - Mesh shaders emit clip, cull, point size and viewport outputs. - NGG mesh assembly is built from the GS registers, and a lowered NGG vertex stage is seeded. - A sample texel offset is folded into the coordinate, scaled to the sampled level. - Flat aliases of custom inputs are read, and flat copies of interpolated outputs are written. - The pixel shader exports its stencil reference, and exported stencil op values are replayed. - Tessellation: - Quad and isoline domains are emitted. - RE Engine strides and patch constants are reflected. - Any-hit calls the host cannot resolve accept every hit. This is a stub. ## Shader recompiler: stability and speed optimizations - A shader the recompiler can't use is skipped instead of exiting. - Compute loops can be guarded with an optional per-invocation budget. - Dispatcher SPIR-V is capped, and a program that a draw proved unfoldable is rebuilt. - Structurized control flow is cached by body and backed by a file. - SPIR-V modules are simplified before the driver builds them. - Phi and memory-accessor queries in resource planning are memoized. - Materialization memo replays are faster. ## Renderer: images and texture cache - Images are collected by presented frames, under a device memory budget. - Metadata clear state stays exact across slices, format switches and shader stores. - A stencil plane is kept with the depth target that owns it. - An overlap victim that nothing can reproduce is parked, then readmitted by layout. - Image identities are settled before views are acquired. - GPU writes are copied between same-layout images of different formats. - GPU-written images are downloaded into whole-surface raw reads. - Depth and colour images are copied directly, and a depth surface's other format is parked. - An image is marked maybe-dirty when an edge page is untracked. - Narrower texture reads get their own image at a shared address. - Between an image and a buffer at the same bytes, the newer write wins. - Device-local images are tiled in place with whole-dword stores, and the tiler path follows the buffer's actual memory. - The RE Engine buffer-copy kernel is served as an image copy. - Cached image mips and layers are compared separately. - An exact image match that a newer overlapping write has replaced is skipped. - Fast clears of every unpacked colour format are decoded. - Only the planes a storage view writes count as dispatch writes. - An equal-address image whose shared mips sit elsewhere is retired. - A one-row 2D image is synced from its 1D alias, including one with superseded padding. - Standard 64KB array and volume colour targets are allowed. - Guest image layouts are memoized per thread, a texture binding is laid out once, and image region queries are memoized until the page index changes. - The texture-cache lock is skipped on write faults no image covers. ## Renderer memory, BDA and guest faults - Whole guest mappings are faulted in behind a BDA miss, and the fault walk is bounded. - Memory that dispatches reach through BDA is mapped and kept resident, including the mapping behind a BDA store pointer. - The BDA page table is backed by sparse memory and suballocated buffers. - GPU-written bytes are downloaded and guest memory is unmapped without draining the GPU. - Guest faults on GPU-written pages are served from the faulting thread, or from an in-flight hot write-back. - The per-page write-watcher count is widened to 15 bits. - Pages that a large dispatch left unchanged are released. - Buffers can be bound across unmapped holes. - Unmapped guest memory is tolerated under cached buffers and images. - The last dword of a buffer that ends mid-dword is exposed. - Cached buffers are aged in presented frames. ## Renderer: draws, dispatches and pipelines - A dispatch or draw whose counts exceed the device limits is skipped. - A substitute is bound for a guest descriptor the host can't represent. - Indirect draws with a GPU-written count stay on the GPU. - Mesh indirect packets are drawn through a task shader. - Thread-dimension indirect dispatches are converted on the GPU. - A compute fill whose stride is wider than its element clears whole records. - Graphics pipelines are linked from shared libraries, with a pixel-only descriptor set. - Helper pipelines are built through the driver cache, and the executable is fingerprinted. - Dual-source blending is used only when export 0 reaches colour buffer 0. - The dynamic depth bounds are clamped to [0, 1]. ## Renderer and graphics: performance and synchronization changes - Long recordings are submitted early. - Fewer barriers are recorded between dispatches, and back-to-back buffer transfers share one barrier pair. - Per-draw binding work is trimmed, and identical pixel bindings are reused. - Command-processor writes are ordered behind the GPU work. - Queued guest submissions are merged into one Vulkan submit. - Blocked guest queues are polled briefly before sleeping. - Stream reservations are held until their consumer is recorded. - Prepared buffers are reset with the rest of the binding scratch. - A BDA sync is queued after its buffer registers and again when it unregisters. - The whole address is compared before the prefetch DMA is dropped. - An image download larger than the staging stream is split. - Freed images of the same shape are reused. - An image the guest reallocated larger is expanded within its requested data range. - The null buffer is zeroed when it is created. - Packed float formats are kept out of the 32-bit view class. - A RangeSet add that merges reuses its map node. ## Kernel - umtx is added, and the kernel no longer aborts on guest misuse. - The renderer is told about guest protection changes. - Short guest sleeps spin within a per-thread budget. - Guest ranges are reserved before host threads start. - The address-space lock is taken shared for transient protects. ## Loader - The red zone is protected in frame-pointer functions, including ones the unwind tables miss, and the analysis follows jump tables. - The unresolved-import stub log is budgeted per symbol. ## common - The GPU and present threads run ahead of guest threads. - A fatal error forces the exit after 10 s and runs the emergency hooks once. - Linear images are read back by default. - The guest can render at a resolution other than the window. ## Audio - AudioOut2 pushes and grains are paced against the output, and synchronous pushes block on the modelled queue. - Ambisonic AudioOut2 objects are decoded to stereo, and surround output is folded to stereo in the emulator. - ATRAC9 S32 output is scaled to full scale. - AJM skips live ids when an instance index wraps. ## Saves and system - Save data matches a trailing % and sorts directory name searches by the requested key. - The save data dialog lets you pick saves from a list. - AMPR no longer caches resolved save data paths. Games that this PR targets: RE/2/3/4/7/8/9, PRAGMATA, Onimusha, and a few small graphical fixes for Silent Hill 2/f RE2/3/7 are confirmed playable from beginning to end with consistent 30-60 fps depending on the game. All others get in game and run stably with no noticable graphical issues. After the rebase, RE2 (ray tracing on), RE8, RE9, Onimusha, Dead Space, Silent Hill 2 and Silent Hill Townfall were re-tested on the final build. All games were tested with Intel/NVIDIA Hardware. PR follows contribution guidelines and the Windows build is verified.
Only 7 of the 24 gather4 encodings were listed, so image_gather4_l aborted CFG build. The rest
now decode with their sample flags. A 1D gather is no longer limited to _lz and samples its level.
Three test targets link xbyak or use try/throw directly, which clang-cl only
accepts with /EHsc. They were silently skipped before.
It is bound in place of a missing guest buffer, so a read must see zeros.
Sign extension on a float compare source or neg/abs on an integer compare source rejects that
source, not the whole encoding.
Vulkan cannot express a16 rays, so they translate to the invalid-node sentinel, which ends a
traversal. An unknown encoding family or a zero-width decode is refused instead of exiting.
An undecodable instruction, an unevaluable descriptor expression or a program the backend cannot
express aborted the emulator. Each now marks the program skipped, drops its draws and
dispatches, and logs the pc and reason once per hash.
Writing a raw pointer was rejected, which dropped the shader's dispatches entirely. Aligned
dwords take a plain store, narrower ones a read-modify-write. A store faults on a page the host
does not track yet, tagging it so later store dispatches mark it GPU-written.

Lanes faulting pages of one bitmap word lost each other's bits in the load/or/store.
Nothing else returns a GPU-written linear surface to the guest, so a CPU read
of one silently saw whatever the guest's own memory still held.
s_barrier was emitted with WorkgroupMemory only, which covers LDS and not buffers.
SILENT HILL 2 submits dozens of command buffers per frame, so a staleness limit counted in queue
submits expired inside one frame and deleted live GPU-only images.
The recognizer matched the first written buffer at a registered metadata base
and skipped the whole dispatch, so a shader that also wrote images, other
buffers or atomics lost all of it silently.

A four byte fill at a registered base published a clear of all 32 slices, and
the next depth bind then discarded contents the guest meant to keep. The
registry now carries the range size the depth target already knew.

RE9 clears each shadow atlas layer at an offset into its HTILE; ignoring those
kept every past silhouette in the shadow map and darkened a moving model.

SILENT HILL 2's Nanite exports depth into HTILE after the engine fast-clears it; the
pending clear wiped the exported depth at the next attachment load (black stairwell shards).
Accept a loop-carried phi whose operands all reproduce the value the loop is
entered with, proving the fixpoint before anything is bound so a phi that really
advances is still refused.

A constant offset was enough to hoist a scalar read into the flattened SRT, but
a descriptor carried around a loop names a different record each iteration.
The fault, blit, tiler and overlay pipelines go through the driver pipeline cache, which is not
saved past 1 GiB. EmulatorBinaryHash reads the path with _get_wpgmptr: wmain leaves the narrow
program path unset, and _get_pgmptr then aborts with STATUS_STACK_BUFFER_OVERRUN.
SILENT HILL 2's BVH passes size one another from counts an earlier dispatch wrote, so descriptor
reads take only GPU-clean guest bytes and a failed materialization skips just that dispatch.
On upstream this replaces 3ba0e971's strict capture of vector descriptor reads.
A readback past 32 MiB aborted. Oversized image levels, layers and rows are split and packed
into batches that fit, each waiting for the previous one to be written back.
Vulkan gives B10G11R11 and E5B9G9R9 classes of their own. Sharing one backing let an R11G11B10
render target reuse a UNORM8 image, where every HDR texel clamped.
A garbage indirect count of 2,709,921 groups went straight to vkCmdDispatch and reset the driver.
Such work is now dropped with a log line naming its source.
Round to nearest, saturate to the largest finite value, and store negatives as zero and NaN as
all ones, so packed R11G11B10-style stores read back as the guest wrote them.
A depth address reused for another pass's stencil made the depth image a stencil proxy, so its
next binding aborted. CopyImage carries stencil between identical formats, a depth-only copy no
longer re-associates the plane (RE4), and images stamp GPU and buffer writes with an epoch.
On upstream this builds on 39248a1f8's mesh clip and cull distances: DefineMeshOutputs
counts the distances from the outputs itself and shares one builtin per kind, so point size
and viewport index take the same path.
An unsupported ES/GS register layout now drops the draw and says so instead of
exiting the emulator.
Each stubbed import logs its first 8 calls instead of all stubs sharing the first 1024, and a
re-registered stub refreshes its record.
--render-width/--render-height set the video-out extent the guest draws for;
they default to the window size, so an unflagged run is unchanged.
A terminator's phi stores wait until its condition and selector, which may read a spill slot, are
emitted. A mismatched specialization refuses the program, a uniform fill may store several
elements per invocation, and an unmapped vertex buffer binds the null buffer.
A dispatcher module past 131072 words is refused. The pcs a materialization reports unfoldable
are learned per code key, and the program is rebuilt with those reads left on the GPU.
Roughly fourteen fatal exits on the texture and image-upload paths become a
reported, recoverable substitute: the shader takes the null texture or an
image keeps what it holds, and the refusal is named once per descriptor.
The GPU counter counts every faulting page while the area stores at most
1023, so the host walked past its own area and handed ResolveBdaFault an
unaligned range.
A queue landing before the registration can be swallowed by an in-flight drain, and the pages an
unregistered buffer leaves may still be CPU-dirty. BDA stores are marked only in mapped memory.
Sixty-four EXIT sites ended the process on values a guest may legitimately
pass - wait_mode, detach state, mutex protocol, an equeue at capacity. They
return errors now, so a level load that hits one survives it.
A permutation miss re-structurized a graph that cannot have changed. The cache
is keyed on the decoded body alone, which is the structurizer's whole input.

First-time structurization is now paid once per machine rather than once per
launch. The binary fingerprint is the stamp.
The pixel stage takes set 2, after upstream's image heap at set 1, so a fragment library's
layout depends on the pixel shader alone. Only set 0 may be a push-descriptor set.
Pre-raster and fragment libraries are cached; mesh pipelines stay monolithic (RE9 device loss).
DB_SHADER_CONTROL bits 1 and 2 put the stencil reference in MRTZ channel 1.
Gated on VK_EXT_shader_stencil_export.

Without VK_EXT_shader_stencil_export the draw is reissued with a discard variant per bit; library pipelines keep stencil state dynamic.
The GPU reads a stream reservation under whichever command buffer records its
consumer, not the one recording when the CPU wrote it.
Integer min/max, the missing integer compares, multiply-high and the integer
reciprocal all appear in guest code that assembles a V#, and rejecting one aborted
the emulator.

The failure only said which dword was bad, so identifying the instruction cost
an instrumented run.

The host walk refused CompositeExtractU32x4, which dropped SILENT HILL 2's BVH compute pass
0x68ca7b6fd9c44cfa for the whole session.
PageManager::ReapplyProtection exists to re-narrow the write watch a guest
mprotect replaces, but nothing called it, so the host stopped learning about
CPU writes to those pages. RE9 protects GPU ranges hundreds of times a run.
The guard tested only the low 32 bits of the destination, so a real guest
address ending in 0003022c would have had its transfer dropped. The packet it
means to catch is an L2 prefetch whose destination is a register offset.
The patcher only recognised stack accesses through RSP, so a function that
addresses its locals through RBP after mov rbp, rsp kept none of its red zone
across a resumed host page fault.

SILENT HILL f describes 16,670 of its 297,734 functions, so the patcher never saw the one
whose rbp-addressed local sits in the red zone and the guest faulted on a resumed read.
Resolving one binding can displace an image another binding already resolved, and the view was
then acquired from the retired image. Stage images and colour targets are resolved until none
moves (at most four passes) before any view is acquired.
Materialization has a dozen distinct ways to refuse and the report carried
none of them, so a dropped dispatch said only that it was dropped. RE9's
transient drops separate into image descriptor, buffer table not single and
flat srt refresh.
A count buffer goes to vkCmdDraw*IndirectCount and NUM_INSTANCES follows the counted record.
Provably empty records skip the draw before its targets resolve, an args barrier orders earlier
GPU writes, and IndirectDrawResult says why a draw falls back to CPU counts.
RE9's vibration thread otherwise spun on yield while the one-grain queue drained.

RE Engine advances on its mixer thread and pushes from another; pushing the
ports' current PCM repeated one grain and dropped the next.

Exact grain clock, a jitter cushion for async pushes and a latency trim.

RE7 keeps advancing without new PCM while it loads at boot; replaying the last grain buzzed.
An emergency hook can wait on a thread that waits on the failing one, as a connected profiler's
shutdown does.
Aliased surfaces recreate each other every frame; a pool of idle images spares the allocation and free.
A heap table read is a materialization dependency, not a scalar read the draw's own writes must
avoid (HeapReadSlot). A heap sample folds a dynamic texel offset into the coordinate without
maintenance8, and a memoized specialization replays its heap roots.
A depth/colour recreate took the larger subresource count but the smaller range, so the upload refused a 32-layer image over 8 MB.
An unmapped BDA page reads zero until its fault is handled after the dispatch, which left RE9's
meshlet table empty on ~40% of boots. Faulted pages stay pinned until unmapped, and the mapping
behind each named DMA pointer is prefetched, and store-tracked for stores.
Chains thousands of values deep (RE9's model viewer, per-lane addresses) overflowed the stack; the
walk, evaluation and lowering use explicit per-thread stacks. Closed ballots are cached on the plan,
one walker serves a lane sweep, and a refused value is replayed with its reason on revisit.
Each GPU-written range remembers its tick; a CPU read waits for that submission alone, on a second queue when there is one.

In-flight work only touches device-local copies, so an unmap waits only for
write-backs over its range, and a map over free space skips the GPU thread.

An unmap forgets its range instead of unmapping it, and upstream's partial-invalidation test
expects the survivor to publish on its own read: readback covers only requested pages since
0ce84e59.
MRT outputs past the last colour attachment no longer count as targets. Tests cover compressed
colour export decode and exports routed past disabled colour buffers.
Guest-code cases for Nanite bit readers, wave64 lane masks, scalar bit scans, ds_permute ISA
examples, ds_mskor and the float min/max second data operand.
An indirect dispatch in thread dimensions exited. A helper pass turns its thread counts into
group counts and a dispatch limit the shader checks with DispatchThreadInRange.
A sub-dword load from the ragged tail was bounds-checked as a whole dword and read zero; SILENT HILL f's skin cache lost the last vertex of a section.
Onimusha's largest compute shaders stalled for up to 15 s in NVIDIA's
pipeline build. Replace values by equal ones the module already has
(bitcast round trips, no-op masks, shared half unpacks, dominating
duplicates) and move pure instructions next to their first user, since
the emitter keeps both wave64 halves live at once and the driver's
compile time follows that order. The largest modules shrink by a
fifth and the worst stall halves.
A heap table serves its mapped prefix and grows as the guest maps more. A view out of elements
declines to the enumeration instead of exiting, views idle for 32 frames release their images,
and parking an image or reassigning a stencil plane re-resolves the slots that sampled it.
SILENT HILL 2 clears its water normal map with one 32_32 store per 256-byte record and
expects the whole record cleared; the rest of each record kept stale data (intermittent black sea).
GS_VGPR_COMP_CNT preloads the primitive and invocation IDs into VGPR2 and VGPR3. A 64-bit DS
atomic outside LDS is refused at decode, and a test pins DS_MAX_RTN_U64's data operand.
An R32_UINT storage image and an R11G11B10 view of the same tiled bytes no longer share a backing, so the sampled image was filled from stale guest memory.
RESIDENT EVIL 2 keeps more than 127 cached images on one guest page, which tripped the write-watcher overflow fatal.
A read-only unformatted storage buffer that starts at a GPU-written image and
spans all of it now takes the image's pixels, as RE2's smoke and rain copies need.
An S_SWAPPC_B64 marked as a call stub, such as a call through a hit-group record the GPU selects,
returns s16 = EXEC, so shadow passes that call any-hit functions run instead of being skipped.
Cyclic phi entries are cached per planning pass, a frozen plan keeps each phi's invariant and
entry for the SRT walk, and memory-accessor ownership is indexed once instead of rescanned.
A FLAT address whose high dword is built from private_base or shared_base halves is
proven local from its top 16 bits, so a private stack reached that way resolves.

Apertures are 4 GiB windows, so an overflowed address must not alias LDS or scratch; Little Nightmares' SDWA-built stack addresses pad the low half.
RE3's look-back scan publishes its {flag, value} pair with a plain glc DWORDX2 store and has no
64-bit atomic, so split dword stores tore it and its BVH walkers hung the GPU at boot.
Above-normal priority and no execution-speed throttling, so the hybrid scheduler
keeps them on performance cores.
A guest store that releases WAIT_REG_MEM lands well inside the 1 ms condition-variable tick.
WRITE_DATA, EOP and COPY_DATA stores into GPU-owned memory are recorded in queue order
through the buffer cache instead of draining the GPU first.
A written binding of 1 MiB or more is compared against a GPU snapshot after the dispatch, and
only the pages it changed stay GPU-owned.
Back-to-back dispatches whose buffer and image ranges do not conflict share one deferred compute
barrier, a storage image that barrier already flushed takes no extra transition, and a dispatch
skipped after joining leaves the group as it was.
VK_KHR_maintenance8 copies bit-identical depth/colour pairs with vkCmdCopyImage instead of a
buffer bounce. A depth <-> colour switch revives the twin and copies only the layers written since.
Object ports take an order-5 ambisonic stereo decoder and gain vectors of up to 16 floats.
Surround output to a stereo device takes an ITU fold with a soft limiter instead of SDL's
normalized downmix. KYTY_AUDIO_GAIN_DB scales the output.
RE7 lists its manual saves with LINE-0-%Slot%, which never matched, so they never showed up.

SaveDataDirNameSearch always sorted by name; RE4 asks for modification time, newest first.
List mode finished at once with nothing chosen, so RE7 had no save menu and always saved to a new slot.
An autosave rewrites data000.bin; the cached old size made RE7's Retry reject the save as broken.
A partial buffer write over a GPU-written image no longer blocks its write-back for good: the
newest write wins. Fixes stale frames and black textures in RE3.
Silhouette warps culled by stencil have no lane 31, so the light-mask OR across the wave read 0
and left black pixels along character edges.
Flat SRT reads of GPU-owned bytes stay native loads and GPU-owned buffer handles are decoded in
the shader instead of draining the GPU. A handle that is stored through stays bound unless its
store span is one the host can name and prefetch into the BDA page table (RE2 RT, SH2 BVH).
A guest access to GPU-written pages waits for the writer itself, so the GPU thread
keeps recording meanwhile.
A sampled 8-bit stencil plane also reads its depth owner unless a newer write replaced it, a
cached image grows its layers for a wider request, and exact matches compare guest mip layouts.
A 256-byte line proven clean serves its neighbours' descriptor words. Each stage keeps up to 8
recordings of the SRT walk and replays their guest reads and image heap acquisitions; a hit skips
the walk. Chronic missers back off and descriptor words are patched on replay.
Buffer and scalar-buffer accesses drop their own range test when the device has it.
A static_assert checks that the first and last binding of the vertex, pixel and tessellation
stages map to that stage's set; TES bindings once landed in the pixel set and the GPU faulted.
RE7's water writes its LS records with DS_WRITE_B64, and its one-control-point HS never
extracts the control-point index. RE4's hull shader takes the patch ordinal as v1 & 0xff
instead of an SDWA byte select.
A loop with atomics can be a cross-workgroup queue; leaving it after a miss strands its idle workgroups spinning. RE9's lighting cs ed77e9e7 lost the device this way.

The exit returns from the whole invocation, so an inner work loop skips the queue sign-off of the loop around it. Onimusha's New-Game cs d65ab87a lost the device this way.
Normalize sorted demand terms by instruction address before truncating
them, so which write-mask selects survived depended on heap layout and
the SPIR-V of the largest shaders changed every run. Every one of them
missed the cross-run pipeline cache. Order by program position instead.
Stores, formatted stores and atomics through a V# the guest builds on the GPU decode it in the
shader and write through the BDA page table. A buffer table materialization would refuse, or the
GPU wrote, is planned that way at tracking time; glc loads are ordered before they read.
The defaulted ImageSubresources ordering is lexicographic, so a 4-mip single-layer image passed for a 16-layer request and FindView exited (RE4 boot crash).
RE4 streams a 32 MB material table page by page; clamping to the first contiguous mapping read every later record as zero and its materials sampled a null texture.

RE4 writes its clustered light list into a page-streamed span; committed pieces sync as written, writes into holes are dropped as on the console.
A buffer range over unmapped memory binds nothing and is reported at growing intervals instead
of exiting. Unreadable colour metadata skips the fast clear, and a new mapping reloads the images
over it.
Stores to a page without a host buffer are dropped and a one-shot producer never reruns:
Townfall's BVH builder lost its node-list tail and the refit hung on New Game.
Townfall's VectorVM handlers keep the VM ip below rsp behind a switch, and a resumed fault clobbered it.
Unresolved tables fall back to protecting every rbp access below the prologue frame.
SILENT HILL Townfall's performance mode aliases a 2D target with the TSR reprojection array; slice 0
matched the stale 2D image exactly and the history update streaked the main menu.
Read both clear words and decode from the Vulkan format traits. Dead Space's RGBA16F, RG8
and R8 CMask clears were skipped, leaving stale aliased memory on screen.
A cube mip-generation dispatch reads mip 0 while writing mips 1-4 of the same layers.
Dead Space reuses one address for a 3-level and a 1-level texture; serving the second
from the first read its mip 0 from +0x20000.
Dead Space writes a 1x1 value through a 1D T# and reads it through a 2D one; the woken
2D image kept its first upload, a NaN in the grey-frame runs.
A synchronous push to a device bypassed the modelled queue (from upstream f380d69b9) and
returned while GetQueueLevel reported it full. Wwise in Until Dawn renders only into a free
slot after the push, so it ran at ~60% real time and crackled.
Only 1D standard 64KB views and non-2D depth-tiled views still exit.
Memory now initialises before the timer, pthread and profiler threads, and the
reserve scan rescans a hole that a concurrent host allocation changed.
A DeviceLocal buffer that VMA placed in system memory was tiled in place over PCIe.
A lock-free per-page count of registered images answers the common uncovered fault.
Uploads, copies and fills between guest ops join one batch; an overlapping transfer
gets a transfer-to-transfer barrier.
A fixed task shader reads each record and the GPU-written count, so merged ES/GS and native
NGG indirect packets no longer drain to the CPU. Indices past INDEX_BUFFER_SIZE read zero on
both paths. KYTY_NO_MESH_INDIRECT=1 restores the CPU replay.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:58:02 +00:00
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:26 UTC · original

Schermafbeelding 2026-10-13 162229 Schermafbeelding 2026-10-13 183754 Schermafbeelding 2026-10-13 184042 Schermafbeelding 2026-10-13 184108
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:26 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157349635) <img width="637" height="377" alt="Schermafbeelding 2026-10-13 162229" src="https://github.com/user-attachments/assets/a2ac8293-76f0-48ac-aafa-5edae206a1e6" /> <img width="637" height="379" alt="Schermafbeelding 2026-10-13 183754" src="https://github.com/user-attachments/assets/767609c9-5708-4f6e-b280-a5396e2751b5" /> <img width="641" height="373" alt="Schermafbeelding 2026-10-13 184042" src="https://github.com/user-attachments/assets/4533cb02-d3d2-43f3-a81f-542efd67a0ab" /> <img width="643" height="382" alt="Schermafbeelding 2026-10-13 184108" src="https://github.com/user-attachments/assets/57d77072-7cbd-480d-8b78-8f02699de8d6" />
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:28 UTC · original · edited 2026-10-13 23:41 UTC

image image Schermafbeelding 2026-10-12 181914 Schermafbeelding 2026-10-12 183630 Schermafbeelding 2026-10-12 184042
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157378193) · edited 2026-10-13 23:41 UTC <img width="962" height="564" alt="image" src="https://github.com/user-attachments/assets/1cebd402-4edc-4842-9a67-842da6c09827" /> <img width="1918" height="1113" alt="image" src="https://github.com/user-attachments/assets/16bd9929-fd1f-40d9-bf5a-0f58eafdddd1" /> <img width="1280" height="758" alt="Schermafbeelding 2026-10-12 181914" src="https://github.com/user-attachments/assets/e6b257d8-a633-426e-b317-0137e07daf15" /> <img width="1278" height="757" alt="Schermafbeelding 2026-10-12 183630" src="https://github.com/user-attachments/assets/2d0ae850-4379-40c2-9cf3-c53d1303d9de" /> <img width="1278" height="764" alt="Schermafbeelding 2026-10-12 184042" src="https://github.com/user-attachments/assets/ced72a19-e8a5-4171-90da-e5ed67bc24c0" />
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:30 UTC · original

image Schermafbeelding 2026-10-12 153447 Schermafbeelding 2026-10-12 153532 Schermafbeelding 2026-10-09 161640
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157396639) <img width="959" height="560" alt="image" src="https://github.com/user-attachments/assets/d9dc4b57-fc53-4a71-b407-1debbb699bb3" /> <img width="1280" height="762" alt="Schermafbeelding 2026-10-12 153447" src="https://github.com/user-attachments/assets/afd91e5a-e592-43d8-811e-b4defc563853" /> <img width="1275" height="764" alt="Schermafbeelding 2026-10-12 153532" src="https://github.com/user-attachments/assets/795e8678-bc19-4588-ada0-95f7b032eecd" /> <img width="647" height="376" alt="Schermafbeelding 2026-10-09 161640" src="https://github.com/user-attachments/assets/ae606c5b-bbd4-4142-867a-151e19326e46" />
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:30 UTC · original · edited 2026-10-13 23:40 UTC

Schermafbeelding 2026-10-12 010751 Schermafbeelding 2026-10-12 150229 Schermafbeelding 2026-10-10 145531 Schermafbeelding 2026-10-10 163632 image
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:30 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157405103) · edited 2026-10-13 23:40 UTC <img width="638" height="384" alt="Schermafbeelding 2026-10-12 010751" src="https://github.com/user-attachments/assets/1e7facd5-f1b1-4d0f-bd84-8b44603e18d6" /> <img width="1280" height="800" alt="Schermafbeelding 2026-10-12 150229" src="https://github.com/user-attachments/assets/8f4c4c00-2153-4606-b7d5-fd497a44f776" /> <img width="1274" height="759" alt="Schermafbeelding 2026-10-10 145531" src="https://github.com/user-attachments/assets/f8571469-a2dc-4e08-887b-c1ea4a9c1998" /> <img width="1271" height="763" alt="Schermafbeelding 2026-10-10 163632" src="https://github.com/user-attachments/assets/04ac7955-74f5-46bb-8c2b-e7bac5a3da09" /> <img width="1828" height="993" alt="image" src="https://github.com/user-attachments/assets/4522c9a0-4b84-4175-9dc2-2e4628ebc2ff" />
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-13 23:32 UTC · original · edited 2026-10-23 21:59 UTC

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

  • Last reviewed commit: 8335a6014e7391483b53e149cc3d0b81575ca0cd
  • Latest commit, not reviewed: 989c5dcf2e

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d7c86352-f4e7-4300-bf9c-41d95d16c056
📥 Commits

Reviewing files that changed from the base of the PR and between 7e2caa6202d78976564e11fc463e95fc8ae28155 and 8335a6014e7391483b53e149cc3d0b81575ca0cd.

📒 Files selected for processing: 4
  • src/graphics/shader/recompiler/ir/ShaderIR.h
  • src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp
  • src/graphics/shader/recompiler/ir/passes/SrtWalker.h
  • tests/ResourceMaterializationTests.cpp

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

📝 Walkthrough

The pull request updates GPU rendering and memory management, shader decoding and compilation, guest runtime services, audio output, and save-data dialogs. It adds GPU indirect draws, bindless image handling, stencil export, memory synchronization, image allocation and readback, and shader analysis and caching. It also adds UMTX operations, guest-memory and loader changes, platform library handlers, and related tests. The build configuration adds shader generation and test targets. The release workflow permits pushes from an additional repository.

Suggested reviewers: nmzik

Priority: ➖ Normal

Merge Risk: 🟡 Moderate · up to 8335a

Previously identified rendering and scheduler failures remain unresolved on the supplied evidence. Confirm or fix the material paths before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 15.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 737 functions across 71 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 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 directly identifies the main objective: bringing up RE Engine game compatibility. It is concise and related to the changeset.
Description check Passed The description is detailed and directly explains the shader, renderer, kernel, loader, audio, save-system, performance, compatibility, and testing changes.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157420268) · edited 2026-10-23 21:59 UTC <!-- coderabbit-ai-generated:v1 --> <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1495?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=3"><source media="(prefers-color-scheme: light)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg?v=3" alt="Review in Change Stack →" height="32"></picture></a> <!-- review_stack_entry_end --> <!-- This is an auto-generated comment: review paused by coderabbit.ai --> > [!NOTE] > ## Reviews paused > > It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the `reviews.auto_review.auto_pause_after_reviewed_commits` setting. > > - Last reviewed commit: 8335a6014e7391483b53e149cc3d0b81575ca0cd > - Latest commit, not reviewed: 989c5dcf2ed9842d10240ef5269364c39b55205a > > Use the following commands to manage reviews: > - `@coderabbitai resume` to resume automatic reviews. > - `@coderabbitai review` to trigger a single review. > > Use the checkboxes below for quick actions: > - [ ] <!-- {"checkboxId":"7f6cc2e2-2e4e-497a-8c31-c9e4573e93d1"} --> ▶️ Resume reviews > - [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> 🔍 Trigger review <!-- end of auto-generated comment: review paused by coderabbit.ai --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary><strong>ℹ️ Recent review info</strong></summary> <dl> <dd> <details> <summary><strong>⚙️ Run configuration</strong></summary> <dl> <dd> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `d7c86352-f4e7-4300-bf9c-41d95d16c056` </dd> </dl> </details> <details> <summary><strong>📥 Commits</strong></summary> <dl> <dd> Reviewing files that changed from the base of the PR and between 7e2caa6202d78976564e11fc463e95fc8ae28155 and 8335a6014e7391483b53e149cc3d0b81575ca0cd. </dd> </dl> </details> <details> <summary><strong>📒 Files selected for processing: 4</strong></summary> <dl> <dd> * `src/graphics/shader/recompiler/ir/ShaderIR.h` * `src/graphics/shader/recompiler/ir/passes/SrtWalker.cpp` * `src/graphics/shader/recompiler/ir/passes/SrtWalker.h` * `tests/ResourceMaterializationTests.cpp` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </dd> </dl> </details> <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary><strong>📝 Walkthrough</strong></summary> <dl> <dd> The pull request updates GPU rendering and memory management, shader decoding and compilation, guest runtime services, audio output, and save-data dialogs. It adds GPU indirect draws, bindless image handling, stencil export, memory synchronization, image allocation and readback, and shader analysis and caching. It also adds UMTX operations, guest-memory and loader changes, platform library handlers, and related tests. The build configuration adds shader generation and test targets. The release workflow permits pushes from an additional repository. **Suggested reviewers:** `nmzik` </dd> </dl> </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ➖ Normal <!-- change_assessment_commit:"8335a6014e7391483b53e149cc3d0b81575ca0cd" --> <!-- change_assessment_end --> <details> <summary><strong>Merge Risk:</strong> <strong>🟡 Moderate</strong> · up to <code>8335a</code></summary> <dl> <dd> <!-- final_review_risk_start --> <!-- final_review_risk_label **Merge Risk:** **🟡 Moderate** · up to `8335a` --> <!-- final_review_risk_coverage:{"sourceCommitId":"8335a6014e7391483b53e149cc3d0b81575ca0cd","coveredCommitId":"8335a6014e7391483b53e149cc3d0b81575ca0cd","kind":"reviewed"} --> Previously identified rendering and scheduler failures remain unresolved on the supplied evidence. Confirm or fix the material paths before merging. <!-- final_review_risk_end --> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_start --> <details> <summary><strong>Pre-merge checks: <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> 4 · <sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> 1</strong></summary> <dl> <dd> <strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-failed-14-v2.svg" width="14" height="14" align="middle" alt="Failed" title="Failed"></picture></sup> Failed checks: 1 warning</strong> | Check name | Status | Explanation | Resolution | | :---------------- | :----------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ![Warning](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-warning.svg) | Docstring coverage is 15.88% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 737 functions across 71 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary><strong><sup><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-counter-passed-14-v2.svg" width="14" height="14" align="middle" alt="Passed" title="Passed"></picture></sup> Passed checks: 4 passed</strong></summary> <dl> <dd> | Check name | Status | Explanation | | :------------------------ | :--------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------------------------------------------------------------------- | | Linked Issues check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | Check skipped because no linked issues were found for this pull request. | | Title check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The title directly identifies the main objective: bringing up RE Engine game compatibility. It is concise and related to the changeset. | | Description check | ![Passed](https://storage.googleapis.com/coderabbit_public_assets/pre-merge-checks-passed.svg) | The description is detailed and directly explains the shader, renderer, kernel, loader, audio, save-system, performance, compatibility, and testing changes. | </dd> </dl> </details> </dd> </dl> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autofix</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1495)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary><strong>❤️ Share</strong></summary> <dl> <dd> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </dd> </dl> </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
@ -439,3 +439,3 @@
always() &&
github.event_name == 'push' &&
github.repository == 'KytyPS5/KytyPS5' &&
(github.repository == 'KytyPS5/KytyPS5' || github.repository == 'shadowbeat070/KytyPS5-re-engine') &&
Author
Owner

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

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

Remove the fork-specific repository from the upstream release condition.

The release condition now also accepts shadowbeat070/KytyPS5-re-engine. That is a personal fork. In the upstream repository this clause never matches, so it is dead configuration. It also gives a third-party repository a supported contents: write release path in the upstream workflow. Keep the fork setting in the fork's own branch.

🔧 Proposed fix
--- "a/.github/workflows/build.yml"
+++ "b/.github/workflows/build.yml"
@@ -438,7 +438,7 @@
     if: >-
       always() &&
       github.event_name == 'push' &&
-      (github.repository == 'KytyPS5/KytyPS5' || github.repository == 'shadowbeat070/KytyPS5-re-engine') &&
+      github.repository == 'KytyPS5/KytyPS5' &&
       (needs.windows.result == 'success' ||
        needs.macos.result == 'success' ||
        needs.linux.result == 'success')
📝 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.

      github.repository == 'KytyPS5/KytyPS5' &&
🧰 Tools
🪛 zizmor (1.30.1)

[warning] 1-532: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block

(excessive-permissions)

**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180614) **📐 Maintainability & Code Quality** | **🟡 Minor** | **⚡ Quick win** **Remove the fork-specific repository from the upstream release condition.** The release condition now also accepts `shadowbeat070/KytyPS5-re-engine`. That is a personal fork. In the upstream repository this clause never matches, so it is dead configuration. It also gives a third-party repository a supported `contents: write` release path in the upstream workflow. Keep the fork setting in the fork's own branch. <details> <summary>🔧 Proposed fix</summary> ```diff --- "a/.github/workflows/build.yml" +++ "b/.github/workflows/build.yml" @@ -438,7 +438,7 @@ if: >- always() && github.event_name == 'push' && - (github.repository == 'KytyPS5/KytyPS5' || github.repository == 'shadowbeat070/KytyPS5-re-engine') && + github.repository == 'KytyPS5/KytyPS5' && (needs.windows.result == 'success' || needs.macos.result == 'success' || needs.linux.result == 'success') ``` </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 github.repository == 'KytyPS5/KytyPS5' && ``` </details> <!-- suggestion_end --> <details> <summary>🧰 Tools</summary> <details> <summary>🪛 zizmor (1.30.1)</summary> [warning] 1-532: overly broad permissions (excessive-permissions): default permissions used due to no permissions: block (excessive-permissions) </details> </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:92086a0642d587e13247d7c6 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -444,6 +505,7 @@ void GuestGpu::ThreadRun(void* data) {
}
continue;
}
blocked_since = {};
Author
Owner

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

🚀 Performance & Scalability | 🟠 Major | ⚡ Quick win

Reset blocked_since only after a submission makes progress. Otherwise the 2 ms budget never runs out.

The loop works as follows when every queue front stays blocked:

  1. All fronts are blocked. WaitBlockedBriefly sets since = now, spins for 50 µs, and returns true.
  2. The loop unblocks every queue front and continues.
  3. On the next iteration a front is no longer blocked, so a queue is selected. Line 561 resets blocked_since = {}.
  4. Process returns incomplete, and the submission is blocked again.

Because of step 3, now - since never reaches Budget. The thread never falls back to m_work_available.WaitFor(..., 100). While a guest wait lasts (WAIT_REG_MEM, CE/DE counters, flip waits), the GPU thread re-runs every blocked submission about every 50 µs, without limit. One host core stays busy for the whole wait, and that core is not available to guest threads. The old code polled at most every 100 ms.

Reset the timer only when a submission completes or makes progress.

Proposed fix
--- "a/src/graphics/guest_gpu/graphicsRun.cpp"
+++ "b/src/graphics/guest_gpu/graphicsRun.cpp"
@@ -558,8 +558,7 @@
 					}
 					continue;
 				}
-				blocked_since = {};
 				auto& queue = gpu->m_queues[static_cast<uint32_t>(selected_queue)];
 				submission  = std::move(queue.front());
 				queue.pop_front();
 				gpu->m_submission_count--;
		EXIT_IF(!has_submission);
		const bool complete = gpu->Process(submission);
		if (complete || submission.command_execution.MadeProgress() ||
		    submission.constant_execution.MadeProgress()) {
			blocked_since = {};
		}
📝 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.


**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180656) **🚀 Performance & Scalability** | **🟠 Major** | **⚡ Quick win** **Reset `blocked_since` only after a submission makes progress. Otherwise the 2 ms budget never runs out.** The loop works as follows when every queue front stays blocked: 1. All fronts are blocked. `WaitBlockedBriefly` sets `since = now`, spins for 50 µs, and returns `true`. 2. The loop unblocks every queue front and continues. 3. On the next iteration a front is no longer blocked, so a queue is selected. Line 561 resets `blocked_since = {}`. 4. `Process` returns incomplete, and the submission is blocked again. Because of step 3, `now - since` never reaches `Budget`. The thread never falls back to `m_work_available.WaitFor(..., 100)`. While a guest wait lasts (WAIT_REG_MEM, CE/DE counters, flip waits), the GPU thread re-runs every blocked submission about every 50 µs, without limit. One host core stays busy for the whole wait, and that core is not available to guest threads. The old code polled at most every 100 ms. Reset the timer only when a submission completes or makes progress. <details> <summary>Proposed fix</summary> ```diff --- "a/src/graphics/guest_gpu/graphicsRun.cpp" +++ "b/src/graphics/guest_gpu/graphicsRun.cpp" @@ -558,8 +558,7 @@ } continue; } - blocked_since = {}; auto& queue = gpu->m_queues[static_cast<uint32_t>(selected_queue)]; submission = std::move(queue.front()); queue.pop_front(); gpu->m_submission_count--; ``` ```cpp EXIT_IF(!has_submission); const bool complete = gpu->Process(submission); if (complete || submission.command_execution.MadeProgress() || submission.constant_execution.MadeProgress()) { blocked_since = {}; } ``` </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 ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:33b200f5346bccc2f03149c8 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-13 23:32 UTC · original
On src/graphics/guest_gpu/graphicsRun.cpp line 1083 (outdated):

@@ -895,6 +1073,16 @@ void CommandProcessor::DrawIndirectMulti(uint32_t data_offset, uint32_t max_coun
 	EXIT_NOT_IMPLEMENTED((draw_initiator & ~0x20u) != (indexed ? 0u : 2u));
 	EXIT_NOT_IMPLEMENTED(m_draw_indirect_args_base_addr == 0);
 
+	if (max_count_or_count == 0) {
+		return;
+	}
+	const auto result = DrawIndirectOnGpu(m_draw_indirect_args_base_addr + data_offset,
+	                                      max_count_or_count, stride_in_bytes, count_addr, indexed);
+	if (result == IndirectDrawResult::Drawn) {
+		return;
+	}

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C4 '\bstruct\s+IndirectDrawArgs\b'
rg -nP -C3 'vertex_offset_sgpr|instance_offset_sgpr' --type=cpp -g '!**/tests/**' | head -120
rg -nP -C3 'BaseVertex|BaseInstance|gl_BaseVertex' src/graphics/shader | head -80

Repository: KytyPS5/KytyPS5

Length of output: 5883


🏁 Script executed:

set -eu
printf '%s\n' '--- indirect declarations and definitions ---'
rg -n -C5 -F -- 'DrawIndirectOnGpu' src/graphics
rg -n -C5 -F -- 'PatchIndirectDrawOffsets' src/graphics
rg -n -C5 -F -- 'IndirectDrawRegisters' src/graphics
printf '%s\n' '--- indirect draw implementation/context ---'
sed -n '1000,1125p' src/graphics/guest_gpu/graphicsRun.cpp
sed -n '1,180p' src/graphics/host_gpu/renderer/render.h
rg -n -C8 -F -- 'vertexOffset' src/graphics/host_gpu src/graphics/guest_gpu src/graphics/shader
rg -n -C8 -F -- 'firstInstance' src/graphics/host_gpu src/graphics/guest_gpu src/graphics/shader

Repository: KytyPS5/KytyPS5

Length of output: 25712


🏁 Script executed:

set -u
printf '%s\n' '--- guest GPU path ---'
sed -n '900,955p' src/graphics/guest_gpu/graphicsRun.cpp
sed -n '1063,1165p' src/graphics/guest_gpu/graphicsRun.cpp
printf '%s\n' '--- renderer indirect implementation ---'
rg -n -C6 -F -- 'RenderExecutor::DrawIndirect' src/graphics
rg -n -C6 -F -- 'DrawIndirect(const' src/graphics
printf '%s\n' '--- offset metadata consumers ---'
rg -n -C8 -F -e 'vertex_offset_sgpr' -e 'instance_offset_sgpr' -e 'base_vertex' -e 'first_instance' -e 'offset_source' src/graphics
printf '%s\n' '--- shader base builtins and generated inputs ---'
rg -n -C5 -i -F -e 'basevertex' -e 'baseinstance' -e 'gl_BaseVertex' -e 'gl_BaseInstance' -e 'BaseVertex' -e 'BaseInstance' src

Repository: KytyPS5/KytyPS5

Length of output: 41967


🏁 Script executed:

set -u
printf '%s\n' '--- renderer indirect implementation ---'
sed -n '1748,1905p' src/graphics/host_gpu/renderer/renderDraw.cpp
printf '%s\n' '--- draw emission and offset resolution ---'
sed -n '1530,1730p' src/graphics/host_gpu/renderer/renderDraw.cpp
printf '%s\n' '--- native-fetch metadata and consumers ---'
rg -n -C10 -F -e 'fetch_embedded' -e 'vertex_offset_sgpr' -e 'instance_offset_sgpr' src/graphics/host_gpu src/graphics/shader src/graphics/guest_gpu
printf '%s\n' '--- exact indirect register declaration and packet binding ---'
sed -n '20,35p' src/graphics/guest_gpu/command_processor/commandProcessor.h
sed -n '1640,1685p' src/graphics/guest_gpu/command_processor/pm4Handlers.cpp

Repository: KytyPS5/KytyPS5

Length of output: 41961


🏁 Script executed:

set -u
printf '%s\n' '--- ExecutePreparedDraw declaration and definition ---'
rg -n -C8 -F -- 'ExecutePreparedDraw' src/graphics/host_gpu/renderer/renderDraw.cpp src/graphics/host_gpu
printf '%s\n' '--- indirect Vulkan command recording ---'
rg -n -C8 -i -F -e 'drawIndirect' -e 'drawIndexedIndirect' -e 'drawIndirectCount' -e 'drawIndexedIndirectCount' src/graphics/host_gpu
printf '%s\n' '--- fetch mode contract and shader input setup ---'
sed -n '460,515p' src/graphics/shader/shader.cpp
sed -n '1538,1575p' src/graphics/shader/recompiler/ShaderRecompiler.cpp

Repository: KytyPS5/KytyPS5

Length of output: 33850


🏁 Script executed:

sed -n '1263,1450p' src/graphics/host_gpu/renderer/renderDraw.cpp

Repository: KytyPS5/KytyPS5

Length of output: 9453


🏁 Script executed:

set -u
printf '%s\n' '--- final draw command recording ---'
sed -n '1450,1515p' src/graphics/host_gpu/renderer/renderDraw.cpp
printf '%s\n' '--- shader vertex and instance index handling ---'
rg -n -C8 -i -F -e 'vertexindex' -e 'instanceindex' -e 'vertex_index' -e 'instance_index' -e 'basevertex' -e 'baseinstance' src/graphics/shader src/graphics/host_gpu

Repository: KytyPS5/KytyPS5

Length of output: 34744


Refuse GPU indirect draws when they require patched offset registers.

DrawIndirectMulti returns after DrawIndirectOnGpu reports Drawn, before PatchIndirectDrawOffsets runs. The GPU path records a Vulkan indirect draw, but it does not receive IndirectDrawRegisters or update the packet-selected SGPRs. A vertex shader that consumes vertex_offset_sgpr or instance_offset_sgpr can therefore read stale values instead of the current indirect record.

Pass the register destinations into the GPU-path classification, or refuse that path when an active stage consumes either register. Use the existing CPU fallback so it patches the registers for each record.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180678) On `src/graphics/guest_gpu/graphicsRun.cpp` line 1083 (outdated): ```diff @@ -895,6 +1073,16 @@ void CommandProcessor::DrawIndirectMulti(uint32_t data_offset, uint32_t max_coun EXIT_NOT_IMPLEMENTED((draw_initiator & ~0x20u) != (indexed ? 0u : 2u)); EXIT_NOT_IMPLEMENTED(m_draw_indirect_args_base_addr == 0); + if (max_count_or_count == 0) { + return; + } + const auto result = DrawIndirectOnGpu(m_draw_indirect_args_base_addr + data_offset, + max_count_or_count, stride_in_bytes, count_addr, indexed); + if (result == IndirectDrawResult::Drawn) { + return; + } ``` **🎯 Functional Correctness** | **🟠 Major** | **🏗️ Heavy lift** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash rg -nP -C4 '\bstruct\s+IndirectDrawArgs\b' rg -nP -C3 'vertex_offset_sgpr|instance_offset_sgpr' --type=cpp -g '!**/tests/**' | head -120 rg -nP -C3 'BaseVertex|BaseInstance|gl_BaseVertex' src/graphics/shader | head -80 ``` Repository: KytyPS5/KytyPS5 Length of output: 5883 --- 🏁 Script executed: ```bash set -eu printf '%s\n' '--- indirect declarations and definitions ---' rg -n -C5 -F -- 'DrawIndirectOnGpu' src/graphics rg -n -C5 -F -- 'PatchIndirectDrawOffsets' src/graphics rg -n -C5 -F -- 'IndirectDrawRegisters' src/graphics printf '%s\n' '--- indirect draw implementation/context ---' sed -n '1000,1125p' src/graphics/guest_gpu/graphicsRun.cpp sed -n '1,180p' src/graphics/host_gpu/renderer/render.h rg -n -C8 -F -- 'vertexOffset' src/graphics/host_gpu src/graphics/guest_gpu src/graphics/shader rg -n -C8 -F -- 'firstInstance' src/graphics/host_gpu src/graphics/guest_gpu src/graphics/shader ``` Repository: KytyPS5/KytyPS5 Length of output: 25712 --- 🏁 Script executed: ```bash set -u printf '%s\n' '--- guest GPU path ---' sed -n '900,955p' src/graphics/guest_gpu/graphicsRun.cpp sed -n '1063,1165p' src/graphics/guest_gpu/graphicsRun.cpp printf '%s\n' '--- renderer indirect implementation ---' rg -n -C6 -F -- 'RenderExecutor::DrawIndirect' src/graphics rg -n -C6 -F -- 'DrawIndirect(const' src/graphics printf '%s\n' '--- offset metadata consumers ---' rg -n -C8 -F -e 'vertex_offset_sgpr' -e 'instance_offset_sgpr' -e 'base_vertex' -e 'first_instance' -e 'offset_source' src/graphics printf '%s\n' '--- shader base builtins and generated inputs ---' rg -n -C5 -i -F -e 'basevertex' -e 'baseinstance' -e 'gl_BaseVertex' -e 'gl_BaseInstance' -e 'BaseVertex' -e 'BaseInstance' src ``` Repository: KytyPS5/KytyPS5 Length of output: 41967 --- 🏁 Script executed: ```bash set -u printf '%s\n' '--- renderer indirect implementation ---' sed -n '1748,1905p' src/graphics/host_gpu/renderer/renderDraw.cpp printf '%s\n' '--- draw emission and offset resolution ---' sed -n '1530,1730p' src/graphics/host_gpu/renderer/renderDraw.cpp printf '%s\n' '--- native-fetch metadata and consumers ---' rg -n -C10 -F -e 'fetch_embedded' -e 'vertex_offset_sgpr' -e 'instance_offset_sgpr' src/graphics/host_gpu src/graphics/shader src/graphics/guest_gpu printf '%s\n' '--- exact indirect register declaration and packet binding ---' sed -n '20,35p' src/graphics/guest_gpu/command_processor/commandProcessor.h sed -n '1640,1685p' src/graphics/guest_gpu/command_processor/pm4Handlers.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 41961 --- 🏁 Script executed: ```bash set -u printf '%s\n' '--- ExecutePreparedDraw declaration and definition ---' rg -n -C8 -F -- 'ExecutePreparedDraw' src/graphics/host_gpu/renderer/renderDraw.cpp src/graphics/host_gpu printf '%s\n' '--- indirect Vulkan command recording ---' rg -n -C8 -i -F -e 'drawIndirect' -e 'drawIndexedIndirect' -e 'drawIndirectCount' -e 'drawIndexedIndirectCount' src/graphics/host_gpu printf '%s\n' '--- fetch mode contract and shader input setup ---' sed -n '460,515p' src/graphics/shader/shader.cpp sed -n '1538,1575p' src/graphics/shader/recompiler/ShaderRecompiler.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 33850 --- 🏁 Script executed: ```bash sed -n '1263,1450p' src/graphics/host_gpu/renderer/renderDraw.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 9453 --- 🏁 Script executed: ```bash set -u printf '%s\n' '--- final draw command recording ---' sed -n '1450,1515p' src/graphics/host_gpu/renderer/renderDraw.cpp printf '%s\n' '--- shader vertex and instance index handling ---' rg -n -C8 -i -F -e 'vertexindex' -e 'instanceindex' -e 'vertex_index' -e 'instance_index' -e 'basevertex' -e 'baseinstance' src/graphics/shader src/graphics/host_gpu ``` Repository: KytyPS5/KytyPS5 Length of output: 34744 --- </details> **Refuse GPU indirect draws when they require patched offset registers.** `DrawIndirectMulti` returns after `DrawIndirectOnGpu` reports `Drawn`, before `PatchIndirectDrawOffsets` runs. The GPU path records a Vulkan indirect draw, but it does not receive `IndirectDrawRegisters` or update the packet-selected SGPRs. A vertex shader that consumes `vertex_offset_sgpr` or `instance_offset_sgpr` can therefore read stale values instead of the current indirect record. Pass the register destinations into the GPU-path classification, or refuse that path when an active stage consumes either register. Use the existing CPU fallback so it patches the registers for each record. <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:6b51d11f7d4f0ecf327f44b3 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -310,0 +373,4 @@
vk::FenceCreateInfo fence_info {};
EXIT_NOT_IMPLEMENTED(device.createFence(&fence_info, nullptr, &m_detached_fence) !=
vk::Result::eSuccess);
}
Author
Owner

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Initialize the detached command buffer and fence independently of the shared pool.

RunDetached creates m_detached_buffer and m_detached_fence only when m_detached_pool == nullptr. SubmitDetached (Lines 444-451) also creates m_detached_pool, but it does not create m_detached_buffer or m_detached_fence.

A guest fault takes the async path first by default: ReadMemoryAttempt → BeginGuestDownload → SubmitDetached. After that, the pool exists and the buffer and fence are still null. A later RunDetached call skips initialization. That call can come from TryDownloadDetached on a GPU-thread read or from BufferCache::MakePageTableResident. It then calls m_detached_buffer.begin(...) on a null handle and submits with a null fence. The result is a crash or a Vulkan error.

🐛 Proposed fix
--- "a/src/graphics/host_gpu/renderer/commandScheduler.cpp"
+++ "b/src/graphics/host_gpu/renderer/commandScheduler.cpp"
@@ -379,24 +379,28 @@
 void CommandScheduler::RunDetached(uint64_t                                         wait_tick,
                                    Common::UniqueFunction<void, vk::CommandBuffer>&& record) {
 	EXIT_IF(wait_tick >= CurrentTick() || !record);
 	auto& device = m_graphics.device;
 	if (m_detached_pool == nullptr) {
 		vk::CommandPoolCreateInfo pool_info {};
 		pool_info.queueFamilyIndex = m_graphics.queue_family;
 		pool_info.flags            = vk::CommandPoolCreateFlagBits::eTransient |
 		                  vk::CommandPoolCreateFlagBits::eResetCommandBuffer;
 		EXIT_NOT_IMPLEMENTED(device.createCommandPool(&pool_info, nullptr, &m_detached_pool) !=
 		                     vk::Result::eSuccess);
+	}
+	if (m_detached_buffer == nullptr) {
 		vk::CommandBufferAllocateInfo allocate {};
 		allocate.commandPool        = m_detached_pool;
 		allocate.level              = vk::CommandBufferLevel::ePrimary;
 		allocate.commandBufferCount = 1;
 		EXIT_NOT_IMPLEMENTED(device.allocateCommandBuffers(&allocate, &m_detached_buffer) !=
 		                     vk::Result::eSuccess);
+	}
+	if (m_detached_fence == nullptr) {
 		vk::FenceCreateInfo fence_info {};
 		EXIT_NOT_IMPLEMENTED(device.createFence(&fence_info, nullptr, &m_detached_fence) !=
 		                     vk::Result::eSuccess);
 	}
 	// The semaphore wait orders this batch after the writer's submission alone.
 	const auto queue = m_graphics.readback_queue != nullptr ? m_graphics.readback_queue
 	                                                        : m_graphics.queue;
📝 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 (m_detached_pool == nullptr) {
		vk::CommandPoolCreateInfo pool_info {};
		pool_info.queueFamilyIndex = m_graphics.queue_family;
		pool_info.flags            = vk::CommandPoolCreateFlagBits::eTransient |
		                  vk::CommandPoolCreateFlagBits::eResetCommandBuffer;
		EXIT_NOT_IMPLEMENTED(device.createCommandPool(&pool_info, nullptr, &m_detached_pool) !=
		                     vk::Result::eSuccess);
	}
	if (m_detached_buffer == nullptr) {
		vk::CommandBufferAllocateInfo allocate {};
		allocate.commandPool        = m_detached_pool;
		allocate.level              = vk::CommandBufferLevel::ePrimary;
		allocate.commandBufferCount = 1;
		EXIT_NOT_IMPLEMENTED(device.allocateCommandBuffers(&allocate, &m_detached_buffer) !=
		                     vk::Result::eSuccess);
	}
	if (m_detached_fence == nullptr) {
		vk::FenceCreateInfo fence_info {};
		EXIT_NOT_IMPLEMENTED(device.createFence(&fence_info, nullptr, &m_detached_fence) !=
		                     vk::Result::eSuccess);
	}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180687) **🩺 Stability & Availability** | **🟠 Major** | **⚡ Quick win** **Initialize the detached command buffer and fence independently of the shared pool.** `RunDetached` creates `m_detached_buffer` and `m_detached_fence` only when `m_detached_pool == nullptr`. `SubmitDetached` (Lines 444-451) also creates `m_detached_pool`, but it does not create `m_detached_buffer` or `m_detached_fence`. A guest fault takes the async path first by default: `ReadMemoryAttempt` → `BeginGuestDownload` → `SubmitDetached`. After that, the pool exists and the buffer and fence are still null. A later `RunDetached` call skips initialization. That call can come from `TryDownloadDetached` on a GPU-thread read or from `BufferCache::MakePageTableResident`. It then calls `m_detached_buffer.begin(...)` on a null handle and submits with a null fence. The result is a crash or a Vulkan error. <details> <summary>🐛 Proposed fix</summary> ```diff --- "a/src/graphics/host_gpu/renderer/commandScheduler.cpp" +++ "b/src/graphics/host_gpu/renderer/commandScheduler.cpp" @@ -379,24 +379,28 @@ void CommandScheduler::RunDetached(uint64_t wait_tick, Common::UniqueFunction<void, vk::CommandBuffer>&& record) { EXIT_IF(wait_tick >= CurrentTick() || !record); auto& device = m_graphics.device; if (m_detached_pool == nullptr) { vk::CommandPoolCreateInfo pool_info {}; pool_info.queueFamilyIndex = m_graphics.queue_family; pool_info.flags = vk::CommandPoolCreateFlagBits::eTransient | vk::CommandPoolCreateFlagBits::eResetCommandBuffer; EXIT_NOT_IMPLEMENTED(device.createCommandPool(&pool_info, nullptr, &m_detached_pool) != vk::Result::eSuccess); + } + if (m_detached_buffer == nullptr) { vk::CommandBufferAllocateInfo allocate {}; allocate.commandPool = m_detached_pool; allocate.level = vk::CommandBufferLevel::ePrimary; allocate.commandBufferCount = 1; EXIT_NOT_IMPLEMENTED(device.allocateCommandBuffers(&allocate, &m_detached_buffer) != vk::Result::eSuccess); + } + if (m_detached_fence == nullptr) { vk::FenceCreateInfo fence_info {}; EXIT_NOT_IMPLEMENTED(device.createFence(&fence_info, nullptr, &m_detached_fence) != vk::Result::eSuccess); } // The semaphore wait orders this batch after the writer's submission alone. const auto queue = m_graphics.readback_queue != nullptr ? m_graphics.readback_queue : m_graphics.queue; ``` </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 (m_detached_pool == nullptr) { vk::CommandPoolCreateInfo pool_info {}; pool_info.queueFamilyIndex = m_graphics.queue_family; pool_info.flags = vk::CommandPoolCreateFlagBits::eTransient | vk::CommandPoolCreateFlagBits::eResetCommandBuffer; EXIT_NOT_IMPLEMENTED(device.createCommandPool(&pool_info, nullptr, &m_detached_pool) != vk::Result::eSuccess); } if (m_detached_buffer == nullptr) { vk::CommandBufferAllocateInfo allocate {}; allocate.commandPool = m_detached_pool; allocate.level = vk::CommandBufferLevel::ePrimary; allocate.commandBufferCount = 1; EXIT_NOT_IMPLEMENTED(device.allocateCommandBuffers(&allocate, &m_detached_buffer) != vk::Result::eSuccess); } if (m_detached_fence == nullptr) { vk::FenceCreateInfo fence_info {}; EXIT_NOT_IMPLEMENTED(device.createFence(&fence_info, nullptr, &m_detached_fence) != vk::Result::eSuccess); } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:f92fc16d031c21d8f66437d5 --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -347,0 +567,4 @@
m_in_before_submit = true;
m_before_submit();
m_in_before_submit = false;
}
Author
Owner

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C4 '\bShutdown\s*\(|ShutdownGpu\s*\(|SetBeforeSubmit|RecordHotWriteBacks' --type=cpp src/graphics

Repository: KytyPS5/KytyPS5

Length of output: 11100


🏁 Script executed:

sed -n '1,330p' src/graphics/host_gpu/renderer/commandScheduler.cpp
sed -n '560,630p' src/graphics/host_gpu/renderer/commandScheduler.cpp
sed -n '820,975p' src/graphics/host_gpu/renderer/cache/bufferCache.cpp
sed -n '30,75p' src/graphics/host_gpu/renderer/renderContext.cpp
rg -n -F --glob '*.cpp' --glob '*.h' -e 'AcceptsOperations()' -e 'DeferOperation(' -e 'RecordHotWriteBacks' -e 'm_operation_state' src/graphics/host_gpu/renderer

Repository: KytyPS5/KytyPS5

Length of output: 24219


🏁 Script executed:

nl -ba src/graphics/host_gpu/renderer/commandScheduler.cpp | sed -n '132,172p;255,275p;580,600p'
nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '820,850p;900,915p'
nl -ba src/graphics/host_gpu/renderer/renderContext.cpp | sed -n '37,50p'

Repository: KytyPS5/KytyPS5

Length of output: 5647


🏁 Script executed:

nl -ba src/graphics/guest_gpu/graphicsRun.cpp | sed -n '90,135p'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'm_scheduler.Finish' -e 'm_command_scheduler.Finish' -e 'ShutdownGpu()' src/graphics/guest_gpu src/graphics/host_gpu/renderer

Repository: KytyPS5/KytyPS5

Length of output: 1868


Guard RecordHotWriteBacks during scheduler shutdown.

When CommandScheduler::Shutdown() enters Draining, it calls Submit(). If m_hot_written is non-empty, RecordHotWriteBacks() calls DeferOperation(). That call waits for Closed, but Shutdown() sets Closed only after Submit() returns. This can deadlock when RenderContext::ShutdownGpu() skips Finish() because m_video_out is null.

Suggested fix
 void BufferCache::RecordHotWriteBacks() {
+	if (!m_scheduler.AcceptsOperations()) {
+		return;
+	}
 	if (m_hot_written.Empty()) {
 		return;
 	}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180697) **🩺 Stability & Availability** | **🟠 Major** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash rg -nP -C4 '\bShutdown\s*\(|ShutdownGpu\s*\(|SetBeforeSubmit|RecordHotWriteBacks' --type=cpp src/graphics ``` Repository: KytyPS5/KytyPS5 Length of output: 11100 --- 🏁 Script executed: ```bash sed -n '1,330p' src/graphics/host_gpu/renderer/commandScheduler.cpp sed -n '560,630p' src/graphics/host_gpu/renderer/commandScheduler.cpp sed -n '820,975p' src/graphics/host_gpu/renderer/cache/bufferCache.cpp sed -n '30,75p' src/graphics/host_gpu/renderer/renderContext.cpp rg -n -F --glob '*.cpp' --glob '*.h' -e 'AcceptsOperations()' -e 'DeferOperation(' -e 'RecordHotWriteBacks' -e 'm_operation_state' src/graphics/host_gpu/renderer ``` Repository: KytyPS5/KytyPS5 Length of output: 24219 --- 🏁 Script executed: ```bash nl -ba src/graphics/host_gpu/renderer/commandScheduler.cpp | sed -n '132,172p;255,275p;580,600p' nl -ba src/graphics/host_gpu/renderer/cache/bufferCache.cpp | sed -n '820,850p;900,915p' nl -ba src/graphics/host_gpu/renderer/renderContext.cpp | sed -n '37,50p' ``` Repository: KytyPS5/KytyPS5 Length of output: 5647 --- 🏁 Script executed: ```bash nl -ba src/graphics/guest_gpu/graphicsRun.cpp | sed -n '90,135p' rg -n -F --glob '*.cpp' --glob '*.h' -e 'm_scheduler.Finish' -e 'm_command_scheduler.Finish' -e 'ShutdownGpu()' src/graphics/guest_gpu src/graphics/host_gpu/renderer ``` Repository: KytyPS5/KytyPS5 Length of output: 1868 --- </details> **Guard `RecordHotWriteBacks` during scheduler shutdown.** When `CommandScheduler::Shutdown()` enters `Draining`, it calls `Submit()`. If `m_hot_written` is non-empty, `RecordHotWriteBacks()` calls `DeferOperation()`. That call waits for `Closed`, but `Shutdown()` sets `Closed` only after `Submit()` returns. This can deadlock when `RenderContext::ShutdownGpu()` skips `Finish()` because `m_video_out` is null. <details> <summary>Suggested fix</summary> ```diff void BufferCache::RecordHotWriteBacks() { + if (!m_scheduler.AcceptsOperations()) { + return; + } if (m_hot_written.Empty()) { return; } ``` </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:ca3038ef23a148047722ce3e --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-13 23:32 UTC · original
On src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp line 210 (outdated):

@@ -162,12 +186,44 @@ uint32_t EmitConvertF16F32(EmitterState& state, uint32_t arg0) {
 	return EmitPackHalf2x16(state, pair);
 }
 
-uint32_t EmitConvertS32F32(EmitterState& state, uint32_t arg0) {
-	return EmitF32ToU32(state, arg0, true);
+static bool SaturatedConvertFoldDisabled() {
+	static const bool disabled = [] {
+		const char* text = std::getenv("KYTY_NO_SATURATED_CVT_FOLD");
+		return text != nullptr && text[0] != '\0' && text[0] != '0';
+	}();
+	return disabled;
+}
+
+// Convert.cpp saturates first; its final SelectF32 is always finite, integral and in range.
+static bool ConvertSourceSaturated(const IR::Inst& inst, bool signed_value) {
+	if (SaturatedConvertFoldDisabled()) {
+		return false;
+	}
+	const auto source = inst.Arg(0).Resolve();
+	if (source.IsImmediate()) {
+		const float value = source.F32Value();
+		return std::trunc(value) == value &&
+		       (signed_value ? value >= -2147483648.0f && value < 2147483648.0f
+		                     : value >= 0.0f && value < 4294967296.0f);
+	}
+	const auto* producer = source.ResolveInstruction();
+	return producer != nullptr && producer->GetOpcode() == IR::ValueOpcode::SelectF32;

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Find every producer of ConvertU32F32 / ConvertS32F32 IR.
rg -nP -C3 'ValueOpcode::Convert(U32|S32)F32' --type=cpp
# Find other SelectF32 producers that could feed a conversion.
rg -nP -C2 '\bSelectF32\s*\(' --type=cpp -g '!**/backend/**'

Repository: KytyPS5/KytyPS5

Length of output: 9620


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- emitter definitions and callers ---'
rg -n -F -- 'ConvertSourceSaturated' src tests
rg -n -F -- 'EmitConvertU32F32' src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp src/graphics/shader/recompiler
rg -n -F -- 'EmitConvertS32F32' src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp src/graphics/shader/recompiler
sed -n '170,235p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp
printf '%s\n' '--- frontend conversion implementation ---'
sed -n '1,50p' src/graphics/shader/recompiler/frontend/translate/Convert.cpp
printf '%s\n' '--- scalar provenance test ---'
sed -n '380,440p' tests/ScalarProvenanceTests.cpp
printf '%s\n' '--- current diff for the affected file ---'
git diff --no-ext-diff --unified=30 df5b9b92be7dfd463b47756b707d6d356a9f0550 d4cd928e991f7c0771bc648e0982c2fb2a8afeaf -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp src/graphics/shader/recompiler/frontend/translate/Convert.cpp

Repository: KytyPS5/KytyPS5

Length of output: 23179


Restrict the saturated-conversion fold to the Convert.cpp producer.

ConvertSourceSaturated treats every SelectF32 producer as finite and in range. SelectF32 is a generic IR helper, so this check does not prove that the value came from the saturation sequence in Convert.cpp.

If another SelectF32 reaches ConvertU32F32 or ConvertS32F32, the emitter uses bare OpConvertFToU or OpConvertFToS. This bypasses EmitF32ToU32, which explicitly handles NaN and out-of-range values. The result can therefore differ from the required clamped conversion.

Require provenance from the saturation sequence, or add an IR flag in Convert.cpp and test that flag here.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180704) On `src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp` line 210 (outdated): ```diff @@ -162,12 +186,44 @@ uint32_t EmitConvertF16F32(EmitterState& state, uint32_t arg0) { return EmitPackHalf2x16(state, pair); } -uint32_t EmitConvertS32F32(EmitterState& state, uint32_t arg0) { - return EmitF32ToU32(state, arg0, true); +static bool SaturatedConvertFoldDisabled() { + static const bool disabled = [] { + const char* text = std::getenv("KYTY_NO_SATURATED_CVT_FOLD"); + return text != nullptr && text[0] != '\0' && text[0] != '0'; + }(); + return disabled; +} + +// Convert.cpp saturates first; its final SelectF32 is always finite, integral and in range. +static bool ConvertSourceSaturated(const IR::Inst& inst, bool signed_value) { + if (SaturatedConvertFoldDisabled()) { + return false; + } + const auto source = inst.Arg(0).Resolve(); + if (source.IsImmediate()) { + const float value = source.F32Value(); + return std::trunc(value) == value && + (signed_value ? value >= -2147483648.0f && value < 2147483648.0f + : value >= 0.0f && value < 4294967296.0f); + } + const auto* producer = source.ResolveInstruction(); + return producer != nullptr && producer->GetOpcode() == IR::ValueOpcode::SelectF32; ``` **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash # Find every producer of ConvertU32F32 / ConvertS32F32 IR. rg -nP -C3 'ValueOpcode::Convert(U32|S32)F32' --type=cpp # Find other SelectF32 producers that could feed a conversion. rg -nP -C2 '\bSelectF32\s*\(' --type=cpp -g '!**/backend/**' ``` Repository: KytyPS5/KytyPS5 Length of output: 9620 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- emitter definitions and callers ---' rg -n -F -- 'ConvertSourceSaturated' src tests rg -n -F -- 'EmitConvertU32F32' src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp src/graphics/shader/recompiler rg -n -F -- 'EmitConvertS32F32' src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp src/graphics/shader/recompiler sed -n '170,235p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp printf '%s\n' '--- frontend conversion implementation ---' sed -n '1,50p' src/graphics/shader/recompiler/frontend/translate/Convert.cpp printf '%s\n' '--- scalar provenance test ---' sed -n '380,440p' tests/ScalarProvenanceTests.cpp printf '%s\n' '--- current diff for the affected file ---' git diff --no-ext-diff --unified=30 df5b9b92be7dfd463b47756b707d6d356a9f0550 d4cd928e991f7c0771bc648e0982c2fb2a8afeaf -- src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp src/graphics/shader/recompiler/frontend/translate/Convert.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 23179 --- </details> **Restrict the saturated-conversion fold to the `Convert.cpp` producer.** `ConvertSourceSaturated` treats every `SelectF32` producer as finite and in range. `SelectF32` is a generic IR helper, so this check does not prove that the value came from the saturation sequence in `Convert.cpp`. If another `SelectF32` reaches `ConvertU32F32` or `ConvertS32F32`, the emitter uses bare `OpConvertFToU` or `OpConvertFToS`. This bypasses `EmitF32ToU32`, which explicitly handles NaN and out-of-range values. The result can therefore differ from the required clamped conversion. Require provenance from the saturation sequence, or add an IR flag in `Convert.cpp` and test that flag here. <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:d51aecc0f56fb2c67f8c2282 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-13 23:32 UTC · original
On src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp line 1291 (outdated):

@@ -887,61 +1205,105 @@ void EmitImage(ValueEmitContext& ctx, const IR::Inst& inst) {
 			}
 		}
 		std::array<uint32_t, 4> operands {};
-		size_t operand_count = 0;
+		size_t                  operand_count = 0;
 		if (HasFlag(mem, Decoder::ImageSampleFlagDerivative)) {
 			operands[0] = spv::ImageOperandsGradMask;
-			operands[1] = CoordF32(ctx, mem, *address, layout.grad_x, dimension_info.spatial_components);
-			operands[2] = CoordF32(ctx, mem, *address, layout.grad_y, dimension_info.spatial_components);
+			operands[1] =
+			    CoordF32(ctx, mem, *address, layout.grad_x, dimension_info.spatial_components);
+			operands[2] =
+			    CoordF32(ctx, mem, *address, layout.grad_y, dimension_info.spatial_components);
 			operand_count = 3;
 		} else if (explicit_lod) {
 			auto lod = ZeroF32(state);
 			if (HasFlag(mem, Decoder::ImageSampleFlagLod) && layout.lod != NoImageComponent) {
 				lod = AddressF32(ctx, mem, *address, layout.lod);
 			}
-			operands[0] = spv::ImageOperandsLodMask;
-			operands[1] = lod;
+			operands[0]   = spv::ImageOperandsLodMask;
+			operands[1]   = lod;
 			operand_count = 2;
 		} else if (layout.bias != NoImageComponent) {
-			operands[0] = spv::ImageOperandsBiasMask;
-			operands[1] = AddressF32(ctx, mem, *address, layout.bias);
+			operands[0]   = spv::ImageOperandsBiasMask;
+			operands[1]   = AddressF32(ctx, mem, *address, layout.bias);
 			operand_count = 2;
 		}
-		const auto& samplers = state.program.info.samplers.at(mem.sampler).indirect_resources;
-		uint32_t sampler_index = 0;
+		const auto& samplers      = state.program.info.samplers.at(mem.sampler).indirect_resources;
+		uint32_t    sampler_index = 0;
 		if (!samplers.empty()) {
 			const auto* handle = inst.Arg(1).ResolveInstruction();
 			if (handle == nullptr || handle->GetOpcode() != IR::ValueOpcode::GetSamplerResource)
 				ctx.Fail(inst, "has invalid finite sampler key provenance");
 			sampler_index = EmitIndexSwitch(
 			    state, ctx.Def(handle->Arg(0)), static_cast<uint32_t>(samplers.size()),
-			    TypeU32(state), [&](uint32_t ordinal) { return ConstantU32(state, samplers[ordinal]); });
+			    TypeU32(state),
+			    [&](uint32_t ordinal) { return ConstantU32(state, samplers[ordinal]); });
 		}
-		if (layout.offset != NoImageComponent &&
-		    !offset_value.IsImmediate()) {
-			ctx.Fail(inst, "has a nonconstant sample texel offset");
-		}
-		const auto sampler_id = LoadSamplerDescriptor(state, mem.sampler, sampler_index);
-		const auto EmitSample = [&](uint32_t resource, uint32_t array_index) {
-			const auto& candidate = state.program.info.images[resource];
-			auto sample_operands = operands;
+		const auto sampler_id   = LoadSamplerDescriptor(state, mem.sampler, sampler_index);
+		const auto EmitSampleOf = [&](ImageDimension candidate_dimension, bool candidate_cube,
+		                              uint32_t sampled, uint32_t resource, uint32_t loaded_image,
+		                              uint32_t array_index) {
+			auto sample_operands      = operands;
 			auto sample_operand_count = operand_count;
-			if (layout.offset != NoImageComponent) {
-				sample_operand_count = std::max(size_t{1}, sample_operand_count);
-				sample_operands[sample_operand_count++] = PackedOffset(
-				    ctx, offset_value, candidate.dimension, sample_operands[0]);
+			auto coord = CoordF32(ctx, mem, *address, layout.coord,
+			                      ImageDimensionInfoFor(candidate_dimension).coordinate_components,
+			                      candidate_cube);
+			// A cube has no texel offset.
+			if (layout.offset != NoImageComponent && !candidate_cube && !image.cube) {
+				if (offset_value.IsImmediate()) {
+					sample_operand_count = std::max(size_t {1}, sample_operand_count);
+					sample_operands[sample_operand_count++] =
+					    PackedOffset(ctx, offset_value, candidate_dimension, sample_operands[0]);
+				} else {
+					// Offset is gather-only, so a varying sample offset is folded into the
+					// coordinate at the sampled level.
+					coord = OffsetCoordinate(ctx, mem, *address, layout, candidate_dimension, coord,
+					                         resource, loaded_image, array_index);
+				}
 			}
-			const auto coord =
-			    CoordF32(ctx, mem, *address, layout.coord,
-			             ImageDimensionInfoFor(candidate.dimension).coordinate_components,
-			             candidate.cube);
-			const auto sampled = MakeSampledImage(state, resource, sampler_id, 0u, array_index,
-			                                      sampler_index != 0u);
 			const auto sample = state.builder.AllocateId();
-			state.builder.AddFunction(opcode, result_type, sample, sampled, coord,
-			                          std::span(&dref_value, dref ? 1u : 0u),
-			                          std::span<const uint32_t>(sample_operands).first(sample_operand_count));
+			state.builder.AddFunction(
+			    opcode, result_type, sample, sampled, coord, std::span(&dref_value, dref ? 1u : 0u),
+			    std::span<const uint32_t>(sample_operands).first(sample_operand_count));
 			return sample;
 		};
+		if (image.bindless && image.indirect_root == mem.resource) {
+			const auto key = BindlessImageKey(ctx, inst);
+			if (key == 0) {
+				return;
+			}
+			// A compared sample returns one float; a record the switch has no arm for compares
+			// as zero.
+			const auto MakeZero = [&] {
+				const auto zero_f32 = ZeroF32(state);
+				if (dref) {
+					return zero_f32;
+				}
+				return state.builder.Constant(
+				    spv::OpConstantComposite, result_type,
+				    std::vector<uint32_t> {zero_f32, zero_f32, zero_f32, zero_f32});
+			};
+			const auto sample =
+			    EmitBindlessImageSwitch(state, image, key, result_type, false, MakeZero,
+			                            [&](const BindlessArm& arm, uint32_t loaded_image) {
+				                            const auto sampled = MakeBindlessSampledImage(
+				                                state, arm.array, loaded_image, mem.sampler);
+				                            return EmitSampleOf(arm.dimension, arm.cube, sampled,
+				                                                mem.resource, loaded_image, 0u);
+			                            });

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Bindless sampling ignores the finite sampler key.

Lines 1229-1239 compute sampler_index from the finite sampler table. Line 1240 loads sampler_id with that index. The bindless arm does not use sampler_id. It calls MakeBindlessSampledImage(state, arm.array, loaded_image, mem.sampler), which calls LoadSamplerDescriptor(state, sampler) with no array index. That loads the base sampler slot. A bindless sample whose sampler comes from an indirect sampler table therefore uses the wrong sampler state, such as the wrong filtering, wrapping, or compare settings.

Pass the already loaded sampler into the helper. The bindless gather path at line 1135 can keep its current behavior, or it can use the same signature with a sampler loaded once.

Proposed fix
-				                            const auto sampled = MakeBindlessSampledImage(
-				                                state, arm.array, loaded_image, mem.sampler);
+				                            const auto sampled = MakeBindlessSampledImage(
+				                                state, arm.array, loaded_image, sampler_id);

Then change MakeBindlessSampledImage in spirvEmitterAnalysis.cpp to take a sampler id. Add NonUniform when the index is dynamic:

uint32_t MakeBindlessSampledImage(EmitterState& state, IR::BindlessShape shape, uint32_t image,
                                  uint32_t sampler_id) {
	const auto sampled_type =
	    state.builder.Type(spv::OpTypeSampledImage, ImageType(state, BindlessImageResource(shape)));
	...
}

Update the gather call site to pass LoadSamplerDescriptor(state, mem.sampler).

**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180710) On `src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp` line 1291 (outdated): ```diff @@ -887,61 +1205,105 @@ void EmitImage(ValueEmitContext& ctx, const IR::Inst& inst) { } } std::array<uint32_t, 4> operands {}; - size_t operand_count = 0; + size_t operand_count = 0; if (HasFlag(mem, Decoder::ImageSampleFlagDerivative)) { operands[0] = spv::ImageOperandsGradMask; - operands[1] = CoordF32(ctx, mem, *address, layout.grad_x, dimension_info.spatial_components); - operands[2] = CoordF32(ctx, mem, *address, layout.grad_y, dimension_info.spatial_components); + operands[1] = + CoordF32(ctx, mem, *address, layout.grad_x, dimension_info.spatial_components); + operands[2] = + CoordF32(ctx, mem, *address, layout.grad_y, dimension_info.spatial_components); operand_count = 3; } else if (explicit_lod) { auto lod = ZeroF32(state); if (HasFlag(mem, Decoder::ImageSampleFlagLod) && layout.lod != NoImageComponent) { lod = AddressF32(ctx, mem, *address, layout.lod); } - operands[0] = spv::ImageOperandsLodMask; - operands[1] = lod; + operands[0] = spv::ImageOperandsLodMask; + operands[1] = lod; operand_count = 2; } else if (layout.bias != NoImageComponent) { - operands[0] = spv::ImageOperandsBiasMask; - operands[1] = AddressF32(ctx, mem, *address, layout.bias); + operands[0] = spv::ImageOperandsBiasMask; + operands[1] = AddressF32(ctx, mem, *address, layout.bias); operand_count = 2; } - const auto& samplers = state.program.info.samplers.at(mem.sampler).indirect_resources; - uint32_t sampler_index = 0; + const auto& samplers = state.program.info.samplers.at(mem.sampler).indirect_resources; + uint32_t sampler_index = 0; if (!samplers.empty()) { const auto* handle = inst.Arg(1).ResolveInstruction(); if (handle == nullptr || handle->GetOpcode() != IR::ValueOpcode::GetSamplerResource) ctx.Fail(inst, "has invalid finite sampler key provenance"); sampler_index = EmitIndexSwitch( state, ctx.Def(handle->Arg(0)), static_cast<uint32_t>(samplers.size()), - TypeU32(state), [&](uint32_t ordinal) { return ConstantU32(state, samplers[ordinal]); }); + TypeU32(state), + [&](uint32_t ordinal) { return ConstantU32(state, samplers[ordinal]); }); } - if (layout.offset != NoImageComponent && - !offset_value.IsImmediate()) { - ctx.Fail(inst, "has a nonconstant sample texel offset"); - } - const auto sampler_id = LoadSamplerDescriptor(state, mem.sampler, sampler_index); - const auto EmitSample = [&](uint32_t resource, uint32_t array_index) { - const auto& candidate = state.program.info.images[resource]; - auto sample_operands = operands; + const auto sampler_id = LoadSamplerDescriptor(state, mem.sampler, sampler_index); + const auto EmitSampleOf = [&](ImageDimension candidate_dimension, bool candidate_cube, + uint32_t sampled, uint32_t resource, uint32_t loaded_image, + uint32_t array_index) { + auto sample_operands = operands; auto sample_operand_count = operand_count; - if (layout.offset != NoImageComponent) { - sample_operand_count = std::max(size_t{1}, sample_operand_count); - sample_operands[sample_operand_count++] = PackedOffset( - ctx, offset_value, candidate.dimension, sample_operands[0]); + auto coord = CoordF32(ctx, mem, *address, layout.coord, + ImageDimensionInfoFor(candidate_dimension).coordinate_components, + candidate_cube); + // A cube has no texel offset. + if (layout.offset != NoImageComponent && !candidate_cube && !image.cube) { + if (offset_value.IsImmediate()) { + sample_operand_count = std::max(size_t {1}, sample_operand_count); + sample_operands[sample_operand_count++] = + PackedOffset(ctx, offset_value, candidate_dimension, sample_operands[0]); + } else { + // Offset is gather-only, so a varying sample offset is folded into the + // coordinate at the sampled level. + coord = OffsetCoordinate(ctx, mem, *address, layout, candidate_dimension, coord, + resource, loaded_image, array_index); + } } - const auto coord = - CoordF32(ctx, mem, *address, layout.coord, - ImageDimensionInfoFor(candidate.dimension).coordinate_components, - candidate.cube); - const auto sampled = MakeSampledImage(state, resource, sampler_id, 0u, array_index, - sampler_index != 0u); const auto sample = state.builder.AllocateId(); - state.builder.AddFunction(opcode, result_type, sample, sampled, coord, - std::span(&dref_value, dref ? 1u : 0u), - std::span<const uint32_t>(sample_operands).first(sample_operand_count)); + state.builder.AddFunction( + opcode, result_type, sample, sampled, coord, std::span(&dref_value, dref ? 1u : 0u), + std::span<const uint32_t>(sample_operands).first(sample_operand_count)); return sample; }; + if (image.bindless && image.indirect_root == mem.resource) { + const auto key = BindlessImageKey(ctx, inst); + if (key == 0) { + return; + } + // A compared sample returns one float; a record the switch has no arm for compares + // as zero. + const auto MakeZero = [&] { + const auto zero_f32 = ZeroF32(state); + if (dref) { + return zero_f32; + } + return state.builder.Constant( + spv::OpConstantComposite, result_type, + std::vector<uint32_t> {zero_f32, zero_f32, zero_f32, zero_f32}); + }; + const auto sample = + EmitBindlessImageSwitch(state, image, key, result_type, false, MakeZero, + [&](const BindlessArm& arm, uint32_t loaded_image) { + const auto sampled = MakeBindlessSampledImage( + state, arm.array, loaded_image, mem.sampler); + return EmitSampleOf(arm.dimension, arm.cube, sampled, + mem.resource, loaded_image, 0u); + }); ``` **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** **Bindless sampling ignores the finite sampler key.** Lines 1229-1239 compute `sampler_index` from the finite sampler table. Line 1240 loads `sampler_id` with that index. The bindless arm does not use `sampler_id`. It calls `MakeBindlessSampledImage(state, arm.array, loaded_image, mem.sampler)`, which calls `LoadSamplerDescriptor(state, sampler)` with no array index. That loads the base sampler slot. A bindless sample whose sampler comes from an indirect sampler table therefore uses the wrong sampler state, such as the wrong filtering, wrapping, or compare settings. Pass the already loaded sampler into the helper. The bindless gather path at line 1135 can keep its current behavior, or it can use the same signature with a sampler loaded once. <details> <summary>Proposed fix</summary> ```diff - const auto sampled = MakeBindlessSampledImage( - state, arm.array, loaded_image, mem.sampler); + const auto sampled = MakeBindlessSampledImage( + state, arm.array, loaded_image, sampler_id); ``` Then change `MakeBindlessSampledImage` in `spirvEmitterAnalysis.cpp` to take a sampler id. Add `NonUniform` when the index is dynamic: ```cpp uint32_t MakeBindlessSampledImage(EmitterState& state, IR::BindlessShape shape, uint32_t image, uint32_t sampler_id) { const auto sampled_type = state.builder.Type(spv::OpTypeSampledImage, ImageType(state, BindlessImageResource(shape))); ... } ``` Update the gather call site to pass `LoadSamplerDescriptor(state, mem.sampler)`. </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:95b09264a09ca8709a928fca --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -491,0 +1032,4 @@
stub_all();
return;
}
bool failed = false;
Author
Owner

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Bail out of call-target preparation when the CFG build is rejected.

BuildGraph no longer terminates on a guest-program rejection. Instead, BuildFailure returns a graph with unsupported = true, an empty blocks list, and entry_block = UINT32_MAX. PrepareCallTarget does not check this result. Register then calls CFG::FindScalarDefinition(source.decoded, graph, ...), which runs EXIT_IF(found == graph.blocks.end()) on the empty block list.

Trigger: a compute shader has exactly one S_SWAPPC_B64 with valid SGPR pairing and also contains an UNSUPPORTED instruction or an invalid branch target. In that case the process still terminates in PrepareShaderSource. TranslateProgram would have reported the shader as BuildRejected, and the caller would have dropped the draw. This defeats the PR's goal of making CFG rejections non-fatal.

When the graph is unsupported, clear the call so that the translator keeps the any-hit stub and the later CFG step reports the rejection:

🛡️ Proposed fix
--- "a/src/graphics/shader/recompiler/ShaderRecompiler.cpp"
+++ "b/src/graphics/shader/recompiler/ShaderRecompiler.cpp"
@@ -1176,9 +1176,13 @@
 		source.call.reset();
 		return;
 	}
 	bool       failed = false;
 	const auto graph = CFG::BuildGraph(source.decoded);
+	if (graph.unsupported) {
+		source.call.reset();
+		return;
+	}
 	Program query;
 	query.stage = options.stage;
 	query.user_data_base = options.user_data_base;
 	query.user_data_count = static_cast<uint32_t>(options.user_data.size());
**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180721) **🩺 Stability & Availability** | **🟡 Minor** | **⚡ Quick win** **Bail out of call-target preparation when the CFG build is rejected.** `BuildGraph` no longer terminates on a guest-program rejection. Instead, `BuildFailure` returns a graph with `unsupported = true`, an empty `blocks` list, and `entry_block = UINT32_MAX`. `PrepareCallTarget` does not check this result. `Register` then calls `CFG::FindScalarDefinition(source.decoded, graph, ...)`, which runs `EXIT_IF(found == graph.blocks.end())` on the empty block list. Trigger: a compute shader has exactly one `S_SWAPPC_B64` with valid SGPR pairing and also contains an `UNSUPPORTED` instruction or an invalid branch target. In that case the process still terminates in `PrepareShaderSource`. `TranslateProgram` would have reported the shader as `BuildRejected`, and the caller would have dropped the draw. This defeats the PR's goal of making CFG rejections non-fatal. When the graph is unsupported, clear the call so that the translator keeps the any-hit stub and the later CFG step reports the rejection: <details> <summary>🛡️ Proposed fix</summary> ```diff --- "a/src/graphics/shader/recompiler/ShaderRecompiler.cpp" +++ "b/src/graphics/shader/recompiler/ShaderRecompiler.cpp" @@ -1176,9 +1176,13 @@ source.call.reset(); return; } bool failed = false; const auto graph = CFG::BuildGraph(source.decoded); + if (graph.unsupported) { + source.call.reset(); + return; + } Program query; query.stage = options.stage; query.user_data_base = options.user_data_base; query.user_data_count = static_cast<uint32_t>(options.user_data.size()); ``` </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:8175d2a50cdc1cf9d571f51f --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-13 23:32 UTC · original
On src/graphics/shader/recompiler/ShaderRecompiler.cpp line 1344 (outdated):

@@ -625,48 +1333,60 @@ const Decoder::Program& RefreshShaderSource(ShaderSource& source, const IR::SrtR
 		}
 		reads.resize(query_reads);
 	}
-	ShaderSource::Linked linked {.code = source.code,
-	                             .decoded = source.decoded};
-	const auto& last = source.decoded.instructions.back();
-	EXIT_NOT_IMPLEMENTED(last.opcode != Decoder::Opcode::S_ENDPGM);
+	ShaderSource::Linked linked {.code = source.code, .decoded = source.decoded};
+	const auto&          last = source.decoded.instructions.back();
+	// A call this linker cannot follow keeps the stub: only a scalar leaf that returns through
+	// the call's own register pair is inlined.
+	const auto unlinked = [&](const char* reason) -> const Decoder::Program& {
+		LOGF("shader call at pc 0x%08x not linked (%s); using the stub\n", call.pc, reason);
+		reads.resize(query_reads);
+		return source.decoded;
+	};

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Find consumers of ShaderSource revision/linked state and RefreshShaderSource results.
rg -nP -C4 '\bRefreshShaderSource\s*\(' --type=cpp
rg -nP -C3 '\.revision\b' --type=cpp
rg -nP -C3 '\.linked\b' --type=cpp -g '!**/ShaderRecompiler.cpp'

Repository: KytyPS5/KytyPS5

Length of output: 26679


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- ShaderSource declaration and refresh implementation ---'
rg -n -F -- 'struct ShaderSource' src/graphics/shader/recompiler src/graphics/host_gpu/renderer/pipeline
sed -n '70,145p' src/graphics/shader/recompiler/ShaderRecompiler.h
sed -n '1280,1420p' src/graphics/shader/recompiler/ShaderRecompiler.cpp

printf '%s\n' '--- pipeline caller context ---'
sed -n '640,735p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
sed -n '1125,1215p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

printf '%s\n' '--- all local ShaderSource field uses ---'
rg -n -F -- 'call_source->' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
rg -n -F -- 'current->linked' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

Repository: KytyPS5/KytyPS5

Length of output: 19542


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- RefreshCallSource callers ---'
rg -n -F -C8 -- 'RefreshCallSource(' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

printf '%s\n' '--- SourceEntry cache flow ---'
sed -n '735,930p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
sed -n '930,1135p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

Repository: KytyPS5/KytyPS5

Length of output: 20591


Clear stale linked state when falling back to the stub.

When ShaderSource has a previous link, RefreshShaderSource returns source.decoded for failed target evaluation, zero targets, and unlinked leaves. It leaves source.linked and source.revision unchanged. ProgramCache::RefreshCallSource then reports no change, so the cache can reuse the previous linked permutation instead of the stub.

🐛 Suggested fix
 	const auto&         call = source.decoded.instructions[source.call->instruction];
+	const auto use_stub = [&]() -> const Decoder::Program& {
+		if (source.linked) {
+			source.linked.reset();
+			++source.revision;
+		}
+		return source.decoded;
+	};
 	if (!walker.Evaluate(source.call->target[0], low) ||
 	    !walker.Evaluate(source.call->target[1], high)) {
 		LOGF("shader call at pc 0x%08x has an unavailable scalar target; using the stub\n",
 		     call.pc);
-		return source.decoded;
+		return use_stub();
 	}
 	// SWAPPC reads the old aliased pair and ignores the target's low two bits.
 	const auto address = ((uint64_t {high} << 32u) | low) & ~uint64_t {3};
-	if (address == 0u) return source.decoded;
+	if (address == 0u) return use_stub();
 	const auto unlinked = [&](const char* reason) -> const Decoder::Program& {
 		LOGF("shader call at pc 0x%08x not linked (%s); using the stub\n", call.pc, reason);
 		reads.resize(query_reads);
-		return source.decoded;
+		return use_stub();
 	};
**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180726) On `src/graphics/shader/recompiler/ShaderRecompiler.cpp` line 1344 (outdated): ```diff @@ -625,48 +1333,60 @@ const Decoder::Program& RefreshShaderSource(ShaderSource& source, const IR::SrtR } reads.resize(query_reads); } - ShaderSource::Linked linked {.code = source.code, - .decoded = source.decoded}; - const auto& last = source.decoded.instructions.back(); - EXIT_NOT_IMPLEMENTED(last.opcode != Decoder::Opcode::S_ENDPGM); + ShaderSource::Linked linked {.code = source.code, .decoded = source.decoded}; + const auto& last = source.decoded.instructions.back(); + // A call this linker cannot follow keeps the stub: only a scalar leaf that returns through + // the call's own register pair is inlined. + const auto unlinked = [&](const char* reason) -> const Decoder::Program& { + LOGF("shader call at pc 0x%08x not linked (%s); using the stub\n", call.pc, reason); + reads.resize(query_reads); + return source.decoded; + }; ``` **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash # Find consumers of ShaderSource revision/linked state and RefreshShaderSource results. rg -nP -C4 '\bRefreshShaderSource\s*\(' --type=cpp rg -nP -C3 '\.revision\b' --type=cpp rg -nP -C3 '\.linked\b' --type=cpp -g '!**/ShaderRecompiler.cpp' ``` Repository: KytyPS5/KytyPS5 Length of output: 26679 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- ShaderSource declaration and refresh implementation ---' rg -n -F -- 'struct ShaderSource' src/graphics/shader/recompiler src/graphics/host_gpu/renderer/pipeline sed -n '70,145p' src/graphics/shader/recompiler/ShaderRecompiler.h sed -n '1280,1420p' src/graphics/shader/recompiler/ShaderRecompiler.cpp printf '%s\n' '--- pipeline caller context ---' sed -n '640,735p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp sed -n '1125,1215p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp printf '%s\n' '--- all local ShaderSource field uses ---' rg -n -F -- 'call_source->' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp rg -n -F -- 'current->linked' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 19542 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- RefreshCallSource callers ---' rg -n -F -C8 -- 'RefreshCallSource(' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp printf '%s\n' '--- SourceEntry cache flow ---' sed -n '735,930p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp sed -n '930,1135p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 20591 --- </details> **Clear stale linked state when falling back to the stub.** When `ShaderSource` has a previous link, `RefreshShaderSource` returns `source.decoded` for failed target evaluation, zero targets, and unlinked leaves. It leaves `source.linked` and `source.revision` unchanged. `ProgramCache::RefreshCallSource` then reports no change, so the cache can reuse the previous linked permutation instead of the stub. <details> <summary>🐛 Suggested fix</summary> ```diff const auto& call = source.decoded.instructions[source.call->instruction]; + const auto use_stub = [&]() -> const Decoder::Program& { + if (source.linked) { + source.linked.reset(); + ++source.revision; + } + return source.decoded; + }; if (!walker.Evaluate(source.call->target[0], low) || !walker.Evaluate(source.call->target[1], high)) { LOGF("shader call at pc 0x%08x has an unavailable scalar target; using the stub\n", call.pc); - return source.decoded; + return use_stub(); } // SWAPPC reads the old aliased pair and ignores the target's low two bits. const auto address = ((uint64_t {high} << 32u) | low) & ~uint64_t {3}; - if (address == 0u) return source.decoded; + if (address == 0u) return use_stub(); ``` ```diff const auto unlinked = [&](const char* reason) -> const Decoder::Program& { LOGF("shader call at pc 0x%08x not linked (%s); using the stub\n", call.pc, reason); reads.resize(query_reads); - return source.decoded; + return use_stub(); }; ``` </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:837551482e030eaf28fe5383 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-13 23:32 UTC · original
On src/graphics/shader/shader.cpp line 838 (outdated):

@@ -751,44 +805,38 @@ ShaderParams PrepareProgram(const HW::VertexShaderInfo& regs, const HW::Context&
 		params.hash = XXH3_64bits(hashes, sizeof(hashes));
 		mesh.scratch_size_dwords = std::max(mesh.scratch_size_dwords, back.scratch_size_dwords);
 	}
-	const auto& group = user_config.GetGeControl();
+	const auto& group     = user_config.GetGeControl();
+	const auto& user_vgpr = user_config.GetGeUserVgprEn();
 	if (mesh.fast_launch) {
-		const auto& user_vgpr = user_config.GetGeUserVgprEn();
 		EXIT_NOT_IMPLEMENTED(data.type != Prospero::ShaderBinaryType::kGs ||
 		                     regs.gs_regs.rsrc1.gs_vgpr_component_count != 0u ||
 		                     regs.gs_regs.rsrc2.es_vgpr_component_count != 1u ||
 		                     user_config.GetPrimType() != Prospero::PrimitiveType::kPointList ||
 		                     group.primitive_group_size != 1u || group.vertex_group_size != 1u ||
 		                     user_vgpr.vgpr1 || user_vgpr.vgpr2 || user_vgpr.vgpr3 ||
 		                     mesh.max_vertices != sh.m_vgtGsMaxVertOut);
-	} else if (merged) {
-		EXIT_NOT_IMPLEMENTED(regs.gs_regs.rsrc1.gs_vgpr_component_count != 3u ||
-		                     regs.gs_regs.rsrc2.es_vgpr_component_count != 3u);
-	}
-	if ((user_config.GetPrimType() != Prospero::PrimitiveType::kPointList &&
-	     user_config.GetPrimType() != Prospero::PrimitiveType::kLineList &&
-	     user_config.GetPrimType() != Prospero::PrimitiveType::kTriFan &&
-	     user_config.GetPrimType() != Prospero::PrimitiveType::kTriStrip &&
-	     user_config.GetPrimType() != Prospero::PrimitiveType::kTriList) ||
-	    sh.m_vgtGsOutPrimType != 2u || (!native_ngg && sh.m_vgtGsMaxVertOut < 3u) ||
-	    group.vertex_group_size < mesh.InputPrimitiveSize() ||
-	    mesh.max_vertices == 0u) {
-		EXIT("unsupported GS assembly: input=%u output=%u vertices=%u GE=%u/%u max_output=%u\n",
-		     mesh.input_primitive, sh.m_vgtGsOutPrimType, sh.m_vgtGsMaxVertOut,
-		     group.primitive_group_size, group.vertex_group_size, mesh.max_vertices);
-	}
-	mesh.max_primitives = mesh.fast_launch ? mesh.max_vertices :
-	                      native_ngg ? mesh.InputPrimitiveCount(mesh.max_vertices) :
-	                      group.primitive_group_size * (sh.m_vgtGsMaxVertOut - 2u);
-	mesh.primitives_per_group = std::min({static_cast<uint32_t>(group.primitive_group_size),
-	                                      mesh.InputPrimitiveCount(group.vertex_group_size),
-	                                      native_ngg ? mesh.max_primitives :
-	                                          mesh.max_vertices / sh.m_vgtGsMaxVertOut});
-	EXIT_IF(mesh.primitives_per_group == 0u);
-	mesh.vertices_per_group = mesh.InputVertexCount(mesh.primitives_per_group);
-	const auto threads = native_ngg && !mesh.fast_launch ? mesh.vertices_per_group : mesh.max_vertices;
-	mesh.threads_num[0] = ((threads + mesh.wave_size - 1u) / mesh.wave_size) * mesh.wave_size;
-	mesh.threads_num[1] = mesh.threads_num[2] = 1u;
+	}
+	const ShaderGsAssemblyRegisters gs_regs {
+	    .gs_vgpr_component_count = regs.gs_regs.rsrc1.gs_vgpr_component_count,
+	    .es_vgpr_component_count = regs.gs_regs.rsrc2.es_vgpr_component_count,
+	    .gs_out_prim_type        = sh.m_vgtGsOutPrimType,
+	    .gs_max_vert_out         = sh.m_vgtGsMaxVertOut,
+	    .gs_instance_count       = sh.m_vgtGsInstanceCnt,
+	    .primitive_group_size    = group.primitive_group_size,
+	    .vertex_group_size       = group.vertex_group_size,
+	    .es_offchip_lds          = regs.gs_regs.rsrc2.offchip_lds,
+	    .user_vgpr1_enabled      = user_vgpr.vgpr1,
+	    .user_vgpr2_enabled      = user_vgpr.vgpr2,
+	    .user_vgpr3_enabled      = user_vgpr.vgpr3,
+	    .native_ngg              = native_ngg,
+	};
+	ShaderGsAssemblyNotes notes;
+	std::string           error;
+	if (!ShaderBuildGsAssembly(gs_regs, mesh, &notes, &error)) {
+		LOGF("\t warning: dropping GS draw: %s\n", error.c_str());
+		return {};
+	}

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP -C8 '\bPrepareProgram\s*\(' --type=cpp -g '!**/shader.cpp'
rg -nP -C3 'code\.empty\(\)' --type=cpp src/graphics

Repository: KytyPS5/KytyPS5

Length of output: 40521


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- pipeline graphics path ---'
sed -n '1680,1970p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
printf '%s\n' '--- shader parameter and cache consumers ---'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'struct ShaderParams' -e 'class ShaderParams' -e 'ShaderProgram PipelineCache::GetGraphicsProgram' -e 'GetGraphicsProgram(' -e 'm_program_cache->Get' -e 'ShaderProgramCache' src/graphics
printf '%s\n' '--- changed preparation block ---'
sed -n '760,860p' src/graphics/shader/shader.cpp

Repository: KytyPS5/KytyPS5

Length of output: 19836


🏁 Script executed:

printf '%s\n' '--- graphics function boundaries and calls ---'
rg -n -F -C4 -- 'ShaderProgram PipelineCache::GetGraphicsProgram' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
rg -n -F -C8 -- 'vertex_params' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
printf '%s\n' '--- cache definitions and parameter shape ---'
rg -n -F -C8 -- 'struct ShaderParams' src/graphics
rg -n -F -C12 -- 'ShaderProgram Get(' src/graphics/host_gpu/renderer/pipeline
rg -n -F -C8 -- 'ShaderProgram PipelineCache::GetGraphicsProgram' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp

Repository: KytyPS5/KytyPS5

Length of output: 7897


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- complete ProgramCache::Get body ---'
sed -n '930,1065p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
printf '%s\n' '--- graphics-program consumers and validity checks ---'
rg -n -F -C8 --glob '*.cpp' --glob '*.h' \
  -e 'GetGraphicsPrograms(' \
  -e 'programs.vertex' \
  -e 'result.vertex' \
  -e 'GraphicsPrograms' \
  -e 'if (!.*vertex' \
  src/graphics/host_gpu/renderer

Repository: KytyPS5/KytyPS5

Length of output: 35179


🏁 Script executed:

set -o pipefail
printf '%s\n' '--- ProgramCache::Get continuation ---'
sed -n '1060,1245p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
printf '%s\n' '--- translation entrypoints used by ProgramCache ---'
rg -n -F -C8 --glob '*.cpp' --glob '*.h' \
  -e 'PrepareShaderSource(' \
  -e 'TranslateProgram(' \
  -e 'Compile(' \
  src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp \
  src/graphics/shader/recompiler

Repository: KytyPS5/KytyPS5

Length of output: 38129


Reject empty vertex parameters before shader compilation.

PrepareProgram logs the GS assembly failure and returns empty parameters. ProgramCache::Get then passes the empty code to PrepareShaderSource, which rejects it before PrepareDrawShaders can drop the draw.

Suggested fix
 	} else {
 		vertex_params[0] = PrepareProgram(vertex_regs, context, user_config, vertex_info[0]);
+		if (vertex_params[0].code.empty()) {
+			return {};
+		}
 	}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180734) On `src/graphics/shader/shader.cpp` line 838 (outdated): ```diff @@ -751,44 +805,38 @@ ShaderParams PrepareProgram(const HW::VertexShaderInfo& regs, const HW::Context& params.hash = XXH3_64bits(hashes, sizeof(hashes)); mesh.scratch_size_dwords = std::max(mesh.scratch_size_dwords, back.scratch_size_dwords); } - const auto& group = user_config.GetGeControl(); + const auto& group = user_config.GetGeControl(); + const auto& user_vgpr = user_config.GetGeUserVgprEn(); if (mesh.fast_launch) { - const auto& user_vgpr = user_config.GetGeUserVgprEn(); EXIT_NOT_IMPLEMENTED(data.type != Prospero::ShaderBinaryType::kGs || regs.gs_regs.rsrc1.gs_vgpr_component_count != 0u || regs.gs_regs.rsrc2.es_vgpr_component_count != 1u || user_config.GetPrimType() != Prospero::PrimitiveType::kPointList || group.primitive_group_size != 1u || group.vertex_group_size != 1u || user_vgpr.vgpr1 || user_vgpr.vgpr2 || user_vgpr.vgpr3 || mesh.max_vertices != sh.m_vgtGsMaxVertOut); - } else if (merged) { - EXIT_NOT_IMPLEMENTED(regs.gs_regs.rsrc1.gs_vgpr_component_count != 3u || - regs.gs_regs.rsrc2.es_vgpr_component_count != 3u); - } - if ((user_config.GetPrimType() != Prospero::PrimitiveType::kPointList && - user_config.GetPrimType() != Prospero::PrimitiveType::kLineList && - user_config.GetPrimType() != Prospero::PrimitiveType::kTriFan && - user_config.GetPrimType() != Prospero::PrimitiveType::kTriStrip && - user_config.GetPrimType() != Prospero::PrimitiveType::kTriList) || - sh.m_vgtGsOutPrimType != 2u || (!native_ngg && sh.m_vgtGsMaxVertOut < 3u) || - group.vertex_group_size < mesh.InputPrimitiveSize() || - mesh.max_vertices == 0u) { - EXIT("unsupported GS assembly: input=%u output=%u vertices=%u GE=%u/%u max_output=%u\n", - mesh.input_primitive, sh.m_vgtGsOutPrimType, sh.m_vgtGsMaxVertOut, - group.primitive_group_size, group.vertex_group_size, mesh.max_vertices); - } - mesh.max_primitives = mesh.fast_launch ? mesh.max_vertices : - native_ngg ? mesh.InputPrimitiveCount(mesh.max_vertices) : - group.primitive_group_size * (sh.m_vgtGsMaxVertOut - 2u); - mesh.primitives_per_group = std::min({static_cast<uint32_t>(group.primitive_group_size), - mesh.InputPrimitiveCount(group.vertex_group_size), - native_ngg ? mesh.max_primitives : - mesh.max_vertices / sh.m_vgtGsMaxVertOut}); - EXIT_IF(mesh.primitives_per_group == 0u); - mesh.vertices_per_group = mesh.InputVertexCount(mesh.primitives_per_group); - const auto threads = native_ngg && !mesh.fast_launch ? mesh.vertices_per_group : mesh.max_vertices; - mesh.threads_num[0] = ((threads + mesh.wave_size - 1u) / mesh.wave_size) * mesh.wave_size; - mesh.threads_num[1] = mesh.threads_num[2] = 1u; + } + const ShaderGsAssemblyRegisters gs_regs { + .gs_vgpr_component_count = regs.gs_regs.rsrc1.gs_vgpr_component_count, + .es_vgpr_component_count = regs.gs_regs.rsrc2.es_vgpr_component_count, + .gs_out_prim_type = sh.m_vgtGsOutPrimType, + .gs_max_vert_out = sh.m_vgtGsMaxVertOut, + .gs_instance_count = sh.m_vgtGsInstanceCnt, + .primitive_group_size = group.primitive_group_size, + .vertex_group_size = group.vertex_group_size, + .es_offchip_lds = regs.gs_regs.rsrc2.offchip_lds, + .user_vgpr1_enabled = user_vgpr.vgpr1, + .user_vgpr2_enabled = user_vgpr.vgpr2, + .user_vgpr3_enabled = user_vgpr.vgpr3, + .native_ngg = native_ngg, + }; + ShaderGsAssemblyNotes notes; + std::string error; + if (!ShaderBuildGsAssembly(gs_regs, mesh, &notes, &error)) { + LOGF("\t warning: dropping GS draw: %s\n", error.c_str()); + return {}; + } ``` **🩺 Stability & Availability** | **🟠 Major** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash rg -nP -C8 '\bPrepareProgram\s*\(' --type=cpp -g '!**/shader.cpp' rg -nP -C3 'code\.empty\(\)' --type=cpp src/graphics ``` Repository: KytyPS5/KytyPS5 Length of output: 40521 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- pipeline graphics path ---' sed -n '1680,1970p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp printf '%s\n' '--- shader parameter and cache consumers ---' rg -n -F --glob '*.cpp' --glob '*.h' -e 'struct ShaderParams' -e 'class ShaderParams' -e 'ShaderProgram PipelineCache::GetGraphicsProgram' -e 'GetGraphicsProgram(' -e 'm_program_cache->Get' -e 'ShaderProgramCache' src/graphics printf '%s\n' '--- changed preparation block ---' sed -n '760,860p' src/graphics/shader/shader.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 19836 --- 🏁 Script executed: ```bash printf '%s\n' '--- graphics function boundaries and calls ---' rg -n -F -C4 -- 'ShaderProgram PipelineCache::GetGraphicsProgram' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp rg -n -F -C8 -- 'vertex_params' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp printf '%s\n' '--- cache definitions and parameter shape ---' rg -n -F -C8 -- 'struct ShaderParams' src/graphics rg -n -F -C12 -- 'ShaderProgram Get(' src/graphics/host_gpu/renderer/pipeline rg -n -F -C8 -- 'ShaderProgram PipelineCache::GetGraphicsProgram' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 7897 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- complete ProgramCache::Get body ---' sed -n '930,1065p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp printf '%s\n' '--- graphics-program consumers and validity checks ---' rg -n -F -C8 --glob '*.cpp' --glob '*.h' \ -e 'GetGraphicsPrograms(' \ -e 'programs.vertex' \ -e 'result.vertex' \ -e 'GraphicsPrograms' \ -e 'if (!.*vertex' \ src/graphics/host_gpu/renderer ``` Repository: KytyPS5/KytyPS5 Length of output: 35179 --- 🏁 Script executed: ```bash set -o pipefail printf '%s\n' '--- ProgramCache::Get continuation ---' sed -n '1060,1245p' src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp printf '%s\n' '--- translation entrypoints used by ProgramCache ---' rg -n -F -C8 --glob '*.cpp' --glob '*.h' \ -e 'PrepareShaderSource(' \ -e 'TranslateProgram(' \ -e 'Compile(' \ src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp \ src/graphics/shader/recompiler ``` Repository: KytyPS5/KytyPS5 Length of output: 38129 --- </details> **Reject empty vertex parameters before shader compilation.** `PrepareProgram` logs the GS assembly failure and returns empty parameters. `ProgramCache::Get` then passes the empty code to `PrepareShaderSource`, which rejects it before `PrepareDrawShaders` can drop the draw. <details> <summary>Suggested fix</summary> ```diff } else { vertex_params[0] = PrepareProgram(vertex_regs, context, user_config, vertex_info[0]); + if (vertex_params[0].code.empty()) { + return {}; + } } ``` </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:bd50e6a7225eab6216161dfc --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -0,0 +25,4 @@
}
if (regs.gs_out_prim_type != 2u) {
return "unsupported GS output primitive";
}
Author
Owner

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# Check how native_ngg and gs_out_prim_type reach ShaderBuildGsAssembly, and whether the mesh lowering emits non-triangle output.
rg -n -C4 'native_ngg' --type=cpp
rg -n -C3 'gs_out_prim_type|m_vgtGsOutPrimType' --type=cpp

Repository: KytyPS5/KytyPS5

Length of output: 15917


Confirm whether native NGG draws should skip the GS output-primitive check.

The native NGG path does not use the GS output registers. The current check can reject native NGG point and line draws because VGT_GS_OUT_PRIM_TYPE is derived from the draw primitive, while the lowering uses the input primitive to calculate native NGG workgroup counts.

🔧 Suggested fix
--- "a/src/graphics/shader/shaderGsAssembly.cpp"
+++ "b/src/graphics/shader/shaderGsAssembly.cpp"
@@ -68,9 +68,9 @@
 	    primitive != Prospero::PrimitiveType::kTriList) {
 		return Reject(error, regs, mesh, "unsupported GS input primitive");
 	}
-	if (regs.gs_out_prim_type != 2u) {
+	if (!regs.native_ngg && regs.gs_out_prim_type != 2u) {
 		return Reject(error, regs, mesh, "unsupported GS output primitive");
 	}
 	if (!regs.native_ngg && regs.gs_max_vert_out < 3u) {
 		return Reject(error, regs, mesh, "GS emits fewer than one triangle");
 	}
📝 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 (!regs.native_ngg && regs.gs_out_prim_type != 2u) {
		return Reject(error, regs, mesh, "unsupported GS output primitive");
	}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180741) **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash # Check how native_ngg and gs_out_prim_type reach ShaderBuildGsAssembly, and whether the mesh lowering emits non-triangle output. rg -n -C4 'native_ngg' --type=cpp rg -n -C3 'gs_out_prim_type|m_vgtGsOutPrimType' --type=cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 15917 --- </details> **Confirm whether native NGG draws should skip the GS output-primitive check.** The native NGG path does not use the GS output registers. The current check can reject native NGG point and line draws because `VGT_GS_OUT_PRIM_TYPE` is derived from the draw primitive, while the lowering uses the input primitive to calculate native NGG workgroup counts. <details> <summary>🔧 Suggested fix</summary> ```diff --- "a/src/graphics/shader/shaderGsAssembly.cpp" +++ "b/src/graphics/shader/shaderGsAssembly.cpp" @@ -68,9 +68,9 @@ primitive != Prospero::PrimitiveType::kTriList) { return Reject(error, regs, mesh, "unsupported GS input primitive"); } - if (regs.gs_out_prim_type != 2u) { + if (!regs.native_ngg && regs.gs_out_prim_type != 2u) { return Reject(error, regs, mesh, "unsupported GS output primitive"); } if (!regs.native_ngg && regs.gs_max_vert_out < 3u) { return Reject(error, regs, mesh, "GS emits fewer than one triangle"); } ``` </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 (!regs.native_ngg && regs.gs_out_prim_type != 2u) { return Reject(error, regs, mesh, "unsupported GS output primitive"); } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:5eba300552b453d151d240b7 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-13 23:32 UTC · original
On tests/MemoryTrackerTests.cpp line 1317 (outdated):

@@ -1109,6 +1112,373 @@ void CheckDeathCase(const char *name) {
 #endif
 }
 
+// ---------------------------------------------------------------------------------------------
+// The BDA synchronise set.
+//
+// PrepareBda used to rediscover, on every DMA draw and every DMA dispatch, which mapped bytes
+// needed uploading, by walking every mapped range. It now drains a set that is appended where
+// memory actually changes hands. The only thing that makes that sound is that the set is a
+// superset of everything a full walk would have uploaded, so the cases below pin:
+//
+//   * every range a FULL walk uploads was in the set an incremental walk would have drained;
+//   * two worlds driven through the same mutations, one walked fully and one walked
+//     incrementally, upload the same bytes and end in the same ownership.
+//
+// The two worlds live at two base addresses in one tracker: the set is keyed by address, so
+// filtering the drained set by each world's mapped ranges separates them.
+// ---------------------------------------------------------------------------------------------
+
+constexpr uint64_t kBdaBlockSize = Libs::Graphics::TRACKER_REGION_SIZE * 3;
+constexpr uint64_t kBdaBaseFull = 0x0000000210000000ull;
+constexpr uint64_t kBdaBaseIncremental = 0x0000000220000000ull;
+
+struct BdaWorld {
+  MemoryTracker *tracker = nullptr;
+  uint64_t base = 0;
+  std::map<uint64_t, uint64_t> buffers;
+  RangeSet mapped;
+  RangeSet uploaded;
+};
+
+// The shape of BufferCache::SynchronizeBuffersInRange with the Vulkan half removed: the same
+// std::map walk, the same clamp, the same ForEachUploadRange call.
+void BdaSynchronizeBuffersInRange(BdaWorld &world, uint64_t vaddr, uint64_t size) {
+  const auto end = vaddr + size;
+  auto it = world.buffers.upper_bound(vaddr);
+  if (it != world.buffers.begin()) {
+    --it;
+  }
+  for (; it != world.buffers.end() && it->first < end; ++it) {
+    const auto start = std::max(it->first, vaddr);
+    const auto finish = std::min(it->first + it->second, end);
+    if (start >= finish) {
+      continue;
+    }
+    auto *uploaded = &world.uploaded;
+    world.tracker->ForEachUploadRange(
+        start, finish - start, false,
+        [uploaded](uint64_t address, uint64_t bytes) noexcept {
+          uploaded->Add(address, bytes);
+        },
+        []() noexcept {});
+  }
+}
+
+// BufferCache::CreateBuffer: overlapping buffers are absorbed into one spanning their union, so
+// a single register can unregister several. Both halves of ChangeRegister queue.
+void BdaRegisterBuffer(BdaWorld &world, uint64_t address, uint64_t size) {
+  uint64_t begin = address;
+  uint64_t end = address + size;
+  for (bool changed = true; changed;) {
+    changed = false;
+    auto it = world.buffers.lower_bound(begin);
+    if (it != world.buffers.begin() &&
+        std::prev(it)->first + std::prev(it)->second > begin) {
+      --it;
+    }
+    while (it != world.buffers.end() && it->first < end) {
+      const auto overlap_begin = it->first;
+      const auto overlap_end = it->first + it->second;
+      if (overlap_begin < begin || overlap_end > end) {
+        changed = true;
+      }
+      begin = std::min(begin, overlap_begin);
+      end = std::max(end, overlap_end);
+      it = world.buffers.erase(it);
+      world.tracker->QueueBdaSync(overlap_begin, overlap_end - overlap_begin);
+    }
+  }
+  world.buffers.emplace(begin, end - begin);
+  world.tracker->QueueBdaSync(begin, end - begin);
+}
+
+// BufferCache::RunGarbageCollector: drop GPU ownership, untrack, unregister.
+void BdaUnregisterBuffer(BdaWorld &world, uint64_t address) {
+  auto it = world.buffers.upper_bound(address);
+  if (it == world.buffers.begin()) {
+    return;
+  }
+  --it;
+  if (it->first + it->second <= address) {
+    return;
+  }
+  const auto begin = it->first;
+  const auto size = it->second;
+  world.buffers.erase(it);
+  world.tracker->UnmarkRegionAsGpuModified(begin, size);
+  world.tracker->UntrackMemory(begin, size);
+  world.tracker->QueueBdaSync(begin, size);
+}
+
+enum class BdaMutation {
+  Map,        // RenderContext::MapMemory
+  Unmap,      // RenderContext::UnmapMemory
+  Register,   // BufferCache::CreateBuffer -> Register -> ChangeRegister<true>
+  Unregister, // BufferCache::RunGarbageCollector -> UntrackMemory + Unregister
+  CpuWrite,   // BufferCache::ReadMemory(is_write = true)
+  GpuWrite,   // MarkBdaStores -> SynchronizeBuffer(is_written = true)
+  Fault,      // RenderContext::HandleFault(Write) -> BufferCache::InvalidateMemory
+};
+
+struct BdaStep {
+  BdaMutation kind;
+  uint64_t offset;
+  uint64_t size;
+  const char *name;
+};
+
+void BdaApply(BdaWorld &world, const BdaStep &step) {
+  const auto address = world.base + step.offset;
+  auto &tracker = *world.tracker;
+  const auto invalidate = [&] {
+    tracker.InvalidateRegion(address, step.size, [&] {
+      tracker.ForEachDownloadRange<true>(address, step.size,
+                                         [](uint64_t, uint64_t) noexcept {});
+      tracker.MarkRegionAsCpuModified(address, step.size);
+    });
+  };
+  switch (step.kind) {
+  case BdaMutation::Map:
+    world.mapped.Add(address, step.size);
+    tracker.QueueBdaSync(address, step.size);
+    break;
+  case BdaMutation::Unmap:
+    invalidate();
+    world.mapped.Subtract(address, step.size);
+    tracker.DropBdaSync(address, step.size);
+    break;
+  case BdaMutation::Register:
+    BdaRegisterBuffer(world, address, step.size);
+    break;
+  case BdaMutation::Unregister:
+    BdaUnregisterBuffer(world, address);
+    break;
+  case BdaMutation::CpuWrite:
+    tracker.ForEachDownloadRange<true>(address, step.size,
+                                       [](uint64_t, uint64_t) noexcept {});
+    tracker.MarkRegionAsCpuModified(address, step.size);
+    break;
+  case BdaMutation::GpuWrite:
+    tracker.ForEachUploadRange(address, step.size, true,
+                               [](uint64_t, uint64_t) noexcept {},
+                               []() noexcept {});
+    break;
+  case BdaMutation::Fault:
+    invalidate();
+    break;
+  }
+}
+
+std::vector<std::pair<uint64_t, uint64_t>> BdaNormalize(const RangeSet &set,
+                                                        uint64_t base) {
+  std::vector<std::pair<uint64_t, uint64_t>> out;
+  set.ForEach([&](uint64_t begin, uint64_t end) {
+    out.emplace_back(begin - base, end - base);
+  });
+  return out;
+}
+
+// The CPU/GPU ownership of every tracker page a shader could reach through a raw pointer: the
+// pages that are both mapped and covered by a buffer. Confined to those so the probe cannot
+// create a region and change what it is measuring.
+std::vector<std::pair<uint64_t, uint32_t>> BdaOwnership(BdaWorld &world) {
+  constexpr auto page = Libs::Graphics::TRACKER_PAGE_SIZE;
+  std::vector<std::pair<uint64_t, uint32_t>> out;
+  for (const auto &entry : world.buffers) {
+    world.mapped.ForEachInRange(
+        entry.first, entry.second, [&](uint64_t begin, uint64_t end) {
+          for (auto probe = begin & ~(page - 1); probe < end; probe += page) {
+            const uint32_t state =
+                (world.tracker->IsRegionCpuModified(probe, page) ? 1u : 0u) |
+                (world.tracker->IsRegionGpuModified(probe, page) ? 2u : 0u);
+            out.emplace_back(probe - world.base, state);
+          }
+        });
+  }
+  return out;
+}
+
+void TestBdaSyncSetMatchesFullWalk() {
+  using Libs::Graphics::ForEachBdaSyncRange;
+  using Libs::Graphics::ForEachBdaSyncRangeFull;
+  constexpr uint64_t R = Libs::Graphics::TRACKER_REGION_SIZE;
+  constexpr uint64_t P = Libs::Graphics::TRACKER_PAGE_SIZE;
+
+  TrackerHarness harness;
+  auto *memory_full = static_cast<uint8_t *>(
+      VirtualAlloc(reinterpret_cast<void *>(kBdaBaseFull), kBdaBlockSize,
+                   MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE));
+  Check(memory_full == reinterpret_cast<void *>(kBdaBaseFull),
+        "full-walk world allocation failed");
+  auto *memory_incremental = static_cast<uint8_t *>(
+      VirtualAlloc(reinterpret_cast<void *>(kBdaBaseIncremental), kBdaBlockSize,
+                   MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE));
+  Check(memory_incremental == reinterpret_cast<void *>(kBdaBaseIncremental),
+        "incremental world allocation failed");

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Allocate the BDA test worlds with the existing fixed-address retry helper.

TestBdaSyncSetMatchesFullWalk asks VirtualAlloc for the exact addresses kBdaBaseFull (0x210000000) and kBdaBaseIncremental (0x220000000). There is no retry. If the host already uses either address, the Check fails and the test aborts. The other tests in this file use AllocateFixedGuestRange, and its comment states the reason: a fixed address "can be occupied by the host process (notably by the macOS runner's ASLR layout)".

The two bases do not have to be fixed constants. The test only needs two separate ranges in one tracker. Allocate both ranges with AllocateFixedGuestRange, then use the returned addresses as full.base and incremental.base. Use those bases in the taken.ForEachInRange filters and in the diagnostics in place of the constants.

Proposed fix
--- "a/tests/MemoryTrackerTests.cpp"
+++ "b/tests/MemoryTrackerTests.cpp"
@@ -1305,16 +1305,10 @@
   constexpr uint64_t P = Libs::Graphics::TRACKER_PAGE_SIZE;
 
   TrackerHarness harness;
-  auto *memory_full = static_cast<uint8_t *>(
-      VirtualAlloc(reinterpret_cast<void *>(kBdaBaseFull), kBdaBlockSize,
-                   MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE));
-  Check(memory_full == reinterpret_cast<void *>(kBdaBaseFull),
-        "full-walk world allocation failed");
-  auto *memory_incremental = static_cast<uint8_t *>(
-      VirtualAlloc(reinterpret_cast<void *>(kBdaBaseIncremental), kBdaBlockSize,
-                   MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE));
-  Check(memory_incremental == reinterpret_cast<void *>(kBdaBaseIncremental),
-        "incremental world allocation failed");
+  auto *memory_full = AllocateFixedGuestRange(kBdaBlockSize, 0x10000000);
+  auto *memory_incremental = AllocateFixedGuestRange(kBdaBlockSize, 0x20000000);
+  const auto base_full = reinterpret_cast<uint64_t>(memory_full);
+  const auto base_incremental = reinterpret_cast<uint64_t>(memory_incremental);
 
   BdaWorld full;
   full.tracker = &harness.tracker;
📝 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.

  auto *memory_full = AllocateFixedGuestRange(kBdaBlockSize, 0x10000000);
  auto *memory_incremental = AllocateFixedGuestRange(kBdaBlockSize, 0x20000000);
  const auto base_full = reinterpret_cast<uint64_t>(memory_full);
  const auto base_incremental = reinterpret_cast<uint64_t>(memory_incremental);
**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4265180756) On `tests/MemoryTrackerTests.cpp` line 1317 (outdated): ```diff @@ -1109,6 +1112,373 @@ void CheckDeathCase(const char *name) { #endif } +// --------------------------------------------------------------------------------------------- +// The BDA synchronise set. +// +// PrepareBda used to rediscover, on every DMA draw and every DMA dispatch, which mapped bytes +// needed uploading, by walking every mapped range. It now drains a set that is appended where +// memory actually changes hands. The only thing that makes that sound is that the set is a +// superset of everything a full walk would have uploaded, so the cases below pin: +// +// * every range a FULL walk uploads was in the set an incremental walk would have drained; +// * two worlds driven through the same mutations, one walked fully and one walked +// incrementally, upload the same bytes and end in the same ownership. +// +// The two worlds live at two base addresses in one tracker: the set is keyed by address, so +// filtering the drained set by each world's mapped ranges separates them. +// --------------------------------------------------------------------------------------------- + +constexpr uint64_t kBdaBlockSize = Libs::Graphics::TRACKER_REGION_SIZE * 3; +constexpr uint64_t kBdaBaseFull = 0x0000000210000000ull; +constexpr uint64_t kBdaBaseIncremental = 0x0000000220000000ull; + +struct BdaWorld { + MemoryTracker *tracker = nullptr; + uint64_t base = 0; + std::map<uint64_t, uint64_t> buffers; + RangeSet mapped; + RangeSet uploaded; +}; + +// The shape of BufferCache::SynchronizeBuffersInRange with the Vulkan half removed: the same +// std::map walk, the same clamp, the same ForEachUploadRange call. +void BdaSynchronizeBuffersInRange(BdaWorld &world, uint64_t vaddr, uint64_t size) { + const auto end = vaddr + size; + auto it = world.buffers.upper_bound(vaddr); + if (it != world.buffers.begin()) { + --it; + } + for (; it != world.buffers.end() && it->first < end; ++it) { + const auto start = std::max(it->first, vaddr); + const auto finish = std::min(it->first + it->second, end); + if (start >= finish) { + continue; + } + auto *uploaded = &world.uploaded; + world.tracker->ForEachUploadRange( + start, finish - start, false, + [uploaded](uint64_t address, uint64_t bytes) noexcept { + uploaded->Add(address, bytes); + }, + []() noexcept {}); + } +} + +// BufferCache::CreateBuffer: overlapping buffers are absorbed into one spanning their union, so +// a single register can unregister several. Both halves of ChangeRegister queue. +void BdaRegisterBuffer(BdaWorld &world, uint64_t address, uint64_t size) { + uint64_t begin = address; + uint64_t end = address + size; + for (bool changed = true; changed;) { + changed = false; + auto it = world.buffers.lower_bound(begin); + if (it != world.buffers.begin() && + std::prev(it)->first + std::prev(it)->second > begin) { + --it; + } + while (it != world.buffers.end() && it->first < end) { + const auto overlap_begin = it->first; + const auto overlap_end = it->first + it->second; + if (overlap_begin < begin || overlap_end > end) { + changed = true; + } + begin = std::min(begin, overlap_begin); + end = std::max(end, overlap_end); + it = world.buffers.erase(it); + world.tracker->QueueBdaSync(overlap_begin, overlap_end - overlap_begin); + } + } + world.buffers.emplace(begin, end - begin); + world.tracker->QueueBdaSync(begin, end - begin); +} + +// BufferCache::RunGarbageCollector: drop GPU ownership, untrack, unregister. +void BdaUnregisterBuffer(BdaWorld &world, uint64_t address) { + auto it = world.buffers.upper_bound(address); + if (it == world.buffers.begin()) { + return; + } + --it; + if (it->first + it->second <= address) { + return; + } + const auto begin = it->first; + const auto size = it->second; + world.buffers.erase(it); + world.tracker->UnmarkRegionAsGpuModified(begin, size); + world.tracker->UntrackMemory(begin, size); + world.tracker->QueueBdaSync(begin, size); +} + +enum class BdaMutation { + Map, // RenderContext::MapMemory + Unmap, // RenderContext::UnmapMemory + Register, // BufferCache::CreateBuffer -> Register -> ChangeRegister<true> + Unregister, // BufferCache::RunGarbageCollector -> UntrackMemory + Unregister + CpuWrite, // BufferCache::ReadMemory(is_write = true) + GpuWrite, // MarkBdaStores -> SynchronizeBuffer(is_written = true) + Fault, // RenderContext::HandleFault(Write) -> BufferCache::InvalidateMemory +}; + +struct BdaStep { + BdaMutation kind; + uint64_t offset; + uint64_t size; + const char *name; +}; + +void BdaApply(BdaWorld &world, const BdaStep &step) { + const auto address = world.base + step.offset; + auto &tracker = *world.tracker; + const auto invalidate = [&] { + tracker.InvalidateRegion(address, step.size, [&] { + tracker.ForEachDownloadRange<true>(address, step.size, + [](uint64_t, uint64_t) noexcept {}); + tracker.MarkRegionAsCpuModified(address, step.size); + }); + }; + switch (step.kind) { + case BdaMutation::Map: + world.mapped.Add(address, step.size); + tracker.QueueBdaSync(address, step.size); + break; + case BdaMutation::Unmap: + invalidate(); + world.mapped.Subtract(address, step.size); + tracker.DropBdaSync(address, step.size); + break; + case BdaMutation::Register: + BdaRegisterBuffer(world, address, step.size); + break; + case BdaMutation::Unregister: + BdaUnregisterBuffer(world, address); + break; + case BdaMutation::CpuWrite: + tracker.ForEachDownloadRange<true>(address, step.size, + [](uint64_t, uint64_t) noexcept {}); + tracker.MarkRegionAsCpuModified(address, step.size); + break; + case BdaMutation::GpuWrite: + tracker.ForEachUploadRange(address, step.size, true, + [](uint64_t, uint64_t) noexcept {}, + []() noexcept {}); + break; + case BdaMutation::Fault: + invalidate(); + break; + } +} + +std::vector<std::pair<uint64_t, uint64_t>> BdaNormalize(const RangeSet &set, + uint64_t base) { + std::vector<std::pair<uint64_t, uint64_t>> out; + set.ForEach([&](uint64_t begin, uint64_t end) { + out.emplace_back(begin - base, end - base); + }); + return out; +} + +// The CPU/GPU ownership of every tracker page a shader could reach through a raw pointer: the +// pages that are both mapped and covered by a buffer. Confined to those so the probe cannot +// create a region and change what it is measuring. +std::vector<std::pair<uint64_t, uint32_t>> BdaOwnership(BdaWorld &world) { + constexpr auto page = Libs::Graphics::TRACKER_PAGE_SIZE; + std::vector<std::pair<uint64_t, uint32_t>> out; + for (const auto &entry : world.buffers) { + world.mapped.ForEachInRange( + entry.first, entry.second, [&](uint64_t begin, uint64_t end) { + for (auto probe = begin & ~(page - 1); probe < end; probe += page) { + const uint32_t state = + (world.tracker->IsRegionCpuModified(probe, page) ? 1u : 0u) | + (world.tracker->IsRegionGpuModified(probe, page) ? 2u : 0u); + out.emplace_back(probe - world.base, state); + } + }); + } + return out; +} + +void TestBdaSyncSetMatchesFullWalk() { + using Libs::Graphics::ForEachBdaSyncRange; + using Libs::Graphics::ForEachBdaSyncRangeFull; + constexpr uint64_t R = Libs::Graphics::TRACKER_REGION_SIZE; + constexpr uint64_t P = Libs::Graphics::TRACKER_PAGE_SIZE; + + TrackerHarness harness; + auto *memory_full = static_cast<uint8_t *>( + VirtualAlloc(reinterpret_cast<void *>(kBdaBaseFull), kBdaBlockSize, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)); + Check(memory_full == reinterpret_cast<void *>(kBdaBaseFull), + "full-walk world allocation failed"); + auto *memory_incremental = static_cast<uint8_t *>( + VirtualAlloc(reinterpret_cast<void *>(kBdaBaseIncremental), kBdaBlockSize, + MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)); + Check(memory_incremental == reinterpret_cast<void *>(kBdaBaseIncremental), + "incremental world allocation failed"); ``` **🩺 Stability & Availability** | **🟡 Minor** | **⚡ Quick win** **Allocate the BDA test worlds with the existing fixed-address retry helper.** `TestBdaSyncSetMatchesFullWalk` asks `VirtualAlloc` for the exact addresses `kBdaBaseFull` (`0x210000000`) and `kBdaBaseIncremental` (`0x220000000`). There is no retry. If the host already uses either address, the `Check` fails and the test aborts. The other tests in this file use `AllocateFixedGuestRange`, and its comment states the reason: a fixed address "can be occupied by the host process (notably by the macOS runner's ASLR layout)". The two bases do not have to be fixed constants. The test only needs two separate ranges in one tracker. Allocate both ranges with `AllocateFixedGuestRange`, then use the returned addresses as `full.base` and `incremental.base`. Use those bases in the `taken.ForEachInRange` filters and in the diagnostics in place of the constants. <details> <summary>Proposed fix</summary> ```diff --- "a/tests/MemoryTrackerTests.cpp" +++ "b/tests/MemoryTrackerTests.cpp" @@ -1305,16 +1305,10 @@ constexpr uint64_t P = Libs::Graphics::TRACKER_PAGE_SIZE; TrackerHarness harness; - auto *memory_full = static_cast<uint8_t *>( - VirtualAlloc(reinterpret_cast<void *>(kBdaBaseFull), kBdaBlockSize, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)); - Check(memory_full == reinterpret_cast<void *>(kBdaBaseFull), - "full-walk world allocation failed"); - auto *memory_incremental = static_cast<uint8_t *>( - VirtualAlloc(reinterpret_cast<void *>(kBdaBaseIncremental), kBdaBlockSize, - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE)); - Check(memory_incremental == reinterpret_cast<void *>(kBdaBaseIncremental), - "incremental world allocation failed"); + auto *memory_full = AllocateFixedGuestRange(kBdaBlockSize, 0x10000000); + auto *memory_incremental = AllocateFixedGuestRange(kBdaBlockSize, 0x20000000); + const auto base_full = reinterpret_cast<uint64_t>(memory_full); + const auto base_incremental = reinterpret_cast<uint64_t>(memory_incremental); BdaWorld full; full.tracker = &harness.tracker; ``` </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 auto *memory_full = AllocateFixedGuestRange(kBdaBlockSize, 0x10000000); auto *memory_incremental = AllocateFixedGuestRange(kBdaBlockSize, 0x20000000); const auto base_full = reinterpret_cast<uint64_t>(memory_full); const auto base_incremental = reinterpret_cast<uint64_t>(memory_incremental); ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:d8389c3844ad7bc68b422a49 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

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

Actionable comments posted: 12


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 22ca055a-2cd0-424c-b6d8-398d35eff4f0
📥 Commits

Reviewing files that changed from the base of the PR and between 9e41d8320a and d4cd928e991f7c0771bc648e0982c2fb2a8afeaf.

📒 Files selected for processing: 213
  • .github/workflows/build.yml
  • CMakeLists.txt
  • src/common/assert.cpp
  • src/common/emulatorConfig.cpp
  • src/common/emulatorConfig.h
  • src/common/profiler.cpp
  • src/common/profiler.h
  • src/common/subsystems.cpp
  • src/common/threads.cpp
  • src/common/threads.h
  • 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/graphicsRun.h
  • src/graphics/guest_gpu/hardwareContext.h
  • src/graphics/guest_gpu/pm4.h
  • src/graphics/guest_gpu/tile.cpp
  • src/graphics/host_gpu/bdaSyncSet.h
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/memoryHeadroom.h
  • src/graphics/host_gpu/memoryTracker.cpp
  • src/graphics/host_gpu/memoryTracker.h
  • src/graphics/host_gpu/pageManager.cpp
  • src/graphics/host_gpu/pageManager.h
  • src/graphics/host_gpu/renderer/bindingEpoch.h
  • src/graphics/host_gpu/renderer/cache/bindlessTranslation.cpp
  • src/graphics/host_gpu/renderer/cache/bindlessTranslation.h
  • src/graphics/host_gpu/renderer/cache/bufferCache.cpp
  • src/graphics/host_gpu/renderer/cache/bufferCache.h
  • src/graphics/host_gpu/renderer/cache/faultManager.cpp
  • src/graphics/host_gpu/renderer/cache/faultManager.h
  • src/graphics/host_gpu/renderer/cache/indirectKeyFeedback.cpp
  • src/graphics/host_gpu/renderer/cache/indirectKeyFeedback.h
  • src/graphics/host_gpu/renderer/cache/pageDiff.cpp
  • src/graphics/host_gpu/renderer/cache/pageDiff.h
  • src/graphics/host_gpu/renderer/cache/streamBuffer.cpp
  • src/graphics/host_gpu/renderer/cache/streamBuffer.h
  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • src/graphics/host_gpu/renderer/cache/textureCache.h
  • src/graphics/host_gpu/renderer/commandScheduler.cpp
  • src/graphics/host_gpu/renderer/commandScheduler.h
  • src/graphics/host_gpu/renderer/context.cpp
  • src/graphics/host_gpu/renderer/debug.cpp
  • src/graphics/host_gpu/renderer/depthRenderTarget.cpp
  • src/graphics/host_gpu/renderer/depthRenderTarget.h
  • src/graphics/host_gpu/renderer/dispatchGuard.h
  • src/graphics/host_gpu/renderer/dispatchHazard.h
  • src/graphics/host_gpu/renderer/image/blitHelper.cpp
  • src/graphics/host_gpu/renderer/image/colorClearHelper.cpp
  • src/graphics/host_gpu/renderer/image/colorClearHelper.h
  • src/graphics/host_gpu/renderer/image/image.cpp
  • src/graphics/host_gpu/renderer/image/image.h
  • src/graphics/host_gpu/renderer/image/imageInfo.cpp
  • src/graphics/host_gpu/renderer/image/imageInfo.h
  • src/graphics/host_gpu/renderer/image/imageView.cpp
  • src/graphics/host_gpu/renderer/image/imageView.h
  • src/graphics/host_gpu/renderer/image/textureCommon.cpp
  • src/graphics/host_gpu/renderer/image/textureCommon.h
  • src/graphics/host_gpu/renderer/image/tiler.cpp
  • src/graphics/host_gpu/renderer/image/tiler.h
  • src/graphics/host_gpu/renderer/masterSemaphore.cpp
  • src/graphics/host_gpu/renderer/pipeline/bindlessImageHeap.cpp
  • src/graphics/host_gpu/renderer/pipeline/bindlessImageHeap.h
  • src/graphics/host_gpu/renderer/pipeline/descriptorHeap.cpp
  • src/graphics/host_gpu/renderer/pipeline/descriptors.cpp
  • src/graphics/host_gpu/renderer/pipeline/descriptors.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.h
  • src/graphics/host_gpu/renderer/pipeline/shaderReadCache.h
  • src/graphics/host_gpu/renderer/pipeline/shaderResourceBarrier.cpp
  • src/graphics/host_gpu/renderer/pipeline/shaderResourceBarrier.h
  • src/graphics/host_gpu/renderer/pipeline/shaders.cpp
  • src/graphics/host_gpu/renderer/pipeline/unfoldableSet.h
  • src/graphics/host_gpu/renderer/refusalReport.h
  • src/graphics/host_gpu/renderer/render.h
  • src/graphics/host_gpu/renderer/renderCompute.cpp
  • src/graphics/host_gpu/renderer/renderContext.cpp
  • src/graphics/host_gpu/renderer/renderContext.h
  • src/graphics/host_gpu/renderer/renderDraw.cpp
  • src/graphics/host_gpu/renderer/renderTarget.h
  • src/graphics/host_gpu/renderer/threadDispatch.cpp
  • src/graphics/host_gpu/renderer/threadDispatch.h
  • src/graphics/host_gpu/shaders/fault_buffer_process.comp
  • src/graphics/host_gpu/shaders/gpu_color_clear.frag
  • src/graphics/host_gpu/shaders/gpu_color_clear_classify.comp
  • src/graphics/host_gpu/shaders/gpu_color_clear_sint.frag
  • src/graphics/host_gpu/shaders/gpu_color_clear_uint.frag
  • src/graphics/host_gpu/shaders/gpu_dispatch_threads.comp
  • src/graphics/host_gpu/shaders/gpu_page_diff.comp
  • src/graphics/host_gpu/vma.cpp
  • src/graphics/presentation/renderDoc.cpp
  • src/graphics/presentation/systemOverlay.cpp
  • src/graphics/presentation/videoOut.cpp
  • src/graphics/presentation/window/swapchain.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.h
  • src/graphics/shader/recompiler/Tessellation.cpp
  • src/graphics/shader/recompiler/Tessellation.h
  • src/graphics/shader/recompiler/backend/spirv/SpirvDriverSimplify.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvDriverSimplify.h
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterAnalysis.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.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/spirvEmitterMesh.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterTessellation.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.h
  • src/graphics/shader/recompiler/frontend/decode/ImageOps.cpp
  • src/graphics/shader/recompiler/frontend/decode/ImageOps.h
  • src/graphics/shader/recompiler/frontend/decode/MemoryOps.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/decode/VectorAluOps.cpp
  • src/graphics/shader/recompiler/frontend/translate/Control.cpp
  • src/graphics/shader/recompiler/frontend/translate/Integer.cpp
  • src/graphics/shader/recompiler/frontend/translate/Memory.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/Program.cpp
  • src/graphics/shader/recompiler/ir/ResourceSnapshot.h
  • src/graphics/shader/recompiler/ir/ShaderIR.h
  • src/graphics/shader/recompiler/ir/Value.cpp
  • src/graphics/shader/recompiler/ir/Value.h
  • src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.cpp
  • src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc
  • src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp
  • src/graphics/shader/recompiler/ir/passes/DeadLaneMasks.cpp
  • src/graphics/shader/recompiler/ir/passes/DeadLaneMasks.h
  • src/graphics/shader/recompiler/ir/passes/IndexRangeFold.cpp
  • src/graphics/shader/recompiler/ir/passes/IndexRangeFold.h
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.h
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.h
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceTracking.h
  • 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/rectListShader.cpp
  • src/graphics/shader/shader.cpp
  • src/graphics/shader/shader.h
  • src/graphics/shader/shaderGsAssembly.cpp
  • src/graphics/shader/shaderGsAssembly.h
  • src/graphics/shader/shaderPixelParameter.cpp
  • src/kernel/eventFlag.cpp
  • src/kernel/eventQueue.cpp
  • src/kernel/fileSystem.cpp
  • src/kernel/memory.cpp
  • src/kernel/memory.h
  • src/kernel/memoryAddressSpace.inc
  • src/kernel/pthread.cpp
  • src/kernel/semaphore.cpp
  • src/kernel/umtx.cpp
  • src/kernel/umtx.h
  • src/libs/agc.cpp
  • src/libs/ajm.cpp
  • src/libs/ajm/atrac9_decoder.h
  • src/libs/audio.cpp
  • src/libs/audio.h
  • src/libs/audio_internal.h
  • src/libs/dialog.cpp
  • src/libs/dialog.h
  • src/libs/dualSenseHaptics.h
  • src/libs/libAmpr.cpp
  • src/libs/libAudio.cpp
  • src/libs/libAudio2.cpp
  • src/libs/libConvertKeycode.cpp
  • src/libs/libDebug.cpp
  • src/libs/libKernel.cpp
  • src/libs/libNet.cpp
  • src/libs/libSaveData.cpp
  • src/libs/libVideoOut.cpp
  • src/loader/guestInstructionPatcher.cpp
  • src/loader/guestInstructionPatcher.h
  • src/loader/runtimeLinker.cpp
  • src/main.cpp
  • tests/AjmInstanceTests.cpp
  • tests/AudioOut2PortTests.cpp
  • tests/AudioOutTimingTests.cpp
  • tests/KernelFileSystemTests.cpp
  • tests/MemoryTrackerTests.cpp
  • tests/Ngs2SamplerTests.cpp
  • tests/PageManagerTests.cpp
  • tests/ResourceMaterializationTests.cpp
  • tests/ResourceTrackingTests.cpp
  • tests/SaveDataDialogTests.cpp
  • tests/SaveDataMemoryTests.cpp
  • tests/ScalarProvenanceTests.cpp
  • tests/ShaderRayTracingGpuTests.inc
  • tests/ShaderRayTracingTests.inc
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/ShaderVertexMetadataTests.cpp
  • tests/UmtxTests.cpp
  • tests/UnfoldableRebuildTests.cpp
  • tests/UnresolvedImportRegistrationTests.cpp
  • tests/VirtualMemoryAllocationTests.cpp
  • tests/VramHeadroomTests.cpp
  • tests/shaderCfgTests.cpp
💤 Files with no reviewable changes: 1
  • src/graphics/shader/recompiler/ir/Value.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#pullrequestreview-5511300796) · **reviewed** **Actionable comments posted: 12** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `22ca055a-2cd0-424c-b6d8-398d35eff4f0` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 9e41d8320a2774b303fbad344c2347e8d0292e83 and d4cd928e991f7c0771bc648e0982c2fb2a8afeaf. </details> <details> <summary>📒 Files selected for processing: 213</summary> * `.github/workflows/build.yml` * `CMakeLists.txt` * `src/common/assert.cpp` * `src/common/emulatorConfig.cpp` * `src/common/emulatorConfig.h` * `src/common/profiler.cpp` * `src/common/profiler.h` * `src/common/subsystems.cpp` * `src/common/threads.cpp` * `src/common/threads.h` * `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/graphicsRun.h` * `src/graphics/guest_gpu/hardwareContext.h` * `src/graphics/guest_gpu/pm4.h` * `src/graphics/guest_gpu/tile.cpp` * `src/graphics/host_gpu/bdaSyncSet.h` * `src/graphics/host_gpu/graphicContext.h` * `src/graphics/host_gpu/memoryHeadroom.h` * `src/graphics/host_gpu/memoryTracker.cpp` * `src/graphics/host_gpu/memoryTracker.h` * `src/graphics/host_gpu/pageManager.cpp` * `src/graphics/host_gpu/pageManager.h` * `src/graphics/host_gpu/renderer/bindingEpoch.h` * `src/graphics/host_gpu/renderer/cache/bindlessTranslation.cpp` * `src/graphics/host_gpu/renderer/cache/bindlessTranslation.h` * `src/graphics/host_gpu/renderer/cache/bufferCache.cpp` * `src/graphics/host_gpu/renderer/cache/bufferCache.h` * `src/graphics/host_gpu/renderer/cache/faultManager.cpp` * `src/graphics/host_gpu/renderer/cache/faultManager.h` * `src/graphics/host_gpu/renderer/cache/indirectKeyFeedback.cpp` * `src/graphics/host_gpu/renderer/cache/indirectKeyFeedback.h` * `src/graphics/host_gpu/renderer/cache/pageDiff.cpp` * `src/graphics/host_gpu/renderer/cache/pageDiff.h` * `src/graphics/host_gpu/renderer/cache/streamBuffer.cpp` * `src/graphics/host_gpu/renderer/cache/streamBuffer.h` * `src/graphics/host_gpu/renderer/cache/textureCache.cpp` * `src/graphics/host_gpu/renderer/cache/textureCache.h` * `src/graphics/host_gpu/renderer/commandScheduler.cpp` * `src/graphics/host_gpu/renderer/commandScheduler.h` * `src/graphics/host_gpu/renderer/context.cpp` * `src/graphics/host_gpu/renderer/debug.cpp` * `src/graphics/host_gpu/renderer/depthRenderTarget.cpp` * `src/graphics/host_gpu/renderer/depthRenderTarget.h` * `src/graphics/host_gpu/renderer/dispatchGuard.h` * `src/graphics/host_gpu/renderer/dispatchHazard.h` * `src/graphics/host_gpu/renderer/image/blitHelper.cpp` * `src/graphics/host_gpu/renderer/image/colorClearHelper.cpp` * `src/graphics/host_gpu/renderer/image/colorClearHelper.h` * `src/graphics/host_gpu/renderer/image/image.cpp` * `src/graphics/host_gpu/renderer/image/image.h` * `src/graphics/host_gpu/renderer/image/imageInfo.cpp` * `src/graphics/host_gpu/renderer/image/imageInfo.h` * `src/graphics/host_gpu/renderer/image/imageView.cpp` * `src/graphics/host_gpu/renderer/image/imageView.h` * `src/graphics/host_gpu/renderer/image/textureCommon.cpp` * `src/graphics/host_gpu/renderer/image/textureCommon.h` * `src/graphics/host_gpu/renderer/image/tiler.cpp` * `src/graphics/host_gpu/renderer/image/tiler.h` * `src/graphics/host_gpu/renderer/masterSemaphore.cpp` * `src/graphics/host_gpu/renderer/pipeline/bindlessImageHeap.cpp` * `src/graphics/host_gpu/renderer/pipeline/bindlessImageHeap.h` * `src/graphics/host_gpu/renderer/pipeline/descriptorHeap.cpp` * `src/graphics/host_gpu/renderer/pipeline/descriptors.cpp` * `src/graphics/host_gpu/renderer/pipeline/descriptors.h` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp` * `src/graphics/host_gpu/renderer/pipeline/pipelineCache.h` * `src/graphics/host_gpu/renderer/pipeline/shaderReadCache.h` * `src/graphics/host_gpu/renderer/pipeline/shaderResourceBarrier.cpp` * `src/graphics/host_gpu/renderer/pipeline/shaderResourceBarrier.h` * `src/graphics/host_gpu/renderer/pipeline/shaders.cpp` * `src/graphics/host_gpu/renderer/pipeline/unfoldableSet.h` * `src/graphics/host_gpu/renderer/refusalReport.h` * `src/graphics/host_gpu/renderer/render.h` * `src/graphics/host_gpu/renderer/renderCompute.cpp` * `src/graphics/host_gpu/renderer/renderContext.cpp` * `src/graphics/host_gpu/renderer/renderContext.h` * `src/graphics/host_gpu/renderer/renderDraw.cpp` * `src/graphics/host_gpu/renderer/renderTarget.h` * `src/graphics/host_gpu/renderer/threadDispatch.cpp` * `src/graphics/host_gpu/renderer/threadDispatch.h` * `src/graphics/host_gpu/shaders/fault_buffer_process.comp` * `src/graphics/host_gpu/shaders/gpu_color_clear.frag` * `src/graphics/host_gpu/shaders/gpu_color_clear_classify.comp` * `src/graphics/host_gpu/shaders/gpu_color_clear_sint.frag` * `src/graphics/host_gpu/shaders/gpu_color_clear_uint.frag` * `src/graphics/host_gpu/shaders/gpu_dispatch_threads.comp` * `src/graphics/host_gpu/shaders/gpu_page_diff.comp` * `src/graphics/host_gpu/vma.cpp` * `src/graphics/presentation/renderDoc.cpp` * `src/graphics/presentation/systemOverlay.cpp` * `src/graphics/presentation/videoOut.cpp` * `src/graphics/presentation/window/swapchain.cpp` * `src/graphics/presentation/window/vulkanWindow.cpp` * `src/graphics/shader/recompiler/ShaderRecompiler.cpp` * `src/graphics/shader/recompiler/ShaderRecompiler.h` * `src/graphics/shader/recompiler/Tessellation.cpp` * `src/graphics/shader/recompiler/Tessellation.h` * `src/graphics/shader/recompiler/backend/spirv/SpirvDriverSimplify.cpp` * `src/graphics/shader/recompiler/backend/spirv/SpirvDriverSimplify.h` * `src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp` * `src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.h` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterAlu.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterAluHelpers.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterAnalysis.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.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/spirvEmitterMesh.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp` * `src/graphics/shader/recompiler/backend/spirv/spirvEmitterTessellation.cpp` * `src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp` * `src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.h` * `src/graphics/shader/recompiler/frontend/decode/ImageOps.cpp` * `src/graphics/shader/recompiler/frontend/decode/ImageOps.h` * `src/graphics/shader/recompiler/frontend/decode/MemoryOps.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/decode/VectorAluOps.cpp` * `src/graphics/shader/recompiler/frontend/translate/Control.cpp` * `src/graphics/shader/recompiler/frontend/translate/Integer.cpp` * `src/graphics/shader/recompiler/frontend/translate/Memory.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/Program.cpp` * `src/graphics/shader/recompiler/ir/ResourceSnapshot.h` * `src/graphics/shader/recompiler/ir/ShaderIR.h` * `src/graphics/shader/recompiler/ir/Value.cpp` * `src/graphics/shader/recompiler/ir/Value.h` * `src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.cpp` * `src/graphics/shader/recompiler/ir/opcodes/ValueOpcodes.inc` * `src/graphics/shader/recompiler/ir/passes/ConstantPropagation.cpp` * `src/graphics/shader/recompiler/ir/passes/DeadLaneMasks.cpp` * `src/graphics/shader/recompiler/ir/passes/DeadLaneMasks.h` * `src/graphics/shader/recompiler/ir/passes/IndexRangeFold.cpp` * `src/graphics/shader/recompiler/ir/passes/IndexRangeFold.h` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterialization.h` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.h` * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceTracking.h` * `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/rectListShader.cpp` * `src/graphics/shader/shader.cpp` * `src/graphics/shader/shader.h` * `src/graphics/shader/shaderGsAssembly.cpp` * `src/graphics/shader/shaderGsAssembly.h` * `src/graphics/shader/shaderPixelParameter.cpp` * `src/kernel/eventFlag.cpp` * `src/kernel/eventQueue.cpp` * `src/kernel/fileSystem.cpp` * `src/kernel/memory.cpp` * `src/kernel/memory.h` * `src/kernel/memoryAddressSpace.inc` * `src/kernel/pthread.cpp` * `src/kernel/semaphore.cpp` * `src/kernel/umtx.cpp` * `src/kernel/umtx.h` * `src/libs/agc.cpp` * `src/libs/ajm.cpp` * `src/libs/ajm/atrac9_decoder.h` * `src/libs/audio.cpp` * `src/libs/audio.h` * `src/libs/audio_internal.h` * `src/libs/dialog.cpp` * `src/libs/dialog.h` * `src/libs/dualSenseHaptics.h` * `src/libs/libAmpr.cpp` * `src/libs/libAudio.cpp` * `src/libs/libAudio2.cpp` * `src/libs/libConvertKeycode.cpp` * `src/libs/libDebug.cpp` * `src/libs/libKernel.cpp` * `src/libs/libNet.cpp` * `src/libs/libSaveData.cpp` * `src/libs/libVideoOut.cpp` * `src/loader/guestInstructionPatcher.cpp` * `src/loader/guestInstructionPatcher.h` * `src/loader/runtimeLinker.cpp` * `src/main.cpp` * `tests/AjmInstanceTests.cpp` * `tests/AudioOut2PortTests.cpp` * `tests/AudioOutTimingTests.cpp` * `tests/KernelFileSystemTests.cpp` * `tests/MemoryTrackerTests.cpp` * `tests/Ngs2SamplerTests.cpp` * `tests/PageManagerTests.cpp` * `tests/ResourceMaterializationTests.cpp` * `tests/ResourceTrackingTests.cpp` * `tests/SaveDataDialogTests.cpp` * `tests/SaveDataMemoryTests.cpp` * `tests/ScalarProvenanceTests.cpp` * `tests/ShaderRayTracingGpuTests.inc` * `tests/ShaderRayTracingTests.inc` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/ShaderVertexMetadataTests.cpp` * `tests/UmtxTests.cpp` * `tests/UnfoldableRebuildTests.cpp` * `tests/UnresolvedImportRegistrationTests.cpp` * `tests/VirtualMemoryAllocationTests.cpp` * `tests/VramHeadroomTests.cpp` * `tests/shaderCfgTests.cpp` </details> <details> <summary>💤 Files with no reviewable changes: 1</summary> * src/graphics/shader/recompiler/ir/Value.cpp </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=8923c293-34bd-445c-b8d9-66a0b79ebef4 attempt=416c436f-a8ac-4fd8-8004-8ef88688fbf3 batch=1/1 -->
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:32 UTC · original

image Schermafbeelding 2026-10-06 232736 Schermafbeelding 2026-10-07 005340 Schermafbeelding 2026-10-06 220512
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:32 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157423457) <img width="960" height="564" alt="image" src="https://github.com/user-attachments/assets/61df3359-5322-4bfd-8456-c68d5c34bfb1" /> <img width="1279" height="766" alt="Schermafbeelding 2026-10-06 232736" src="https://github.com/user-attachments/assets/c841ba94-ae3c-469c-9363-a9ac259ec90b" /> <img width="1276" height="763" alt="Schermafbeelding 2026-10-07 005340" src="https://github.com/user-attachments/assets/ebcec1e4-8981-4d9d-8f9b-e6bcea2a0643" /> <img width="1280" height="751" alt="Schermafbeelding 2026-10-06 220512" src="https://github.com/user-attachments/assets/1eb3f013-6b6f-4b67-9e5f-d5deac666858" />
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:36 UTC · original

image3 image2 image
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157469311) <img width="1319" height="641" alt="image3" src="https://github.com/user-attachments/assets/c5ca9b4b-2ddf-427c-add5-2702e4ff7d0a" /> <img width="1397" height="641" alt="image2" src="https://github.com/user-attachments/assets/54cf4d1f-c3b8-4355-8cf6-a3f309d9e2fe" /> <img width="1280" height="559" alt="image" src="https://github.com/user-attachments/assets/035b6b56-bea5-4d91-8088-ee5d8c23744a" />
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:40 UTC · original

image Schermafbeelding 2026-10-04 181032 image
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:40 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157518304) <img width="959" height="557" alt="image" src="https://github.com/user-attachments/assets/05a71044-992d-4626-8120-c3a7a51e2969" /> <img width="640" height="383" alt="Schermafbeelding 2026-10-04 181032" src="https://github.com/user-attachments/assets/04c2cdf6-8176-43ed-96b3-15cbc4f0232a" /> <img width="958" height="568" alt="image" src="https://github.com/user-attachments/assets/3cbf2184-5f72-4761-bd97-7f3ef549f1e3" />
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:42 UTC · original

image image image
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157542370) <img width="1921" height="1105" alt="image" src="https://github.com/user-attachments/assets/0cd93e60-17a6-4415-bea0-08aa3437edce" /> <img width="1920" height="1123" alt="image" src="https://github.com/user-attachments/assets/f7d7761a-5dc1-4e21-bd74-b9acc1fa8e66" /> <img width="1936" height="1128" alt="image" src="https://github.com/user-attachments/assets/d7d718d6-8210-4f9d-a9c8-79c81af2831c" />
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-13 23:42 UTC · original

image image image image
**@⁠shadowbeat070** on GitHub · 2026-10-13 23:42 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6157549901) <img width="1915" height="1135" alt="image" src="https://github.com/user-attachments/assets/f60232f2-464d-4212-baec-af2abdaf592c" /> <img width="1285" height="760" alt="image" src="https://github.com/user-attachments/assets/6ac68018-3641-4c2c-907a-7973b559b366" /> <img width="1909" height="1119" alt="image" src="https://github.com/user-attachments/assets/bf31045a-6482-4bb4-9393-fc9166f88c68" /> <img width="1927" height="1135" alt="image" src="https://github.com/user-attachments/assets/a0475128-12da-4ac6-9e78-551f774fee16" />
Author
Owner

@⁠JurreBrandsenInfoSupport on GitHub · 2026-10-14 14:00 UTC · original · approved these changes

**@⁠JurreBrandsenInfoSupport** on GitHub · 2026-10-14 14:00 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#pullrequestreview-5519143596) · **approved these changes**
Author
Owner

@⁠fozter on GitHub · 2026-10-14 16:35 UTC · original · edited 2026-10-15 13:15 UTC

Seem to have worked for #1101 aswell
Before/after:

Edit: github.com/KytyPS5/KytyPS5@0643f0754d is what solves it

f01f84f_before_start_game f01f84f_after_start_game
**@⁠fozter** on GitHub · 2026-10-14 16:35 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6173267140) · edited 2026-10-15 13:15 UTC Seem to have worked for #1101 aswell Before/after: Edit: https://github.com/KytyPS5/KytyPS5/commit/0643f0754d7772091176322d0698fffc474c7b50 is what solves it <img width="1264" height="711" alt="f01f84f_before_start_game" src="https://github.com/user-attachments/assets/4affe9ed-0a73-46f6-932a-7911bf40d4db" /> <img width="1265" height="712" alt="f01f84f_after_start_game" src="https://github.com/user-attachments/assets/120ad64d-370c-426c-bd9e-299c2edcdae3" />
Author
Owner

@⁠gandalfthewhite19890404 on GitHub · 2026-10-14 16:36 UTC · original

RE2 PPSA04228 1.000.003 does not booting for me:

--- Guest fault context ---
thread: (host thread)
rax=0000000000000000 rbx=000003b9884257c8 rcx=000003b9886f0948 rdx=0000000000000116
rsi=0000000000000000 rdi=000003b9886f07d0 rbp=000000ffa1b0bbd0 rsp=000000ffa1b0bad0
r8 =000003b9886f0948 r9 =0000000000000040 r10=0000000000000001 r11=000000ffa1b0bab0
r12=000003b9886f2da8 r13=000000ffa1b0c740 r14=000000ffa1b0be48 r15=0000000000000000
code (pc-48 .. pc+48, fault at byte 48):
 41 b8 02 00 00 00 48 8d 4d 80 e8 9e 7e 0d 01 90
 8b 54 24 58 ff c2 48 8b 85 f8 01 00 00 8b 14 90
 49 8b cd e8 75 d7 fd ff 48 8b c8 e8 8d c9 0d 01
 48 8b 48 28 49 89 4d 40 48 8d 48 18 49 89 4d 48
 48 8b 50 30 48 89 95 f0 01 00 00 48 85 d2 74 12
 41 b8 02 00 00 00 48 8d 8d f0 01 00 00 e8 4b 7e
stack:
  000000ffb17381b8 000000ffa1b0bbd0 000003b9884257c8 0000000000000000
  0000000000000000 0000000000000000 0000000000000001 0000000000000001
  000003b9883d3800 0000000000000001 0000000000000040 ffffffff00000004
  000003b988060850 0000000000000000 0000000000000000 000003b9000027af
  0000000000000000 000003b900000006 000000ff00000050 0000000000000006
  000000ffa1b0bdc0 0000000000000001 000003b988073400 0000000000000000
  0000000000000000 000000000000000f 000003b9886f07d0 000003b9886f0808
  000003b9886f2da8 000003b9884b00f8 0000000000000000 0000000000000000
--- Build ---
Source build d4cd928-dirty
--- Error ---
Unhandled host exception: type=1 code=3221225477 pc=0x00007ff87f8ab7b3 access=1 address=0x0000000000000028
 in E:/KytyPS5-ShadowBeat/src/loader/runtimeLinker.cpp:724

using !1495 (commit d4cd928e99)

**@⁠gandalfthewhite19890404** on GitHub · 2026-10-14 16:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6173286595) RE2 PPSA04228 1.000.003 does not booting for me: ``` --- Guest fault context --- thread: (host thread) rax=0000000000000000 rbx=000003b9884257c8 rcx=000003b9886f0948 rdx=0000000000000116 rsi=0000000000000000 rdi=000003b9886f07d0 rbp=000000ffa1b0bbd0 rsp=000000ffa1b0bad0 r8 =000003b9886f0948 r9 =0000000000000040 r10=0000000000000001 r11=000000ffa1b0bab0 r12=000003b9886f2da8 r13=000000ffa1b0c740 r14=000000ffa1b0be48 r15=0000000000000000 code (pc-48 .. pc+48, fault at byte 48): 41 b8 02 00 00 00 48 8d 4d 80 e8 9e 7e 0d 01 90 8b 54 24 58 ff c2 48 8b 85 f8 01 00 00 8b 14 90 49 8b cd e8 75 d7 fd ff 48 8b c8 e8 8d c9 0d 01 48 8b 48 28 49 89 4d 40 48 8d 48 18 49 89 4d 48 48 8b 50 30 48 89 95 f0 01 00 00 48 85 d2 74 12 41 b8 02 00 00 00 48 8d 8d f0 01 00 00 e8 4b 7e stack: 000000ffb17381b8 000000ffa1b0bbd0 000003b9884257c8 0000000000000000 0000000000000000 0000000000000000 0000000000000001 0000000000000001 000003b9883d3800 0000000000000001 0000000000000040 ffffffff00000004 000003b988060850 0000000000000000 0000000000000000 000003b9000027af 0000000000000000 000003b900000006 000000ff00000050 0000000000000006 000000ffa1b0bdc0 0000000000000001 000003b988073400 0000000000000000 0000000000000000 000000000000000f 000003b9886f07d0 000003b9886f0808 000003b9886f2da8 000003b9884b00f8 0000000000000000 0000000000000000 --- Build --- Source build d4cd928-dirty --- Error --- Unhandled host exception: type=1 code=3221225477 pc=0x00007ff87f8ab7b3 access=1 address=0x0000000000000028 in E:/KytyPS5-ShadowBeat/src/loader/runtimeLinker.cpp:724 ``` using https://git.gtahub.st/github/KytyPS5--KytyPS5/pulls/1495/commits/d4cd928e991f7c0771bc648e0982c2fb2a8afeaf
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-14 18:58 UTC · original

RE2 PPSA04228 1.000.003 does not booting for me:

--- Guest fault context ---
thread: (host thread)
rax=0000000000000000 rbx=000003b9884257c8 rcx=000003b9886f0948 rdx=0000000000000116
rsi=0000000000000000 rdi=000003b9886f07d0 rbp=000000ffa1b0bbd0 rsp=000000ffa1b0bad0
r8 =000003b9886f0948 r9 =0000000000000040 r10=0000000000000001 r11=000000ffa1b0bab0
r12=000003b9886f2da8 r13=000000ffa1b0c740 r14=000000ffa1b0be48 r15=0000000000000000
code (pc-48 .. pc+48, fault at byte 48):
 41 b8 02 00 00 00 48 8d 4d 80 e8 9e 7e 0d 01 90
 8b 54 24 58 ff c2 48 8b 85 f8 01 00 00 8b 14 90
 49 8b cd e8 75 d7 fd ff 48 8b c8 e8 8d c9 0d 01
 48 8b 48 28 49 89 4d 40 48 8d 48 18 49 89 4d 48
 48 8b 50 30 48 89 95 f0 01 00 00 48 85 d2 74 12
 41 b8 02 00 00 00 48 8d 8d f0 01 00 00 e8 4b 7e
stack:
  000000ffb17381b8 000000ffa1b0bbd0 000003b9884257c8 0000000000000000
  0000000000000000 0000000000000000 0000000000000001 0000000000000001
  000003b9883d3800 0000000000000001 0000000000000040 ffffffff00000004
  000003b988060850 0000000000000000 0000000000000000 000003b9000027af
  0000000000000000 000003b900000006 000000ff00000050 0000000000000006
  000000ffa1b0bdc0 0000000000000001 000003b988073400 0000000000000000
  0000000000000000 000000000000000f 000003b9886f07d0 000003b9886f0808
  000003b9886f2da8 000003b9884b00f8 0000000000000000 0000000000000000
--- Build ---
Source build d4cd928-dirty
--- Error ---
Unhandled host exception: type=1 code=3221225477 pc=0x00007ff87f8ab7b3 access=1 address=0x0000000000000028
 in E:/KytyPS5-ShadowBeat/src/loader/runtimeLinker.cpp:724

using d4cd928

What hardware are you using?

**@⁠shadowbeat070** on GitHub · 2026-10-14 18:58 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6175990676) > RE2 PPSA04228 1.000.003 does not booting for me: > > ``` > --- Guest fault context --- > thread: (host thread) > rax=0000000000000000 rbx=000003b9884257c8 rcx=000003b9886f0948 rdx=0000000000000116 > rsi=0000000000000000 rdi=000003b9886f07d0 rbp=000000ffa1b0bbd0 rsp=000000ffa1b0bad0 > r8 =000003b9886f0948 r9 =0000000000000040 r10=0000000000000001 r11=000000ffa1b0bab0 > r12=000003b9886f2da8 r13=000000ffa1b0c740 r14=000000ffa1b0be48 r15=0000000000000000 > code (pc-48 .. pc+48, fault at byte 48): > 41 b8 02 00 00 00 48 8d 4d 80 e8 9e 7e 0d 01 90 > 8b 54 24 58 ff c2 48 8b 85 f8 01 00 00 8b 14 90 > 49 8b cd e8 75 d7 fd ff 48 8b c8 e8 8d c9 0d 01 > 48 8b 48 28 49 89 4d 40 48 8d 48 18 49 89 4d 48 > 48 8b 50 30 48 89 95 f0 01 00 00 48 85 d2 74 12 > 41 b8 02 00 00 00 48 8d 8d f0 01 00 00 e8 4b 7e > stack: > 000000ffb17381b8 000000ffa1b0bbd0 000003b9884257c8 0000000000000000 > 0000000000000000 0000000000000000 0000000000000001 0000000000000001 > 000003b9883d3800 0000000000000001 0000000000000040 ffffffff00000004 > 000003b988060850 0000000000000000 0000000000000000 000003b9000027af > 0000000000000000 000003b900000006 000000ff00000050 0000000000000006 > 000000ffa1b0bdc0 0000000000000001 000003b988073400 0000000000000000 > 0000000000000000 000000000000000f 000003b9886f07d0 000003b9886f0808 > 000003b9886f2da8 000003b9884b00f8 0000000000000000 0000000000000000 > --- Build --- > Source build d4cd928-dirty > --- Error --- > Unhandled host exception: type=1 code=3221225477 pc=0x00007ff87f8ab7b3 access=1 address=0x0000000000000028 > in E:/KytyPS5-ShadowBeat/src/loader/runtimeLinker.cpp:724 > ``` > > using [d4cd928](https://github.com/KytyPS5/KytyPS5/commit/d4cd928e991f7c0771bc648e0982c2fb2a8afeaf) What hardware are you using?
Author
Owner

@⁠gandalfthewhite19890404 on GitHub · 2026-10-14 19:05 UTC · original

What hardware are you using?

Intel 10400, NVIDIA 2070

**@⁠gandalfthewhite19890404** on GitHub · 2026-10-14 19:05 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6176132571) > What hardware are you using? Intel 10400, NVIDIA 2070
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-14 19:27 UTC · original

What hardware are you using?

Intel 10400, NVIDIA 2070

what are your driver versions?

**@⁠shadowbeat070** on GitHub · 2026-10-14 19:27 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6176560664) > > What hardware are you using? > > Intel 10400, NVIDIA 2070 what are your driver versions?
Author
Owner

@⁠gandalfthewhite19890404 on GitHub · 2026-10-14 19:41 UTC · original

What hardware are you using?

Intel 10400, NVIDIA 2070

what are your driver versions?

580.88

**@⁠gandalfthewhite19890404** on GitHub · 2026-10-14 19:41 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6176804842) > > > What hardware are you using? > > > > > > Intel 10400, NVIDIA 2070 > > what are your driver versions? 580.88
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-14 19:48 UTC · original

What hardware are you using?

Intel 10400, NVIDIA 2070

what are your driver versions?

580.88

Is it possible for you to install the latest game ready drivers and then try again?

**@⁠shadowbeat070** on GitHub · 2026-10-14 19:48 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6176946116) > > > > What hardware are you using? > > > > > > > > > Intel 10400, NVIDIA 2070 > > > > > > what are your driver versions? > > 580.88 Is it possible for you to install the latest game ready drivers and then try again?
Author
Owner

@⁠gandalfthewhite19890404 on GitHub · 2026-10-15 02:29 UTC · original

Is it possible for you to install the latest game ready drivers and then try again?

Thank you very much! Fixed now

**@⁠gandalfthewhite19890404** on GitHub · 2026-10-15 02:29 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6183035841) > Is it possible for you to install the latest game ready drivers and then try again? Thank you very much! Fixed now
Author
Owner

@⁠shadowbeat070 on GitHub · 2026-10-17 02:12 UTC · original

With the 10 follow up commits we now reach in silent hill townfall and dead space in game
Schermafbeelding 2026-10-15 214449
Schermafbeelding 2026-10-16 000539
Schermafbeelding 2026-10-16 000618
Schermafbeelding 2026-10-16 000811
Schermafbeelding 2026-10-16 032145
Schermafbeelding 2026-10-16 032337

**@⁠shadowbeat070** on GitHub · 2026-10-17 02:12 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#issuecomment-6228360155) With the 10 follow up commits we now reach in silent hill townfall and dead space in game <img width="641" height="381" alt="Schermafbeelding 2026-10-15 214449" src="https://github.com/user-attachments/assets/cb17f0e0-d4e7-45be-aa9c-a16e4ab99a1e" /> <img width="784" height="456" alt="Schermafbeelding 2026-10-16 000539" src="https://github.com/user-attachments/assets/d0017cd9-ed7a-497a-bc5b-5c0f122f9c43" /> <img width="782" height="459" alt="Schermafbeelding 2026-10-16 000618" src="https://github.com/user-attachments/assets/2bd664eb-3a2d-429e-bbed-2fe1ea454ee4" /> <img width="857" height="485" alt="Schermafbeelding 2026-10-16 000811" src="https://github.com/user-attachments/assets/6b5a6678-527a-49ed-bdad-7217e51c6a6c" /> <img width="638" height="382" alt="Schermafbeelding 2026-10-16 032145" src="https://github.com/user-attachments/assets/609ca70b-9af3-4104-aed6-09f245d27d01" /> <img width="640" height="381" alt="Schermafbeelding 2026-10-16 032337" src="https://github.com/user-attachments/assets/ab69eebd-5a21-4ffe-89a9-829a354049e0" />
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 02:20 UTC · original
On src/graphics/host_gpu/renderer/renderCompute.cpp line 851 (outdated):

@@ -429,31 +739,163 @@ void RenderExecutor::DispatchDirect(uint64_t submit_id, CommandBuffer& buffer,
 		}
 	}
 
+	if (use_thread_dimensions) {
+		const uint32_t old_x = thread_group_x;
+		const uint32_t old_y = thread_group_y;
+		const uint32_t old_z = thread_group_z;
+		thread_group_x       = plan.groups[0];
+		thread_group_y       = plan.groups[1];
+		thread_group_z       = plan.groups[2];
+
+		static std::atomic<uint32_t> log_count {0};
+		if (log_count.fetch_add(1, std::memory_order_relaxed) < 32) {
+			LOGF("GraphicsRenderDispatchDirect: use-thread-dimensions %ux%ux%u / %ux%ux%u -> "
+			     "groups %ux%ux%u\n",
+			     old_x, old_y, old_z, std::max(cs_regs.cs_regs.num_thread_x, 1u),
+			     std::max(cs_regs.cs_regs.num_thread_y, 1u),
+			     std::max(cs_regs.cs_regs.num_thread_z, 1u), thread_group_x, thread_group_y,
+			     thread_group_z);
+		}
+	}
+
+	if (plan.action == DispatchPlanAction::SkipEmpty) {
+		static std::atomic<uint32_t> log_count {0};
+		if (log_count.fetch_add(1, std::memory_order_relaxed) < 32) {
+			LOGF("GraphicsRenderDispatchDirect: skipping zero-sized dispatch groups=%ux%ux%u "
+			     "mode=0x%08" PRIx32 " shader=0x%016" PRIx64 "\n",
+			     thread_group_x, thread_group_y, thread_group_z, mode,
+			     sh_ctx.GetCs().cs_regs.data_addr);
+		}
+		return;
+	}
+
+	buffer.EndRendering();
+	// The probe state block is a few kilobytes, so it is only reset for the BVH shader set.
+	auto& pipeline = m_context.GetPipelineCache().GetComputePipeline(input_info, compute_program);
+	StreamHold stream_hold(m_context.GetBufferCache().GetUtilityBuffer(MemoryUsage::Stream));
+	auto&      bindings = m_compute_bindings;
+	PrepareBindings(input_info.stage, bindings);
+	PreparedBindings* descriptor_stage = &bindings;
+	FindBuffers(std::span {&descriptor_stage, 1u});
+	if (program.info.uses_dma) {
+		m_context.PrepareBda(program.info.writes_dma);
+	}
+	PreparedBindings* bindless_stage = &bindings;
+	PrepareBindlessTables(std::span {&bindless_stage, 1u});
+	RebindImages(bindings);
+	BindSharedMemory(m_context, input_info, bindings);
+	const PreciseWriteScope precise_writes(m_context.GetBufferCache());
+	RebindBuffers(bindings);
+	bool has_storage_writes =
+	    bindings.shared_memory.buffer != nullptr || HasShaderBufferWrites(input_info.stage);
+	has_storage_writes =
+	    std::any_of(program.info.images.begin(), program.info.images.end(),
+	                [](const auto& image) {
+		                return image.written &&
+		                       image.resource_class ==
+		                           ShaderRecompiler::IR::ImageResourceClass::Storage;
+	                }) ||
+	    has_storage_writes;
+	const bool                  overlap = DispatchOverlapEnabled() && !GuestSyncOnly();
+	CommandBuffer::DeferredJoin join {};
+	if (overlap) {
+		CollectDispatchAccess(m_context.GetTextureCache(), input_info.stage, bindings,
+		                      m_dispatch_access);
+		// Writing the thread-dimension record is a transfer the group must be ordered before.
+		if (!use_thread_dimensions) {
+			join = buffer.JoinDeferredBarrier(m_dispatch_access, has_storage_writes);
+		}
+		if (!join.joined) {
+			buffer.FlushDeferredBarrier();
+		}
+	}
+	const bool ordered_before =
+	    join.joined ? join.ordered_before : BarrierElisionEnabled() && buffer.FullBarrierIsLast();
+
+	auto                     vk_buffer = buffer.Handle();
+	ThreadDispatcher::Record thread_record {};
+	if (use_thread_dimensions) {
+		thread_record = ThreadDispatch().Write(vk_buffer, {input_info.dispatch_threads_num[0],
+		                                                   input_info.dispatch_threads_num[1],
+		                                                   input_info.dispatch_threads_num[2]});
+	}
+	CommitBindings(buffer, vk::PipelineBindPoint::eCompute, pipeline,
+	               std::span {&descriptor_stage, 1u});
+	const bool hazard_barrier = has_storage_writes && !GuestSyncOnly() && !ordered_before;
+	if (hazard_barrier) {
+		// A host fence used to serialize every dispatch. Preserve its read-before-write ordering
+		// while allowing the queue to execute asynchronously.
+		ShaderWriteHazardBarrier(vk_buffer, vk::PipelineStageFlagBits::eComputeShader);
+	}
 	vk_buffer.bindPipeline(vk::PipelineBindPoint::eCompute, pipeline.pipeline);
-	vk_buffer.dispatch(thread_group_x, thread_group_y, thread_group_z);
+	if (use_thread_dimensions) {
+		PushThreadLimit(vk_buffer, pipeline, thread_record);
+	}
+	const bool ordered_append = (mode & Pm4::COMPUTE_DISPATCH_INITIATOR_ORDERED_APPEND_ENBL) != 0 &&
+	                            program.info.uses_gds && !use_thread_dimensions &&
+	                            thread_group_x * thread_group_y * thread_group_z > 1u;
+	if (ordered_append) {
+		// Ordered append hands out GDS counts in workgroup launch order, X fastest.
+		for (uint32_t z = 0; z < thread_group_z; z++) {
+			for (uint32_t y = 0; y < thread_group_y; y++) {
+				for (uint32_t x = 0; x < thread_group_x; x++) {
+					if (x + y + z != 0u) {
+						ShaderAccessBarrier(vk_buffer, vk::PipelineStageFlagBits::eComputeShader);
+					}
+					vk_buffer.dispatchBase(x, y, z, 1, 1, 1);
+				}
+			}
+		}
+	} else {
+		vk_buffer.dispatch(thread_group_x, thread_group_y, thread_group_z);
+	}

🚀 Performance & Scalability | 🟠 Major | 🏗️ Heavy lift

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
# How does the compute recompiler obtain the workgroup count?
rg -nP 'NumWorkgroups|NumWorkGroups|BuiltIn::?NumWorkgroups' --type=cpp src/graphics/shader -C3
# Which users read uses_gds / ordered append in the recompiler?
rg -nP '\buses_gds\b' --type=cpp src -C2

Repository: KytyPS5/KytyPS5

Length of output: 10102


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- renderCompute dispatch block ---'
sed -n '760,875p' src/graphics/host_gpu/renderer/renderCompute.cpp
printf '%s\n' '--- SPIR-V program built-in use ---'
sed -n '1040,1095p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp
printf '%s\n' '--- SPIR-V module built-in declarations ---'
sed -n '560,655p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp
printf '%s\n' '--- shader info collection shared-memory classification ---'
sed -n '330,390p' src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp
printf '%s\n' '--- compute pipeline flags ---'
sed -n '1065,1100p' src/graphics/host_gpu/renderer/pipeline/shaders.cpp

Repository: KytyPS5/KytyPS5

Length of output: 17104


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- lds storage class and GDS/LDS pipeline relationships ---'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'lds_storage_class' -e 'StorageClassStorageBuffer' -e 'uses_gds' -e 'uses_lds' src/graphics/shader src/graphics/host_gpu | head -240
printf '%s\n' '--- dispatch plan definitions and validation ---'
rg -n -F --glob 'renderCompute.cpp' -e 'DispatchPlan' -e 'thread_group_x' -e 'thread_group_y' -e 'thread_group_z' src/graphics/host_gpu/renderer/renderCompute.cpp | head -180

Repository: KytyPS5/KytyPS5

Length of output: 7784


🏁 Script executed:

#!/bin/bash
set -e
printf '%s\n' '--- lds_storage_class initialization ---'
sed -n '78,112p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h
printf '%s\n' '--- dispatch plan type and construction references ---'
rg -n -F --glob '*.cpp' --glob '*.h' -e 'struct DispatchPlan' -e 'enum class DispatchPlanAction' -e 'DispatchPlanAction::SkipOverLimit' -e 'MakeDispatchPlan' -e 'PlanDispatch' src/graphics | head -200
printf '%s\n' '--- DispatchDirect complete control flow ---'
sed -n '540,775p' src/graphics/host_gpu/renderer/renderCompute.cpp

Repository: KytyPS5/KytyPS5

Length of output: 13670


🏁 Script executed:

#!/bin/bash
set -e
sed -n '1,180p' src/graphics/host_gpu/renderer/dispatchGuard.h

Repository: KytyPS5/KytyPS5

Length of output: 3081


Preserve the guest workgroup count in the ordered-append path.

dispatchBase(x, y, z, 1, 1, 1) makes NumWorkgroups equal to 1, 1, 1. A shader that uses both GDS and storage-buffer LDS can therefore calculate its LDS base from the wrong grid dimensions. uses_gds and uses_lds are tracked independently.

Use a mechanism that preserves the original NumWorkgroups value while retaining ordered launch order. Do not assume that WorkgroupId alone is sufficient.

The split also records one dispatch and one ShaderAccessBarrier per workgroup. PlanComputeDispatch checks only per-axis limits, so an otherwise valid dispatch can still create a very large serialized command sequence. Add a bounded fallback or another implementation that preserves ordering without recording one full dispatch per workgroup.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 02:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4300888880) On `src/graphics/host_gpu/renderer/renderCompute.cpp` line 851 (outdated): ```diff @@ -429,31 +739,163 @@ void RenderExecutor::DispatchDirect(uint64_t submit_id, CommandBuffer& buffer, } } + if (use_thread_dimensions) { + const uint32_t old_x = thread_group_x; + const uint32_t old_y = thread_group_y; + const uint32_t old_z = thread_group_z; + thread_group_x = plan.groups[0]; + thread_group_y = plan.groups[1]; + thread_group_z = plan.groups[2]; + + static std::atomic<uint32_t> log_count {0}; + if (log_count.fetch_add(1, std::memory_order_relaxed) < 32) { + LOGF("GraphicsRenderDispatchDirect: use-thread-dimensions %ux%ux%u / %ux%ux%u -> " + "groups %ux%ux%u\n", + old_x, old_y, old_z, std::max(cs_regs.cs_regs.num_thread_x, 1u), + std::max(cs_regs.cs_regs.num_thread_y, 1u), + std::max(cs_regs.cs_regs.num_thread_z, 1u), thread_group_x, thread_group_y, + thread_group_z); + } + } + + if (plan.action == DispatchPlanAction::SkipEmpty) { + static std::atomic<uint32_t> log_count {0}; + if (log_count.fetch_add(1, std::memory_order_relaxed) < 32) { + LOGF("GraphicsRenderDispatchDirect: skipping zero-sized dispatch groups=%ux%ux%u " + "mode=0x%08" PRIx32 " shader=0x%016" PRIx64 "\n", + thread_group_x, thread_group_y, thread_group_z, mode, + sh_ctx.GetCs().cs_regs.data_addr); + } + return; + } + + buffer.EndRendering(); + // The probe state block is a few kilobytes, so it is only reset for the BVH shader set. + auto& pipeline = m_context.GetPipelineCache().GetComputePipeline(input_info, compute_program); + StreamHold stream_hold(m_context.GetBufferCache().GetUtilityBuffer(MemoryUsage::Stream)); + auto& bindings = m_compute_bindings; + PrepareBindings(input_info.stage, bindings); + PreparedBindings* descriptor_stage = &bindings; + FindBuffers(std::span {&descriptor_stage, 1u}); + if (program.info.uses_dma) { + m_context.PrepareBda(program.info.writes_dma); + } + PreparedBindings* bindless_stage = &bindings; + PrepareBindlessTables(std::span {&bindless_stage, 1u}); + RebindImages(bindings); + BindSharedMemory(m_context, input_info, bindings); + const PreciseWriteScope precise_writes(m_context.GetBufferCache()); + RebindBuffers(bindings); + bool has_storage_writes = + bindings.shared_memory.buffer != nullptr || HasShaderBufferWrites(input_info.stage); + has_storage_writes = + std::any_of(program.info.images.begin(), program.info.images.end(), + [](const auto& image) { + return image.written && + image.resource_class == + ShaderRecompiler::IR::ImageResourceClass::Storage; + }) || + has_storage_writes; + const bool overlap = DispatchOverlapEnabled() && !GuestSyncOnly(); + CommandBuffer::DeferredJoin join {}; + if (overlap) { + CollectDispatchAccess(m_context.GetTextureCache(), input_info.stage, bindings, + m_dispatch_access); + // Writing the thread-dimension record is a transfer the group must be ordered before. + if (!use_thread_dimensions) { + join = buffer.JoinDeferredBarrier(m_dispatch_access, has_storage_writes); + } + if (!join.joined) { + buffer.FlushDeferredBarrier(); + } + } + const bool ordered_before = + join.joined ? join.ordered_before : BarrierElisionEnabled() && buffer.FullBarrierIsLast(); + + auto vk_buffer = buffer.Handle(); + ThreadDispatcher::Record thread_record {}; + if (use_thread_dimensions) { + thread_record = ThreadDispatch().Write(vk_buffer, {input_info.dispatch_threads_num[0], + input_info.dispatch_threads_num[1], + input_info.dispatch_threads_num[2]}); + } + CommitBindings(buffer, vk::PipelineBindPoint::eCompute, pipeline, + std::span {&descriptor_stage, 1u}); + const bool hazard_barrier = has_storage_writes && !GuestSyncOnly() && !ordered_before; + if (hazard_barrier) { + // A host fence used to serialize every dispatch. Preserve its read-before-write ordering + // while allowing the queue to execute asynchronously. + ShaderWriteHazardBarrier(vk_buffer, vk::PipelineStageFlagBits::eComputeShader); + } vk_buffer.bindPipeline(vk::PipelineBindPoint::eCompute, pipeline.pipeline); - vk_buffer.dispatch(thread_group_x, thread_group_y, thread_group_z); + if (use_thread_dimensions) { + PushThreadLimit(vk_buffer, pipeline, thread_record); + } + const bool ordered_append = (mode & Pm4::COMPUTE_DISPATCH_INITIATOR_ORDERED_APPEND_ENBL) != 0 && + program.info.uses_gds && !use_thread_dimensions && + thread_group_x * thread_group_y * thread_group_z > 1u; + if (ordered_append) { + // Ordered append hands out GDS counts in workgroup launch order, X fastest. + for (uint32_t z = 0; z < thread_group_z; z++) { + for (uint32_t y = 0; y < thread_group_y; y++) { + for (uint32_t x = 0; x < thread_group_x; x++) { + if (x + y + z != 0u) { + ShaderAccessBarrier(vk_buffer, vk::PipelineStageFlagBits::eComputeShader); + } + vk_buffer.dispatchBase(x, y, z, 1, 1, 1); + } + } + } + } else { + vk_buffer.dispatch(thread_group_x, thread_group_y, thread_group_z); + } ``` **🚀 Performance & Scalability** | **🟠 Major** | **🏗️ Heavy lift** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash # How does the compute recompiler obtain the workgroup count? rg -nP 'NumWorkgroups|NumWorkGroups|BuiltIn::?NumWorkgroups' --type=cpp src/graphics/shader -C3 # Which users read uses_gds / ordered append in the recompiler? rg -nP '\buses_gds\b' --type=cpp src -C2 ``` Repository: KytyPS5/KytyPS5 Length of output: 10102 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- renderCompute dispatch block ---' sed -n '760,875p' src/graphics/host_gpu/renderer/renderCompute.cpp printf '%s\n' '--- SPIR-V program built-in use ---' sed -n '1040,1095p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp printf '%s\n' '--- SPIR-V module built-in declarations ---' sed -n '560,655p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp printf '%s\n' '--- shader info collection shared-memory classification ---' sed -n '330,390p' src/graphics/shader/recompiler/ir/passes/ShaderInfoCollection.cpp printf '%s\n' '--- compute pipeline flags ---' sed -n '1065,1100p' src/graphics/host_gpu/renderer/pipeline/shaders.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 17104 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- lds storage class and GDS/LDS pipeline relationships ---' rg -n -F --glob '*.cpp' --glob '*.h' -e 'lds_storage_class' -e 'StorageClassStorageBuffer' -e 'uses_gds' -e 'uses_lds' src/graphics/shader src/graphics/host_gpu | head -240 printf '%s\n' '--- dispatch plan definitions and validation ---' rg -n -F --glob 'renderCompute.cpp' -e 'DispatchPlan' -e 'thread_group_x' -e 'thread_group_y' -e 'thread_group_z' src/graphics/host_gpu/renderer/renderCompute.cpp | head -180 ``` Repository: KytyPS5/KytyPS5 Length of output: 7784 --- 🏁 Script executed: ```bash #!/bin/bash set -e printf '%s\n' '--- lds_storage_class initialization ---' sed -n '78,112p' src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h printf '%s\n' '--- dispatch plan type and construction references ---' rg -n -F --glob '*.cpp' --glob '*.h' -e 'struct DispatchPlan' -e 'enum class DispatchPlanAction' -e 'DispatchPlanAction::SkipOverLimit' -e 'MakeDispatchPlan' -e 'PlanDispatch' src/graphics | head -200 printf '%s\n' '--- DispatchDirect complete control flow ---' sed -n '540,775p' src/graphics/host_gpu/renderer/renderCompute.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 13670 --- 🏁 Script executed: ```bash #!/bin/bash set -e sed -n '1,180p' src/graphics/host_gpu/renderer/dispatchGuard.h ``` Repository: KytyPS5/KytyPS5 Length of output: 3081 --- </details> **Preserve the guest workgroup count in the ordered-append path.** `dispatchBase(x, y, z, 1, 1, 1)` makes `NumWorkgroups` equal to `1, 1, 1`. A shader that uses both GDS and storage-buffer LDS can therefore calculate its LDS base from the wrong grid dimensions. `uses_gds` and `uses_lds` are tracked independently. Use a mechanism that preserves the original `NumWorkgroups` value while retaining ordered launch order. Do not assume that `WorkgroupId` alone is sufficient. The split also records one dispatch and one `ShaderAccessBarrier` per workgroup. `PlanComputeDispatch` checks only per-axis limits, so an otherwise valid dispatch can still create a very large serialized command sequence. Add a bounded fallback or another implementation that preserves ordering without recording one full dispatch per workgroup. <!-- coderabbit-global-learning v1 gid=079b9f27666668d5 scope=protocol --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:e98616997027b917f81750ea --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -509,0 +614,4 @@
break;
}
targets.push_back(static_cast<uintptr_t>(target));
}
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 02:20 UTC · original

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

ScanJumpTableTargets can miss real targets and still report them as bounded.

DecodeFunction treats this result as a complete superset of the table's targets. If the result is not empty, it sets indirect_targets_bounded. RelocateGuestInstructions then allows neighbor relocation and short-jump fallback for the function. The current scan does not guarantee a superset in two cases:

  • Line 615 stops at the first entry outside [function_start, function_end). function_end is the next discovered start, which can be a call target, a code pointer, or a padding start. If that start splits a real function, some case targets land beyond function_end. The scan then stops before later entries that land back inside the function. Those later targets are never recorded. A relocation span can then cover one of them, and the guest jumps into the middle of the patched jmp/nop bytes.
  • Lines 559-565 do not check that the MOVSXD destination is target_reg. ResolveBoundedJumpTable checks this. Without the check, an unrelated load can match the pattern and produce a wrong set of "bounded" targets.

A larger target set only reduces relocation, so over-approximation is the safe direction. Skip out-of-range entries instead of stopping at them, and add the destination check.

🛠️ Proposed fix
 	if (load == function.instructions.end() ||
 	    load->second.instruction.mnemonic != ZYDIS_MNEMONIC_MOVSXD ||
+	    load->second.operands[0].type != ZYDIS_OPERAND_TYPE_REGISTER ||
+	    !IsSameRegister(load->second.operands[0].reg.value, target_reg) ||
 	    load->second.operands[1].type != ZYDIS_OPERAND_TYPE_MEMORY ||
@@
 			const s64 target = static_cast<s64>(table) + offset;
 			if (target < static_cast<s64>(function_start) ||
 			    target >= static_cast<s64>(function_end)) {
-				break;
+				continue;
 			}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 02:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4300888887) **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** **`ScanJumpTableTargets` can miss real targets and still report them as bounded.** `DecodeFunction` treats this result as a complete superset of the table's targets. If the result is not empty, it sets `indirect_targets_bounded`. `RelocateGuestInstructions` then allows neighbor relocation and short-jump fallback for the function. The current scan does not guarantee a superset in two cases: - Line 615 stops at the first entry outside `[function_start, function_end)`. `function_end` is the next discovered start, which can be a call target, a code pointer, or a padding start. If that start splits a real function, some case targets land beyond `function_end`. The scan then stops before later entries that land back inside the function. Those later targets are never recorded. A relocation span can then cover one of them, and the guest jumps into the middle of the patched `jmp`/`nop` bytes. - Lines 559-565 do not check that the `MOVSXD` destination is `target_reg`. `ResolveBoundedJumpTable` checks this. Without the check, an unrelated load can match the pattern and produce a wrong set of "bounded" targets. A larger target set only reduces relocation, so over-approximation is the safe direction. Skip out-of-range entries instead of stopping at them, and add the destination check. <details> <summary>🛠️ Proposed fix</summary> ```diff if (load == function.instructions.end() || load->second.instruction.mnemonic != ZYDIS_MNEMONIC_MOVSXD || + load->second.operands[0].type != ZYDIS_OPERAND_TYPE_REGISTER || + !IsSameRegister(load->second.operands[0].reg.value, target_reg) || load->second.operands[1].type != ZYDIS_OPERAND_TYPE_MEMORY || @@ const s64 target = static_cast<s64>(table) + offset; if (target < static_cast<s64>(function_start) || target >= static_cast<s64>(function_end)) { - break; + continue; } ``` </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:7c35751bef3a8a0b4d319e96 --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-17 02:20 UTC · original · reviewed

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

⚠️ Outside diff range comments (1)

🟡 Minor · Guard __builtin_ia32_pause by architecture. · pthread.cpp:517-523

src/kernel/pthread.cpp:517-523
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Guard __builtin_ia32_pause by architecture.

On non-Windows aarch64 builds, this code reaches the x86-only __builtin_ia32_pause() and can fail to compile. Select an architecture-specific relax operation and provide a generic fallback.

🛠️ Suggested fix
 static void CpuRelax() {
 #if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS
 	YieldProcessor();
-#else
+#elif defined(__x86_64__) || defined(_M_X64)
 	__builtin_ia32_pause();
+#elif defined(__aarch64__)
+	asm volatile("yield");
+#else
+	std::this_thread::yield();
 #endif
 }

ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9d3ea41a-1901-4076-9f01-756cee674ece
📥 Commits

Reviewing files that changed from the base of the PR and between d4cd928e991f7c0771bc648e0982c2fb2a8afeaf and 3d194c1b5178b6c1d22f09af57c0946175d09d3d.

📒 Files selected for processing: 17
  • src/graphics/guest_gpu/pm4.h
  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • src/graphics/host_gpu/renderer/colorRenderTarget.cpp
  • src/graphics/host_gpu/renderer/image/imageInfo.h
  • src/graphics/host_gpu/renderer/pipeline/descriptors.cpp
  • src/graphics/host_gpu/renderer/pipeline/shaders.cpp
  • src/graphics/host_gpu/renderer/renderCompute.cpp
  • src/graphics/host_gpu/renderer/renderContext.cpp
  • src/graphics/host_gpu/renderer/renderContext.h
  • src/graphics/shader/shaderGsAssembly.cpp
  • src/kernel/pthread.cpp
  • src/loader/guestInstructionPatcher.cpp
  • src/loader/guestInstructionPatcher.h
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/ShaderVertexMetadataTests.cpp
  • tests/VirtualMemoryAllocationTests.cpp
  • tests/shaderCfgTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 02:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#pullrequestreview-5555539244) · **reviewed** **Actionable comments posted: 2** > [!CAUTION] > Some comments are outside the diff and can’t be posted inline due to GitHub limitations. > > **⚠️ Outside diff range comments (1)** > > <details> > <summary><strong>🟡 Minor</strong> · Guard <code>__builtin_ia32_pause</code> by architecture. · <code>pthread.cpp:517-523</code></summary><blockquote> > > `src/kernel/pthread.cpp:517-523` > **🩺 Stability & Availability** | **🟡 Minor** | **⚡ Quick win** > > **Guard `__builtin_ia32_pause` by architecture.** > > On non-Windows aarch64 builds, this code reaches the x86-only `__builtin_ia32_pause()` and can fail to compile. Select an architecture-specific relax operation and provide a generic fallback. > > <details> > <summary>🛠️ Suggested fix</summary> > > ```diff > static void CpuRelax() { > #if KYTY_PLATFORM == KYTY_PLATFORM_WINDOWS > YieldProcessor(); > -#else > +#elif defined(__x86_64__) || defined(_M_X64) > __builtin_ia32_pause(); > +#elif defined(__aarch64__) > + asm volatile("yield"); > +#else > + std::this_thread::yield(); > #endif > } > ``` > > </details> > > <!-- cr-comment:v1:74c80a4a0dee3b437f403fe7 --> > > </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**: `9d3ea41a-1901-4076-9f01-756cee674ece` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between d4cd928e991f7c0771bc648e0982c2fb2a8afeaf and 3d194c1b5178b6c1d22f09af57c0946175d09d3d. </details> <details> <summary>📒 Files selected for processing: 17</summary> * `src/graphics/guest_gpu/pm4.h` * `src/graphics/host_gpu/renderer/cache/textureCache.cpp` * `src/graphics/host_gpu/renderer/colorRenderTarget.cpp` * `src/graphics/host_gpu/renderer/image/imageInfo.h` * `src/graphics/host_gpu/renderer/pipeline/descriptors.cpp` * `src/graphics/host_gpu/renderer/pipeline/shaders.cpp` * `src/graphics/host_gpu/renderer/renderCompute.cpp` * `src/graphics/host_gpu/renderer/renderContext.cpp` * `src/graphics/host_gpu/renderer/renderContext.h` * `src/graphics/shader/shaderGsAssembly.cpp` * `src/kernel/pthread.cpp` * `src/loader/guestInstructionPatcher.cpp` * `src/loader/guestInstructionPatcher.h` * `tests/ShaderRecompilerComputeTests.cpp` * `tests/ShaderVertexMetadataTests.cpp` * `tests/VirtualMemoryAllocationTests.cpp` * `tests/shaderCfgTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=7caa5bfd-7064-4297-84d8-afbff1c56222 attempt=edbbbd9c-e977-4def-aca9-17de56b84c4b batch=1/1 -->
@ -397,0 +414,4 @@
if (m_merge_pending.exchange(false, std::memory_order_acq_rel)) {
m_gfx_cp->BufferFlush();
}
}
Author
Owner

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP '\bWaitForIdle\s*\(' -C3 --type=cpp

Repository: KytyPS5/KytyPS5

Length of output: 12426


🏁 Script executed:

nl -ba src/graphics/guest_gpu/graphicsRun.cpp | sed -n '430,600p'
printf '\n--- declarations and related symbols ---\n'
rg -n -F -e 'm_processing' -e 'm_merge_pending' -e 'FlushMergedSubmissions' -e 'm_idle' src/graphics/guest_gpu/graphicsRun.cpp src/graphics/guest_gpu/graphicsRun.h

Repository: KytyPS5/KytyPS5

Length of output: 9887


🏁 Script executed:

nl -ba src/graphics/guest_gpu/graphicsRun.cpp | sed -n '468,585p'

Repository: KytyPS5/KytyPS5

Length of output: 5180


Keep m_processing true until merged flushing finishes.

FlushMergedSubmissions() clears m_merge_pending before CommandScheduler::Flush() runs. In the first merge path, m_processing can already be false. A concurrent WaitForIdle() can then observe no pending work and return before the flush completes.

Set m_processing before each unlock and clear it only after the flush.

Suggested fix
 				if (gpu->m_merge_pending.load(std::memory_order_acquire)) {
+					gpu->m_processing = true;
 					gpu->m_queue_mutex.Unlock();
 					gpu->FlushMergedSubmissions();
 					gpu->m_queue_mutex.Lock();
 					gpu->m_processing = false;
 					gpu->m_idle.SignalAll();
 					continue;
 				}
 					if (gpu->m_merge_pending.load(std::memory_order_acquire)) {
+						gpu->m_processing = true;
 						gpu->m_queue_mutex.Unlock();
 						gpu->FlushMergedSubmissions();
 						gpu->m_queue_mutex.Lock();
+						gpu->m_processing = false;
+						gpu->m_idle.SignalAll();
 						continue;
 					}
**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 21:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4304583545) **🩺 Stability & Availability** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash rg -nP '\bWaitForIdle\s*\(' -C3 --type=cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 12426 --- 🏁 Script executed: ```bash nl -ba src/graphics/guest_gpu/graphicsRun.cpp | sed -n '430,600p' printf '\n--- declarations and related symbols ---\n' rg -n -F -e 'm_processing' -e 'm_merge_pending' -e 'FlushMergedSubmissions' -e 'm_idle' src/graphics/guest_gpu/graphicsRun.cpp src/graphics/guest_gpu/graphicsRun.h ``` Repository: KytyPS5/KytyPS5 Length of output: 9887 --- 🏁 Script executed: ```bash nl -ba src/graphics/guest_gpu/graphicsRun.cpp | sed -n '468,585p' ``` Repository: KytyPS5/KytyPS5 Length of output: 5180 --- </details> **Keep `m_processing` true until merged flushing finishes.** `FlushMergedSubmissions()` clears `m_merge_pending` before `CommandScheduler::Flush()` runs. In the first merge path, `m_processing` can already be false. A concurrent `WaitForIdle()` can then observe no pending work and return before the flush completes. Set `m_processing` before each unlock and clear it only after the flush. <details> <summary>Suggested fix</summary> ```diff if (gpu->m_merge_pending.load(std::memory_order_acquire)) { + gpu->m_processing = true; gpu->m_queue_mutex.Unlock(); gpu->FlushMergedSubmissions(); gpu->m_queue_mutex.Lock(); gpu->m_processing = false; gpu->m_idle.SignalAll(); continue; } ``` ```diff if (gpu->m_merge_pending.load(std::memory_order_acquire)) { + gpu->m_processing = true; gpu->m_queue_mutex.Unlock(); gpu->FlushMergedSubmissions(); gpu->m_queue_mutex.Lock(); + gpu->m_processing = false; + gpu->m_idle.SignalAll(); continue; } ``` </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:c22d59adc361760b9e7c541d --> <!-- This is an auto-generated comment by CodeRabbit -->
@ -749,0 +943,4 @@
} else {
// Too many pieces to keep exactly: forget them, which only ever claims less.
m_superseded_since_gpu_write.clear();
}
Author
Owner

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

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

🔎 Supported by static analysis

🏁 Script executed:

#!/bin/bash
rg -nP 'SupersededSinceGpuWrite(Ranges)?\s*\(' -C5 --type=cpp

Repository: KytyPS5/KytyPS5

Length of output: 7259


🏁 Script executed:

set -eu
printf '%s\n' '--- image.cpp range tracking ---'
nl -ba src/graphics/host_gpu/renderer/image/image.cpp | sed -n '880,985p'
printf '%s\n' '--- image.h range state and contract ---'
nl -ba src/graphics/host_gpu/renderer/image/image.h | sed -n '130,215p'
printf '%s\n' '--- range state references ---'
rg -n -F -- 'm_superseded_since_gpu_write' src/graphics/host_gpu/renderer/image src/graphics/host_gpu/renderer/cache
printf '%s\n' '--- texture cache consumers ---'
nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '260,310p'
nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '1600,1680p'
nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '1915,1970p'

Repository: KytyPS5/KytyPS5

Length of output: 20916


Stop recording post-GPU-write ranges after overflow.

When Image::Supersede() clears m_superseded_since_gpu_write at MaxRanges, a later call can insert a new range. TextureCache::SupersededAliasCanSync() then accepts the non-empty list, and SyncLayoutAlias() copies only those later ranges. The omitted ranges can remain unmarked, which can allow stale bytes to overwrite newer guest-buffer data.

Add an overflow flag. Reset it in MarkGpuModified(), MarkBufferModified(), and ClearSuperseded(). Skip range insertion while the flag is set.

Suggested fix
-	if (m_superseded_since_gpu_write.size() < MaxRanges) {
+	if (!m_superseded_since_gpu_write_overflow &&
+	    m_superseded_since_gpu_write.size() < MaxRanges) {
 		auto& fresh = m_superseded_since_gpu_write;
 		fresh.emplace_back(begin, end);
 		std::ranges::sort(fresh);
 		size_t kept = 0;
 		for (size_t i = 1; i < fresh.size(); i++) {
 			if (fresh[i].first <= fresh[kept].second) {
 				fresh[kept].second = std::max(fresh[kept].second, fresh[i].second);
 			} else {
 				fresh[++kept] = fresh[i];
 			}
 		}
 		fresh.resize(kept + 1);
 	} else {
 		// Too many pieces to keep exactly: forget them, which only ever claims less.
 		m_superseded_since_gpu_write.clear();
+		m_superseded_since_gpu_write_overflow = true;
 	}
 		m_superseded_since_gpu_write.clear();
+		m_superseded_since_gpu_write_overflow = false;

Apply the reset to all three existing clear paths, and add bool m_superseded_since_gpu_write_overflow = false; beside the range vector.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 21:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#discussion_r4304583554) **🗄️ Data Integrity & Integration** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash #!/bin/bash rg -nP 'SupersededSinceGpuWrite(Ranges)?\s*\(' -C5 --type=cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 7259 --- 🏁 Script executed: ```bash set -eu printf '%s\n' '--- image.cpp range tracking ---' nl -ba src/graphics/host_gpu/renderer/image/image.cpp | sed -n '880,985p' printf '%s\n' '--- image.h range state and contract ---' nl -ba src/graphics/host_gpu/renderer/image/image.h | sed -n '130,215p' printf '%s\n' '--- range state references ---' rg -n -F -- 'm_superseded_since_gpu_write' src/graphics/host_gpu/renderer/image src/graphics/host_gpu/renderer/cache printf '%s\n' '--- texture cache consumers ---' nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '260,310p' nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '1600,1680p' nl -ba src/graphics/host_gpu/renderer/cache/textureCache.cpp | sed -n '1915,1970p' ``` Repository: KytyPS5/KytyPS5 Length of output: 20916 --- </details> **Stop recording post-GPU-write ranges after overflow.** When `Image::Supersede()` clears `m_superseded_since_gpu_write` at `MaxRanges`, a later call can insert a new range. `TextureCache::SupersededAliasCanSync()` then accepts the non-empty list, and `SyncLayoutAlias()` copies only those later ranges. The omitted ranges can remain unmarked, which can allow stale bytes to overwrite newer guest-buffer data. Add an overflow flag. Reset it in `MarkGpuModified()`, `MarkBufferModified()`, and `ClearSuperseded()`. Skip range insertion while the flag is set. <details> <summary>Suggested fix</summary> ```diff - if (m_superseded_since_gpu_write.size() < MaxRanges) { + if (!m_superseded_since_gpu_write_overflow && + m_superseded_since_gpu_write.size() < MaxRanges) { auto& fresh = m_superseded_since_gpu_write; fresh.emplace_back(begin, end); std::ranges::sort(fresh); size_t kept = 0; for (size_t i = 1; i < fresh.size(); i++) { if (fresh[i].first <= fresh[kept].second) { fresh[kept].second = std::max(fresh[kept].second, fresh[i].second); } else { fresh[++kept] = fresh[i]; } } fresh.resize(kept + 1); } else { // Too many pieces to keep exactly: forget them, which only ever claims less. m_superseded_since_gpu_write.clear(); + m_superseded_since_gpu_write_overflow = true; } ``` ```diff m_superseded_since_gpu_write.clear(); + m_superseded_since_gpu_write_overflow = false; ``` Apply the reset to all three existing clear paths, and add `bool m_superseded_since_gpu_write_overflow = false;` beside the range vector. </details> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:8553cd97addbc83162091a3c --> <!-- This is an auto-generated comment by CodeRabbit -->
Author
Owner

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

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 27da1373-19f0-41ef-bb24-a027c9fd55b4
📥 Commits

Reviewing files that changed from the base of the PR and between 3d194c1b5178b6c1d22f09af57c0946175d09d3d and 8ab50452e5d0c9ae93e9db7da74738c9449ed231.

📒 Files selected for processing: 19
  • CMakeLists.txt
  • src/graphics/guest_gpu/graphicsRun.cpp
  • src/graphics/guest_gpu/graphicsRun.h
  • src/graphics/host_gpu/renderer/cache/bufferCache.cpp
  • src/graphics/host_gpu/renderer/cache/bufferCache.h
  • src/graphics/host_gpu/renderer/cache/streamBuffer.h
  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • src/graphics/host_gpu/renderer/cache/textureCache.h
  • src/graphics/host_gpu/renderer/image/image.cpp
  • src/graphics/host_gpu/renderer/image/image.h
  • src/graphics/host_gpu/renderer/image/imageInfo.cpp
  • src/graphics/host_gpu/renderer/image/imageInfo.h
  • src/graphics/host_gpu/renderer/pipeline/descriptors.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.cpp
  • src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.h
  • tests/ImageLayoutMemoTests.inc
  • tests/RegionQueryMemoTests.inc
  • tests/ResourceMaterializationTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp

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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-17 21:28 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1495#pullrequestreview-5560178221) · **reviewed** **Actionable comments posted: 2** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `27da1373-19f0-41ef-bb24-a027c9fd55b4` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 3d194c1b5178b6c1d22f09af57c0946175d09d3d and 8ab50452e5d0c9ae93e9db7da74738c9449ed231. </details> <details> <summary>📒 Files selected for processing: 19</summary> * `CMakeLists.txt` * `src/graphics/guest_gpu/graphicsRun.cpp` * `src/graphics/guest_gpu/graphicsRun.h` * `src/graphics/host_gpu/renderer/cache/bufferCache.cpp` * `src/graphics/host_gpu/renderer/cache/bufferCache.h` * `src/graphics/host_gpu/renderer/cache/streamBuffer.h` * `src/graphics/host_gpu/renderer/cache/textureCache.cpp` * `src/graphics/host_gpu/renderer/cache/textureCache.h` * `src/graphics/host_gpu/renderer/image/image.cpp` * `src/graphics/host_gpu/renderer/image/image.h` * `src/graphics/host_gpu/renderer/image/imageInfo.cpp` * `src/graphics/host_gpu/renderer/image/imageInfo.h` * `src/graphics/host_gpu/renderer/pipeline/descriptors.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.cpp` * `src/graphics/shader/recompiler/ir/passes/ResourceMaterializationMemo.h` * `tests/ImageLayoutMemoTests.inc` * `tests/RegionQueryMemoTests.inc` * `tests/ResourceMaterializationTests.cpp` * `tests/ShaderRecompilerComputeTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=6be401f6-3998-411c-ac14-8474f39666bc attempt=9de796bd-327a-4ace-9cb1-098462866978 batch=1/1 -->
This pull request has changes conflicting with the target branch.
  • CMakeLists.txt
  • src/common/assert.cpp
  • src/common/threads.h
  • src/emulator.cpp
  • src/graphics/guest_gpu/command_processor/pm4Handlers.cpp
  • src/graphics/guest_gpu/graphicsRun.cpp
  • src/graphics/guest_gpu/hardwareContext.h
  • src/graphics/host_gpu/graphicContext.h
  • src/graphics/host_gpu/pageManager.cpp
  • src/graphics/host_gpu/rangeSet.h
  • src/graphics/host_gpu/renderer/cache/bufferCache.cpp
  • src/graphics/host_gpu/renderer/cache/bufferCache.h
  • src/graphics/host_gpu/renderer/cache/faultManager.cpp
  • src/graphics/host_gpu/renderer/cache/streamBuffer.cpp
  • src/graphics/host_gpu/renderer/cache/textureCache.cpp
  • src/graphics/host_gpu/renderer/cache/textureCache.h
  • src/graphics/host_gpu/renderer/colorRenderTarget.cpp
  • 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.cpp
  • src/graphics/host_gpu/renderer/image/image.h
  • src/graphics/host_gpu/renderer/image/imageInfo.cpp
  • src/graphics/host_gpu/renderer/image/imageInfo.h
  • src/graphics/host_gpu/renderer/image/textureCommon.cpp
  • src/graphics/host_gpu/renderer/image/tiler.cpp
  • src/graphics/host_gpu/renderer/image/tiler.h
  • src/graphics/host_gpu/renderer/pipeline/descriptors.cpp
  • src/graphics/host_gpu/renderer/pipeline/imageHeap.cpp
  • src/graphics/host_gpu/renderer/pipeline/imageHeap.h
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.cpp
  • src/graphics/host_gpu/renderer/pipeline/pipelineCache.h
  • src/graphics/host_gpu/renderer/pipeline/shaders.cpp
  • src/graphics/host_gpu/renderer/render.h
  • src/graphics/host_gpu/renderer/renderCompute.cpp
  • src/graphics/host_gpu/renderer/renderContext.cpp
  • src/graphics/host_gpu/renderer/renderDraw.cpp
  • src/graphics/host_gpu/shaders/fault_buffer_process.comp
  • src/graphics/host_gpu/shaders/gpu_mesh_indirect.task
  • src/graphics/host_gpu/vma.cpp
  • src/graphics/presentation/videoOut.cpp
  • src/graphics/presentation/window/swapchain.cpp
  • src/graphics/presentation/window/vulkanWindow.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.cpp
  • src/graphics/shader/recompiler/ShaderRecompiler.h
  • src/graphics/shader/recompiler/Tessellation.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.cpp
  • src/graphics/shader/recompiler/backend/spirv/SpirvEmitter.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterImage.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterInternal.h
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterMemory.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterModule.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterProgram.cpp
  • src/graphics/shader/recompiler/backend/spirv/spirvEmitterTessellation.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.cpp
  • src/graphics/shader/recompiler/frontend/cfg/ShaderCFG.h
  • src/graphics/shader/recompiler/frontend/decode/ImageOps.cpp
  • src/graphics/shader/recompiler/frontend/decode/ImageOps.h
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.cpp
  • src/graphics/shader/recompiler/frontend/decode/ShaderDecoder.h
  • src/graphics/shader/recompiler/frontend/translate/Memory.cpp
  • src/graphics/shader/recompiler/frontend/translate/Translate.cpp
  • src/graphics/shader/recompiler/frontend/translate/Translator.h
  • src/graphics/shader/recompiler/ir/Program.cpp
  • src/graphics/shader/recompiler/ir/ShaderIR.h
  • src/graphics/shader/recompiler/ir/Value.cpp
  • src/graphics/shader/recompiler/ir/Value.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/SrtWalker.cpp
  • src/graphics/shader/recompiler/ir/passes/SrtWalker.h
  • src/graphics/shader/rectListShader.cpp
  • src/graphics/shader/shader.cpp
  • src/graphics/shader/shader.h
  • src/kernel/eventFlag.cpp
  • src/kernel/eventQueue.cpp
  • src/kernel/memory.cpp
  • src/kernel/memory.h
  • src/kernel/memoryAddressSpace.inc
  • src/kernel/pthread.cpp
  • src/launcher/include/configuration.h
  • src/launcher/src/mainDialog.cpp
  • src/libs/libAmpr.cpp
  • src/libs/libAudio2.cpp
  • src/libs/libKernel.cpp
  • src/libs/libSaveData.cpp
  • src/loader/guestInstructionPatcher.cpp
  • src/loader/runtimeLinker.cpp
  • tests/AudioOut2PortTests.cpp
  • tests/AudioOutTimingTests.cpp
  • tests/ImagePageTableTests.cpp
  • tests/PageManagerTests.cpp
  • tests/ResourceMaterializationTests.cpp
  • tests/ResourceTrackingTests.cpp
  • tests/ShaderRecompilerComputeTests.cpp
  • tests/ShaderVertexMetadataTests.cpp
  • tests/shaderCfgTests.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

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

Merge

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