Commit Graph
10481 Commits
Author SHA1 Message Date
Adrià Franch d5eeed0b34 fix(libc): use std::fabs overload for fabsl 2026-10-18 20:02:58 +02:00
BIGFERRY999 831ecb05f7 feat(libc): implement fabsf and fabsl 2026-10-18 20:02:41 +02:00
Adrià 8d17389a73 Merge pull request #6161 from freshstart2066-create/feat/libc-fdim
feat(libc): implement fdim and fdimf
2026-10-18 20:00:19 +02:00
Adrià 8625038579 Merge pull request #6150 from BasilF-dev/basil/wolverine-barrier
fix(agc): defer unrouted vertex barriers
2026-10-18 19:53:21 +02:00
Dean c3591adf97 Merge pull request #7510 from AlxcBTW/pr/crash-stack-words-v4
feat(libc): dump the faulting thread's stack words in Windows crash reports
2026-10-19 06:52:21 +13:00
AlxcBTW 33fea9e1ba Merge main into pr/profile-windows 2026-10-18 19:49:54 +02:00
Adrià c34e9d855c Merge pull request #6160 from fma-rc/feat/agc-fs-table-calls
feat(agc): link calls through the AGC FS table
2026-10-18 19:44:10 +02:00
frankea fb020d215b feat(libSceSsl): apply the verify options, run the verify callback, add ALPN, non-blocking sockets and sceSslClose
sceSslConnect verifies the server's chain under MBEDTLS_SSL_VERIFY_OPTIONAL and returns the first failure the connection's verify options select, with the SSL_ERROR_* codes KytyPS5 lists. The initial options are all five checks, so a connection whose title never sets them fails closed: with no CA loaded it returns SSL_ERROR_UNKNOWN_CA instead of throwing. The result is final for the connection: a failure sends close_notify, later sceSslConnect calls return the same code, and sceSslRead and sceSslWrite throw. A verify callback runs once after the handshake, outside the session lock, with the connection id, that code, handles to a copy of the peer chain that the context's certificate readers accept, the chain length and the user argument; a negative return fails the connect with SSL_ERROR_APPLICATION_VERIFICATION_CALLBACK_CHECK. The ALPN list set with sceSslSetAlpn is split on commas and offered, sceSslGetAlpnSelected returns the protocol the server chose, and the minimum version floors the handshake at TLS 1.2. A socket that would block returns SSL_ERROR_WANT_POLLIN or WANT_POLLOUT from connect, read and write and the next sceSslConnect resumes the handshake; the BIO maps a reset to MBEDTLS_ERR_NET_CONN_RESET, which returns SSL_ERROR_SOCKET_CLOSED, and tells a blocking socket's expired receive timeout, which returns SSL_ERROR_READ_TIMEOUT, apart from a non-blocking would-block. sceSslClose sends close_notify once and marks the connection closed. The debt entry records the default options and the situation-to-code choices as unverified and drops the title IDs.
2026-10-18 13:37:58 -04:00
MarcZX100 e541cc9546 test(relinker): assert Windows symbolic rejection 2026-10-18 17:35:36 +00:00
MarcZX100 2f7eb66c65 test(relinker): keep symbolic fixture on Linux output 2026-10-18 17:34:06 +00:00
MarcZX100 86d3c085e9 fix(relinker): reject Windows DF_SYMBOLIC modules 2026-10-18 17:30:25 +00:00
Adrià Franch b8692a74f2 fix(agc): route the sRGB expand copy through AllocateImageMemory 2026-10-18 19:29:55 +02:00
Gustavo Ariel Gamarra Rojas 57fc04be01 fix(agc): place repacked and stencil copies in host memory after a refused reclaim
Repacked copies and depth stencil copies allocated device-local memory
directly and stopped the title on a refusal; they now take the same
allocation path as the other images. Device buffers choose their host
fallback type the same way, the host placement line carries the cumulative
MiB, and the debt file records that a placed image stays in host memory
for its lifetime.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas cfde713e10 fix(agc): release the texture caches before placing any image in host memory
Textures, storage textures, block, depth and depth plane copies and
attachments now share one allocation path: the pool trims its idle tiers,
releases the texture caches, retries device-local memory and places the
image in host memory only when that retry is refused too. Block and depth
plane copies no longer fall back on their first refusal.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas 9b2339e735 fix(agc): reclaim the buffer pool before placing an attachment in host memory
Render, depth and multisampled targets and attachment proxies that the
driver refuses device memory now go through the buffer pool's recovery:
the pool releases its idle allocations and the attachment is retried in
device-local memory. Only a second refusal places it in host memory, and
that placement is logged with the bytes reclaimed.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas 79b6f79745 fix(agc): fall back to host memory for render, depth and copy images refused device memory
Depth targets, depth plane copies, multisampled and render targets, block and
depth copies and attachment proxies allocated device-local memory without the
fallback, so a full device-local heap still stopped the title at them.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas ad11cb1b3e fix(agc): place device memory in host memory when the driver refuses a device-local allocation
The budget check in DeviceMemoryType trusts VK_EXT_memory_budget, which lags
behind the driver: with the device-local heap nearly full the budget can still
report room, the allocation fails with VK_ERROR_OUT_OF_DEVICE_MEMORY, and the
title stops. Device buffers (after the pool's reclaim and retry), textures and
storage textures now retry in a host memory type allowed by their requirements.
2026-10-18 19:29:47 +02:00
Adrià 218aa8f00b Merge pull request #6082 from meh7an/perf/agc-draw-snapshot-upload-chunk
perf(agc): copy small draw snapshots into a per-recorder upload chunk
2026-10-18 19:28:06 +02:00
Adrià 09acc80f7e Merge pull request #6145 from MarcZX10/codex/fix-agc-atomic-gds-size
fix(libSceAgc): reserve complete atomic GDS packets
2026-10-18 19:28:01 +02:00
Dean 19bb30cee8 Merge pull request #7602 from MarcZX10/codex/agc-overlay-test-gpu-selector
fix(tests): honor ANYPS5_GPU in performance overlay fixture
2026-10-19 06:22:32 +13:00
MarcZX100 e88f7fc157 fix(libkernel): return errno when Windows CPU clock queries fail 2026-10-18 17:14:22 +00:00
Adrià f03a2da5ee Merge pull request #5668 from babyhuey/fix/libc-keep-host-standard-streams
fix(libc): keep the host standard stream when a guest freopen of it fails
2026-10-18 19:11:47 +02:00
Adrià FranchandClaude Sonnet 5.5 e751268ad9 test(relinker): provide libkernel.prx to the native guest preinit load
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 19:09:58 +02:00
Ayamullah Khan 6574ade033 fix(relinker): pop the guest preinit thunk registers in reverse order
The Windows deferred preinit thunk pushed r12, r13 and r14 and then
popped r12, r13 and r14, so the caller got r12 and r14 back swapped.
InitializeDeferredModule keeps the module base, table and count live
across the call to the thunk, so a compiler that keeps any of them in
r12 or r14 sees corrupted loader state after opening a deferred module
that has a preinit array. Pop in reverse push order instead and pin the
new bytes in test_guest_preinit.
2026-10-18 19:09:47 +02:00
Ayamullah Khan 36baa5fcad test(relinker): run the guest preinit test with verify_asan_link_order=0
guest_preinit loads the instrumented guest_module_args_host.prx into Python, so in an ANYPS5_ENABLE_ASAN build it needs the same verify_asan_link_order=0 as the other module tests; without it, it fails with "ASan runtime does not come first in initial library list". add_asan_test_options does nothing outside ASan builds.

Signed-off-by: Ayamullah Khan <ayamullahkhan04@gmail.com>
2026-10-18 19:09:47 +02:00
Ayamullah Khan 9c43211664 fix(relinker): run guest preinit arrays before the module initializer
Converted guest modules never ran their DT_PREINIT_ARRAY entries: the
reader validated the array and the unused-NID filter kept its targets,
but no writer emitted or ran it. ld.so runs a shared object's preinit
array only for the main executable, so the Linux output runs the
entries from the DT_INIT stub before the module initializer; the macOS
and Windows outputs run them before the initializer in their startup
stubs, and the deferred Windows output exports a thunk that runs them
before the initializer for runtime-loaded modules. A module with a
preinit array and no initializer is still rejected, since the Linux
stub exists only with one.
2026-10-18 19:09:46 +02:00
Adrià 3aebaa7de6 Merge pull request #6124 from yripper/feat/macos-guest-arena
feat(libc): reserve the guest arena on macOS
2026-10-18 19:09:43 +02:00
MarcZX100 40bc17cb86 fix(libkernel): return errno when Windows CPU clock queries fail 2026-10-18 17:04:35 +00:00
Adrià f890e21a81 Merge pull request #6111 from Kernel-Hunter/fix/rosetta-rdtscp-processor
fix(relinker): report processor 0 from RDTSCP under --to-rosetta
2026-10-18 19:00:12 +02:00
Adrià e1dae23e01 Merge pull request #6107 from YossiYad/fix/libc-closed-standard-descriptors
fix(libc): open closed standard descriptors on /dev/null when libc loads
2026-10-18 18:58:19 +02:00
Adrià 84b7ef9de3 Merge pull request #6181 from MarcZX10/codex/document-guest-clock-scale-6172
docs(dev): describe the guest clock scale switch
2026-10-18 18:58:07 +02:00
Adrià b5ab10185b Merge pull request #6121 from fdfawef324/claude/mc-np-state-callbacks
feat(libSceNpManager): register NP state callbacks and report signed-out from sceNpCheckCallback
2026-10-18 18:57:53 +02:00
AlxcBTW 78869e5a47 test(libc): drop the stack bound case, it also passes without the bound 2026-10-18 18:57:49 +02:00
Adrià e1338ff5ea Merge pull request #5999 from mazen320/fix/retroarch-windows-select-and-8_8-uint
fix(libkernel,agc): unblock RetroArch Windows select and 8_8 UINT
2026-10-18 18:53:13 +02:00
Adrià FranchandClaude Sonnet 5.5 827df2d907 fix(libSceAudioOut): lock the per-port output mutex in sceAudioOutSysClose
main replaced g_outputMutex with g_outputMutexes[], so the Sys close no longer compiled. Mirror sceAudioOutExClose: range-check the handle, lock its mutex.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 18:52:46 +02:00
primesoul-web 5dd106ef20 test(libs): assert the GameUpdate null-label error and pin the mastering states layout
guest_gameupdate still asserted the throw that sceGameUpdateGetAddcontLatestVersion
no longer raises for a null entitlement label since it answers 0x80412803, so the
test aborts; it now asserts the error, the same change #5919 makes. The mastering
states layout is pinned with compile-time size checks for the descriptors, the
compressor and limiter states and both states structs, as #6380 suggested.
2026-10-18 18:52:36 +02:00
primesoul-web 3f03bc0e24 feat(libs): finish the CesCs conversions and the AudioOut, AudioIn and GameUpdate exports
libSceCesCs goes to 17 of 17: three-byte EUC-JP JIS X 0212 (0x8F)
characters convert through a table read from the Unicode consortium's
JIS0212.TXT, both directions, so sceCesEucJpToUcs2, the MbcsStrTo*
and *Get*Len forms and the context conversions accept them, and a
character with cells in both JIS X 0208 and JIS X 0212 still encodes
to the two-byte form. sceCesRefersUcsProfileCp1250 returns a profile
with the Windows-1250 table of Microsoft's bestfit1250.txt, accepted
by the SBC and context conversions.

The AudioOut HDMI bitstream Sys family follows the Ex ports: SysOpen
opens a port only for mode 5, the TrueHD MAT route EVO-PLAYER-PS5
reads from the firmware 12.70 mode tables, paced at 192 kHz with no
host device; SysConfigureOutput accepts the observed HDMI MAT switch;
SysClose closes a Sys port. sceAudioOut2MasteringGetState fills the
states by states id with the descriptors KytyPS5 declares, SetParam
answers a null parameter with the mastering invalid-API-parameter
error, Set3DLatency follows KytyPS5's output validation (0x80268001
above 2, any user), SetSystemDebugState records the debug state id,
and GetSpeakerArrayCoefficients returns the front pair KytyPS5 and
prosper both return.

sceAudioInOpen accepts param 0x10 as float mono like KytyPS5; HqOpen
answers a longer grain or a lower rate with the invalid-size and
invalid-frequency errors; AsyncOpen also accepts the 384-sample grain
SharpProspero documents. sceGameUpdateGetAddcontLatestVersion answers
a null entitlement label with 0x80412803, as prosper does.
2026-10-18 18:52:36 +02:00
AlxcBTW 5dbdd6b797 Merge main into pr/input-analog-keys 2026-10-18 18:51:35 +02:00
Adrià FranchandClaude Sonnet 5.5 3b5c41b20f fix(libc): ilogb special cases match PS5 libc.prx (0 -> INT_MIN, inf/NaN -> INT_MAX)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 18:49:34 +02:00
BIGFERRY999 0edfefaf18 feat(libc): implement ilogb and ilogbf 2026-10-18 18:49:25 +02:00
AlxcBTW 19b8fb3239 fix(libc): bound the stack dump by the thread's stack top and keep its buffers off the stack 2026-10-18 18:49:20 +02:00
milescovielloandClaude Opus 5.5 4c50918d91 fix(agc): leave a guest read check the page table can answer to the page table
The process_vm_readv probe answered a small read check before the page
table was looked at, so a page the table holds as inaccessible (as #6184
records them) read as accessible whenever the host page was readable. The
probe now runs only for ranges with no recorded page state.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:45:07 +00:00
milescovielloandClaude Opus 5.5 eb6b567fbe perf(agc): answer small guest read checks without /proc/self/maps
On Linux kernels without PROCMAP_QUERY (before 6.11, which includes the
stock Ubuntu 24.04 kernel), every guest range check that misses the page
cache reads and parses /proc/self/maps up to the covering mapping. The
cache only covers the guest arena and the image, so ranges in the host
heap always miss. ASTRO BOT (PPSA21564) checks 96-byte shader headers
there from RegisteredHeader (through SameHeader) on every
sceAgcCreatePrimState and interpolant mapping, about 3,700 times per
second while it loads.

A read-only check of at most 4 KiB on such a kernel now first reads the
range into a scratch buffer with process_vm_readv on the own process.
If every byte is read, the range is readable. Anything else (a fault,
a partial read, a refused call, a write check or a larger range) takes
the path it took before, which also builds the failure message.

agc_driver_graphics runs a second time with APS5_NO_PROCMAP_QUERY=1, so
the fallback path is covered on kernels that have PROCMAP_QUERY too, and
LiveStack gains read-only checks: a readable range, and ranges that end
in a guard page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 16:45:07 +00:00
Adrià 889cee5f9f Merge pull request #6115 from ArjenS-LA/fix/relinker-needed-output-collisions
fix(relinker): reject needed companion output collisions
2026-10-18 18:44:13 +02:00
Adrià cd04995e01 Merge pull request #6054 from Dextroid17/feat/srgb-copy-pr
feat(agc): sample 8 and 8_8 sRGB textures through an RGBA8 sRGB copy
2026-10-18 18:44:08 +02:00
BIGFERRY999 5509b6c701 feat(libc): implement erf, erfc, and erfcf 2026-10-18 18:43:58 +02:00
BIGFERRY999 c33cf11f06 feat(libc): implement fdim and fdimf 2026-10-18 18:42:52 +02:00
Adrià dc2aae4c6c Merge pull request #6094 from n-delic/pr/unaligned-atomics-32
fix(shader): act on the containing dword for unaligned 32-bit buffer atomics
2026-10-18 18:42:02 +02:00
Romans Pokrovskis 8ff509a9ab fix(agc): honor GPU selection in overlay tests
(cherry picked from commit 932eeb085e8e7db2eff4615d9a24786001dc7ad7)
2026-10-18 16:41:53 +00:00
Adrià 4eaf162e30 Merge pull request #6109 from YatoVoid/fix/shader-memory-tests-disable-disk-cache
test(agc): disable the shader disk cache in agc_shader_memory_tests
2026-10-18 18:39:41 +02:00