Skip to content

fix(libSceFiber): run a fiber on its own context when the context is large - #6003

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
XairRrR:fix/fiber-large-context-stack
Oct 17, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
XairRrR:fix/fiber-large-context-stack

Conversation

@XairRrR

@XairRrR XairRrR commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

What

Since #4265 every fiber runs on an mmap'd host stack (its context size plus 1 MiB), so that host calls made from a fiber cannot overrun the small contexts PPSA01341 packs next to each other. A title that derives state from the stack pointer then reads the wrong memory:

  • PPSA05684 (Uncharted: Legacy of Thieves Collection) creates 36 job fibers with 512 KiB contexts at 1 MiB-aligned addresses and 64 fibers with 64 KiB contexts. Its job fibers find their job record by masking the stack pointer (and rsp, ~0xfffff for the 512 KiB ones). On a host stack the mask lands outside the context, the job system loses track of a GameInit job, and the main thread waits forever (while (job->counter) usleep(1)) right after loading big4r/actor76.txt.
  • With only the 512 KiB fibers back on their contexts, the game passes GameInit and then faults in guest code running on a 64 KiB fiber's host stack.

A fiber now gets a host stack only when its context is smaller than 64 KiB; a larger context is the stack again, as on the console. StackTop, FiberBounds and SizedWindow already handle a fiber without a host stack, so sceFiberGetInfo (#5348) keeps reporting the context the fiber runs on.

The limit sits between the 16 KiB contexts PPSA01341 needs protected and the 64 KiB ones PPSA05684 needs as its stack; it is chosen between these two titles, not measured, and recorded in docs/dev/debt/libSceFiber.md. A title with small contexts that also derives state from the stack pointer, or one whose host calls overrun what is left of a large context, is not covered.

Tested

Checklist

…large

Since 7947149 every fiber ran on an mmap'd host stack so that host calls
cannot overrun the small contexts PPSA01341 packs next to each other. A
title that derives state from the stack pointer then reads the wrong
memory: PPSA05684's job fibers have 512 KiB contexts at 1 MiB-aligned
addresses and find their job record by masking rsp with ~0xfffff, so the
job system lost track of a GameInit job and the game waited forever
right after loading big4r/actor76.txt. Its 64 KiB fibers fault later on
a host stack too.

A fiber now gets a host stack only when its context is smaller than
64 KiB; a larger context is the stack again, as on the console. The
limit sits between the 16 KiB contexts that need protection and the
64 KiB ones that need the guest stack (technical debt entry). The fiber
test runs a 512 KiB fiber and checks that its stack is in its context;
it fails without this change.

AI-assisted: yes
@Dextroid17

Copy link
Copy Markdown
Contributor

I ran this PR's test on Linux.

Setup: this PR's diff applied to main at 8cd937e (the PR's base is 282 commits behind it), default CMake build (CMAKE_BUILD_TYPE empty, unoptimized), clean environment. ctest -R '^fiber$', 3 runs each. The test did not open a GPU device, so this is a CPU-only run.

  • with this PR: 3 of 3 pass.
  • with libSceFiber/Export.cpp put back to main's version (the new test kept): 3 of 3 fail at "Fiber check failed: a fiber with a 512 KiB context runs on its context".

So the new test catches the old behaviour here. I did not check Windows, macOS or a real GPU.

AI-assisted: yes

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/Fiber.cpp
PR 6222 core/libs/prx/libSceFiber/Export.cpp
PR 6361 core/libs/prx/libSceFiber/Export.cpp

@XairRrR

XairRrR commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for running it, Dextroid17.

Still needed on current main: Uncharted: Legacy of Thieves Collection (PPSA05684, #4001) built from unchanged main at 5d9dcc4 stalls during startup (its log stops and its fiber worker threads spin at 100% CPU), and it boots with this PR layered on the same commit. Linux, RTX 4070 Ti SUPER, driver 615.78.08.

AI-assisted: yes

@adriadam10 adriadam10 self-assigned this Oct 16, 2026
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux: build + ctest in scope 34/34 green; fiber fails with Export.cpp reverted to main and passes with the PR. The 64 KiB limit is recorded as unmeasured in docs/dev/debt/libSceFiber.md. Merging once the Windows build is green.

@adriadam10
adriadam10 merged commit 6caba08 into boykopovar:main Oct 17, 2026
9 checks passed
oneandonlydean pushed a commit that referenced this pull request Oct 17, 2026
Since #6003 a fiber with a context of 64 KiB or more runs on the
context itself, so the 64 KiB fiber of agc_driver_gpu_map_on_fiber
imports its mapping on a host thread on Windows too, and the test's
Windows-only expectation of no thread failed. The test now also maps
on a 16 KiB fiber, which keeps a host stack and imports on it on
Windows, and expects one import thread for the 64 KiB fiber on every
platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RINNECODER added a commit to RINNECODER/AnyPS5 that referenced this pull request Oct 17, 2026
…hroughput (#530)

* 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.

* docs(debt): sync debt documentation structure with upstream

* 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.

* fix(shader): flush v_cvt_pknorm_*_f16 denormal inputs by FLOAT_MODE

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA

* refactor(libSceNet): wait for a local address after sceNetRecvmsg's socket type check

* feat(libSceAppContent): implement sceAppContentGetAddcontDownloadProgress

The signature (uint32_t service label, const NpUnifiedEntitlementLabel*,
progress*) follows SharpProspero Interop/AppContent/AppContent.cs.
dlc_emu dlc_content.cpp (fcf69b16) answers PARAMETER for a null label or
progress and NOT_FOUND for a label that is not installed additional
content. No additional content is ever installed here, as
sceAppContentAddcontMount, sceAppContentAddcontEnqueueDownload and
sceAppContentAddcontDelete already model, so every other call answers
NOT_FOUND and the progress, whose 16-byte layout SharpProspero gives,
is never written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(shader): intersect dominator sets as bitsets

Structurizing recomputes dominators after every CFG rewrite, and each block started from a vector of every block id. The same fixed point now runs on bitsets and still writes the sorted id lists.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(relinker): run the file writer's replacement test on a copy of itself

The running-executable replacement test copied /bin/sleep under the
names "running" and "leftover" and started the copy. On Ubuntu 26.04
/bin/sleep is the uutils multi-call coreutils binary, which picks the
utility from the file name of the path it was started through, not
from argv[0], so the copy printed "coreutils: unknown program
'running'" and exited, and file_writer_binary and file_writer_text
failed without ever replacing a running executable. The test now
copies its own executable and starts it with a "wait" argument that
sleeps, so it no longer depends on how a system binary reads its name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ajm): honor Opus gapless resets

* fix(ajm): preserve live decoder handles across ID wrap

* feat(libSceNpPartner001): answer sceNpHasEAAccessSubscription without an EA Access server

Co-authored-by: Cursor <cursoragent@cursor.com>

* perf(libSceSysmodule): cache the unwind region of loaded images on Windows

sceSysmoduleGetModuleInfoForUnwind called VirtualQuery and GetMappedFileNameA on every call. VirtualQuery on a large image section costs time proportional to the section (2 us for 16 KiB, 51 us for 8 MiB, 167 us for 32 MiB), and a title that unwinds exceptions while loading calls it for every frame of every throw.

The region and file name of an address inside an image of the Windows loader's module list are kept per region and used while the loader still reports the same image (base, time stamp and size). Other addresses are queried every time.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* feat(opus): decode at 8, 12, 16 and 24 kHz

Accept every creation rate listed by the public decoder research in
libSceOpusDec and libSceOpusCeltDec, resampling FFmpeg's 48 kHz output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(libc): raise logic_error::_Doraise and _Xruntime_error

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(relinker): preserve weak imports in Linux guest modules

* fix(libSceNetCtl): answer the DHCP host name, PPPoE name and proxy server as empty strings

Since boykopovar#5056, sceNetCtlGetInfo throws for every info code it does not
model. Ghost of Yotei (PPSA26344) asks for code 12, the DHCP host name,
during boot and now aborts one second in.

The configuration boykopovar#5056 reports (wired, DHCP, HTTP proxy off) sets no
DHCP host name, no PPPoE user name and no proxy server, so codes 12, 13
and 20 now return 0 with an empty string. The Wi-Fi codes (5-10) and
the proxy port (21) still throw. GuestNetCtl checks the three empty
answers and keeps the throw check for the rest; the libSceNetCtl debt
line says the same.

* feat(libSceAmpr): implement __cxa_call_unexpected

__cxa_call_unexpected takes the in-flight exception's unwind header and
never returns, as in libcxxabi. No std::set_unexpected is exported and
the exception header's unexpected handler is never set, so the handler
is always the default one, which calls std::terminate. It therefore
forwards to libc's __cxa_call_terminate, which begins the catch and runs
the current terminate handler; a null header terminates in libc's
__cxa_begin_catch. libcxxabi's std::terminate would instead run the
terminate handler saved in the exception header at throw time; the two
differ only if std::set_terminate was called in between, which the debt
entry records.

The test shares the forked-child helper of the std::_Pad test, which now
takes the terminate handler to install.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(relinker): guard TLS instruction byte access at EOF

* feat(libSceLoginService): let PPSA34015 load without a missing module

FC 27 stops on Windows with Failed to load module / error 126 because this PRX is absent. Export Initialize and Terminate as no-ops and keep RequestDevices throwing until the buffer layout is known.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(libSceSysmodule): report the region of the queried page from a cached unwind region

VirtualQuery describes the pages from the queried address to the end of the run of equal pages, so the reported seg0 begins at the queried page. The cached entry returned the first lookup's page for every later address in the run. It now returns the queried page and the bytes up to the end of the cached run, which is what VirtualQuery returns.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(libSceSysmodule): look up an earlier page of a cached unwind region after a later one

The backward lookup added with the region fix compared the address with a page it could not reach and never ran. The test now queries an ntdll address three pages in, then the first page, then the pages between, and compares each with VirtualQuery. The lookups after the first fail on the cache before the region fix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* docs(input): list the default keyboard and mouse bindings

INPUT_MAPPING.md names the actions and says that omitted actions keep their built-in bindings, but not what those bindings are. The table is read from InputMapping in core/libs/prx/libScePad/include/InputMapping.hpp.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* test(libc): keep intentional aborts away from the system crash handler

guest_host_standard_error and exception_runtime fork children that end in
SIGABRT on purpose. When kernel.core_pattern pipes cores to a handler, as
Ubuntu's apport and systemd-coredump do, the kernel starts it for every
dumpable crash even with RLIMIT_CORE at 0. apport takes about 1.1 s per
crash here, so guest_host_standard_error spent 2.3 s waiting and timed out
at its 10 s limit under parallel ctest load. Marking those children
non-dumpable on Linux skips the handler: 2.29 s to 0.01 s and
1.17 s to 0.01 s, with the same SIGABRT and message checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(libkernel): support EVFILT_READ on the read end of a pipe

kevent threw for any descriptor that is not a guest socket. The read end
of a pipe now gets the descriptor knote, following FreeBSD 11's
filt_piperead: data is the number of buffered bytes and EV_EOF is set
once the write end is closed. GuestSockets::Ready falls back to the new
PipeReadState for a descriptor that is not a socket, and WaitAny waits on
the pipe with ppoll on Linux or in 1 ms WSAPoll slices on Windows, only
when the queue holds a pipe. On Windows the equeue waker now starts
Winsock itself, since a queue can wait on a pipe before any socket exists.

* feat(libkernel): add sceCoredumpConfigDumpMode as a throwing stub

PPSA16833 imports it from libkernel, and its executable does not load
while no library exports the NID. The signature is unknown, so it throws
if called, like sceCoredumpWriteUserString.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(libkernel): share the Windows pipe query between poll and kevent

PipeReadiness and PipeReadState both opened the pipe handle and asked
NtQueryInformationFile for its access mask and local information. Both
now go through QueryPipe, which keeps each caller's error prefix.

* docs(build): describe the [gputime] line and its command classes

* fix(libkernel): fail connect on a listening socket with EOPNOTSUPP

FreeBSD's soconnectat refuses a socket with SO_ACCEPTCONN set with EOPNOTSUPP (45). The host answers EINVAL on Windows and EISCONN on Linux, so connect() on a listening stream socket returned the host's error. Answer EOPNOTSUPP for a listening stream socket before the address is read.

* test(agc): wait for preparation workers before linking

* fix(libkernel): reject invalid ftruncate descriptors safely

* fix(ngs2): stop stale rendering after waveform callbacks

* fix(libkernel): use precise waits for select and poll on pipes on Windows

On Windows, select over pipes polls readiness in HostPoll and sleeps
std::this_thread::sleep_for(1 ms) between rounds, and poll with pipes
but no native sockets sleeps sleep_for(slice). winpthreads ends these
sleeps on 15.6 ms timer ticks (boykopovar#1471), so a guest select or poll with a
short timeout on an idle pipe waits about 15 ms per call instead of its
timeout, and a longer wait checks the pipes only every 15.6 ms.

Both paths now sleep with PreciseSleepUntil. Each sleep requests at
most 1 ms and ends no later than the deadline; the old HostPoll sleep
could pass its deadline by a whole tick. poll on pipes also stops
spinning through the last partial millisecond before its deadline,
where the remaining time truncated to 0 ms and no sleep was made.
Infinite timeouts still sleep 1 ms per round.

The pipes are now checked about every 1.5 ms instead of every 15.6 ms:
a pipe that becomes ready is noticed sooner, and a thread blocked on an
idle pipe wakes about ten times as often. A 1 ms poll on an idle pipe
returns after about 1.5 ms instead of spinning for 1 ms.

guest_poll times 20 polls with a 2 ms timeout on an empty pipe read end
and guest_select times 20 selects with a 1 ms timeout on it; each set
must take less than 200 ms. A 1 ms poll does not reach the old sleep,
because the remaining time truncates to 0 ms and the old loop spins
until the deadline, so the poll check uses 2 ms. On Windows Server 2025
both sets took 312 ms before this change and about 50 ms and 30 ms
after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(shader): allow 32 sampler pairs per shader

A pixel shader of MXGP 26 (PPSA30839) uses 17 samplers, over the limit
of 16 sampler pairs. The sampler heap now holds 64 descriptors, ShaderData
grows by 32 sampler metadata records and the runtime ABI version moves
to 13.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(agc): honor the GPU selector in recorder fixtures

* perf(agc): draw an indirect rect list from its records on the GPU

ClassifyIndirectDraw sent every indirect rect-list draw to the CPU path
(non-vertex path), which reads the records on the CPU. When the GPU writes
those records earlier in the frame, the read waits for every batch up to
the producer: in Kena (PPSA01802) each such DRAW_INDIRECT waited about
15 ms, about once per frame.

A rect list on the vertex path is drawn by its generated tessellation
stages from three-vertex patches, with no draw-dependent constants, so the
records can be consumed on the GPU like any vertex-path draw. The
classifier now keeps a rect list without mesh or tessellation stages on
the GPU path, and Graphics::Draw accepts it. APS5_NO_RECT_INDIRECT=1
restores the CPU path.

agc_driver_rect_list_indirect submits a direct rect-list draw and the
same rectangle from a DRAW_INDIRECT record and requires the same bytes,
and a record without vertices to draw nothing; it passes on either path.
agc_driver_draw_offset_indices requires an auto indirect rect-list record
whose packet names no offset registers to be classified to the GPU.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(libSceNet): return 0 from an unbound datagram receive after shutdown or for zero bytes

On Windows a receive on a datagram socket with no local address waits
for one. A sceNetShutdown of the receive side now ends that wait, and
later receives return 0 at once; a zero-length receive returns 0 without
waiting. FreeBSD's soreceive_dgram returns 0 in both cases. Before, a
thread blocked in such a receive kept waiting after the socket was shut
down.

* test(libSceNet): receive on an unbound datagram socket that another thread binds or connects

The test covered a send that names the waiting socket. A bind and a
datagram connect from another thread name it too: each case now waits in
sceNetRecv on the unbound socket, binds or connects it, and checks that a
peer's datagram to the new address reaches the waiting receive.

* perf(libSceNet): end the wait for a local address when a bind, connect or send gives one

A receive on an unbound datagram socket checked the host socket every
10 ms, so it went on waiting up to 10 ms after another thread's bind,
connect or send had named the socket. sceNetBind now wakes the waiting
receives. On Windows a datagram connect or a send marks the socket bound
and wakes them once the host socket has its local address; a raw socket
that a send leaves without one stays unmarked and keeps waiting.

* fix(libSceNet): keep one receive timeout across the wait for a local address

When the address came during the wait, the host receive that followed
waited its whole SO_RCVTIMEO again, so a receive could take up to twice
the timeout. FreeBSD's soreceive_dgram sleeps once per timeout. Now the
receive waits for a datagram with WSAPoll only for what is left of the
timeout, and fails with EAGAIN when it runs out, as before. Nothing
changes when the socket already had an address or has no timeout.

* test(tools): add tool convention tests from upstream

* fix(tools): recognize markdown fences with CRLF endings

* fix(tools): keep duplicate export paths unquoted

* fix(tools): hide labels that do not fit treemap slivers

* docs(usage): state that the shader cache directory has no size limit

The Shader cache section says only that subdirectories of other versions are removed after 14 days. housekeeping() in ShaderDiskCache.cpp removes nothing from the current version, and no size or entry limit applies there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>

* fix(tools): read workflow job keys at the indentation the file uses

The ci-gate check read a job's needs and if only two spaces deeper
than the job name. In a workflow indented by four spaces those keys
were never found, so a job gated with needs: eligibility and an if on
its outputs was reported as ungated. Read the keys at the indentation
of the job's first child instead.

* test(agc): wait for the second-store image itself to be pending

* test(agc): wait for pending result on the tested surface

* test(agc): cover pending surface identity in the shared wait

* docs(usage): describe the texture cache budgets and APS5_TEXTURE_CACHE_MIB

* test(agc): shut libc down before agc_shader_helpers returns

On Windows, agc_shader_helpers returned from main with the driver's
threads still running. ExitProcess ends them first, then the DLLs'
static destructors run and wait on what those threads left locked:
the async log's queue mutex in Driver::stop, DeviceUseGate's condition
variable in ~Driver, and condition variables in libkernel's statics.
The test hung after printing its result in about one ctest run of
three on a Radeon 860M (boykopovar#6791).

Like the other driver tests, it now runs LibcRunShutdown_nid_postfix
before returning, which stops the driver while its threads are alive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(libkernel): validate the address before refusing connect on a listening socket

FreeBSD reads and checks the address (getsockaddr) before soconnect refuses a listening socket with EOPNOTSUPP, so a null or short address on a listener fails with the address error. Move the listener check after the address is read and keep it ahead of the family check.

* test(agc): require the GPU route for the indirect rect-list draws

agc_driver_rect_list_indirect compared the indirect draws' output with
the direct draws only, so it also passed when the records were read on
the CPU. Its records lived in a static array that is not guest memory,
so every indirect draw fell back to the CPU path as not imported.

The records now sit in a registered 64 KiB guest allocation, the test
turns on APS5_PROFILE_DRAW and reads the indirect-draw counters through
the new Graphics::IndirectDrawCounts, and it requires all four indirect
draws on the GPU path. It fails with APS5_NO_RECT_INDIRECT=1 and with
the IndirectDraw.cpp and Draw.cpp changes reverted (4 non-vertex path).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(libc): print the text that registers point at in Windows crash reports

Unreal titles end in their own libc fatal path with the UTF-16
LowLevelFatalError message in a register, and the crash report shows
only the first 64 bytes of it as hex words, so the message is lost
(boykopovar#4238: Demon Slayer PPSA03490, Stray PPSA02100).

For every general register that points at readable memory starting
with at least four printable ASCII characters, as UTF-16LE or as single
bytes, the report now prints the text up to a NUL, the first other
character, 512 characters or the end of readable memory (each page is
checked with VirtualQuery before it is read).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* feat(libSceVdecsw): block on SyncDecodeInput/Output like TrySync

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(libSceNpManager): export two unknown NIDs so PPSA34015 can load

Co-authored-by: Cursor <cursoragent@cursor.com>

* feat(libkernel): serve the console CA list from the host trust store

Titles that bundle OpenSSL load the console's CA file from the sandbox
directory and fail every HTTPS request without it. ProsperoRadio
(PPSA99001, libcurl 8.18.0 + OpenSSL 3.5.2) on main + boykopovar#4796 + boykopovar#4525:

  [ProsperoRadio][http] https://all.api.radio-browser.info/json/servers: Problem with the SSL CA cert (path? access rights?) (error adding trust anchors from file: /gkbHtXc3Wq/common/cert/CA_LIST.cer)

SwanStation (PPSA98510) stops on the same file (boykopovar#5001).

The guest path resolver now accepts exact-path providers, and libkernel
registers one for /<sceKernelGetFsSandboxRandomWord()>/common/cert/CA_LIST.cer.
On first use it writes a PEM bundle once per process to
cert_cache/CA_LIST.cer in the run directory, read-only: on Windows the
current user's ROOT and CA system stores, elsewhere SSL_CERT_FILE or the
first distro bundle that exists. Without a certificate the path keeps
resolving under the guest root and does not exist, as before. Every other
path under the sandbox word is unchanged. The console file's format and
the rest of its common/cert directory are unverified and recorded in
docs/dev/debt/libkernel.md.

With this change, boykopovar#4796, boykopovar#4525 and boykopovar#5025 on Windows 11, 60 s each:

  [ProsperoRadio][http] 11846160 bytes in 1458 ms: 1161 passes, 803 waits (679 woken) for 1428 ms
  [ProsperoRadio][catalog] page offset=0 bytes=11846160 objects=10000 accepted=9549 total=9549
  ...
  [ProsperoRadio][catalog] page offset=60000 bytes=1712035 objects=1494 accepted=1436 total=59371

  [SwanStationPS5] update: latest 1.2.5, this 1.1.3, available
  [SwanStationPS5] gamedb: index written

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* fix(libkernel): filter sandbox TLS roots and preserve path overrides

* test(agc): map GPU memory on fibers with and without a host stack

Since boykopovar#6003 a fiber with a context of 64 KiB or more runs on the
context itself, so the 64 KiB fiber of agc_driver_gpu_map_on_fiber
imports its mapping on a host thread on Windows too, and the test's
Windows-only expectation of no thread failed. The test now also maps
on a 16 KiB fiber, which keeps a host stack and imports on it on
Windows, and expects one import thread for the 64 KiB fiber on every
platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(recompiler): hold 32 samplers in the runtime sampler heap

A pixel shader of PPSA16833 binds more than 16 samplers outside the
sampler tables. Each takes two heap entries, one per descriptor variant,
so the 32-entry heap refused it with "shader sampler pairs exceed runtime
heap capacity" and the title aborted when a new game started.

The heap now holds 64 entries (32 samplers). Its metadata array is part
of ShaderData, which grows from 14528 to 16064 bytes, still within the
16 KiB uniform buffer every Vulkan device supports; the runtime ABI
version moves to 13 so shaders cached with the old layout are rebuilt.
The overflow message names the sampler count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* perf(metal): optimize Civ 7 128-bit detile vectors and elide non-indexed draw snapshots

* fix(tools): sync nid_names and exempt missing debt doc-links for macOS fork

---------

Co-authored-by: Yunus Shaikh <75296019+EagleBearerYS@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: KernelPanicNT <76663133+KernelPanicNT@users.noreply.github.com>
Co-authored-by: wh1trope <noxerkrul@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Niko <nikobilger2000@gmail.com>
Co-authored-by: Ondra97 <47064087+Ondra97@users.noreply.github.com>
Co-authored-by: notaxeltv <notaxeltv@gmail.com>
Co-authored-by: JAB-dev <68183649+JAB-dev@users.noreply.github.com>
Co-authored-by: snipeTR <31975916+snipeTR@users.noreply.github.com>
Co-authored-by: Zinebyte <197974009+Zinebyte@users.noreply.github.com>
Co-authored-by: Celegans12 <53881228+Celegans12@users.noreply.github.com>
Co-authored-by: MarcZX100 <marczxrr@gmail.com>
Co-authored-by: xXPBSXx <20614131+xXPBSXx@users.noreply.github.com>
Co-authored-by: Hashaam Zafar <hashaam1217@gmail.com>
Co-authored-by: Felipe Arce <felipearce.2004@gmail.com>
Co-authored-by: Tamalero <11452991+Tamalero@users.noreply.github.com>
Co-authored-by: Josip Parlov <josipparlov@protonmail.com>
Co-authored-by: Hussein Kadhim <husseinkad.dev@gmail.com>
Co-authored-by: MarcZX100 <MarcZX100@users.noreply.github.com>
Co-authored-by: fdfawef324 <omarelfernani07@gmail.com>
Co-authored-by: Nahid Delic <nahe.delic84@gmail.com>
Co-authored-by: Romans Pokrovskis <motivated.it@gmail.com>
Co-authored-by: alfalfa-star <kosher-chive-take@duck.com>
Co-authored-by: Ishmam Ahmed <89687266+IshmamDC217@users.noreply.github.com>
Co-authored-by: LeandroLP23 <leandroplacidi@gmail.com>
Co-authored-by: screamm <davidrydgren@gmail.com>
Co-authored-by: Santhosh Kumar <santhosh-pc@outlook.com>
Co-authored-by: thuanquang <60096168+thuanquang@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants