Commit Graph
12196 Commits
Author SHA1 Message Date
Rajkamalcode 368fb65ab2 fix(libc): keep the guest %ld argument 64-bit in the err test
The guest is LP64, so vwarnx consumes a full 64-bit slot for %ld. On LLP64 hosts (Windows) the 123456789L argument is only 32 bits wide and leaves the upper half of that slot undefined, so the check saw garbage in the high bits.
2026-10-19 18:29:59 +05:30
Crimson bd03daa4f2 fix(shader): give the default NaN for an f16 fma invalid product with a NaN src2 2026-10-19 14:57:35 +02:00
Crimson 49d22c5b8f test(agc): require the default NaN for f16 fma invalid operations 2026-10-19 14:57:32 +02:00
Crimson de82860c94 fix(shader): leave a NaN src2 of an f16 fma invalid product to the driver 2026-10-19 14:57:32 +02:00
Crimson e98cf7f9a0 fix(shader): give f16 fma invalid operations the default NaN
v_fma_f16, v_fmac_f16, v_fmamk_f16, v_fmaak_f16 and v_fma_mix_f32 with
f16 sources left the NaN of an invalid operation to the driver, so
inf * 0 gave 0x7fff and 0x7fffffff on NVIDIA where the hardware gives
the default NaN 0xfe00 and 0xffc00000. An inf * 0 product, or a NaN
from sources that are not NaN, now gives the default NaN; NaN sources
are still left to the driver.
2026-10-19 14:57:26 +02:00
XairRrR c505661ea9 fix(agc): store a depth plane over the guest writes made before the store
A storage image's write-back keeps the 64 KiB blocks written since its
layers were last in sync, since the memory may have been reused. A
depth plane's image is overwritten whole by every store, but it kept
the sync state of its creation or last reload. A plane bound behind an
HTILE fast clear never reloads, so once guest memory over it had been
written (another render target over the same memory), every later
store kept those blocks and the drawn depth never reached guest memory.
A store now marks the image as holding the whole plane, as a whole-image
copy does (StorageTexture::MarkWholeWritten, split out of CopyFrom).

agc_driver_depth_plane_buffer_memory gains the case: store a plane,
write its memory, clear its HTILE and draw, then fetch the plane. It
fails without the change (the fetch reads the guest write).

AI-assisted: yes
2026-10-19 14:51:51 +02:00
UAQ Taxi a968336825 fix(libc): remove Windows trees without the remove_all symlink hang
MinGW libstdc++ up to GCC 16 does not treat a reparse point as a link in
std::filesystem::remove_all, so a host tree that holds a symlink is walked
through the link and never returns. Add RemoveTree, which removes the tree
itself on Windows, and use it where save data, app content and the shader
disk cache removed host trees. The libstdc++ fix is in GCC 17 (88856ad855ae).
2026-10-19 14:49:49 +02:00
UAQ Taxi 379dca5cac test: raise the slow-host timeouts 2026-10-19 14:49:36 +02:00
Adrià f3bb6a4f8d Merge pull request #6878 from Dragost/fix/libkernel-directory-descriptor-seek-end
fix(libkernel): support SEEK_END on directory descriptors
2026-10-19 14:48:26 +02:00
Adrià d5bbceb4f7 Merge pull request #6725 from johandavidcm/fix/agc-depth-write-address
fix(agc): compare the depth write base only when the depth plane is written
2026-10-19 14:48:21 +02:00
MarcZX100 4c0767c248 test(libkernel): remove stat loop symlink fixture 2026-10-19 14:44:53 +02:00
MarcZX100 7c7a590caa fix(libkernel): map Linux stat symlink loops 2026-10-19 14:44:53 +02:00
MarcZX100 41483e7a21 fix(libkernel): return ELOOP when stat follows a symlink loop 2026-10-19 14:44:32 +02:00
Crimson 317a323eec fix(shader): release the LDS lock with an exchange and drop fences inside it 2026-10-19 14:43:13 +02:00
T3cm0 6fdb88fd48 fix(libc): share slot 8 in ios_base::_Addstd as the console does 2026-10-19 14:41:10 +02:00
tecmo 4bf4fc9864 feat(libc): implement ios_base::_Addstd
Queue the stream in the table of the 8 standard stream
slots of Dinkumware's ios.cpp: the first free slot or the one
that already holds the stream, with a reference count per slot,
and the destructor suppresses the destruction of a standard
stream while its slot still has open references.
2026-10-19 14:41:10 +02:00
Hamidreza 186b2863ea perf(relinker): flat address-taken vector and region query caching in strict reachability 2026-10-19 14:40:17 +02:00
mopgobopotandClaude Opus 5.5 3f8184ae09 fix(relinker): sort PT_LOAD entries of Linux guest modules by address
The Linux executable sorts its PT_LOAD entries, but guest modules (*.guest.prx) kept them in the input table order. A module whose data segment comes before its text segment in the table was written with PT_LOAD entries out of address order, which the gABI forbids: glibc reserves the span from the first to the last entry, so with 0x2000, 0x1000, 0x4000 it reserved 0x2230 bytes instead of 0x3230 and mapped the text below the reservation. The PT_LOAD entries are now sorted in place, as for the executable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 15:40:05 +03:00
mopgobopotandClaude Opus 5.5 87b53b18ca fix(relinker): accept relocations against symbol index 0 for Windows and macOS
Code analysis rejected R_X86_64_64, GLOB_DAT and JUMP_SLOT relocations whose symbol index is 0 (STN_UNDEF) with 'invalid relocation symbol', so the Windows and macOS conversions failed while Linux converted the same input. The pipeline already resolves such relocations to 0 plus the addend, as the gABI defines and as the relinker technical debt entry records for null symbol entries; only an all-zero entry at a nonzero index was accepted. Index 0 is now treated as an import slot like that entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 15:40:01 +03:00
babyhuey 4a5ce8a094 fix(libc): adopt the guest SDK allocator only when the title replaces the heap
A bundled libc.prx can export the ten allocator NIDs while forwarding
them to HLE, so adopting its exports for a title whose replacement
table is empty sends HLE allocations back into themselves. Keep the
default heap in that case, as before the guest SDK adoption.
2026-10-19 08:39:37 -04:00
ebosido444-ai 943b7007c9 fix(agc): resolve a relocated AGC header whose arrays hold the registered bytes
A title can relocate a registered shader header, and the register, special and
semantic arrays it points at, into memory of its own and resolve the ABI with
that copy (Astro's Playroom, PPSA01325, #2914). SameHeader accepted such a copy
only while every pointer inside it stayed put, so a moved array left the
resolution throwing "refers to a replaced shader header".

Accept the copy when every array it names still holds the registered bytes: the
registered header then decodes what the copy describes, nothing is copied and
ShaderSnapshot stays immutable. A copy whose arrays differ or are unreadable
still throws.
2026-10-19 14:36:11 +02:00
valenciana-nc 3eee6be59d test(savedata): update journal and Windows failure cases for exclusive staging 2026-10-19 06:33:14 -06:00
valenciana-nc f7fd9dbf9f fix(libkernel): check recvmsg guest copies on macOS 2026-10-19 06:33:13 -06:00
ABEL VALENCIANA 32b268fe0f fix(savedata): create exclusive temporary files for save replacement 2026-10-19 06:33:13 -06:00
valenciana-nc 7ef31e91cf fix(libkernel): check only the guest bytes recvmsg reads and writes 2026-10-19 06:33:13 -06:00
valenciana-nc 370f48be82 fix(libkernel): validate recvmsg guest pointer ranges are committed
Address review: check the msghdr, iovec array, iovec bases and name
are mapped before MessageLength or the receive loop touches them,
pairing the HostWrite guard with committed-range validation. Add
regression tests for forged iovec-array and output pointers.
2026-10-19 06:33:13 -06:00
valenciana-nc fe8782adc3 fix(libkernel): validate recvmsg guest output buffers in the guest arena
recvmsg_nid_postfix wrote the msghdr, every iovec base and the sender
address with only null checks, unlike recv_nid_postfix and the
sceNetRecvfrom sender outputs which all gate on GuestArena::HostWrite.
Validate the message, each iovec base and the name buffer the same way
so a forged pointer fails with EFAULT instead of writing received bytes
to an arbitrary host address.
2026-10-19 06:33:13 -06:00
valenciana-nc 413b1237b2 test(libkernel): use a fresh directory for the read-only buffer check 2026-10-19 06:33:12 -06:00
Nithishvelan M f677163eec feat(libSceSysmodule): implement sceSysmoduleUnloadModuleInternalWithArg
Add sceSysmoduleUnloadModuleInternalWithArg to match the existing
sceSysmoduleLoadModuleInternalWithArg export. Decrement the module load
count on valid internal IDs, check module existence in kModuleTable,
and set the return pointer when provided.

Add unit test coverage in GuestSysmodule for invalid values, unloaded
modules, successful argument unload, and unknown IDs. Update technical
debt documentation.
2026-10-19 17:57:40 +05:30
milescovielloandClaude Opus 5.5 054cf42202 fix(agc): give copied guest buffer regions transfer-source usage
A guest buffer region that is copied rather than imported gets a buffer
with storage (and, when addressable, device-address) usage only. Host
imports, sparse imports and chunk imports carry VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
so a buffer view of imported guest memory can be read back with
vkCmdCopyBuffer, but not one of a copied region. agc_sparse_run_import_copied
does that readback, and the Khronos validation layer reports
VUID-vkCmdCopyBuffer-srcBuffer-00118 for it.

Copied regions now carry transfer-source usage too. The sparse buffer
hole tests seed the buffer pool with the usage a copied region asks for,
so their seed buffer gets transfer-source usage as well.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:27:16 +00:00
thuanquangandClaude 83e7dcfce2 test(libkernel): wait up to 30 s for the file lock test's child process
Co-Authored-By: Claude <[email protected]>
2026-10-19 19:25:47 +07:00
akkadbakkad89andDevin 7ccf4da486 fix(prx): align declarations to the PS5 3.20 export inventory and add debt notes
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 12:25:10 +00:00
milescovielloandClaude Opus 5.5 50264ab548 test(agc): pin the import watch for the GPU-recorded DCC refill cases
Off Windows, the GPU fill case now runs with host imports kept watched, so it
always checks the absorbed clear, and a new case runs it with imports left
unwatched, which must be refused. On Windows a settled import is watched again
when its settle is polled, possibly before the draw takes the fill, so an
unwatched fill may be either refused or drawn, and a drawn one is checked.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:23:45 +00:00
milescovielloandClaude Opus 5.5 3738088b1a fix(agc): check that a resident DCC target's ranges are watched before their writes
When a fill of the metadata could not be taken because one of its ranges was
no longer watched, the check reached a watched range that the fill had
changed first and reported the write instead of the unwatched range.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:23:44 +00:00
milescovielloandClaude Opus 5.5 74a6bdaa01 feat(agc): take a full DCC fill of a resident multisampled target as its fast clear
A multisampled DCC color target imports its uniform DCC fast clear on
first use and then refuses any later change to its color, DCC or CMASK
memory. Titles built on the PS5 Mesa stack fast-clear such a target
every frame with two buffer fills, the CMASK to 0xcc (FMASK cleared,
color expanded) and the DCC to a uniform clear key, so the second
frame stopped on "writes to a resident multisampled DCC target or its
metadata are not implemented".

The fills of a resident DCC target's metadata are now noted. When a
fill covered the whole DCC range since the last use and the range holds
its key once pending writes land (LandedUniformMetadataByte, which
reads the bytes directly rather than through the resident read guard),
the next use clears every sample to that key's color, as the import
does, and takes the new DCC and CMASK generations. A CMASK written
since must have been filled whole too. Partial fills, other keys,
CMASK-only writes and any write to the color memory are still refused.
Fills of a DCC target's CMASK no longer go to the CMASK-only fast-clear
tracker, which refused the expanded code 0xcc.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 12:23:44 +00:00
billybobpicklioandClaude Opus 5.5 73983f1c29 perf(agc): queue CPU-path indirect draws on the draw pipeline
An indirect draw drained queue 0's draw pipeline on entry and recorded every
record on the worker, so titles that draw mostly through DRAW_INDIRECT,
DRAW_INDEX_INDIRECT and DRAW_INDEX_INDIRECT_MULTI got no overlap between the
worker's capture of one draw and the committer's recording of the previous.

The draw now drains only when its records or its count overlap a write still
queued on the pipeline. Records drawn inline drain first, so they stay in
order, and the last drawn record is queued like a direct draw, carrying its
write ranges. APS5_NO_PIPELINED_INDIRECT=1 restores the drain on every
indirect draw.

agc_driver_pipelined_indirect_draw holds the committer with a blocking item and
checks that two indirect draws queue behind it and draw what a direct draw
does, and that a draw whose record a queued label writes waits for it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 14:23:10 +02:00
Dean b106f6f8c0 Merge pull request #7672 from valenciana-nc/fix/getdirentries-guest-validation
fix(libkernel): refuse read-only guest mappings for getdirentries on Windows
2026-10-20 01:22:24 +13:00
Dean 8982791bc3 Merge pull request #7654 from ionut27001/fix/libkernel-sysarch-i386-bases
fix(libkernel): answer sysarch I386_GET_FSBASE, I386_GET_GSBASE and undefined operations as measured on a PS5
2026-10-20 01:22:09 +13:00
Dean 50fa53d7ac Merge pull request #7723 from jotitadev/fix/agc-unit-shadow-test-host-stage
test(agc): name the host stage in the unit shadow tests' host-write barriers
2026-10-20 01:21:54 +13:00
Adrià c0607cc4bc Merge pull request #6871 from hugodearaujo/fix/audioout2-speaker-angles
fix(libSceAudioOut): report the front left speaker at +30 degrees, as the console does
2026-10-19 14:19:16 +02:00
Adrià b5bc0c5fdd Merge pull request #6869 from Amoenus/codex/fix-msaa-dcc-range-diagnostic-main896
fix(agc): identify invalidated multisample DCC ranges
2026-10-19 14:18:16 +02:00
Adrià 40d244f668 Merge pull request #6853 from DavidSamir/fix/libc-strtol-no-conversion-errno-macos
fix(libc): keep errno when strtol converts nothing on macOS
2026-10-19 14:17:55 +02:00
Adrià 74eec319ca Merge pull request #6822 from ErenYeager1836/feat/libSceRtc-component-accessors
feat(libSceRtc): implement component getters and setters with range validation
2026-10-19 14:16:05 +02:00
Adrià 54e4adde5b Merge pull request #6860 from Amoenus/codex/fix-legacy-haptic-output-main82
fix(audio): route legacy vibration PCM with per-port timing
2026-10-19 14:10:57 +02:00
eljackjoestar-cmdandClaude Opus 5.5 f06e5d4ebf perf(agc): allocate Windows write-tracking stamps on demand
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 16:10:41 +04:00
Adrià 034c4ec3ba Merge pull request #6851 from GitamarT045T3R/fix/libc-unwind-callback-abi
fix(libc): call guest unwind callbacks with the System V ABI on Windows
2026-10-19 14:09:50 +02:00
Adrià 2b049317b8 Merge pull request #6850 from Ondra97/codex/fix-f64-compare-denormals
fix(shader): honor f64 comparison input denormal mode
2026-10-19 14:05:45 +02:00
Adrià ebf1a90270 Merge pull request #6825 from hugodearaujo/fix/report-implied-read-protection
fix(libkernel): report the read bit of every write bit in a mapping's protection
2026-10-19 14:04:45 +02:00
Adrià 5c6c65232b Merge pull request #6844 from al3w0f205/feat/hmd2-firmware-exports
feat(libSceHmd2): export missing firmware functions from database
2026-10-19 14:03:46 +02:00
Adrià 980da5090d Merge pull request #6842 from milescoviello/fix/scripting-heap-own-blocks
fix(libc): give the scripting heap hooks blocks from libc's own heap
2026-10-19 14:03:41 +02:00