Commit Graph
12196 Commits
Author SHA1 Message Date
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
AlxcBTW 0730563b1c test(agc): keep the deferred failure report test independent of log coalescing
Identical deferred write-back failure lines are now coalesced, so the
test throws a distinct message per failure to count every printed line.
2026-10-18 19:28:05 +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
SandstromPLandClaude Opus 5.5 81561867fc Merge upstream/main into fix/relinker-plt-before-code
Resolve the docs/dev/debt/relinker.md conflict with #5994: keep its
sce_module syscall-scan entry, which now also stops at the end of the
last unwind function when the PLT comes before the code (it calls the
same FindSceCodeEnd), and its /libexec/ld-elf.so.1 start in the code
analysis entry, with this PR's end for a PLT before the code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 22:51:57 +05:30
Evgeniy Kazarin 5a1590c9f8 fix(libc): resolve the final Windows path component 2026-10-18 13:15:04 -04: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 <[email protected]>
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 <[email protected]>
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
Evgeniy Kazarin 87a486fb30 fix(libc): preserve lookup in case-sensitive Windows directories 2026-10-18 13:03:41 -04:00
Evgeniy Kazarin cabd834bc5 perf(libc): avoid repeated Windows path component scans 2026-10-18 13:03:41 -04: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
milescovielloandClaude Opus 5.5 de4deb44a1 test(agc): print hex values of failing checks in hex
Four tests printed a value with std::to_string after "0x", so a decimal number
read as a hex one. The anchor of a differing anchored BDA read, guest + 0x100,
was reported as 0x140733498786049 instead of 0x7fff12340101. They now print
these values in hex.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 16:58:32 +00: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à 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
milescovielloandClaude Opus 5.5 1f9ac40808 fix(shader): print the shader hash of a SPIR-V emission failure in hex
The SPIR-V emission failures printed the shader hash with std::to_string
after "hash=0x", so the hash read as a hex number that was the decimal one.
Shader 0x1173ae1000 was reported as hash=0x74955231232. Both now print it in
hex, as the driver's own messages print the shader address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 16:56:23 +00: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
AlxcBTW 6af893fea4 Merge main into fix/bda-unaligned 2026-10-18 18:53:03 +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 <[email protected]>
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 <[email protected]>
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
Lindamea1andClaude Opus 5.5 2514eadcbd feat(libkernel): implement scePthreadAttrGetschedpolicy and scePthreadAttrGetinheritsched
libkernel exported scePthreadAttrSetschedpolicy and
scePthreadAttrSetinheritsched but not the matching getters,
scePthreadAttrGetschedpolicy (NID NMyIQ9WgWbU) and
scePthreadAttrGetinheritsched (NID lpMP8HhkBbg), so a title that
imports either one stopped at startup on the unresolved import. Dragon
Ball Xenoverse 2 (PPSA08587) imports both.

Implement them as FreeBSD 11.4 libthr implements
pthread_attr_getschedpolicy and pthread_attr_getinheritsched
(lib/libthr/thread/thr_attr.c): a null or uninitialized attribute
returns EINVAL (0x80020016), as does a null output of
scePthreadAttrGetschedpolicy; otherwise the attribute's policy or
inheritance is stored and 0 is returned. libthr writes through a null
output of the inheritance getter unchecked, so that case throws, as
pthread_attr_getinheritsched and scePthreadAttrGetsolosched do.

Neither getter was measured on a console. The scePthreadAttr entry in
docs/dev/debt/libkernel.md, which describes the calls measured on a
PS5, now says so and records the throw.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 17:45:49 +01: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 <[email protected]>
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 <[email protected]>
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
Adrià de2f884cc3 Merge pull request #6106 from Zinebyte/fix/deferred-host-dependencies
fix(relinker): scope host dependencies to required guest modules
2026-10-18 18:39:36 +02:00
jagrat Singh d82de57d17 feat(libSceVoiceQoS): implement sceVoiceQoSGetLocalEndpoint and sceVoiceQoSGetRemoteEndpoint 2026-10-18 22:06:03 +05:30
Mehran 3518eb8ded perf(agc): copy small draw snapshots into a per-recorder upload chunk 2026-10-18 18:32:00 +02:00
fdfawef324andClaude Opus 5.5 2ae7896b6d fix(libSceNetCtl): keep the callback argument and deliver the state from sceNetCtlCheckCallback
sceNetCtlRegisterCallback and sceNetCtlRegisterCallbackV6 stored only
the function and dropped its argument, and sceNetCtlCheckCallback
returned 0 without calling anything, so a title that polls
sceNetCtlCheckCallback until its callback reports IPOBTAINED never
got the event.

Each callback slot now keeps the function, its argument and the last
event it received; unregistration clears the slot. With no IPv4
callback registered, sceNetCtlCheckCallback returns 0 without querying
the host. Otherwise it takes the state from the same host-interface
predicate as sceNetCtlGetState, IPOBTAINED (3) or DISCONNECTED (1)
(shadPS4 src/core/libraries/network/net_ctl_codes.h L27-29
@15abf68c9b52), marks the IPv4 slots whose last event differs and
calls them on the calling thread with their argument after the lock is
released, so a callback can unregister itself. Delivery once per state
change and slot follows KytyPS5 src/libs/network.cpp @9e41d8320a27
(NetCtlCallbackSlot L3447-3451, NetCtlCheckCallback L3648-3661,
NetCtlRegisterCallback L3687-3707); shadPS4 net_ctl_obj.cpp L47-57
delivers on every check instead, and the debt entry records the
difference and that KytyPS5 calls the callbacks under its lock.
sceNetCtlTerm clears both tables, as KytyPS5 NetCtlTerm (L3625-3633)
does. V6 slots keep their argument but get no event, since no source
says which call delivers them.

NetCtlCallback is now an APS5_VABI pointer, so the Windows build calls
the guest function with the System V ABI.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 18:31:00 +02:00
Adrià Franch d5b14eaeba fix(libkernel): link libc into semaphore_trace_tests for MinGW 2026-10-18 18:30:22 +02:00
MarcZX100 edbd209a92 feat(libkernel): trace semaphore lifecycle under sync logging 2026-10-18 18:30:11 +02:00
Adrià aff1f7190d Merge pull request #6102 from DavidSamir/fix/relinker-trap-windows-guest-gs
fix(relinker): trap guest GS accesses in Windows output instead of refusing the module
2026-10-18 18:29:03 +02:00
Karim Masmoudi 57e52c1f03 fix(relinker): report processor 0 from RDTSCP under --to-rosetta
Rosetta sets RDTSCP's ECX to its constant TSC_AUX, 0xAAAAAAAB, which is
not a processor index. --to-rosetta already makes RDPID return processor
0 for the same reason, so code reading the processor through RDTSCP saw
a different value from code reading it through RDPID.

--to-rosetta now moves RDTSCP into an optional stub that runs the
instruction unchanged and then loads 0 into ECX with a MOV, which
leaves the counter in EDX:EAX and the flags as they were. A site with no
movable instruction after it for the jump is kept, as for RDPID. The
Intel target and a plain relink are unchanged.
2026-10-18 18:27:15 +02:00
Dean d3d8d79c59 Merge pull request #7583 from MarcZX10/codex/fix-video-out-flip-vblank
test(videoout): correct first flip pacing assertion
2026-10-19 05:22:52 +13:00