Commit Graph
14017 Commits
Author SHA1 Message Date
fdfawef324andCodex f3f453ec9d fix(recompiler): key shader caches on compiled sources
Co-Authored-By: Codex <[email protected]>
2026-10-19 04:27:37 +02:00
milescovielloandClaude Opus 5.5 42f4382bcf fix(libScePlayGo): list chunks 0 to 999 when only a scenario file is present
A dump with sce_sys/playgo-scenario.json and no chunk table already answers
every chunk id as installed, but scePlayGoGetChunkId listed only chunk 0.
Ghost of Tsushima (PPSA02225) builds its set of installed chunks from that
list and never reads its English audio, two of its music archives or its
opening movie. scePlayGoGetChunkId now lists ids 0 to 999, the room that
title passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 02:27:00 +00:00
Adrià 7bc7905978 Merge pull request #6489 from fogydes/feat/agc-dcb-context-state-op
feat(libSceAgc): implement unversioned context state operations
2026-10-19 04:24:41 +02:00
Adrià 1377213ab7 Merge pull request #5957 from xXPBSXx/cand/guest-abort-report-r6
fix(libc): name a guest abort() in the crash report
2026-10-19 04:24:37 +02:00
joedeangelis533-bot 392c947111 fix(tools): reject unbacked segment data when unwrapping SELF 2026-10-18 22:24:06 -04:00
Dean 43797ca8a9 Merge pull request #6198 from valenciana-nc/fix/aio-batch-cap
fix(libkernel): check the AIO Multiple batch limit before reading the requests
2026-10-19 15:22:04 +13:00
Dean 0a3ba87dcc Merge pull request #6200 from valenciana-nc/fix/symlink-parent-escape
fix(libkernel_sys): reject parent-directory components in symlink targets
2026-10-19 15:22:00 +13:00
JJenkx f4630b2144 docs(ssl): record PS5 reader call evidence and remaining limits 2026-10-18 22:17:37 -04:00
JJenkx e8ec260bae fix(ssl): use context-scoped PS5 certificate reader arguments 2026-10-18 22:17:13 -04:00
JJenkx f2d31a0b14 test(ssl): exercise PS5 certificate reader call shapes 2026-10-18 22:17:12 -04:00
SandstromPLandClaude Opus 5.5 f77a9eaa08 fix(relinker): give a Linux module with a DT_INIT of 0 its libkernel.prx
#6106 made a Linux guest module with an initializer depend on
libkernel.prx, which exports the module-argument getter and setter that
its DT_INIT stub imports. That check still tested Init != 0, so a module
whose DT_INIT is 0 got the stub but not the dependency. With no other
libkernel.prx loaded, the executable then stopped with a symbol lookup
error, and a --module-dir module failed to load with "undefined symbol:
__aps5_get_pending_module_args_nid_no_patch". The check now uses HasInit,
like the writers.

guest_zero_initializer now checks that the Linux module lists
libkernel.prx, and its native load provides one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 07:46:52 +05:30
Adrià Franch c567384e83 docs(debt): record sceAgcDcbContextStateOp deviations 2026-10-19 04:13:20 +02:00
fogydes c2a158415d feat(libSceAgc): implement unversioned context state operations 2026-10-19 04:13:09 +02:00
AhirandClaude Opus 5.5 f970620d95 fix(agc): keep half the host heap out of the host import budget
Imports, type-3 mirrors and the buffers and textures placed in host memory share the driver's system memory heap. On Windows that heap is half the physical memory, so on a 16 GiB machine the old budget (the heap less 2 GiB) let imports hold about 6 of its 8 GiB, and host buffer allocations then overflowed into the 256 MiB device-local host-visible heap and failed. The budget now reserves the larger of 2 GiB and half the largest host heap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 04:11:15 +02:00
Yunus Shaikh d2658d4d2b test(agc): decode the sample-order test's pixel stage as a draw does
Since #6470, a draw decode sets the pixel stage's iteratesSamples from the per-sample shading state and its sample locations from the draw's state, and a pixel shader that does not iterate runs once per pixel with sample 0. The sample-order test built its pixel stage from the registers alone, so its per-sample passes ran once per pixel and SampleID read 0. It now sets both fields as DrawDecode does.
2026-10-18 19:08:48 -07:00
Scramblrrrr 88c8320e35 fix(agc): flush the shared logger from native clients 2026-10-18 23:03:58 -03:00
Adrià 40393b0f95 Merge pull request #6487 from klosixgaming-arch/fix/pthread-detach-joiner
fix(libkernel): refuse to detach or rejoin a thread that is being joined
2026-10-19 04:03:57 +02:00
SandstromPLandClaude Opus 5.5 0500362ff2 test(relinker): run guest_zero_initializer with the ASan host-loading option
#7147 added add_asan_test_options so the CPU-side tests pass in an
ANYPS5_ENABLE_ASAN build, and gave the relinker tests that load the
instrumented guest_module_args_host.prx into Python
verify_asan_link_order=0. guest_zero_initializer's Linux run loads the
same host library with ctypes.CDLL in a Python subprocess, so under ASan
it failed with "ASan runtime does not come first in initial library
list". It now runs with the same option.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 07:33:52 +05:30
Adrià b4d517ed10 Merge pull request #6334 from hypermoist/feat/libc-dinkumware-atomics
feat(libc): implement the remaining Dinkumware _Atomic helpers
2026-10-19 04:03:52 +02:00
SandstromPL 40a2e871a1 Merge remote-tracking branch 'upstream/main' into fix/relinker-guest-zero-init 2026-10-19 07:33:46 +05:30
Jota b079a96e3e test(audioin): skip the silent blocks a late capture device leaves
sceAudioInInput waits four block lengths (21 ms at 256 samples and
48 kHz) for the host device and returns silence when nothing arrived.
guest_audio_in_capture required the recording in the first four blocks
after sceAudioInOpen and in the first block after sceAudioInAsyncOpen.
On a loaded host the SDL disk driver's thread starts or runs late, a
block comes back silent, and the test aborted at captured == recorded.
Read until a block carries sound, at most 200 blocks, and check the
recording as before.
2026-10-18 23:01:26 -03:00
XairRrR ca421072df test(agc): find the pipeline cache file in the current version's directory
The test helper took the only entry of the shader cache root as the
version directory. It now opens the directory named after the current
shader cache source version, requires exactly one pipeline cache file
there, and only requires the root to hold no files, so other version
directories do not fail it.

AI-assisted: yes
2026-10-19 03:54:08 +02:00
XairRrR 907c9cd1b6 fix(agc): keep the Vulkan pipeline cache file with its shader cache version
The pipeline cache file lived in the shader cache root and every run
merged its pipelines into it, so pipelines built from SPIR-V of earlier
recompiler versions were never dropped. The file only grew (965 MB for
PPSA05684 after a few recompiler changes) and the driver loads all of
it into host memory at device creation.

The file now sits in the directory of the current shader cache source
version, next to the variants it was built from.

AI-assisted: yes
2026-10-19 03:53:56 +02:00
XairRrR 132e69d595 fix(agc): drop the depth plane images of older surfaces a new plane overlaps
Each depth surface stores its plane through a storage image of its own,
kept for the surface's life. A title that switches output resolution
binds new depth targets over memory where the previous targets' planes
were, and the old images stayed live there. Storage images over the same
memory lend each other pending results, so a later store of the new
plane did not reach guest memory and buffer reads kept seeing the old
depth. A bind now drops the images and the pending store of older
surfaces whose planes overlap its plane over another range. A
same-range surface (another stencil or HTILE address) keeps its image.
The scan runs only when a surface or plane image was created since the
surface's last scan.

AI-assisted: yes
2026-10-19 03:49:59 +02:00
XairRrR 84e3b73f16 fix(agc): keep depth planes coherent with buffer reads and writes of their memory
A depth surface lives in its Vulkan image, so a buffer read of its depth
plane saw guest memory the surface never wrote, and a buffer write into the
plane never reached the surface: binding the target again kept the old
depth.

- A single-sample 32-bit depth surface with the 64 KiB Z swizzle
  (DB_Z_INFO SW_MODE 24) keeps a storage image in that swizzle over its
  plane. A bind that writes or fast clears depth marks the plane stale;
  FlushDepthPlanes copies the depth into the storage image and stores it
  into guest memory. It runs from StorageTexture::FlushPending, when a
  buffer upload finishes (over its regions and address space), and before
  a dispatch for each GuestBuffers V# it binds (a cached dispatch reads
  them without an upload). A reused build flushes its in-place buffer
  regions, and an image lookup flushes the range it reads, as do the
  write-stamp proofs that let a cached image or a reused build skip that
  lookup: a stale plane's memory looks unchanged to them.
- Stale planes are kept as ranges under their own lock with an atomic
  hull; a flush that overlaps none returns without the GPU and surface
  locks.
- Every bind of such a surface, and every flush of its stale plane,
  collects the plane's writes. Written by someone else since the surface's
  previous bind, store or reload, the plane is reloaded from memory
  instead of stored, so a guest write after a depth draw is not
  overwritten by that draw's late store. A pending HTILE fast clear wins
  over the reload.
- A color target flushes the stale planes under it before it retires their
  surfaces, so a target that loads or blends reads the stored depth. A
  retired surface's plane is no longer stale: a later flush never stores
  its old depth over what the new owner of the memory wrote.
- The depth surfaces lock is recursive: a store reached from a flush under
  DepthSurfaceTexture re-enters it.
- Draws pass whether they write depth, so read-only binds do not mark the
  plane stale.

PPSA05684 copies its main depth plane into two ping-pong planes with a
buffer compute, draws the cage's depth into them and fogs its menu from the
result; without this the copy carried nothing and the fog covered the
cliff and the cage.

agc_driver_depth_plane_buffer_memory draws depth 0.5 into such a plane,
fetches vertices from it (the plane must hold 0.5), writes 0.75 into the
memory and draws at 0.5 under LESS (must pass), then checks the depth
written after the reload reaches memory again. On a new plane it writes
memory after a depth draw and before any store: a buffer read must keep
the guest bytes and the next bind must reload them; a guest write before a
depth draw must then lose to that draw. A linear texture at an offset into
a plane must read what memory holds after a flush, also when it is viewed
through its cached storage image after another depth draw. On a plane with
HTILE, an HTILE fast clear after a guest write must win. A color target
that blends ZERO/ONE over a plane just drawn at 0.5 must write back the 0.5
it loaded.

AI-assisted: yes
2026-10-19 03:49:59 +02:00
xXPBSXxandClaude Sonnet 5.5 55b197d31c docs(debt): describe the vertex fetch overhang case without the title
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 03:47:33 +02:00
xXPBSXxandClaude Sonnet 5.5 d01548e81b fix(libSceAgcDriver): zero the overhanging record of a vertex fetch
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 03:47:33 +02:00
Karan Vora 6d92220829 perf(agc): stage raw buffer elements a dispatch sweeps
Since 2688b7646 a read and written V# element is staged in device memory
up to 16 MiB when the direct dispatch's threads times the V# stride cover
at least half of it. A raw buffer has stride 0, so it never passed and
kept the 2 MiB written window: GL storage buffers compiled by Mesa stay
bound in place in the host import however hard a dispatch sweeps them.

The PS5 OpenGL Showcase's particle update (262,144 threads, each loading
and storing its own 32-byte record of an 8 MiB SSBO) took about 53 ms of
GPU per frame on an RTX 4060 bound in place; staged it takes about 0.1 ms
plus 2.2 ms of bulk copies.

The recompiler already records the furthest byte each buffer resource's
accesses reach past their base (maxByteExtent). The binding plan now
carries it per guest buffer element (DescriptorBinding::bufferExtent,
shader disk cache format 37), and a raw element uses it as its record
size in the sweep test. Strided elements are unchanged.
2026-10-19 03:43:19 +02:00
Adrià 324e0e48e0 Merge pull request #6482 from Ondra97/codex/team-20261015-worker-1-ready
fix(libkernel): preserve RTLD_GLOBAL visibility on Windows
2026-10-19 03:39:21 +02:00
Adrià fd2ef7e28e Merge pull request #6465 from milescoviello/fix/free-retired-depth-surfaces
fix(agc): free retired depth surfaces nobody samples
2026-10-19 03:39:16 +02:00
Adrià 9d4382d268 Merge pull request #6475 from EagleBearerYS/fix/agc-guard-lazy-capture-pages
fix(agc): run the read guard over a shader capture's lazy pages and raw word reads
2026-10-19 03:39:11 +02:00
xXPBSXxandClaude Sonnet 5.5 3050c89321 test(libc): report the child's exit code and output when the guest abort check fails
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 03:39:05 +02:00
Adrià 23629c2847 Merge pull request #6454 from EagleBearerYS/perf/shader-image-table-reuse-v3-pr
perf(agc): share one image table per heap and write epoch through capture, compare, resolution and descriptors
2026-10-19 03:39:03 +02:00
Adrià 72b0ab3e8e Merge pull request #6312 from meh7an/perf/agc-cut-draw-allocations
perf(agc): cut per-draw heap allocations
2026-10-19 03:38:58 +02:00
Jota 6f94cba100 test(libkernel): serialise the two dynamic loader tests that share their files
guest_dynamic_loader and guest_dynamic_loader_fixed_base run the same
GuestDynamicLoader.cpp in the same working directory, and both copy the
module fixture to anyps5-relinked-module-for-test.prx.guest.prx and
anyps5-host-loaded-module-for-test.prx before loading it. Under ctest
--parallel one test rewrote or removed a file the other had mapped:
Bus error, or failed at GuestDynamicLoader.cpp:92. Give both one
RESOURCE_LOCK.
2026-10-18 22:38:13 -03:00
Adrià 79d7d26b6d Merge pull request #6484 from Ondra97/codex/team-20261015-worker-2
fix(libkernel): share guest rename semantics with sceKernelRename
2026-10-19 03:35:57 +02:00
Dean Galvin 4d4ae6e5eb Merge main into pr-4650
# Conflicts:
#	core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
#	core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
#	core/shader/recompiler/tests/RequestSerializerTests.cpp
2026-10-19 14:32:36 +13:00
klosixgaming-arch 30cbb2fd66 fix(libkernel): refuse to detach or rejoin a thread that is being joined
PPSA34015 (EA SPORTS FC 27) stopped with "Joining guest thread: Access is
denied": scePthreadJoin waited on a thread that another call released
under it, and then waited on its closed handle. As FreeBSD 11.4's
thr_join.c and thr_detach.c do with the joiner field, scePthreadDetach
now returns EINVAL while a thread waits to join the target, a second
concurrent scePthreadJoin returns EOPNOTSUPP, a cancelled join backs out,
and a completed join leaves the thread detached.
2026-10-19 03:30:58 +02:00
Yunus Shaikh 745f199d5a Merge main into fix/agc-sample-location-grid-exact
Combines this branch's sample order with #6470's once-per-pixel and once-per-sample inputs. The pixel request keeps both sides' fields: #6470's iteration, position location and sample locations are serialized at version 34, and the sample order after them at version 35. The serialization tests move the sample-order bytes after the iteration fields and drop both from older versions. The pixel info collector adds sample order to the SampleLocationsVary inputs, and the draw keys compare and hash both. EmitSampleOffset's iterated index already goes through GuestSampleIndex, since the SampleId builtin does. The shader cache stays at FormatVersion 40, and the sample-location debt entry takes #6470's sentence on the position inputs.
2026-10-18 18:30:37 -07:00
Adrià b5be95ff0b Merge pull request #6364 from SleglJan/pr/flush-wait-newer-writers
fix(agc): store pending image results after the range's writers finish
2026-10-19 03:27:49 +02:00
Adrià c22eb87563 Merge pull request #6476 from JJenkx/fix/bundled-validator-teardown
fix(build): preserve bundled validator type tables through exit
2026-10-19 03:27:03 +02:00
Adrià 7978a4b585 Merge pull request #6366 from EagleBearerYS/fix/agc-defer-unpreparable-abi-stages-v3
fix(agc): leave a stage the title's pipeline ABI cannot prepare to its first use
2026-10-19 03:26:59 +02:00
Adrià f9239c9746 Merge pull request #6473 from ahir061/perf/agc-debug-only-texture-creation-logs
perf(agc): log storage image and storage-viewed texture creation only with APS5_DEBUG_LOG
2026-10-19 03:26:54 +02:00
Adrià c7892bf6c6 Merge pull request #6471 from SleglJan/pr/readwords-lazy-blocks
perf(agc): run reads copy the missing blocks of a page mapped whole at once
2026-10-19 03:26:49 +02:00
milescovielloandClaude Opus 5.5 f0b208a073 test(agc): expect one-sample rasterization of a smoothing draw without MSAA_ENABLE
Since #6196, a one-sample target under a multisampled rasterizer with
MSAA_ENABLE clear is drawn as one sample instead of refused, so the
overrasterized draw with MSAA_ENABLE clear now decodes as one sample without
merged coverage.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 01:25:34 +00:00
milescovielloandClaude Opus 5.5 51ac7d36e2 fix(agc): journal merged coverage with the pipeline state
Pipeline creation and the pipeline store key read State::mergedCoverage,
but the journal's state codec and CanonicalPipelineState dropped it, so a
journalled merged-coverage pipeline replayed as a plain multisampled one
and the draw built its pipeline again. The codec and the canonical state
now carry it and the journal format becomes 4.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 01:25:33 +00:00
milescovielloandClaude Opus 5.5 7f59934b7d feat(agc): draw radeonsi line and polygon smoothing through merged mixed samples
A radeonsi-style GL driver smooths lines and polygons by rasterizing four
samples into a one-sample color target: PA_SC_AA_CONFIG has 4 samples,
DB_EQAA.OVERRASTERIZATION_AMOUNT is log2(4), and the pixel shader reads
SAMPLE_COVERAGE to scale alpha by the covered samples. The pixel is written when
any of the four samples is covered. DecodeState refused the one-sample target as
a sample-count mismatch.

Such a draw (MSAA_ENABLE set, no depth target, no per-sample shading, every
color target one-sample, OVERRASTERIZATION_AMOUNT matching the raster samples)
now decodes with mergedCoverage. Its pipeline keeps the raster sample count,
gives the color attachments one sample (VkAttachmentSampleCountInfoNV or the
render pass) and merges coverage (VK_COVERAGE_REDUCTION_MODE_MERGE_NV). The
device enables VK_NV_framebuffer_mixed_samples and VK_NV_coverage_reduction_mode
when it reports that combination; elsewhere the pipeline throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 01:25:33 +00:00
Yunus Shaikh b6489b863a Merge main into fix/agc-sample-location-grid-fallback
The custom MSAA sample-location debt entry keeps this branch's grid stand-in text and takes main's sentence on ANCILLARY and the position inputs of a once-per-pixel shader.
2026-10-18 18:25:31 -07:00
milescovielloandClaude Opus 5.5 03b0db0520 feat(shader): load the SAMPLE_COVERAGE pixel input from gl_SampleMaskIn
SPI_PS_INPUT_ENA/ADDR bit 14 (SAMPLE_COVERAGE_ENA) gives the pixel shader one
VGPR, after ANCILLARY, holding the samples the primitive covers. The decoder
refused it and the recompiler never loaded the VGPR. It is now loaded from
gl_SampleMaskIn[0] (sharing the input the partial quad sample mask already
declares). On a multisampled draw the hardware word is the whole pixel's
coverage while gl_SampleMaskIn holds only the invocation's samples when the
pixel shader runs per sample, so that case, and sample-rate or ancillary inputs
beside it, are refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 01:25:21 +00:00
Hotline Messina Dev 02dd083729 fix(tools): preserve empty load segment alignment when unwrapping SELF 2026-10-18 21:25:03 -04:00