Commit Graph
14017 Commits
Author SHA1 Message Date
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
akkadbakkad89andDevin eac14403cc docs(libs): add debt notes for the six declared system libraries
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-10-19 12:26:39 +00:00
Adrià Franch 3881028d43 docs(dev): fix the PowerShell log redirection and add the device-lost and abort notes 2026-10-19 14:26:07 +02:00
felekandClaude Opus 5.5 822ad04809 docs(dev): drop the draft notice from the game testing guide
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BywPXoZACVi8ALV4JKvuPZ
2026-10-19 14:25:53 +02:00
felekandClaude Opus 5.5 9702cd0ea7 docs(dev): fold testers' notes from #6622 into the game testing guide
Adds what testers reported in the Q&A thread and what our own runs
showed: confirming the GPU and the cache state, AC power and refresh
rate, the Windows exit code of an uncaught exception, Windows session
and scheduled-task start, Unity module placement and the MinGW DLLs,
a section on measuring performance, and the report fields.
Drops APS5_NO_MOUSE_CAPTURE, which main no longer has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BywPXoZACVi8ALV4JKvuPZ
2026-10-19 14:25:53 +02:00
mrfelekandClaude Opus 5.5 7914eb8ca7 docs(dev): take the tested GPU from the log's selection line
A report names the GPU as the log's `Selected GPU name=` line shows it, since AnyPS5 can fall back to llvmpipe without presentation support or pick another adapter on Windows (suggested by odntht on #6627).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BywPXoZACVi8ALV4JKvuPZ
2026-10-19 14:25:53 +02:00
mrfelekandClaude Haiku 5.5 e4a071f695 docs(dev): add a game testing guide
Draft guide for running a title on AnyPS5: the build and conversion steps,
the environment variables to set for each run, what to read in the log and
the exit code, how to tell a stall from a crash, Windows-specific notes, and
what to include when reporting a result. Maintainers are asked what they need
from it in the Q&A discussion linked from the page.

Co-Authored-By: Claude Haiku 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BywPXoZACVi8ALV4JKvuPZ
2026-10-19 14:25:53 +02: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
xxLnolan 30454880de fix(libc): implement PAF mspace memalign 2026-10-19 13:59:05 +02:00
xXPBSXxandClaude Sonnet 5.5 360e8bd685 fix(tools): print unwrap_self reports as UTF-8 on every console
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-19 13:58:16 +02:00
Nithishvelan M 0f34160a49 feat(libc): export tgammaf float math function
PPSA26578 (issue #7624) imports tgammaf (NID B2ZbqV9geCM) from libc,
and its bundled libc.prx does not export it, causing the process to
exit with 0xC0000139 (GetLastError: 127).

Export tgammaf_nid_postfix in core/libs/prx/libc/src/Math.cpp delegating
to std::tgamma(float), and add unit test coverage in GuestMath
verifying factorials, half-integers, poles, and negative values.
2026-10-19 17:27:50 +05:30
Alex ColliniandClaude Opus 5.5 1d8acd1eda fix(agc): skip a periodic pipeline cache save while a pipeline creation holds the cache
The saver thread took the snapshot lock with a blocking exclusive lock. Behind
a pipeline creation that runs for minutes (an NVIDIA compile of a 1.5M-word
compute pipeline), the queued writer made the shared_mutex hold every later
pipeline creation on every queue until the compile ended. The periodic save now
tries the lock and waits for the next interval when it is busy; SaveNow and the
teardown save still wait.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 13:57:50 +02:00
Nithishvelan M 6487d5e2c5 feat(libc): export nextafter double math function
PPSA26578 (issue #7624) imports nextafter (NID h+J60RRlfnk) from libc,
and its bundled libc.prx does not export it, causing the process to
exit with 0xC0000139 (GetLastError: 127).

Export nextafter_nid_postfix in core/libs/prx/libc/src/Math.cpp delegating
to std::nextafter(double, double), and add unit test coverage in
GuestMath verifying denormals, infinities, NaNs, and negative zero.
2026-10-19 17:25:31 +05:30
alfalfa-starandClaude Opus 5.5 4be9dfe394 docs(agc): list APS5_NO_SPACE_STAMP_ONCE in the environment table
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 13:55:05 +02:00
alfalfa-starandClaude Opus 5.5 713f5c2678 perf(agc): drop the cached space's committed-page memo
Kena's cached-space hits have no copied ranges, so the memo of their
committed pages saved nothing (imports pass 0 us per build with and
without it), and keeping it current needed a second commit-generation
bump in libc. The space is still stamped once per hit; the test that
commits pages between two hits stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 13:55:04 +02:00
alfalfa-starandClaude Opus 5.5 587d1d123c fix(agc): keep a cached space's committed pages per commit generation
The memo of a cached address space's committed pages is published
lock-free and rebuilt when the arena's commit generation moves, which a
commit now advances again when it ends. A trimmed space's last hit
moves back to its imports, and the space hit longest ago is trimmed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 13:55:04 +02:00
alfalfa-starandClaude Opus 5.5 a8dea52d11 perf(agc): reuse a cached address space's committed pages on a hit
A hit in the read-only V# address-space cache described the committed
pages of every copied range again and stamped the space once per import.
The cached space now keeps its copied ranges' committed pages and is
stamped once per hit. APS5_NO_SPACE_COMMIT_MEMO=1 and
APS5_NO_SPACE_STAMP_ONCE=1 turn the two parts off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 13:54:55 +02:00
Savvanis SpyrosandClaude Opus 5.5 c92f09d1d5 docs(debt): name no title in the SCE code gap entry
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 14:53:58 +03:00
Nithishvelan M 2165427879 feat(libc): implement std::_Throw_bad_optional_access
PPSA26578 (issue #7624) imports _ZSt26_Throw_bad_optional_accessv (NID
KwzEip7m6TM) from libc, and its bundled libc.prx does not export it,
causing the process to exit with 0xC0000139 (GetLastError: 127).

Implement std::bad_optional_access type record and vtable deriving from
std::exception, thrown through ThrowPlain, with what() returning
"bad_optional_access", and add unit test coverage in ExceptionRuntime.
2026-10-19 17:22:27 +05:30
Dean 6762694735 Merge pull request #7761 from angleboyndn-stack/fix/libc-secure-string-destination-limits
fix(libc): reject oversized secure string destinations
2026-10-20 00:52:00 +13:00
Dean 08a0b7c95b Merge pull request #7702 from vittoriosalvadore/codex/fix-unwrap-empty-load-alignment
fix(tools): preserve empty load segment alignment when unwrapping SELF
2026-10-20 00:51:46 +13:00
thuanquangandClaude Opus 5.5 9c048ee162 test(agc): skip kept-denormal f64 add and mul rows a device cannot preserve
As for the f64 rounding test: on a device without f64 DenormPreserve, a
mismatch in the modes that keep f64 denormals is reported as skipped;
the modes that flush them are still checked everywhere.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 18:49:58 +07:00
thuanquangandClaude Opus 5.5 01ed9192ed fix(shader): flush v_add_f64 and v_mul_f64 denormals by the f64 field
v_add_f64 and v_mul_f64 ignored the FLOAT_MODE f16/f64 denormal field.
On RDNA2 (gfx1031) bit 6 clear flushes both inputs to a zero of their
sign, and bit 7 clear flushes a sum below 2^-1022 and a product whose
exact value rounded to 53 significant bits with an unbounded exponent
is below 2^-1022. The product test scales one source by 2^64 and
compares the host product with 2^-958.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 18:49:58 +07:00
ionut27001andClaude Opus 5.5 dca67ae477 fix(libkernel): return kern.rng_pseudo in 64-byte blocks as measured on a PS5
In a payload process on a PS5 (firmware 12.70),
sysctlbyname("kern.rng_pseudo") answers a size query with 64 and gives
at most 64 bytes per call, up to a 65536-byte buffer. A buffer smaller
than 64 bytes gets as many bytes as its length and a null length gets
none, both with -1 and ENOMEM; a null buffer with a null length returns
0, and errno is kept when the call succeeds. Here the whole buffer was
filled, a size query threw and the length was never changed. The 64
random bytes are now drawn only for a read that passes both a buffer
and a length.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 14:49:39 +03:00
Adrià bbb45463c7 Merge pull request #6849 from al3w0f205/feat/audiopropagation-firmware-exports
feat(libSceAudioPropagation): export missing firmware functions from database
2026-10-19 13:46:36 +02:00
Adrià 87aee045df Merge pull request #6821 from JJenkx/fix/point-context-sdk-defaults
fix(agc): initialize point size and limits from SDK defaults
2026-10-19 13:45:12 +02:00