Commit Graph
14017 Commits
Author SHA1 Message Date
Yunus Shaikh 98b9b57ef3 docs: describe the performance overlay 2026-10-14 16:36:48 +00:00
Yunus Shaikh a41be04ed9 feat(videoout): toggle the performance overlay with F10
TogglePerformanceOverlay is bound to F10 by default and, like
ToggleFullscreen, accepts only a keyboard key in anyps5-input.ini.
2026-10-14 16:36:48 +00:00
Yunus Shaikh df91160af8 feat(agc): draw a performance overlay over presented frames
ANYPS5_OVERLAY=1 shows frames per second over the last second, the last
frame time, a graph of the last 120 frame times with their minimum,
average and maximum, and with APS5_PROFILE_GPU and APS5_PROFILE_DRAW the
GPU and driver time per frame, in the corner ANYPS5_OVERLAY_POS names.

A 5x7 bitmap font and solid rectangles are drawn as instanced quads by one
render pass after the frame reaches the swapchain image, on the
presentation pass and the blit paths alike, in SDR and at 203 nits on an
HDR10 swapchain. The text scales with the swapchain height. While hidden,
the presentation records nothing for it.
2026-10-14 16:36:48 +00:00
JosepBove 9926c6b76b docs(ngs2): cite the PS5 module for the voice-index error 2026-10-14 18:36:33 +02:00
Ondra97 5474b7756d fix(avplayer): close safely from event callbacks 2026-10-14 18:36:15 +02:00
RINNECODER ce17977ed9 fix(tools): key compile commands relative to the checkout in check_compile
The key was the source path relative to the common parent of the build
directory and the source. With a build directory beside the checkout
that parent is above the checkout, so the key carried the checkout
directory name and no changed file matched. The key is now the source
path relative to the repository root.
2026-10-14 11:30:20 -05:00
Claude 793224067f fix(shader): round and flush f16 conversion results by FLOAT_MODE in every denormal mode
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-14 16:25:23 +00:00
fma-rc c1783f9d64 fix(libkernel): register a relinked guest module's image when Linux protects its pages 2026-10-14 18:24:45 +02:00
Alex ColliniandClaude Opus 5.5 55eefe9c5e feat(agc): plan table columns whose descriptor spans two loads of a record
A descriptor whose dwords come from two scalar buffer loads of the same
record, where one load's offset carries an immediate addend, was refused
because the column wanted one offset expression and one buffer node for
every dword. The column now peels an immediate addend off each read's
offset and compares effective offsets (memory offset plus addend) and
the remaining base expressions, and accepts distinct buffer nodes that
are equivalent. Dword 0 keeps its offset expression, so columns that were
already planned are planned the same way.

Folding a second load into the first changes where its offset wraps:
at a dynamic offset of 0xfffffff0, a second load at +16 wraps to the
start of the buffer, while the folded read lands past 4 GiB. A column
folds a load only when its addend is no smaller than dword 0's and its
immediate is small, and it records dword 0's addend and the largest extra
addend. A record whose offset would carry past 32 bits between the two
loads is not read and becomes OffsetCarry poison.

PPSA26344 pixel shader 0x8000296000 reads T# dwords 0-3 with an
s_buffer_load_dwordx16 at key * 0x88 and dwords 4-7 with an
s_buffer_load_dwordx4 at 48 + key * 0x88.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 18:20:24 +02:00
Alex ColliniandClaude Opus 5.5 c794273ab2 feat(agc): implement image tables whose records hold a pointer to the T#
A table column can now read its descriptor through a 64-bit pointer
stored in each record: the shader loads the record's pointer at
key * stride + addend + offset from a scalar buffer, then the T# (or S#)
through that pointer. The materializer reads each record's pointer when
it builds the table, reads the descriptor behind it and records one
read range per record. Pointer columns take their own path ahead of the
batched record reader, since a descriptor's address is known only once
its record's pointer is read. The column is planned only when the descriptor
dwords are read at an immediate offset from a GetAddressResource whose
two dwords are consecutive reads of one buffer at the same affine offset.

PPSA26344 compute shader 0x8000333c00 picks a record per lane in a
waterfall loop, reads the record's pointer from it and samples the
image behind it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 18:20:24 +02:00
Claude 9399cc93aa fix(shader): flush v_cvt_pknorm_*_f16 denormal inputs by FLOAT_MODE
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-14 16:18:32 +00:00
winstrexandClaude Opus 5.5 97c3687b01 perf(agc): compare snapshot copies on the CPU and evict BDA tables by recency
Each cached snapshot copy keeps a CPU copy of its bytes, so the reuse
check no longer reads the buffer's mapping, which is uncached on devices
without host-cached coherent memory. An address space's table map now
evicts its least recently used table instead of its smallest key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 13:16:55 -03:00
winstrexandClaude Opus 5.5 619be69796 perf(agc): share snapshot copies and the BDA table of repeated address-based builds
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 13:16:54 -03:00
winstrexandClaude Opus 5.5 1ce75da69a perf(agc): find the address space regions under pending writes by search
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 13:16:19 -03:00
Yunus Shaikh 85ff7136d0 docs(libSceNet): record the wait for a datagram socket's local address on Windows 2026-10-14 09:07:56 -07:00
Yunus Shaikh e9b40a14dd fix(libSceNet): let a datagram receive on an unbound socket wait on Windows
sceNetRecv, sceNetRecvfrom and sceNetRecvmsg called Winsock's receive
straight away. Winsock fails a receive on a socket with no local address
with WSAEINVAL, so on Windows the call returned EINVAL at once. On the
console the receive waits: FreeBSD 11.4's soreceive_dgram sleeps on the
receive buffer whether or not the socket has an address, returns
EWOULDBLOCK for a non-blocking socket, and a send from another thread
binds the socket so the reply can arrive.

Steam Remote Play (PPSA99350) relies on that. Its stream library opens
its discovery socket, starts receiving on a worker thread, and binds the
socket only when another thread sends the discovery broadcast. On
Windows the worker got EINVAL, took it as fatal and closed the socket
before the broadcast went out, so the title never found a PC running
Steam.

On Windows a receive on a datagram socket with no local address now
waits until a bind, connect or send gives it one, checking every 10 ms.
A non-blocking socket fails with EAGAIN at once, and the receive timeout
ends the wait with EAGAIN. An abort or close ends the wait, and the host
receive then fails as before. Once the socket has an address it is noted
as bound, so later receives skip the check, and a later sceNetBind fails
with EINVAL as it does on the console.
2026-10-14 09:07:56 -07:00
hossiendehghan989 f6e9cd6ea5 fix(videoout): keep mouse helpers out of NID exports 2026-10-14 16:02:27 +00:00
xXPBSXxandClaude Sonnet 5.5 f4b45af04c fix(libc): name a guest abort() in the crash report
The guest libc ends abort() in int 0x45, which Windows reports as a read access violation of 0xffffffffffffffff. The report now names that case.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-14 18:02:19 +02:00
Ondra97 faef9e3b87 fix(libSceNet): guard recvmsg guest outputs 2026-10-14 18:02:10 +02:00
KernelPanicNTandClaude Opus 5.5 9a0aa5f6a7 fix(exports): export the PS VR2 calls Phasmophobia's psvr2.prx imports
PPSA09030's Media/Plugins/psvr2.prx imports sceHmd2ReprojectionGetStatus
from libSceHmd2 and sceVrTracker2GetCoordinateSystem and
sceVrTracker2GetPlayAreaBoundaryGeometry from libSceVrTracker2, so the
title does not start with the plugin loaded (discussion #4680). Declare
the three as throwing exports, like the earlier PS VR2 imports of
PPSA29866. The names resolve from the NIDs 8GkaY2B7opM, Y-3JCiU9bbU
and SCph4ZbkqzU with tools/nid_names.py; no reference gives their
signatures.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 15:57:41 +00:00
ahmedmakroum e4c77414ba docs(usage): document the shader cache directory and its environment variables 2026-10-14 15:55:45 +00:00
JosepBove 17f8bb521e docs(ngs2): name DOOM + DOOM II among the titles that probe the voice index 2026-10-14 17:55:09 +02:00
Adrià e34c479210 Merge pull request #758 from Celegans12/feat/agc-image-tables-global
feat(agc): implement image tables loaded through 64-bit pointers
2026-10-14 17:53:44 +02:00
Adrià 763ad20fc1 Merge pull request #757 from Celegans12/feat/agc-image-tables
feat(agc): implement image and sampler tables indexed at runtime offsets
2026-10-14 17:48:32 +02:00
SynnZer0andClaude Opus 5.5 8029428497 fix(libkernel): keep host standard streams open on guest close
Guest descriptors are host C runtime descriptors. Closing descriptor 0, 1
or 2 closed the host process's standard stream, and the runtime then gave
that number to the next file opened anywhere in the process, including
files libkernel opens itself, such as the APR reader's. The title's next
close of the same number closed that file mid-read.

close and sceKernelClose now fail with EBADF for descriptors 0 to 2 that
were open when libkernel loaded, and leave them open. A standard
descriptor that was not open at load can still be opened and closed by
the guest.

PPSA21703 calls sceKernelClose(0) repeatedly while loading asset
bundles, which made APR reads return 0 or a part of the requested bytes
and raised UCRT invalid parameter reports from close.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 17:46:42 +02:00
Evgeniy KazarinandClaude Opus 5.5 a1b80121c1 fix(libSceSystemService): pass LoadExec arguments as the whole guest argv
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 18:41:25 +03:00
Yunus Shaikh 7f82da1080 docs(libSceNet): record which timeout options take a timeval 2026-10-14 08:37:49 -07:00
Yunus Shaikh 032dea0aab fix(libSceNet): read SO_RCVTIMEO and SO_SNDTIMEO as a timeval in sceNetSetsockopt
sceNetSetsockopt took the BSD timeout options, SO_SNDTIMEO (0x1005) and
SO_RCVTIMEO (0x1006), like Sony's 0x1105 and 0x1106: as an int of
microseconds read from the first four bytes. A caller passing a struct
timeval got tv_sec taken as microseconds, so {0, 100000} meant to wait
100 ms became 0 and disabled the timeout, and the receive blocked until
data came.

On the console 0x1006 takes a timeval, as FreeBSD 11.4's sosetopt does.
ProsperoLight (PPSA99002) gives it {0, 100000} through sceNetSetsockopt,
and its log from a console (firmware 12.20) shows Moonlight's receive
timing out every 100 ms before the first packet ("Received first video
packet after 400 ms"). Sony moved only these two timeval options to
0x1105 and 0x1106, as ints. On AnyPS5 the receive never times out, so
ProsperoLight's receive threads never wake when the PC stops sending and
LiStopConnection never returns: the stream screen freezes when a session
ends from the PC side. Steam Remote Play (PPSA99350) sets {0, 10000} the
same way and stays on "THE PC DID NOT ANSWER" when the PC doesn't reply.

0x1005 and 0x1006 now go through the timeval path that setsockopt() on a
libSceNet socket already uses (EINVAL for a value shorter than a timeval,
EDOM for a negative or out-of-range one). sceNetGetsockopt gives them
back as a timeval cut to the caller's length, as FreeBSD's sooptcopyout
does. 0x1105 and 0x1106 keep taking an int of microseconds.
2026-10-14 08:37:48 -07:00
Ondra97 ed26cb81a8 fix(agc): keep mesh cache metadata separate from relocation fields 2026-10-14 17:33:06 +02:00
Ondra97 4e82f15c9f fix(agc): validate mesh index descriptors on cached draws 2026-10-14 17:33:06 +02:00
JosepBove 5fe4780812 fix(ngs2): return the voice-index error from sceNgs2RackGetVoiceHandle
An index at or beyond the rack's voice count returned through
APS5_INVALID_ARG_EX, which throws and ends the process. Heretic + Hexen
(PPSA26525) creates a one-voice reverb rack, takes voice 0 and asks for
voice 1 at start-up, so it stopped at 1.5 s on
"sceNgs2RackGetVoiceHandle: invalid argument". Return 0x804A8305 and
leave the output handle untouched, after the existing null-output and
rack-handle checks. The value follows prosper's analysis of
libSceNgs2.native.sprx; shadPS4 lists 0x804A0302 for the PS4 library.
Neither is a PS5 measurement, recorded in the technical debt.

ngs2_voiceindex creates one-voice sampler, submixer, mastering and
reverb racks and a default sampler rack, and checks the error, the
untouched output, the null-output and invalid-rack codes and that the
last valid index still resolves afterwards. It aborts on main's library
with the throw above and passes with this change.
2026-10-14 17:29:25 +02:00
Elvis BruhinandClaude Opus 5.5 f708a73969 feat(libSceSsl): record connection verify options, minimum version and ALPN
sceSslEnableVerifyOption, sceSslDisableVerifyOption, sceSslSetMinSslVersion,
sceSslSetAlpn and sceSslGetAlpnSelected kept throwing because their
signatures were unknown. SharpProspero, the source already used for the
other connection functions, declares them; the signatures follow it.

The options, minimum version and ALPN list are recorded on the connection
like the verification callback; nothing reads them until sceSslConnect has
a transport. sceSslGetAlpnSelected returns null because no handshake
completes. Unknown connections and terminated contexts throw.

The PPSA07411 functional debt entry moves to libSceJson2.md, now its first
linked library.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01SaSmTp7ZiSYcnUMTDVa7hZ
2026-10-14 17:28:07 +02:00
kjhq 019285d46f fix(tools): place an empty segment that ends a load segment in unwrap_self
unwrap_self refused a container when a non-load segment with no file data
sat exactly at the end of a PT_LOAD, as an empty PT_TLS does in Sifu
(PPSA03001): "segment 6 vaddr 0x88cb7a0 is in no PT_LOAD". The eboot and
36 of its 37 bundled modules carry such a segment. A segment of size zero
now matches the load segment it ends, so it is placed at that segment's end.
2026-10-14 15:24:14 +00:00
Adrià a453108cf7 Merge pull request #5817 from snipeTR/feat/voice-reset-port
feat(libSceVoice): implement sceVoiceResetPort
2026-10-14 17:23:46 +02:00
fdfawef324andClaude Opus 5.5 8847086a00 refactor(recompiler): emit the v_fma_mixlo/hi and v_interp_*_f16 emulation once per module
FPInterpolateF16 and FPInterpolateF32 (v_fma_mixlo_f16, v_fma_mixhi_f16,
v_interp_p1ll_f16, v_interp_p1lv_f16, v_interp_p2_f16) were lowered by
expanding the f64-based Interpolate emulation inline at every use, about
1200 SPIR-V words each, twice per instruction in wave64 shaders. Interpolate
now builds one non-inlined helper function per result width and float mode,
created on first use, and each use calls it. The function body is the
same instruction sequence the inline expansion produced, so results are
unchanged; only the module size changes.

agc_fma_mix_once checks that two more uses grow a module by less than the
first use with its shared function.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 11:20:43 -04:00
eljackjoestar-cmd bb4ec482d2 fix(audio): preserve completed AudioOut2 grains across threads 2026-10-14 19:18:32 +04:00
Jota 4cb3271fb2 docs(build): list Mach-O among relinker-only outputs 2026-10-14 12:10:46 -03:00
hamb3r 6976be9c10 perf(libc): add sub-tick spin tail to PreciseSleepUs and PreciseSleepUntil
- Windows (`_WIN32`): replace full-duration waitable-timer sleep in `PreciseSleepHundredNanos` and the repeated `PreciseSleepUs` call loop in `PreciseSleepUntil` with a hybrid sleep-then-spin helper (`PreciseSleepFromCounterWithTimer`) that sleeps on the thread-local high-resolution waitable timer up to a 250 us spin tail, falls back to `std::this_thread::sleep_for` if timer setup/wait fails, and finishes the remaining window using `QueryPerformanceCounter` + `YieldProcessor()` (thresholded to 200 ns and ceiling-rounded via `PreciseHundredNanosToQpcTicks` for non-10MHz QPC frequencies).
- Linux & POSIX (`!_WIN32 && !__EMSCRIPTEN__`): replace repeated `nanosleep` loop in `PreciseSleepUs` and `PreciseSleepUntil` with `PreciseSleepFromNanos` using `clock_gettime(CLOCK_MONOTONIC)`. On Linux (`__linux__`), cache `PR_SET_TIMERSLACK` (`1 ns`) once per thread (`thread_local`) and sleep via `clock_nanosleep(CLOCK_MONOTONIC, TIMER_ABSTIME)` up to a 15 us spin tail (falling back to a conservative 100 us tail if `prctl` fails; 100 us `nanosleep` tail on other POSIX platforms) before finishing with `_mm_pause()` on x86 or `std::atomic_signal_fence` on non-x86.
- Tests: expand `core/libs/tests/PreciseWait.cpp` to assert that the 31-sample median of `PreciseSleepUs(50)` stays below 90 us (which fails on `main` at ~118 us on Linux and ~518 us on Windows) and verify ceiling QPC tick conversion and timer fallbacks.
2026-10-14 17:59:41 +03:00
Adrià 84b01f9cd0 Merge pull request #1316 from TibixDev/pr/vertex-input-layouts
perf(graphics): retain vertex input layouts
2026-10-14 16:46:44 +02:00
KernelPanicNTandClaude Opus 5.5 352a300dd8 feat(libkernel): answer sceCoredumpGetThreadContextInfo outside the coredump handler
sceCoredumpGetThreadContextInfo takes (void* threadContextInfo,
size_t threadContextInfoSize) as in Orbital's IDA type database, and the
144-byte block of 18 64-bit registers follows SharpProspero. It answers
as sceCoredumpGetStopInfoCpu: the handler is never invoked here, so an
aligned 144-byte request returns NOT_IN_COREDUMP_HANDLER without reading
or writing the block, and null, unaligned or wrapping buffers and other
sizes throw, as the console validation order is unverified.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-14 14:45:01 +00:00
Adrià 979ad7b6aa Merge pull request #5861 from simonbronk/feat/sample-location-grid
feat(agc): rasterize sample locations that vary between pixels through a 2x2 grid
2026-10-14 16:44:29 +02:00
Adrià 41cf107810 Merge pull request #5853 from KernelPanicNT/feat/system-gesture-recognizer-information
feat(libSceSystemGesture): implement sceSystemGestureGetTouchRecognizerInformation
2026-10-14 16:44:03 +02:00
Celegans12 34525fdf7a feat(agc): implement image tables loaded through 64-bit pointers
Plan runtime-indexed T# and S# columns read through a 64-bit pointer.
Preserve the console offset alignment, signed immediate and key bounds.
Track the descriptor dwords consumed by each table in its invocation.
Reject table reads when a writable buffer or storage image overlaps them.
Cover the overlapping-storage fault and isolated second-table behavior.
2026-10-14 16:43:57 +02:00
Celegans12 d9e47d1e98 feat(agc): implement image and sampler tables indexed at runtime offsets
Materialize runtime-indexed image and sampler records into descriptor
tables while keeping descriptor selection in the shader. Report invalid
active entries through the existing deferred fault buffer.

Bind fragment tables in the fragment set when pipeline libraries split it,
and reserve a physical descriptor for empty tables. Reject unsupported
sampler, border, cube and anisotropic pairings per entry. Keep one column
per heap access shape, one T# shared by several image operations included
(milescoviello's #5550 case), and narrow it to the union of its keys'
domains when every key has one (SleglJan's key-domain changes). Plan
columns read at (key << n) & mask over their whole domain (tibzejoker's
fix). Read records in runs through SleglJan's bulk reader, and reject
entries whose surface has no mapped byte, as Tamalero proposed. Store
table columns in disk plans; update the runtime ABI and disk format. Bound
table-sized entries in the resource cache (65,536 table elements) and the
dispatch cache (256 MiB of captured words), evicting LRU.
2026-10-14 16:43:57 +02:00
Josip Parlov 4a71c6b05a docs(usage): note the NVIDIA 610.47 shader compiler crash on Windows 2026-10-14 16:42:09 +02:00
Yossi Yadgar 3969d4f8b3 docs(debt): note how AVC units of parameter sets alone are decoded 2026-10-14 17:42:02 +03:00
Adrià f0854887d6 Merge pull request #5686 from ps54all/feat/libscecescs-jisx0208
feat(libSceCesCs): convert two-byte EUC-JP characters through the CP932 table
2026-10-14 16:41:56 +02:00
Yossi Yadgar 5bdcb2d98f test(libSceVideodec2): decode an AVC stream whose parameter sets come alone
guest_videodec2 splits the first access unit of the H.264 fixture into
its parameter sets and its slices and decodes the parameter sets as a
unit of their own: the call must succeed without a picture, and every
picture after it must still match the reference hashes. With the
previous Export.cpp the first call throws "packet submission failed".
2026-10-14 17:41:51 +03:00
Yossi Yadgar 102db2e1a4 fix(libSceVideodec2): hold an AVC unit of parameter sets for the next slice
Twispero (PPSA99474) plays a Twitch stream through its own FFmpeg demuxer
and submits the H.264 sequence and picture parameter sets as an access
unit of their own, before the first slices. libavcodec rejects a packet
with parameter sets and no slice (h264 "no frame!", AVERROR_INVALIDDATA,
with or without AV_EF_EXPLODE), so sceVideodec2Decode threw "packet
submission failed" and the title stopped as soon as a stream was opened.

A unit without a slice NAL (types 1 to 5) is now kept on the decoder and
put in front of the next unit that has one, and the call returns with no
picture. sceVideodec2Reset drops what is kept.
2026-10-14 17:41:51 +03:00
Yossi Yadgar aca7a3a46d docs(debt): note the fallback of mapping hints with no room above them 2026-10-14 17:41:40 +03:00