Commit Graph

4862 Commits

Author SHA1 Message Date
Adrià 51e2c511e7
Merge pull request #3773 from xXPBSXx/fix/export-ppsa07411-imports-v4
fix(exports): export the calls PPSA07411 imports
2026-10-11 23:59:49 +02:00
Adrià f60fe21bc3
Merge pull request #3761 from semirkabir/feat/fiber-underscore-frame-pointer
feat(libSceFiber): add the underscore thread frame pointer export
2026-10-11 23:58:58 +02:00
Adrià 34ceeb05d0
Merge pull request #3760 from semirkabir/feat/ult-underscore-exports
feat(libSceUlt): add underscore mutex and queue create exports
2026-10-11 23:58:47 +02:00
Adrià d4938e1534
Merge pull request #3753 from jweidenh/codex/pthread-destructor-lifetime
fix(libkernel): run pthread key destructors before releasing thread state
2026-10-11 23:58:33 +02:00
Adrià c7b9719951
Merge pull request #3744 from ArekatlaNishanthchowdary/fix/pthread-rwlock-unlock-unowned
fix(libkernel): return EPERM when unlocking an rwlock that is not held
2026-10-11 23:57:59 +02:00
Adrià b997cecfec
Merge pull request #3740 from jagrat04/feat/libSceAcm-fft-panner
feat(libSceAcm): implement sceAcm_FFT and sceAcm_Panner
2026-10-11 23:57:24 +02:00
Adrià df64fa9382
Merge pull request #3738 from Mouad-Scriptz-0/feat/agc-merged-vertex-tables
fix(agc): read a merged program's vertex tables past its hidden user words
2026-10-11 23:56:46 +02:00
Adrià 2b4b8178f9
Merge pull request #3603 from itsbo5/feat/libSceNpEntitlementAccess-offline-requests
feat(libSceNpEntitlementAccess): implement offline entitlement info r…
2026-10-11 23:56:38 +02:00
Adrià 72e67c0e50
Merge pull request #3555 from lisn0/feat/linux-named-shared-memory
feat(libkernel): support named shared memory on Linux
2026-10-11 23:55:30 +02:00
Adrià b6555c8454
Merge pull request #3714 from MarcZX100/codex/libkernel-aio-set-param-3708
feat(libkernel): implement sceKernelAioSetParam
2026-10-11 23:55:27 +02:00
Adrià c4d3b3a743
Merge pull request #3726 from NFSS10/perf/srt-plan-use-replacement
perf(shader): avoid copying SRT read uses
2026-10-11 23:55:24 +02:00
Adrià 32f6414314
Merge pull request #3713 from SleglJan/fix/libkernel-flexible-module-charge
fix(libkernel): count guest module segments against the flexible memory budget
2026-10-11 23:54:59 +02:00
Adrià 06664a44cd
Merge pull request #3717 from jweidenh/codex/nvidia-pipeline-replay
feat(agc): capture and replay compute pipeline compilation
2026-10-11 23:54:52 +02:00
Adrià 4a49ed06f7
Merge pull request #3712 from MarcZX100/codex/test-creat-errors-3303
test(libkernel): cover creat error cases
2026-10-11 23:54:51 +02:00
MarcZX100 8935160160 fix(libkernel): handle available sem_timedwait counts first
Co-authored-by: milescoviello <kitslayer29@gmail.com>
2026-10-11 23:54:18 +02:00
Adrià 1be2ca2028
Merge pull request #3706 from MarcZX100/codex/http-abort-wait-3156
feat(libSceHttp): implement abortable epoll waits
2026-10-11 23:53:59 +02:00
Adrià 0cff844842
Merge pull request #3707 from overlordxrz-source/feat/net-in6addr-linklocal-allnodes
feat(libSceNet): export sce_net_in6addr_linklocal_allnodes
2026-10-11 23:53:51 +02:00
David 774f21845d feat(libkernel): implement pthread_cond_reltimedwait_np
Add pthread_cond_reltimedwait_np (K953PF5u6Pc; computed with
tools/nid_names.py and matching aerolib.csv) as scePthreadCondTimedwait
with POSIX error numbers: ETIMEDOUT when the relative timeout expires,
EPERM when the caller does not hold the mutex, and the mutex held again on
return in every waiting case.

Titles: Porpoise PPSA99764 and RetroArch PPSA99169 import it.
Predicted from relink registry order, not observed: Porpoise stops with
"FAIL: unresolved ELF import K953PF5u6Pc from libkernel.prx" (registry
index 384; RetroArch index 490). No call site is resolved in the registry.

The third argument is a relative timeout in microseconds, not a
struct timespec. FreeBSD 11.4 libthr (8c639945a44588f6cfdddfb057bb5aad88735da0)
has no such function. shadPS4 (3a9f57265d28975658f1ca941daa5c879c7a74bd,
src/core/libraries/kernel/threads/condvar.cpp:229-234, 445, 467-468)
registers posix_pthread_cond_reltimedwait_np(cond, mutex, u64 usec) for this
NID and the same function for scePthreadCondTimedwait (BmMjYxmew1w), whose
microsecond argument this repository already implements. The width follows
the SCE twin's 32-bit SceKernelUseconds, as sem_reltimedwait_np does, not
shadPS4's u64. There is no timespec to validate, so no EINVAL case.
Recorded in TechnicalDebt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit c86ec8417d12f5b12136b0f06eae06493b0e7a62)
2026-10-11 23:53:37 +02:00
David 092f7ef00a feat(libkernel): implement the pthread spinlock calls
Add pthread_spin_init (ZMn3clnAGBA), pthread_spin_destroy (IJIggoPZExk),
pthread_spin_lock (pw+70ClLYlY), pthread_spin_trylock (rCTGkBIHfPY) and
pthread_spin_unlock (LEfMMCT+SlM). The NIDs were computed with
tools/nid_names.py and match aerolib.csv. libkernel has no scePthreadSpin*
twin in aerolib, so the calls are implemented directly, like the barrier.

Titles: Porpoise PPSA99764 and RetroArch PPSA99169 import pthread_spin_lock.
Predicted from relink registry order, not observed: after
pthread_cond_reltimedwait_np, Porpoise stops with
"FAIL: unresolved ELF import pw+70ClLYlY from libkernel.prx" (registry
index 387; RetroArch index 493). No call site is resolved in the registry.

Behaviour follows FreeBSD 11.4 libthr thr_pspinlock.c and thr_umtx.h
(8c639945a44588f6cfdddfb057bb5aad88735da0). The guest pthread_spinlock_t
holds a pointer to an allocated lock. EINVAL for a null or destroyed lock and
for a pshared other than PTHREAD_PROCESS_PRIVATE or PTHREAD_PROCESS_SHARED,
EBUSY from trylock while any thread holds the lock, EPERM from unlock by a
thread that does not hold it. libthr spins forever when the holder locks
again; that call throws here. A shared lock is allocated like a private one,
since guest code runs in one process. Recorded in TechnicalDebt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 13ebf7f926fa2ee1c825cb1fcf18451a8781c045)
2026-10-11 23:53:36 +02:00
Adrià 4989809b13
Merge pull request #3705 from MarcZX100/fix/asan-guest-arena-window-3634
feat(build): support Linux AddressSanitizer builds
2026-10-11 23:53:19 +02:00
Adrià c8536ab100
Merge pull request #3703 from utkuhalis/fix/macos-write-watch-fresh
fix(libc): track never-collected pages in the macOS write watch
2026-10-11 23:53:08 +02:00
Claude db49377bef fix(libkernel): return SCE error codes from sceKernelFsync
sceKernelFsync returned the host fsync or _commit result, so a failure
returned -1 instead of an SCE error code, and a guest socket descriptor
reached the host call. fsync then set the guest errno from the host
errno rather than from that result.

Handle sockets and return SCE error codes as sceKernelFdatasync does
(EINVAL for an open socket, EBADF for a closed one or an unknown
descriptor), and have fsync take the errno from sceKernelFsync's result
like the other POSIX wrappers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 23:53:00 +02:00
Adrià 9ce99f8f4d
Merge pull request #3697 from JAB-dev/fix/font-writing-letter-step
fix(libSceFont): return the letter step of sceFontWritingRefersRenderStepCharacter through a pointer
2026-10-11 23:52:50 +02:00
Adrià 4bde70b4e2
Merge pull request #3702 from oneandonlydean/up4/depth-tests-without-planes
fix(agc): leave the depth surface out when no enabled test has its plane
2026-10-11 23:52:46 +02:00
Adrià 6fa58ec0ac
Merge pull request #3696 from JAB-dev/feat/font-syllable-string-state
feat(libSceFont): implement sceFontCharacterGetSyllableStringState
2026-10-11 23:52:45 +02:00
David 059e1319d1 feat(libkernel): export pause, sigwait and sigwaitinfo
Exports pause (EDyhWelj7UY), sigwait (mrbHXqK8wkg) and sigwaitinfo
(Uq5BGthgbl4) from libkernel. NIDs computed with tools/nid_names.py and
matched in aerolib; ps5-payload-dev/sdk f5d40f02 sce_stubs/libkernel.c
places all three in libkernel.

They throw like the merged sigtimedwait (#3430), with the same message
pattern: "sigwait: waiting for a pending signal", "sigwaitinfo: waiting
for a pending signal" and "pause: waiting for a delivered signal". In
FreeBSD 11.4 (8c639945) sigwaitinfo is kern_sigtimedwait without a
timeout (sys/kern/kern_sig.c:1212), sigwait is the same wait returning
the error number (kern_sig.c:1150, lib/libthr/thread/thr_sig.c:676-728)
and pause is sigsuspend of the current mask (lib/libc/gen/pause.c:46-56).
AnyPS5 never leaves a guest signal pending (blocked signals are dropped
in Dispatch, raise delivers at once), so there is nothing to take, and
raise, kill and pthread_kill run a handler only on the calling thread,
so nothing can end a pause.

Titles (predicted stops, registry order; not observed runs):
- Ruffle PPSA68091, observed today
  "FAIL: unresolved ELF import 1t1-JoZ0sZQ from libSceLibcInternal.prx"
  (sinhf, #3519), predicted next
  "FAIL: unresolved ELF import EDyhWelj7UY from libkernel.prx"
  (pause, call site 0x8F7266).
- RetroArch PPSA99169: pause (0x30DB1, an address table entry).
- PS5MC PPSA99420: pause (0x3BD80F6, 0x3C9E220), sigwait (0x3C9E4C7),
  sigwaitinfo (0x3C9E588).
- XPSemu PPSA97358: sigwait (0xE02AEC, 0x1101294, 0x1101368), QEMU's
  dummy vCPU thread and sigwait_compat thread.

guest_sigtimedwait now also checks the three throws, with an empty set,
a null info, a SIGINT raised while blocked, and that neither the output
nor the blocked mask changes. TechnicalDebt records the call sites.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 23:52:33 +02:00
Adrià ca4ab0d5d6
Merge pull request #3687 from Lorkydey/fix/libc-atoi-guest-width
fix(libc): parse atoi through guest-width strtol
2026-10-11 23:51:52 +02:00
SibteProf eaa9ce97ca test(json2): isolate base constructor regression from float format changes 2026-10-11 23:51:46 +02:00
Codex 3d8db7b5a8 fix(json2): implement InitParameter2 base constructor
Carry the implementation and regression from lucfx18's PR #2823, retaining
the original Git author. Extend the regression with a leading guard and
typed default-field checks, and record the unverified console layout.

Source: https://github.com/boykopovar/AnyPS5/pull/2823
2026-10-11 23:51:34 +02:00
Adrià 153a0a58d6
Merge pull request #3588 from tv7/fix/apr-async-queue
fix(libkernel): run APR buffers past an unsatisfied wait on their own queue
2026-10-11 23:51:13 +02:00
Adrià 4658391b1f
Merge pull request #3681 from zmeizy/claude/kernel-file-errno-translation
fix(libkernel): translate host errno in the file functions' SCE errors
2026-10-11 23:51:05 +02:00
Adrià 53b928cb04
Merge pull request #3686 from zmeizy/claude/truncate-test-root
test(libkernel): skip the read-only truncate cases when running as root
2026-10-11 23:50:44 +02:00
Adrià 562149d750
Merge pull request #3685 from zmeizy/claude/kernel-sys-errno-translation
fix(libkernel_sys): translate host errors to guest errno numbers
2026-10-11 23:50:40 +02:00
Adrià dba34804ec
Merge pull request #3684 from zmeizy/claude/libc-prx-keep-needed
fix(build): keep libc.prx needed by every executable that links a prx
2026-10-11 23:50:32 +02:00
Renan Pires a36b9092d1 feat(libc): implement the long double math functions RetroArch imports 2026-10-11 23:49:38 +02:00
Adrià 6c6c5552dc
Merge pull request #3677 from MarcZX100/carry/libkernel-delete-sharing-3316
fix(libkernel): allow delete sharing for open Windows files
2026-10-11 23:49:25 +02:00
Adrià d956de8425
Merge pull request #3596 from Lorkydey/feat/libc-fstatvfs
feat(libc): implement guest fstatvfs volume statistics
2026-10-11 23:48:10 +02:00
Adrià 2605ad6c76
Merge pull request #3669 from MarcZX100/carry/audioin-open-variants-3340
feat(libSceAudioIn): implement sceAudioInHqOpen and sceAudioInAsyncOpen
2026-10-11 23:46:54 +02:00
Adrià e05a603771
Merge pull request #3668 from CouchRiv/fix-shader-float-compare-clamp
fix(shader): accept the clamp bit on VOP3 float compares
2026-10-11 23:46:41 +02:00
Adrià 2b988061ed
Merge pull request #3665 from itsbo5/feat/libSceSigninDialog-completion
feat(libSceSigninDialog): complete offline sign-in dialog lifecycle
2026-10-11 23:45:50 +02:00
pushkarreddyy 324669722e feat(libkernel): implement pthread_attr_getstackaddr 2026-10-11 17:45:35 -04:00
pushkarreddyy 91bfd6a18c feat(libkernel): implement pthread_attr_getinheritsched, pthread_attr_getscope and pthread_attr_setscope 2026-10-11 17:45:17 -04:00
Adrià cbd98bbdc1
Merge pull request #3540 from ivica00/fix/srgb-bilinear-cube-zero
fix(shader): return 0 for an 8-bit sRGB bilinear cube comparison
2026-10-11 23:45:00 +02:00
Adrià f35bcafbee
Merge pull request #3662 from Celegans12/perf/recompiler-iteration-selection-storage
perf(recompiler): reuse sorted sets for iteration selection merges
2026-10-11 23:44:59 +02:00
Adrià f6203c150b
Merge pull request #3497 from LightStorm72/https-ca-list-stubs
fix(libSceHttp): return an empty CA list from sceHttpsGetCaList/sceHttpsFreeCaList
2026-10-11 23:44:40 +02:00
Adrià 097b8d82a5
Merge pull request #3621 from goncalompontes/feat/shader-vop3-interp-f32-e64
feat(shader): decode GFX10 VOP3-encoded interpolation
2026-10-11 23:44:35 +02:00
Adrià fe03a7d126
Merge pull request #3660 from Celegans12/fix/cache-replace-open-windows-files
fix(cache): replace entries while Windows readers retain old files
2026-10-11 23:44:25 +02:00
Adrià 34c94e1d42
Merge pull request #3639 from AchrafReyani/fix/libc-mspace-32-byte-alignment
fix(libc): align mspace allocations to 32 bytes
2026-10-11 23:44:18 +02:00
Adrià Franch e8ea9a62bb test(libkernel): check that a socket call returns the mapped guest errno
Sending on an unconnected UDP socket must report the guest EDESTADDRREQ (39)
through NativeError, so a regression to EIO is caught on Linux.
2026-10-11 23:43:47 +02:00
Hussein Kadhim d9c2622655 docs(libkernel): record the unreported nonblocking connect refusal and the recv after SHUT_RD difference
(cherry picked from commit c1519d951b2b77346392ccc18204f37c587e7eda)
2026-10-11 23:43:47 +02:00
Hussein Kadhim d694aac7b4 fix(libkernel): translate every host socket error to the guest errno of its name
NativeError listed 17 Winsock and 17 POSIX errors and turned every other
one into EIO. A second connect while the first is pending (WSAEALREADY,
EALREADY) and an option the host rejects (WSAENOPROTOOPT, ENOPROTOOPT)
reached the guest as EIO; on Linux a nonblocking connect (EINPROGRESS),
a send with no destination (EDESTADDRREQ), ENOTSOCK, EAFNOSUPPORT,
EOPNOTSUPP and others did too.

The translation moves to SocketError.hpp and covers the socket errors of
both hosts by name, with the FreeBSD 11 numbers. WSAESHUTDOWN stays EPIPE
as before. socketpair's own table is gone, as NativeError covers it.

(cherry picked from commit a889c98e6a59d62da289f2e6a77355d2b41a1bde)
2026-10-11 23:43:47 +02:00
Adrià e2ea125926
Merge pull request #3605 from CouchRiv/fix-libc-asin-nan-sign
fix(libc): asin(|x| > 1) returns the x86 default NaN and leaves errno unchanged
2026-10-11 23:43:44 +02:00
Adrià 57ba0e7bca
Merge pull request #3568 from DariusHQ/feat/libkernel-sendfile
feat(libkernel): implement sendfile
2026-10-11 23:43:14 +02:00
Dean abd318d9c0
Merge pull request #3683 from Zurisen/fix/amm-below-host-regions
fix(libkernel): reserve the AMM ranges below host regions at the top of the guest arena
2026-10-12 10:43:07 +13:00
Dean b5e6b458e5
Merge pull request #3976 from pipe1os/fix/agc-host-imports-device-switch
fix(agc): keep another device's host imports until its teardown
2026-10-12 10:43:04 +13:00
jweidenh 2ac8c72383 test(agc): bound packed f16 SPIR-V scanner reads
FindF16x2Math read spirv[offset + 1] for every instruction once the f16 vector type was known, so a final one-word OpFunctionEnd read past the module. Check the opcode and its minimum word count before reading operands.
2026-10-11 23:43:03 +02:00
Karan Vora 660e24eeac perf(shader): compute v_pk_add_f16 and v_pk_mul_f16 with native f16 math
v_pk_add_f16 and v_pk_mul_f16 computed each half in f32 and rounded it
back to f16, then fixed the NaN, FP16_OVFL and clamp results on the
bits. On a device with native f16 that rounds to nearest even and keeps
f16 denormals (the Float16, RoundingModeRTE and DenormPreserve
capabilities that #1252 already checks), the arithmetic is now one
f16vec2 OpFAdd or OpFMul decorated NoContraction, and the same NaN,
FP16_OVFL and clamp rules run on its result bits.

The results don't change. f32 has at least 2 * 11 + 2 significand bits,
so rounding an f16 sum or product to f32 and then to f16 gives the
correctly rounded f16 result. Vulkan requires f16 OpFAdd and OpFMul to
be correctly rounded, the module keeps f16 denormals, and any NaN they
produce is replaced by the NaN the existing rules select.

v_pk_fma_f16 and v_pk_fmac_f16 keep the f32 path: Vulkan gives GLSL Fma
only the precision of OpFMul followed by OpFAdd, so a native f16 Fma
may round twice.

New test agc_driver_packed_float16_native compiles one shader with
packed add, mul, fma and fmac (op_sel, op_sel_hi, neg_lo, neg_hi and
clamp variants) with and without Float16, checks that only add and mul
use f16vec2 math, and compares every result bit for bit on random and
special inputs (zeros, denormals, infinities, NaNs, values near the f16
maximum) in nine float modes.
2026-10-11 23:43:03 +02:00
Celegans12 58ee73f475 fix(libc): write the whole what() when terminate reports an exception
The default terminate handler formatted its whole report into a 1024-byte
buffer, so a long what() was cut off without a trailing newline. Driver
refusals that carry a serialized RecompileRequest lost most of it, and the
next log line ran into the truncated text.

The report header still goes through the bounded RawLog, and what() is
now written in full by a raw write to the stderr handle, followed by a
newline. Both keep avoiding the CRT stream lock, as before.

exception_runtime gains a forked child that throws an uncaught
runtime_error with a message over 3000 characters and checks that the
full what() reaches stderr before SIGABRT.
2026-10-11 23:42:53 +02:00
Adrià Franch 208b908238 test(agc): register the multisampled target guest-access test in ctest
The test only ran in the full recorder binary, which no ctest entry starts. It now has its own mode and entry (agc_multisample_guest_access); with the guard back at the single-sample size its new padding row fails.
2026-10-11 23:41:30 +02:00
Adrià Franch 5c5912c49e fix(agc): guard a multisampled target's whole sample planes; docs for host-only multisampled targets
The guest-access guard covers CB bytes times samples (the single-sample layout size alone missed the later sample planes' tile padding), with a test row in that padding. Remove two TechnicalDebt lines duplicated by the rebase, document the guard bound and the unevicted targets, and add the multisampled targets to ARCHITECTURE.md.
2026-10-11 23:41:30 +02:00
Michon d109f3966f fix(agc): guest access to a multisampled color target's memory throws
A multisampled target's samples are only on the host, so its guest memory
never holds them: a CPU read through GuestMemory::Read/ReadCommitted, a
DMA_DATA copy from it and a texture or storage image lookup at its address
throw instead of returning bytes that were never written there. Asked by
oneandonlydean; the test reads a resolved-only target's memory each way.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 23:41:30 +02:00
Michon b64da7caf7 fix(agc): GPL fragment libraries keyed by the sample count
The fragment shader and fragment output libraries are built with the
pipeline's rasterizationSamples, so a 1x and a 4x pipeline with the same
shaders and formats must not share them. Reported by adriadam10 (found by
Raghav314 in #2242).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 23:41:30 +02:00
Michon ae6dfd9073 fix(agc): the standard 8x pattern's last sample is at (7, -7)
Vulkan's standard 8x sample 7 is (0.9375, 0.0625), (7, -7) in signed sixteenths; the table had (7, -8), so the
standard pattern (PPSA99902's PA_SC_AA_SAMPLE_LOCS words 0xbd153fd1 / 0x9773f95b) was refused as nonstandard.
Regression row with those words.

Reported by @Amoenus.

Co-Authored-By: Amoenus <5391396+Amoenus@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 23:41:30 +02:00
Michon eeefb06549 fix(agc): multisampled targets use main's CMASK fields; their CMASK state refuses what it cannot model
The duplicate ColorTarget::cmaskAddress, decode and size helper are gone: multisampled targets
use main's cmaskAddress/cmaskBytes (whole metablocks). Single-sample targets keep main's rule
(CMASK under FAST_CLEAR); a multisampled one takes it under FAST_CLEAR or COMPRESSION. A zero
fill of the whole CMASK clears at the next use, 0xFFFFFFFF marks it expanded, any other or
partial fill refuses the next use; eliminate/DCC passes over a multisampled target and a CB
resolve into a fast-clear destination are refused. The draw key adds CMASK_BASE_EXT (0x398),
which main decodes but did not key.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 23:41:30 +02:00
Michon 163947ef72 style(agc): drop code comments the conventions check rejects
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 23:41:30 +02:00
Michon ebf361103c feat(agc): multisampled color and depth targets with CB resolves
Draws with PA_SC_AA_CONFIG multisampling (2, 4 or 8 samples, every target with as many
fragments, the standard sample locations, MSAA_ENABLE) render into host-only multisampled
color images and multisampled depth surfaces; the pipeline rasterizes with that sample
count. A CB_COLOR_CONTROL resolve over a multisampled CB0 runs as a render pass whose
resolve attachment is CB1's resident image. A zero fill over a target's CMASK fast-clears
it to the CB_COLOR_CLEAR_WORD values of its next use. EQAA, coverage conversion,
nonstandard sample locations, sampling a multisampled surface and multisampled mips stay
refused.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 23:41:30 +02:00
ThatsLeo 58d59f6279 fix(shader): fold a lane's s_wqm bit of the starting pixel lanes to true
Vulkan starts only quads holding a non-helper lane, so the bit is set in every
lane it runs. Stray's pixel shader 0x2012f90000 keeps the packed ancillary
word where that bit is clear, and failed with an unsupported live use.

(cherry picked from commit 2068089b3d75fae55d0994a0916a22bffd7ee2a4)
2026-10-11 21:41:01 +00:00
Adrià 752db7da76
Merge pull request #3569 from DariusHQ/fix/libc-format-positional-arguments
fix(libc): format positional arguments on Windows
2026-10-11 23:40:52 +02:00
Adrià Franch 9ac63c0af8 style: restore blank lines touched by accident 2026-10-11 23:40:51 +02:00
bilel 11f329fd4b fix(libkernel): reject identity changes before ordinary-file fallback
A descriptor replaced before the shared-memory path probe can otherwise
bypass the pinned-object identity check through native fallback. Compare
the negative probe's current file identity to the initial snapshot and
reject a mismatch. Exercise the earlier window with an ordinary file for
all six descriptor operations.

Confidence: high
Scope-risk: narrow
Tested: 18 Linux runtime tests with zero skips; 18 deterministic reuse scenarios; affected three patched modules; standalone ASan/UBSan; Clang analyzer; conventions and diff checks
Not-tested: Full project build/suite, Windows runtime, console hardware and titles
Directive: Identity checks do not synchronize the entire descriptor table or identify separate opens of the same inode
2026-10-11 23:40:46 +02:00
bilel f6ef5a77e2 fix(libkernel): preserve patched loading and shared-memory object identity
Keep guest creation-mask state in libc behind C-linkage helpers so NID
patching preserves the shared exports. Reject a pinned descriptor whose
file identity differs from the snapshot taken before classification.
Exercise close and reuse from another thread at both acquisition windows
for writes, resize and seek, and create temporary ordinary-file fixtures
so runtime tests work without the source tree.

Constraint: NID exemptions require the literal suffix at the end of the exported symbol
Confidence: high
Scope-risk: narrow
Tested: 18 targeted Linux runtime tests with zero skips; patched_libraries for libc/libkernel/libkernel_sys; standalone ASan/UBSan with warnings as errors; source-prefix-remapped fixtures; Clang analyzer and conventions
Not-tested: Full project build and library set, Windows runtime, console hardware and titles
Directive: Device/inode validation establishes file identity, not open-file-description identity
2026-10-11 23:40:46 +02:00
bilel 72b3a2abdd fix(libkernel): keep shared-memory identity and guest permissions consistent
Pin the descriptor before mmap validation so guest descriptor reuse cannot
redirect the eventual mapping. Apply the canonical guest creation mask when
creating named objects, distinguishing new objects before setting permissions
without changing the host process umask. Add regressions that reproduce both
failures and document the remaining host requirements.

Constraint: Guest umask must not mutate the process-wide host mask
Confidence: high
Scope-risk: narrow
Tested: 17 targeted Linux runtime tests passed with zero skips; conventions and diff checks; Clang analyzer on three changed production translation units
Not-tested: Full project build and suite, Windows runtime, console hardware and titles
2026-10-11 23:40:46 +02:00
bilel 2aaeaa3f05 feat(libkernel): make Linux shared memory usable through guest APIs (#3923)
Complete the object lifecycle through guest mapping and unlink APIs, and
preserve FreeBSD shared-object size and seek rules across scalar, vector
and asynchronous descriptor writes. Pin descriptors during operations and
coordinate size-sensitive operations across cooperating emulator processes.

Constraint: Linux host support with existing dependencies and allocation tracking
Rejected: Bare descriptor registry | close, duplication and reuse invalidate identity
Rejected: Per-object OFD locks | forked descriptors share the same lock description
Confidence: high
Scope-risk: moderate
Directive: Keep guest resize, truncating open and bounded writes under the same namespace guard
Tested: Ten Linux runtime suites; focused shared-memory ASan/UBSan suite with warnings as errors
Not-tested: Windows build, PS5 hardware and title compatibility
2026-10-11 23:40:45 +02:00
bilel zenned f274ceb18d feat(libkernel): allow Linux guests to reopen named shared memory (#3921)
Translate guest named-open flags and permissions to POSIX shared-memory descriptors. Bound guest names and use the existing digest implementation to keep a stable AnyPS5 namespace, including long names and internal slashes. Preserve anonymous and Windows behavior, and record the separate unlink and guest mapping gaps.

Constraint: Builds and tests run only through the enrolled 191 compute service.
Rejected: Direct Linux guest names | cannot represent FreeBSD internal slashes and 1023-byte names.
Tested: Source review and diff checks; baseline job100619 accepted, result retrieval currently times out.
Not-tested: Runtime verification pending on191; full build, Windows and titles.
Confidence: medium
Scope-risk: narrow
2026-10-11 23:40:45 +02:00
bilel zenned eeb647c6b5 test(libkernel): expose the missing named shared-memory path (#3921)
Exercise named object creation, reopening, descriptor permissions, truncation and cross-process identity before adding Linux support. The standalone target compiles the production implementation without graphics dependencies.

Tested: Source and staged diff reviewed; failing baseline will run on 191.
Not-tested: Full runtime build and Windows.
2026-10-11 23:40:45 +02:00
Adrià 951fd9afcb
Merge pull request #3590 from karanvora2599/perf/shader-f16-minmax-bits
perf(shader): pick f16 min, max and med3 results on the bits
2026-10-11 23:39:47 +02:00
Adrià 8a13a1b8ef
Merge pull request #3594 from Scramblrrrr/codex/windows-host-write-watch-exclusion
fix(agc): exclude host arena holes from write-watch proofs
2026-10-11 23:39:34 +02:00
Adrià 07eacac68c
Merge pull request #3591 from QRMOE/fix-libkernel-clock-getres-null
fix(libkernel): honor null clock_getres output
2026-10-11 23:39:27 +02:00
Adrià 372fb03284
Merge pull request #3586 from jradelmo/feat/http-uri-authority-delimiter
fix(libSceHttp): retain authority delimiter for partial URI builds
2026-10-11 23:38:55 +02:00
Adrià 87d7ab7950
Merge pull request #3551 from ducloc080202/fix/libc-unhandled-throw-site
fix(libc): name the throw site in unhandled exception reports
2026-10-11 23:38:35 +02:00
Adrià 7c8df1f0e4
Merge pull request #3583 from DariusHQ/feat/libc-wcstok
feat(libc): implement wcstok
2026-10-11 23:38:25 +02:00
Adrià c60f65a227
Merge pull request #3535 from sktharunbalaji13-cmd/contrib/libSceHttp2-invalid-id
fix(libSceHttp2): validate SSL setter handles
2026-10-11 23:37:50 +02:00
Adrià f5824092cf
Merge pull request #3545 from babyhuey/feat/posixforwebkit-fnmatch
feat(libScePosixForWebKit): implement fnmatch
2026-10-11 23:37:41 +02:00
Adrià 011c26cd5e
Merge pull request #3578 from LeandroLP23/fix/libkernel-fsync-read-only-windows
fix(libkernel): sync read-only and directory descriptors on Windows
2026-10-11 23:37:24 +02:00
Adrià 1342c4b9df
Merge pull request #3539 from MarcZX100/codex/agc-write-data-dst3-3534
fix(agc): accept WRITE_DATA destination 3 for memory fences
2026-10-11 23:36:57 +02:00
Adrià 0b7b479a04
Merge pull request #3576 from parl0v/refactor/agc-dcb-atomic-gds-0900
refactor(agc): name zARR5aCmkoY sceAgcDcbAtomicGds_0900
2026-10-11 23:36:55 +02:00
Adrià 24ba6b1764
Merge pull request #3577 from parl0v/refactor/audioin-pad-embedded-mic
refactor(audioin): name X+4jdIS75P0 sceAudioInIsPadEmbeddedMic
2026-10-11 23:36:48 +02:00
Adrià a672688e94
Merge pull request #3523 from XairRrR/fix/agc-default-unexported-pixel-inputs
fix(agc): read zero for pixel inputs of parameters the vertex stage does not export
2026-10-11 23:36:20 +02:00
Adrià 7de666a937
Merge pull request #3512 from LeandroLP23/fix/shader-mix-f16-directed-rounding
fix(shader): round v_fma_mixlo_f16 and v_fma_mixhi_f16 in every f16 rounding mode
2026-10-11 23:36:15 +02:00
Adrià 4d55bf10be
Merge pull request #3493 from AchrafReyani/feat/libkernel-ioctl
feat(libkernel): export _ioctl and getsid
2026-10-11 23:35:53 +02:00
Adrià 195f55eb97
Merge pull request #3572 from Lorkydey/feat/libkernel-getitimer
feat(libkernel): query real-time alarms with getitimer
2026-10-11 23:35:45 +02:00
Adrià 41f013f664
Merge pull request #3567 from DariusHQ/fix/libc-format-grouping-flag
fix(libc): accept the ' flag in Windows formatting
2026-10-11 23:34:57 +02:00
Adrià ac1c340392
Merge pull request #3571 from EdouardSence/feat/json-parser-stream-parse
feat(libSceJson2): add sce::Json::Parser::parse with a read callback
2026-10-11 23:34:48 +02:00
Adrià dafc085adb
Merge pull request #3566 from DariusHQ/fix/libc-format-alternate-octal-zero
fix(libc): print 0 for %#.0o of zero on Windows
2026-10-11 23:34:44 +02:00
Adrià 7450e4dae6
Merge pull request #3570 from EdouardSence/feat/json-array-copy-clear-front-stream-parse
feat(libSceJson2): add the sce::Json::Array copy constructor, clear, front and iterator::operator->
2026-10-11 23:34:22 +02:00
Adrià ada499b635
Merge pull request #3561 from XairRrR/fix/agc-swap-alt-review-guards
fix(agc): reject constant color factors and memory-writing stages in split SWAP_ALT blends
2026-10-11 23:34:15 +02:00
Adrià 4085df4667
Merge pull request #3565 from ivica00/feat/libc-powisf2
feat(libc): implement __powisf2
2026-10-11 23:34:08 +02:00
Adrià 3ccef6abcd
Merge pull request #3564 from Aathish-D/feat/libc-ftrylockfile
feat(libc): implement ftrylockfile
2026-10-11 23:34:00 +02:00
Mouhand Kaddo 121b16fb4b fix(libkernel): guard Unix host polling in Windows select 2026-10-12 01:33:53 +04:00
Adrià c892804260
Merge pull request #3560 from EdouardSence/feat/razorcpu-push-marker
feat(libSceRazorCpu): add sceRazorCpuPushMarker
2026-10-11 23:33:24 +02:00
Adrià e44b7cf78c
Merge pull request #3546 from AlxcBTW/fix/vertex-narrow-wave-entry-2
fix(recompiler): give wave64 vertex programs on 32-lane hosts a 32-lane s3
2026-10-11 23:33:16 +02:00
Adrià 9d5c6afcd6
Merge pull request #3559 from EdouardSence/feat/ngs2-report-handler-exports
feat(libSceNgs2): export sceNgs2ReportRegisterHandler and sceNgs2ReportUnregisterHandler
2026-10-11 23:33:12 +02:00
Adrià 62f8758711
Merge pull request #3544 from babyhuey/feat/libkernel-execv
feat(libkernel): export execv
2026-10-11 23:33:07 +02:00
Adrià c56ea3b343
Merge pull request #3537 from hugodearaujo/feat/ppsa15878-vr2-exports
feat(libs): declare the PS VR2 exports PPSA15878 imports
2026-10-11 23:32:40 +02:00
Adrià ceab34ad63
Merge pull request #3538 from hugodearaujo/fix/sysmodule-id-zero
fix(libSceSysmodule): return INVALID_VALUE for module id 0
2026-10-11 23:32:24 +02:00
Adrià b2477d9804
Merge pull request #3530 from MarcZX100/codex/libkernel-inet-text-rules-3126
fix(libkernel): follow FreeBSD inet text rules
2026-10-11 23:32:18 +02:00
Adrià 28400c02d1
Merge pull request #3542 from BharatYadav007/bharat/libc-setlogmask
feat(libc): implement setlogmask
2026-10-11 23:32:17 +02:00
Adrià 9bee015035
Merge pull request #3524 from XairRrR/perf/agc-attach-2d-array-layers
fix(agc): render a slice of a 2D array color target into that layer of the array
2026-10-11 23:30:07 +02:00
Adrià 039d21ead8
Merge pull request #3527 from Sanjaysrinivas/fix/agc-buffer-memory-recovery
fix(agc): reclaim idle buffers on allocation OOM
2026-10-11 23:30:03 +02:00
ivica00 cd814b8c6f fix(shader): return 0 for an 8-bit sRGB bilinear cube comparison
An 8-bit sRGB compare is already 0 for every texel, so the selected face cannot change the result.
2026-10-11 23:29:39 +02:00
Adrià 989146c3b9
Merge pull request #3514 from gookie-dev/perf/kernel-module-info-frame-tables
perf(libkernel): read a loaded image's unwind tables once in sceKernelGetModuleInfoFromAddr
2026-10-11 23:29:38 +02:00
Adrià b0fd7c017e
Merge pull request #3517 from ee6aba54/fix/trophy2-null-outputs
fix(libSceNpTrophy2): accept a null details or data in GetTrophyInfo and GetGroupInfo
2026-10-11 23:29:33 +02:00
Adrià d2e1f20edb
Merge pull request #3499 from blawesom/carry/ampr-cnd-signal
feat(libSceAmpr): implement _Cnd_signal and _Cnd_init_with_name
2026-10-11 23:29:11 +02:00
Adrià 59559c306c
Merge pull request #3496 from MarcZX100/codex/primstate-normalize-disabled-vgpr-3457
fix(agc): preserve hand-built user VGPR offsets
2026-10-11 23:29:06 +02:00
Adrià a9a34e91cc
Merge pull request #3412 from pushkarreddyy/feat/agc-draw-snapshot-cap
perf(libSceAgcDriver): cap draw input snapshot allocation size
2026-10-11 23:28:42 +02:00
Mouhand Kaddo 9d8ee3de7d fix(shader): isolate single-block loop continue targets
Route semantic self-loops through a dedicated empty back-edge block. This prevents block merging from folding the continue target into the loop header when memory instructions emit nested selections. Add a synthetic loop-store regression that fails SPIR-V validation after optimization on main.
2026-10-12 01:26:17 +04:00
Adrià 14a7e64dcd
Merge pull request #3485 from santhoshkumar-dev/codex/windows-path-traversal
fix(filesystem): reject invalid parent traversal on Windows
2026-10-11 23:24:37 +02:00
Adrià 7562b4b05e
Merge pull request #3473 from superhe11/fix/resource-cache-storage-eviction
fix(agc): keep uncached storage images out of the resource cache
2026-10-11 23:24:32 +02:00
Adrià 90896b5cc9
Merge pull request #3462 from exefer/fix/libkernel-select-host-descriptors
fix(libkernel): select descriptors that are not sockets
2026-10-11 23:24:27 +02:00
Adrià 1770f352d7
Merge pull request #2471 from Scramblrrrr/codex/shared-loop-exit
fix(shader): guard shared loop exit routing and preserve valid fallbacks
2026-10-11 23:24:02 +02:00
Adrià 4cacc78d61
Merge pull request #3391 from tibzejoker/fix/masked-select-wqm-superset
fix(shader): drop masked selects proven unobserved through whole quad mode
2026-10-11 23:23:58 +02:00
Adrià 9865c57f76
Merge pull request #2261 from Sanjaysrinivas/feat/registered-ngg-workgroup
fix(agc): route registered NGG workgroups through mesh
2026-10-11 23:23:54 +02:00
Adrià fc5faefc44
Merge pull request #3159 from XairRrR/perf/agc-shader-prep-lock
perf(agc-driver): prepare shader ABI variants before taking the preparation lock
2026-10-11 23:23:53 +02:00
Adrià 9c75aa87c3
Merge pull request #3513 from jweidenh/codex/test-bda-store-boundaries
test(recompiler): cover BDA store boundary faults and written pages
2026-10-11 23:15:57 +02:00
LightStorm72 1d5f699439 fix(libSceHttp): return an empty CA list from sceHttpsGetCaList/sceHttpsFreeCaList 2026-10-11 23:15:05 +02:00
Ahir Barman Maji f30f3e8a84 fix(libs): find the executable directory on macOS
libSceFont and libSceNpEntitlementAccess located the executable
through /proc/self/exe, which macOS does not have, so finding the
system fonts and the entitlements file threw there. Use
_NSGetExecutablePath and resolve the path with
std::filesystem::canonical on macOS. Linux and Windows are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 02:38:05 +05:30
Claude 11fa3ab843
fix(libc): keep getenv results valid when other variables change
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 21:07:20 +00:00
Claude 1489400189
fix(libc): set EINVAL when getenv gets an invalid name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 21:06:35 +00:00
Adrià Franch 76d43c525e fix(libkernel): drop _ioctl, already exported by #3487
Co-authored-by: Achraf Reyani <noreply@users.noreply.github.com>
2026-10-11 23:06:10 +02:00
Achraf Reyani 6c7a2cbe69 feat(libkernel): export _ioctl and getsid
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 23:06:10 +02:00
Adrià b3ae112012
Merge pull request #3528 from MarcZX100/codex/agc-shutdown-3506
fix(agc): catch shutdown in shader ABI resolution
2026-10-11 23:06:08 +02:00
Claude fe4a2cf7d8
fix(libc): run atexit handlers in one order with __cxa_atexit destructors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 21:05:51 +00:00
Adrià 9d9f2cf094
Merge pull request #3516 from Feuris/carry/windows-udp-short-receive
fix(net): preserve truncated UDP receives on Windows
2026-10-11 23:05:37 +02:00
Adrià 68ac73f3df
Merge pull request #3452 from LeandroLP23/fix/kernel-windows-directory-rewind
fix(libkernel): rewind Windows directory descriptors on lseek
2026-10-11 23:05:29 +02:00
Adrià d80a52b75d
Merge pull request #3500 from notaxeltv/feat/tts2-unavailable-exports
feat(libSceTextToSpeech2): return EOPNOTSUPP from remaining speech exports
2026-10-11 23:04:31 +02:00
Claude e463c5d11f
fix(libkernel): clamp POSIX deadlines beyond the clock range instead of overflowing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 21:01:57 +00:00
Claude 29af23e718
fix(libkernel): apply the memory type in sceKernelMemoryPoolBatch type-protect entries
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 20:58:50 +00:00
Claude 602a76fc26
fix(libkernel): let pthread_barrier_destroy wait for released waiters
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 20:57:22 +00:00
dantdmdarealguy 3c581619d3 feat(input): configure stick deadzones and mouse sensitivity
anyps5-input.ini accepts LeftStickDeadzone and RightStickDeadzone (whole
percent, 0 to 90), a radial deadzone on the controller sticks whose
remaining travel is rescaled to the full range, and MouseSensitivity
(above 0, at most 10), which replaces the fixed factor of 1 for mouse
look. The defaults keep the current mapping exactly.
2026-10-11 15:57:12 -05:00
XairRrR 0ad1a46884 test(agc): reject a split SWAP_ALT draw whose vertex shader stores to memory
The 8_8 SWAP_ALT blend test now also draws with a vertex shader that
stores a dword to a buffer (buffer_store_dword through user data 4-7)
and a separate alpha blend, and requires the draw to be rejected for
its shaders writing memory. With the former pixel-only check the draw
went through and the test fails.
2026-10-11 22:44:57 +02:00
Felipe Arce 4966917282 fix(agc): park retired host imports through shared_ptr so Imports() stays in place 2026-10-11 17:38:22 -03:00
jweidenh 3740c233bc fix(agc): accept core Vulkan capabilities during compute replay 2026-10-11 16:34:26 -04:00
Kikoarl 5d298b6d95 feat(libSceSysmodule): register libSceAudioPropagation module ID (0x120) 2026-10-11 22:33:22 +02:00
Felipe Arce 25f5afe645 fix(agc): keep another device's host imports until its teardown 2026-10-11 17:25:29 -03:00
jweidenh 598e991bca test(agc): provide the binding flag fixture placeholder buffer 2026-10-11 16:20:28 -04:00
Jordan Hans 2d3dd337ad fix(libSceNet): accept guest socket addresses whatever their sa_len 2026-10-11 20:17:41 +00:00
jweidenh a4ae6d7e31 fix(agc): capture larger compute modules and binding flags 2026-10-11 16:14:44 -04:00
jweidenh decbac9bb4 fix(agc): link capture tests with the Windows exception runtime 2026-10-11 16:09:48 -04:00
jweidenh 8fbd0eecc1 feat(agc): capture and replay compute pipeline compilation 2026-10-11 16:09:48 -04:00
Claude f40bb479e2
fix(libkernel): report the remaining time from sceKernelWaitSema
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 20:09:33 +00:00
jweidenh 3b32e54ed9 test(agc): skip partial collection when write watching is unavailable 2026-10-11 16:09:08 -04:00
jweidenh e5e8c232e8 fix(libc): preserve uncollected shared memory writes on Windows 2026-10-11 16:09:08 -04:00
jweidenh bf8a6bc2ff test(libc): cover partial shared write collection 2026-10-11 16:09:08 -04:00
hugodearaujo d5f11b156b fix(libSceUserService): report an unrestricted age level
sceUserServiceGetAgeLevel reported 0. On a PS5 (firmware 13.60) the
value is the age of the user's parental restriction (0, 7, 12 and 15
measured) and 0xFFFFFFFF without one, so 0 is a user restricted to age
0. A user who is not logged in returns 0x80960009 (not logged in) with or
without an output, before the null output check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:07:45 -03:00
Claude d358374ac8
fix(libc): throw for 16-bit wide scanf conversions on Linux
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 20:07:20 +00:00
fma-rc ba9f903e3f
feat(shader): implement s_subvector_loop_begin and s_subvector_loop_end 2026-10-11 22:03:26 +02:00
Claude 6b72296ef5
fix(libc): format 16-bit wide arguments in asprintf on Linux
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 20:02:20 +00:00
Dean 0a8b1d32b1
Merge pull request #3415 from MarcZX100/codex/fix-windows-runtime-unwind-3411
test(libc): keep Windows exception cleanup coverage on guest frames
2026-10-12 08:59:34 +13:00
Santhosh Kumar 2ad916566f fix(libkernel_sys): return the resolver's error from symlink
symlink, added in #3491 while this branch was open, still resolved its
new path with ResolvePath_nid_no_patch, which now throws for an invalid
"..". Use ResolvePathError_nid_no_patch as link does, so
"missing/../x" returns ENOENT and "file/../x" ENOTDIR.

Reported by @Silverash-i8 on #3485.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 01:25:02 +05:30
Santhosh Kumar 17827dd9ab fix(filesystem): reject invalid parent traversal on Windows 2026-10-12 01:25:02 +05:30
milescoviello ad14190c13 fix(libc): resolve ".." in guest paths against the directory before it
Guest paths were normalized lexically before they reached the host, so
"missing/../file" and "file/../x" dropped the component before "..":
stat and open succeeded on the file, unlink deleted it and rmdir removed
a directory, where FreeBSD's lookup() resolves ".." with VOP_LOOKUP in
the directory reached so far and fails with ENOENT for a missing
component and ENOTDIR for a file. POSIX path resolution (XBD 4.13) says
the same.

".." is still collapsed lexically when the path before it is an existing
directory, so case-insensitive matching and aliases behave as before.
When it is not, the rest of the path is passed to the host unchanged and
the host resolves it. Linux then reports ENOENT or ENOTDIR as FreeBSD
does; Windows collapses ".." itself, so its results are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XYhZu5HokHMo9mfi8QU83m
2026-10-12 01:24:53 +05:30
Claude 4a419397cb
fix(libkernel_sys): translate host errors to guest errno numbers
GuestError passed host error values up to 34 through and reported every
other value as EIO, so readlink failed with EIO for a name that is too
long or a symbolic link loop, and a host EAGAIN would have been reported
as the guest's EDEADLK. The values whose numbering differs are now
mapped to FreeBSD's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 19:50:38 +00:00
Hussein Kadhim aaf49fb40f fix(libc): compare strcasecmp and strncasecmp results after lowering
FreeBSD returns the difference of the lowercased bytes where the strings
differ, including where one of them ends. The guest wrappers returned the raw
difference of the terminator and the unfolded byte, so strcasecmp("ab", "A")
gave 66 instead of 98.
2026-10-11 19:49:35 +00:00
Hussein Kadhim 87e9c70157 fix(libkernel): recvfrom on a stream socket reports no sender address
FreeBSD's soreceive leaves the sender unset for a stream socket, so recvfrom
returns an address length of 0 (kern_recvit). The guest call formatted the empty
host address as a 28-byte AF_INET6 sockaddr and reported length 28. Report
length 0 when the host returns no AF_INET or AF_INET6 sender, as recvmsg does.
2026-10-11 19:48:51 +00:00
Dean 12c2266281
Merge pull request #3922 from oneandonlydean/up4/fix-implicit-lod-test-wqm
test(agc): enter whole quad mode in the implicit-LOD 1D sample test
2026-10-12 08:45:56 +13:00
Dean a061f5b5ac
Merge pull request #3510 from babyhuey/fix/libkernel-sys-symlink-windows
fix(libkernel_sys): create symlinks with CreateSymbolicLinkW on Windows
2026-10-12 08:45:52 +13:00
Dean 70eba72ad6
Merge pull request #3518 from Silverash-i8/fix/filesystem-test-directory-time
test(libkernel): don't require restoring the directory time on Windows
2026-10-12 08:45:48 +13:00
Dean f7d623528a
Merge pull request #3532 from MarcZX100/codex/srgb-compare-zero-3526
fix(shader): allow constant-zero sRGB comparisons
2026-10-12 08:45:45 +13:00
Hussein Kadhim 942b5945d1 fix(libkernel): leave the remaining time untouched when nanosleep completes
FreeBSD's kern_clock_nanosleep writes the remaining time only when the sleep is cut short. A completed sleep zeroed rmtp, so nanosleep(&ts, &ts) in a polling loop slept zero time from the second call on.
2026-10-11 19:45:27 +00:00
Scramblrrrr 2a58fb7997 fix(shader): preserve distinct definitions while folding phi inputs
Fold identical resolved values or equal immediate constants, retaining distinct branch-local SSA definitions. AI-assisted: yes (Codex).
2026-10-11 16:44:34 -03:00
MarcZX100 fdf288f3fc fix(libc): return fclose failures to callers
(cherry picked from commit 610d6cdda098e9adfcd3814b52f8eba01caaa4d1)
2026-10-11 19:12:46 +00:00
Achraf Reyani 6eacac2e96 test(libkernel): check close of an unopened descriptor among the other bad-descriptor cases
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 04:08:23 +09:00
Avijit Singh 471d9eced2 fix(agc): keep write tracker alive through driver teardown
Initialize the guest write tracker during Driver construction so its function-local static is destroyed after Driver on process exit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-12 00:19:21 +05:30
Achraf Reyani b610642c61 fix(libkernel): close an unopened descriptor on Windows without the invalid-parameter report
close() of a descriptor that is not open calls _close, which raises the
UCRT invalid-parameter handler before returning EBADF. In a relinked title
that handler is libc's crash reporter, so an ordinary close of a closed
descriptor printed a FATAL report and every thread's stack. The call now
runs with the thread-local no-op handler, as dup and dup2 already do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:47:39 +09:00
Achraf Reyani 10740f85f9 refactor(libc): define the stack candidate helper beside ReportBacktrace
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:42:52 +09:00
Achraf Reyani cf2ca2b103 fix(libc): list stack return address candidates in Windows backtrace reports
The abort() and UCRT invalid-parameter reports capture the stack with
RtlCaptureStackBackTrace, which stops at the first frame without unwind
data (guest code, or our libraries built without asynchronous unwind
tables), so they often end two or three frames in, before any caller.
The fault report already scans the stack for code addresses; that scan
is now a helper the backtrace reports use as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 03:41:02 +09:00
Mouad-Scriptz-0 876c4ecacf test(recompiler): pin that an unwritten window register reads 0
Two more agc_driver_relative_indexing rows read a register of the window
the program never wrote, directly and through v_movrels_b32, and expect 0,
which the zeroed window array gives like an unwritten SSA register did;
the TechnicalDebt entry says the console's value is undefined.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 18:36:09 +00:00
Dean Galvin d9afe1078e test(agc): enter whole quad mode in the implicit-LOD 1D sample test
A pixel wave starts with only its covered pixels in EXEC, so a shader that
takes an implicit LOD has to run s_wqm first or the helper lanes of a partly
covered quad hold no coordinate. The test's pixel shader did not, which goes
unnoticed while its one triangle covers every quad whole. llvmpipe clips that
triangle at twice the viewport into three, and in the quads on the two inner
edges the helpers' zero coordinate gave the last mip instead of the expected
one.

The shader now starts with s_wqm_b64 exec, exec, as a compiled pixel shader
that samples with an implicit LOD does.
2026-10-12 07:35:46 +13:00
xXPBSXx 471e12e484 fix(libSceCesCs): drop the unused module target and move the TechnicalDebt line
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 20:35:09 +02:00
Jordan Hans b1104a2c65 fix(libSceSysmodule): recognize the libSceAgc internal module id 2026-10-11 18:33:48 +00:00
xXPBSXx 4eb3340dcb fix(rudp): throw from sceRudpGetMaxSegmentSize and justify the success of the pump calls
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 20:31:52 +02:00
Mouad-Scriptz-0 f9fd0f125c fix(recompiler): give out-of-range relative vector accesses the measured semantics
M0 is unsigned, so an index at or past the window reads v0 and drops its
write, v_swaprel_b32 writes neither side when either is out of range, and
the window array starts zeroed like unwritten SSA registers; the window
load counts as a lane source so a wave64 program's second half keeps its
own registers. agc_driver_relative_indexing runs in wave32 and wave64 and
pins the rows measured on gfx1035 in the review of #3856, and the
TechnicalDebt entry states the measured behaviour, the window's end at the
last named register and the sizes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 18:28:02 +00:00
Alex 95988c9c34 fix(shader): flush f16 denormals in unary, frexp and conversion ops per the float mode
The f16 unary ops, v_frexp_mant_f16, v_frexp_exp_i16_f16, the norm
conversions and v_cvt_f32_f16 read denormal halves as they are and
rounded denormal results as they are, whatever the denormal field of
FLOAT_MODE says. On RDNA2 a clear bit 0 flushes a denormal half input
to its signed zero and a clear bit 1 flushes a denormal half result.

One shared rule now drives all of them, and v_ldexp_f16 uses it for its
input too.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 14:27:58 -04:00
Chad eedf7a2671 feat(savedata): implement sceSaveDataConvert
PPSA28416 calls it on its existing save at boot (after sceSaveDataDirNameSearch finds it) and aborted on the missing implementation. The call takes one parameter block: user id at +0, the directory name pointer at +8. Host saves have no size limit, so the conversion completes at once: an existing save returns OK, a missing one NOT_FOUND, an invalid name PARAMETER. The title polls sceSaveDataGetEventResult once afterwards and continues on 'no event'.
2026-10-11 13:23:58 -05:00
Tyler Westerberg 565e8e9c4a feat(libSceJson2): implement Object::find, Object::iterator::operator-> and String::compare
Goat Simulator 3 (PPSA04159) imports sce::Json::Object::find(String const&)
const (ehN1Biw3tw8), Object::iterator::operator->() const (EnesV4gXDtE) and
String::compare(char const*) const (Yfw63FVJgtU); without them the Windows
entry stub stops before the game starts with "unresolved ELF import
ehN1Biw3tw8".

find returns an iterator to the first pair whose key equals the argument,
or end(), using the same key match as Object::operator[]. operator->
returns the pair like operator*. compare orders the string against a C
string as std::string::compare does; a null argument throws.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:11:39 -04:00
Lexroid 5cd25dedbd fix(videoout): accept a buffer attribute change while a flip is pending
sceVideoOutSubmitChangeBufferAttribute2 threw when a buffer of the group
had a flip pending, and Marvel's Wolverine makes that call with flips in
the queue. A flip now takes its buffer group when it is reserved, in
submission order, so flips submitted before the change keep the
attributes their buffers were rendered with and later flips use the
new ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:06:04 +03:00
Adrià Franch c61f07409f test(shader): cover clamp alone and inf/NaN/fraction rows in v_cvt_i16_f16 output modifiers
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-11 19:58:44 +02:00
gookie d33dad00b8 fix(libSceXml): add an export-free libSceXml for titles that list it
PPSA19546 (Cookie Clicker) and PPSA34959 (The King is Watching) list
libSceXml.prx among their needed libraries but import nothing from it.
AnyPS5 builds no such library, so on Linux the dynamic loader stops both
before they run:

  ./eboot.elf: error while loading shared libraries: libSceXml.prx:
  cannot open shared object file: No such file or directory

On Windows the start-up stub has skipped a missing library that nothing
imports from since #3129; the Linux loader resolves DT_NEEDED itself
and cannot skip one. libSceXml now exists with no exports, like
libSceAgcVsh and libSceAudio, so it loads on both. A title that imports
from it still stops at the missing import.

Both titles now load and stop at their next missing import:
setSpecialFloatFormatType (PPSA19546, #3575) and sceHttpsFreeCaList
(PPSA34959, #3497).
2026-10-11 19:58:13 +02:00
goncalompontes fa726efe94 test(shader): cover the VOP3 interpolation result and source modifiers
Extend the decode test to mul:4, div:2, -|v2|, -|v2| div:2, a p2
coordinate with neg and a non-zero attribute channel, a clamped p2, and
the mov form with clamp and mul:2. All 18 accepted words are the
assembler output (llvm-mc -mcpu=gfx1010).
2026-10-11 18:57:55 +01:00
Lorkydey 36d37a062a fix(libkernel): limit UTC-to-local DST output to 32 bits 2026-10-11 19:56:47 +02:00
krishnaraya b3be79ffed fix(agc): keep FORCE_DEGAMMA paired when ANISO_OVERRIDE rebuilds a sampler
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 13:50:25 -04:00
virp-mta 302a8774ac feat(libc): implement drand48, lrand48, mrand48 and srand48 2026-10-11 21:48:56 +04:00
Semir Kabir e92547a7a1 feat(libkernel): wake each listed address in _umtx_op UMTX_OP_NWAKE_PRIVATE 2026-10-11 17:48:06 +00:00
Yunus Shaikh 9b1e1ecccd fix(savedata): sort sceSaveDataDirNameSearch results by the requested key and order
The search returned saves in host directory order and ignored the condition's key and order. A title that asks for the newest save first (modification time, descending) got whichever directory the host listed first: the alphabetically first on NTFS, an arbitrary one on Linux. Sort by directory name, user parameter or modification time, reverse for a descending order, and reject unknown keys and orders with the parameter error, as shadPS4 does.
2026-10-11 10:46:53 -07:00
Kikoarl 7714a5c2db feat(libSceSysmodule): register libSceShare module ID (0x10F) 2026-10-11 19:45:25 +02:00
Daan Dehing 780303049b test(agc): cover indexed rect-list draws with a partial last rectangle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:39:47 +02:00
billythemenace2 e2bfacefa3 feat(libSceRudp): declare the calls PPSA06888 imports
PPSA06888 stops on main at start-up because its bundled
Media/Plugins/SceRudp.prx imports sceRudpEnableInternalIOThread2,
sceRudpGetOption and sceRudpGetRemoteInfo, which no library exports.

The signatures are unknown, so they are declared without parameters and
throw. The title does not call them during start-up.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:39:22 +01:00
Lexroid fbb4d3771d fix(libkernel): give AMM buffers their own queue
One queue for APR and AMM buffers kept an AMM buffer behind an APR buffer
waiting on an address that the AMM buffer writes, so neither ran.
Marvel's Wolverine does this: an APR buffer waits on a counter that the
WriteAddress commands of later AMM buffers advance, and its loading
stopped. APR and AMM buffers now keep their order within their own queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 20:32:11 +03:00
LeandroLP23 c27e67ceb5 test(libSceLibcInternal): run guest_force_tls_destructor on Windows
sceKernelGetModuleInfoFromAddr has a Windows path since 77ef75c1d, so
_sceLibcInternalForceTlsDestructor finds each dso's module there too.
The test takes the other module's address with GetProcAddress where
Linux uses dlsym(RTLD_NEXT), and the TechnicalDebt entry no longer says
the call throws on Windows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:31:41 +02:00
Daan Dehing 0418aaaad2 fix(agc): draw the complete rectangles of a rect-list draw with a partial last one
A rect-list draw whose count is not a multiple of 3 threw "incomplete rect-list
primitive". Rect lists are drawn as patch lists of 3 control points, and Vulkan
generates floor(vertexCount/3) patches, so the draw now records as is and the
trailing 1 or 2 vertices are left out. Palworld (PPSA23126) draws 4 vertices x 9
instances as a rect list when character creation opens (#3832).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 19:28:27 +02:00
gookie 73866db755 fix(pad): report special ports as not connected in scePadOpen
scePadOpen returned the standard pad's handle for a special port
(type 2) as well, and scePadGetHandle found it there. Both ports then
read the one input queue, so a press queued between two frames could be
drained by the special port's read and never reach the standard port.
PPSA16827 (Harmony's Odyssey) opens both ports for the initial user and
reads both every frame, also polling controller information and device
class data for the special one.

Special ports now return DEVICE_NOT_CONNECTED (0x80920007) from
scePadOpen, as scePadOpenExt already does because the host has no
special controller, and scePadGetHandle has no handle for them.
TechnicalDebt's scePadOpenExt entry now covers both calls.

guest_pad opens a special port before and after the standard one and
expects DEVICE_NOT_CONNECTED, and DEVICE_NO_HANDLE from scePadGetHandle
for the special port while the standard handle stays valid. It fails on
main.

PPSA16827 over 130 s of its title screen: 6812 scePadRead, 3408
scePadGetControllerInformation and 3406 scePadDeviceClassParseData calls
before, two reads of the same queue per frame; 2702 reads, one
information call and no parse calls after.
2026-10-11 19:26:30 +02:00
omurc4 d40189d707 feat(libSceVideoOut): export sceVideoOutAddBufferAttributeOption
Elden Ring Nightreign (PPSA25380) imports the function, which no library
exported, so the title failed to load. The option is ORed into the buffer
attribute and a null attribute throws. Options other than 0 and 8 still
throw when the buffers are registered.
2026-10-11 13:26:22 -04:00
Mouad-Scriptz-0 f8ed012e3e perf(recompiler): keep relatively addressed vector registers in a window array
`v_movrels_b32`, `v_movreld_b32`, `v_movrelsd_b32`, `v_movrelsd_2_b32`
and `v_swaprel_b32` lowered to a compare-and-select chain over every
register from the base to the program's last allocated register, so a
program addressing 154 registers 104 times turned 3176 ISA words into
649,515 SPIR-V words that Intel's compiler did not finish. The registers
from the lowest relative base up now live in a function-scope array per
invocation (`LoadVectorWindow`/`StoreVectorWindow`), so an indexed access
is one load or store; plain accesses to those registers go through the
same array, DPP-modified relative writes keep their `DppUpdateU32` merge,
an index past the window reads 0 and drops its write, and programs
without relative addressing are unchanged. The same program recompiles
to 392,333 words with 4,992 selects instead of 32,383.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 17:26:18 +00:00
fdfawef324 58669dc134 fix(libc): write each log line in one call
mingw's fprintf writes an unbuffered stream a character at a time and
holds the stream's lock for the whole line. The APS5_LOG_* lines that
carry a RecompileRequest ("Shader ... could not be prepared after
registration", 15-20 KB each) took one WriteFile per character, and every
other thread writing to stderr waited behind them, guest calls that log
included. Demon's Souls (PPSA01342 v1.005, Windows) stops on a black
screen after two frames on main: a BPE job worker waits for the stderr
lock in sceSaveDataDirNameSearch's trace while the shader preparation
pool prints its dumps, so GameCoreLoop never finishes a frame.

The log macros now format the line into memory and write it with one
fwrite, as Driver::reportSkip does since 8cf2f6580. The UCRT writes an
unbuffered stream's fwrite as one even-length block and the last byte,
so a line takes at most two writes on Windows and one on Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 13:23:21 -04:00
hugodearaujo d1631862f5 fix(libkernel): report the operation mode the console reports
sceKernelGetOperationMode returned 0 for both values, which were
unknown. A payload on a PS5 (firmware 13.60) reads mode 2 and submode 0;
nothing past the two ints is written and the result register holds no
status, so the function now returns nothing. PPSA12544 logs both values
and ignores the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:20:54 -03:00
David f4424b5f1e feat(libSceAgc): implement the vieBRwlh1Lw interpolant mapping update
Hollow Knight Silksong (PPSA12544) imports libSceAgc NID vieBRwlh1Lw
(#699). Its name is unknown: it is not in aerolib, and the
sceAgcUpdateInterpolantMapping label other projects give it hashes to
SbuY2jN+axQ.

OpenAGC (src/game_compat.c at 3c7e807, sceAgcUnknownVieBRwlh1Lw) reads
it from FW 11.60 as the dbOlWdppb4o transform with the same (regs, gs,
ps) arguments, without the identity tail: it writes one register per
pixel shader input, none for a pixel shader without inputs, and rejects
a null pixel shader. It now shares the dbOlWdppb4o path and throws for
the rejected arguments.

For is_f16 1 and 3 inputs whose default_value and default_value_hi
differ, OpenAGC takes DEFAULT_VAL from default_value_hi, while KytyPS5,
sharpemu and dbOlWdppb4o here take it from default_value; these inputs
throw. On every other input the dbOlWdppb4o values equal OpenAGC's.

agc_interpolant_mapping runs the dbOlWdppb4o vectors and OpenAGC's
enhanced-mapping vectors through it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 20:16:47 +03:00
krishnaraya 8a0395381e fix(shader): accept DPP8 on v_pk_fmac_f16
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 13:16:11 -04:00
MarcZX100 42ac947f90 fix(agc): wake queue zero when workers become idle 2026-10-11 17:14:27 +00:00
object05 6f527fa956 test(shader): accept the split fma sum in F32DenormalFlush
agc_driver_f32_denormal_flush fails on RADV RENOIR (Mesa 26.2.4):

  lane 20 no float mode v_fma_f32 v14, v4, v5, v6 is 0x00800000, expected 0x00ffffff

The driver lowers Fma to a multiply and an add: the compiled shader has
v_mad_f32 and no v_fma_f32. The product 0x1fffffff * 0x1fffffff is below
2^-126 and is flushed before 0x00800000 is added. Lane 20 is the only
row with a tiny product and a non-zero addend. v_fma_f32 and v_fmac_f32
fail on it in all three float modes; every other check passes.

When both return that sum, the two values are not checked. FmaRounding
already leaves out its fused forms on a device that splits fma.
2026-10-11 19:10:52 +02:00
MarcZX100 6693cd6301 fix(agc): scope idle writeback and test queue worker 2026-10-11 17:09:43 +00:00
gookie 28320acf2c perf(libkernel): read a loaded image's unwind tables once in sceKernelGetModuleInfoFromAddr
sceKernelGetModuleInfoFromAddr found the size of the image's .eh_frame
on every call by walking all of its CIE and FDE records, checking each
against every PT_LOAD header. The guest libc's unwinder calls it for
each frame it unwinds, so a title that unwinds often walked its whole
.eh_frame hundreds of times per second.

The tables read from a .eh_frame_hdr are now kept per header address
and reused while the image stays loaded. The cache is dropped whenever
dl_iterate_phdr reports that an object was unloaded (dlpi_subs), so an
address reused by another image is read again.

guest_module_info queries a module twice and expects the same tables,
then unloads it, loads it again and expects tables of the same size at
the same offset in the new image.

PPSA16827 (Harmony's Odyssey), title screen, over 500 calls per second
counted under gdb, which slows the title: the process used 9269 CPU
samples per 10 s, 53.7% of them in this walk, and 3306 with this change,
3.2% in the lookup. The title still runs at 27 FPS; its frame rate is
limited elsewhere.
2026-10-11 19:07:37 +02:00
Semir Kabir 33c6e825ab feat(libSceUsbd): declare the device and handle calls for the no-device path 2026-10-11 10:06:27 -07:00
winstrex 88e5a2e407 test(agc): split agc_driver_flat_apertures by shader instead of by row
Rows that run the same kernel at the same wave size compile the same
pipeline, so each part now takes whole groups of them, and the test is
split into fourteen parts. Each shader is compiled once per CI run
instead of in up to three parts at once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:05:40 -03:00
xXPBSXx d7bf16a054 fix(exports): export the calls PPSA30601 imports
PPSA30601 (Resonance: A Plague Tale Legacy) fails to load without these imports that no library exports. Their signatures are unknown, so they are declared without parameters and throw until they are implemented. Adds a TechnicalDebt entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 19:02:18 +02:00
David-cmrg 6200b8c7b5 test(agc): split the gated dispatch producer spin into short dispatches 2026-10-11 19:01:47 +02:00
MarcZX100 7c2eba0a6d fix(libkernel): validate APR command payload sizes 2026-10-11 16:57:06 +00:00
xXPBSXx 34688d3a69 test(exports): drop the PPSA07411 export test
CONTRIBUTING asks for no tests that only check that a symbol is exported.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 18:51:54 +02:00
jweidenh 804fcb41e3 test(agc): keep storage probe callbacks out of buffer pools 2026-10-11 12:50:37 -04:00
jweidenh 9f567c227e test(agc): report recorder test Vulkan device 2026-10-11 12:49:32 -04:00
jweidenh 747321d0bb fix(agc): retain storage textures before recording initial uploads 2026-10-11 12:48:00 -04:00
jweidenh a1e01e1850 test(agc): cover storage upload lifetime before submission 2026-10-11 12:47:32 -04:00
Alex fba96d6422 fix(libc): asin(|x| > 1) returns the x86 default NaN and leaves errno unchanged
On main asin(2.0) returns 0x7ff8000000000000 and sets errno to 33;
FreeBSD msun (lib/msun/src/e_asin.c) returns 0xfff8000000000000 and
never sets errno. asin now handles |x| > 1 itself with quiet
comparisons, so a NaN input still raises no exception. For |x| <= 1
and for NaN the host function is still called.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 12:46:30 -04:00
screamm f51180973e feat(libSceAudioOut): implement sceAudioOutSysGetHdmiMonitorInfo
Surround Sound Studio (PPSA99051), catalog build on main a11c8f7f with
the flat-interpolation fix, stops 16 s in, before its first frame
(orishamir, #3581 comment 6109839314):

    sceAudioOutSysGetHdmiMonitorInfo not implemented

The call takes (type, out, size); out must be non-null, size exactly
0x180 and type 1 (HDMI) or 0x10 (sainsaji/PS5-Audio-Passthrough-Research
c3be9c2a, docs/FINDINGS.md section 3 and AGENTS.md:25, firmware 12.70).
Titles read the monitor name at +0x0B, the descriptor count at +0x94 and
8-byte descriptors from +0x98 (same, FINDINGS.md hardware log item 1 and
sample-app/src/platform/ps5/bitstream_out.cpp:92-128).

Audio reaches the host through SDL as PCM and there is no EDID, so type 1
with a 0x180-byte buffer reports a sink without a name or descriptors:
the buffer is zeroed and 0 is returned. Surround Sound Studio's
Passthrough page then lists no formats; EVO Player's code treats an empty
list like a negative return. A null buffer returns 0x80260004, as the
other AudioOut calls do. Type 0x10, other types and other sizes throw:
their results and error codes are not known.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 19:45:00 +03:00
Semir Kabir 2124cfba5f feat(libkernel): report the process affinity from cpuset_getaffinity 2026-10-11 16:43:36 +00:00
Alex 2f5d166e2b fix(shader): accept output modifiers on v_cvt_i16_f16 and ignore them as the hardware does
v_cvt_i16_f16 with mul:2, mul:4, div:2 or clamp in the VOP3 encoding
stops the recompiler with "VOP3 source modifiers are not implemented".
On gfx1036 (Radeon 610M) the result is identical with and without
mul:2, mul:4, div:2 and clamp combined with mul:2, for all 66 measured
inputs; clamp on its own is not a measured case.

The decoder now accepts omod and clamp on v_cvt_i16_f16 and drops them,
as measured. Clamp without an output multiplier is accepted by the same
rule: clamp with mul:2 gives the same hardware result as mul:2 alone.
Matches 528 of 528 rows in two float modes, 0 differing.
v_cvt_u16_f16 is not measured and stays refused.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-11 12:40:48 -04:00
MarcZX100 d57d3f0000 fix(agc): store pending results when queues go idle 2026-10-11 16:39:36 +00:00
xXPBSXx a68bc9dfdc fix(libkernel): allow sceKernelMprotect on committed host memory outside the guest registry
Thread stacks are host-private memory; the call threw instead of setting the native protection.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 18:35:35 +02:00
xXPBSXx a03afed4c3 fix(exports): export the calls PPSA07411 imports
PPSA07411 (Resident Evil 4) fails to load without these imports that no library exports. Their signatures are unknown, so they are declared without parameters and throw until they are implemented. Adds one test and a TechnicalDebt entry.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 18:35:00 +02:00
MiniRML 7a82dd4879 chore: sync upstream before VideoOut driver review 2026-10-11 09:34:01 -07:00
Achraf Reyani 5027dcedc7 fix(shader): accept signed less-than in runtime SRT values
#2072 taught the SRT evaluator SLessThan32, but IsRuntimeUniformOp still
left it out, so the runtime validator rejected any descriptor dword computed
through a signed comparison before the evaluator could compute it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 01:32:12 +09:00
Semir Kabir 5f123fd1b2 feat(libSceFiber): add the underscore thread frame pointer export 2026-10-11 09:30:02 -07:00
fdfawef324 9d96752fcd fix(libkernel): let munmap succeed over a range with nothing mapped
munmap and sceKernelMunmap over a range in which no page is mapped
failed: munmap returned EINVAL and sceKernelMunmap let the registry's
exception escape. Both now return 0. The console returns 0 for
sceKernelMunmap of a range it just unmapped and of a never-mapped
address, and EINVAL only for a zero length, as measured by prosper's
console oracle (kernelx.golden.tsv, kx_fmem_unmap_again,
kx_fmem_munmap_unmapped).

The other half of #3196, a range with an unmapped page in the middle, is
already fixed on main by 04ed61957; the test covers both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 21:59:32 +05:30
Semir Kabir 54b9b93240 feat(libSceUlt): add underscore mutex and queue create exports 2026-10-11 09:29:28 -07:00
Lorkydey 43783f725c feat(libSceAgc): build versioned ACB atomic GDS commands 2026-10-11 18:28:46 +02:00
screamm b2da41e542 test(libkernel): accept host stacks above the AMM range in guest_amm_placement
On Windows, real thread stacks that exist before the guest arena is
reserved can sit near the arena top, so the AMM range correctly lands
9-60 GiB below it and the 1 GiB bound failed about 1 run in 10. The test
now requires that no free 64 GiB window exists above the AMM range.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 18:26:44 +02:00
jweidenh 503043ca00 fix(libkernel): run pthread key destructors before thread release 2026-10-11 12:21:40 -04:00
jweidenh 6ae2a784af test(libkernel): cover pthread key destructor lifetime 2026-10-11 12:20:59 -04:00
Romans Pokrovskis 1e40599f24 test(libkernel): verify app info missing metadata errors 2026-10-11 19:17:25 +03:00
jagrat Singh 86bd3b6621 feat(libSceAcm): implement sceAcm_FFT and sceAcm_Panner 2026-10-11 21:40:58 +05:30
mariusyo07 1e3a9345f0 fix(pad): accept vibration mode 3
Broken Sword Reforged (PPSA21480) calls scePadSetVibrationMode(handle, 3) after
scePadOpen and treats a failure as fatal (ps5_controls.cpp:19 "Sony call failed
with code 80920001"). Modes up to 3 are accepted, 4 and above stay invalid.

Co-Authored-By: xXPBSXx <20614131+xXPBSXx@users.noreply.github.com>
2026-10-11 18:02:39 +02:00
MrMha 474c2b9ff1 fix(libkernel): reject malformed UTF-8 in param JSON 2026-10-11 19:56:55 +04:00
Hussein Kadhim 700f017eb6 test(libkernel): check that timed-out rwlock reads leave no reader count 2026-10-11 21:25:20 +05:30
Hussein Kadhim b02881cf0e fix(libkernel): fail pthread_rwlock_unlock with EPERM when the rwlock is not held
scePthreadRwlockUnlock called unlock_shared on the host mutex whenever the
caller was not the writer, which is undefined behaviour for an unlocked rwlock
or one write-locked by another thread. Track the reader count and return
EPERM like FreeBSD libthr when the caller does not own the write lock and no
read lock is held.
2026-10-11 21:25:20 +05:30
Lorkydey d71c51c22d feat(libkernel): implement wait through guest waitpid 2026-10-11 17:53:21 +02:00
David 60a7f28112 feat(libkernel): implement sceKernelAioSetParam
Dying Light 2 (PPSA02262) imports sceKernelAioSetParam (9WK-vhNXimw) from
its eboot. In #1794 tv7 reported on main b5f5362d3 + #2129 (2026-10-10):

  FAIL: unresolved ELF import -q-vbO859Tw from libSceVideoOut.prx

with "12 other imports are still unresolved on `main`. In the eboot,
`-q-vbO859Tw`, `GTfJ64qFCPw`, `vwtVpHQKelI` (no known names),
`sceKernelAioSetParam` and `sceNpWebApi2GetMemoryPoolStats`." The import
is observed; its position in the loader queue after the nameless NIDs is
predicted.

The function fills one SceKernelAioSchedulingParam (five 4-byte fields,
20 bytes): Orbital cc408367 tools/ida/db_types.json:1103, SharpProspero
5dfdb4b0 Interop/Kernel/KernelAio.cs ("Sets every field of param at
once") and ampr_emu cfa85df3 ps5/include/sce/_fs.h agree on
(param, schedulingWindowSize, delayedCountLimit, enableSplit, splitSize,
splitChunkSize). No source gives an error code, so a null struct and
values outside SharpProspero's maximums (window and delayed count 0..128,
split flag 0 or 1, sizes up to 0x1000000) throw. The engine does not use
the settings, as sceKernelAioInitializeImpl ignores its struct; this is
recorded in TechnicalDebt.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit e45a2b950afe594212db2764529ccae32f84be8c)
2026-10-11 15:50:42 +00:00
Jan Šlégl e753080391 fix(libkernel): count guest module segments against the flexible memory budget
sceKernelAvailableFlexibleMemorySize and the flexible maps counted only
explicit flexible mappings, so the full 448 MiB was reported while the
title's executable and modules were loaded. A title that derives its code
and data size from the budget minus the available size got an unsigned
underflow.

The segments of the main executable and of every .guest.prx module that
the title's ELF gives permissions now count, rounded to 16 KiB pages, as
shadPS4 maps every non-system module segment as flexible memory. The
relinker's own blocks and the host system libraries do not count. The
charge ends when a module is unloaded.

Refs #2883

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Fnrk5Dazjb2tLooVSpdRQq
2026-10-11 17:48:05 +02:00
Alex b00efdb261 fix(shader): accept abs, neg and op_sel source modifiers on v_cvt_pknorm_i16_f16 and v_cvt_pknorm_u16_f16
v_cvt_pknorm_i16_f16 and v_cvt_pknorm_u16_f16 with |x|, -x or op_sel in
the VOP3 encoding stop the recompiler with "VOP3 source modifiers are
not implemented", although the RDNA2 hardware executes them.

These two opcodes now use the two-source f16 modifier path of
v_pack_b32_f16: op_sel picks the high half of either source, then abs
and neg apply. Other op_sel bits, clamp and omod are still refused.
Matches 15632 of 15632 rows measured on gfx1036 (Radeon 610M) in two
float modes, 0 differing.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-11 11:45:26 -04:00
Tharun Balaji a0a7155964 test(libkernel): cover creat error cases
Carry the additional GuestFilesystem checks from issue #3303 after its implementation landed on main. The declaration already exists on main, so keep one prototype.
2026-10-11 15:43:40 +00:00
overlordxrz-source 4891d625af feat(libSceNet): export sce_net_in6addr_linklocal_allnodes
Co-authored-by: eliasbruno124-dev <230422461+eliasbruno124-dev@users.noreply.github.com>
2026-10-11 11:41:05 -04:00
MarcZX100 e56a727375 feat(build): support Linux AddressSanitizer builds 2026-10-11 15:40:36 +00:00
MarcZX100 776cff0efb fix(libSceHttp): use native Windows condition waits
Use an SRW lock and native Windows condition variable for epoll waits, preserving the shared handle lifecycle. This avoids the scheduler-tick overshoot measured with std::condition_variable on Windows.

Suggested-by: winstrex
2026-10-11 15:40:29 +00:00
David 4c7d83a2bf feat(libSceHttp): implement sceHttpAbortWaitRequest and the unlimited sceHttpWaitRequest
Deathloop (PPSA01670) imports sceHttpAbortWaitRequest; Planet Coaster
(PPSA01736) and Palworld import sceHttpWaitRequest.

Epoll handles are kept in a registry with an abort flag, a destroyed flag
and a condition variable. A wait with a negative timeout blocks until
sceHttpAbortWaitRequest, sceHttpDestroyEpoll or the sceHttpTerm of the
last context wakes it; a bounded wait still returns 0 events. An abort
stays set and makes every later wait return SCE_HTTP_ERROR_ABORTED
(0x80431080); a wait woken by destroy or term returns 0 events.
sceHttpDestroyEpoll no longer frees a handle a waiter is blocked on.
sceHttpInit registers its context, and the epoll calls and sceHttpTerm
return BEFORE_INIT without a live context and INVALID_ID for an unknown
context or handle.

Behaviour and error codes: shadPS4 src/core/libraries/network/http.cpp
and http_error.h at a8a70da595da2a96e0410309472ba4a7eb558144.
Signature (void* eh): Orbital tools/ida/db_types.json at
b321fcdbd700cc02da1cb1ad25412781d5ec73c6 and SharpProspero
src/SharpProspero/Interop/Net/Http.cs at
60977b29103452b9681ae10c7a9011d44965bf16.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 766997df3f8329fd6e8e7aac2b5d83daf88c8292)
2026-10-11 15:40:17 +00:00
Darryl Fernandes c2f16e0e4d fix(libkernel): support RUSAGE_CHILDREN in getrusage
Co-authored-by: milescoviello <kitslayer29@gmail.com>
2026-10-11 11:39:12 -04:00
Utku Halis 99ddfa762a fix(libc): track never-collected pages in the macOS write watch
On macOS, GuestWriteWatchCollectFresh reported nothing and returned true, so
MarkWritten took pages no collection had armed yet for clean, and they stayed
writable without being tracked. GuestWriteWatchCollectArmed was a full collect,
which also took those pages.

Pages now carry a fresh bit from registration until a collection takes them, as
the Linux watch keeps its fresh ranges: CollectFresh reports and arms only fresh
pages, CollectArmed skips them, and Collect takes both. Protection changes, host
writes and faults keep the bit.

The write_watch fresh and armed tests check both collections.
2026-10-11 18:34:59 +03:00
Adrià Franch 86da3e9d74 fix(libc): include cerrno in Math.cpp 2026-10-11 17:34:21 +02:00
JAB-dev e127a525d1 feat(libSceFont): implement sceFontCharacterGetSyllableStringState
The call was an unimplemented stub. It now writes syllable state 0 and
returns OK for every character outside the Thai block, where a PS4
firmware 11.00 libSceFont measures 1, 3 or 4; Thai characters throw as
not implemented. A null character or result returns
SCE_FONT_ERROR_INVALID_PARAMETER, and a null character writes 0 to a
non-null result, as measured. The signature follows SharpProspero.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 17:32:23 +02:00
virp-mta e6dcb46f3a feat(libSceNpEntitlementAccess): implement offline entitlement info requests 2026-10-11 19:30:34 +04:00
exefer 3ae2583802 fix(libkernel): select descriptors that are not sockets 2026-10-11 17:25:32 +02:00
Alex 1a6f6a9f13 fix(libc): match FreeBSD asinf errno
asinf returned 0xffc00000 (errno 33) for 2.0 (0x40000000), where FreeBSD
lib/msun/src/math.h returns 0xffc00000 (errno 0).

It now returns the FreeBSD result for that case. A guest test covers it
and fails on main.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-11 11:22:51 -04:00
Lorkydey 6744880450 fix(libc): parse atoi through guest-width strtol 2026-10-11 17:20:39 +02:00
JAB-dev b576273225 fix(libSceFont): return the letter step of sceFontWritingRefersRenderStepCharacter through a pointer
The second argument is an out pointer to the writing's letter step, as
KytyPS5 and the SharpProspero bindings declare it. It was filled as a
letter step struct, which wrote 64 bytes over the caller's 8-byte
pointer. The letter step now lives in the writing and the call stores
its address, or null when there is no current step.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 17:12:47 +02:00
David dc022d8418 fix(libkernel): let a guest unlink and rename files it has open on Windows
FreeBSD removes or renames a file that is still open; the descriptor stays usable. _wopen opens without FILE_SHARE_DELETE, so sceKernelUnlink returned EACCES and rename failed while the guest held a descriptor. sceKernelOpen now opens through CreateFileW with delete sharing and keeps the flag, mode and error mapping of _wopen.

(cherry picked from commit 2f5ada5c86a427505804f22def209e054b3571e4)
2026-10-11 15:11:38 +00:00
virp-mta 4b91755d9a feat(libSceSigninDialog): complete offline sign-in dialog lifecycle 2026-10-11 19:11:37 +04:00
Zurisen 3c6c5d5331 fix(libkernel): reserve the AMM ranges below host regions at the top of the guest arena
The AMM ranges were reserved at the last 64 GiB of the guest arena and
the reservation threw when that window was not free. On Windows the
stacks of the threads that exist before the arena is reserved (the main
thread and the loader's workers) are placed at random addresses and are
left in the arena as host regions; when one fell in the last 64 GiB, the
first AMM use threw "fixed guest mapping ... overlaps a host region in
the guest arena". Reserve the highest free 64 GiB window instead: the
last 64 GiB when it is free, and the window just below an occupied part
of it otherwise.
2026-10-11 17:09:12 +02:00
Alex 9ff132d9a5 fix(shader): accept the clamp bit on VOP3 float compares
The decoder throws "VOP3 source modifiers are not implemented" for
VOP3-encoded float compares (v_cmp_*_f16/f32/f64) that set the clamp
bit, so shaders using them fail to compile.

On RDNA2 hardware the clamp bit does not change the result of a float
compare: the measured results with and without it are the same. The
decoder now accepts the bit on float compares; clamp on other carry-out
and scalar-destination opcodes still throws.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-11 11:04:38 -04:00
goncalompontes 61d4494863 fix(shader): accept the inline constant third source of VOP3 interpolation
The assembler encodes the unused third source of the VOP3-encoded
interpolation forms as the inline constant 0 (src2 = 0x80, bit 25 of the
second word), which the decoder refused. Accept that encoding and refuse
any other third source. The decode test now uses the assembler words for
every accepted form and keeps the refusals one field away from a valid
word.
2026-10-11 16:03:46 +01:00
David 9ac583bddd feat(libSceAudioIn): implement sceAudioInHqOpen and sceAudioInAsyncOpen
Both open the same SDL capture port as sceAudioInOpen, so Input,
GetSilentState and Close work on their handles. HqOpen accepts only a
128-sample grain at 48 kHz (SharpProspero, KytyPS5); AsyncOpen returns
INVALID_SIZE above 384 samples (SharpProspero). Values the sources
disagree on throw. Format 0x10 still throws: only KytyPS5 accepts it.

Imported by FMOD-based titles, The Smurfs Dreams (PPSA21607) and Astro
Bot (PPSA21564); Ghost of Yotei (PPSA26344) calls sceAudioInOpen.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 16bfdf928d0a2da0b4473db2633a2e270538cbf5)
2026-10-11 15:03:16 +00:00
Nuno Silva 199225225f test(shader): cover SRT read use patching 2026-10-11 16:02:49 +01:00
Claude 54e5aad214
test(libkernel): skip the read-only truncate cases when running as root
Root ignores the file mode, so truncating a file with only the owner
read bit succeeds and guest_truncate aborted when the suite ran as root,
as it does in containers. The read-only cases now run only for other
users and the test says on stderr when it skips them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 14:59:10 +00:00
MarcZX100 f942de360e test(libc): keep Windows unwind coverage within guest frames 2026-10-11 14:58:39 +00:00
Tharun Balaji c426143712 fix(libSceHttp2): clear completion queues for cascade-deleted requests
sceHttp2DeleteRequest erased the request's completion queue, but
sceHttp2DeleteTemplate and sceHttp2Term removed descendant request
handles through ReleaseOwnedHandles without clearing their completion
queues. A request that completed asynchronously before its template or
context was deleted kept a stale completion that sceHttp2WaitAsync could
still consume.

ReleaseOwnedHandles now returns every transitively removed handle id, and
DeleteTemplate and Term erase the completion queue of each removed
request. CompleteAsync validates that the request is live while holding
the handle lock and inserts the completion under it, so a send that races
a deletion either returns the invalid-id error without queuing or is
erased by the deletion; a completion is no longer re-created after a
deletion returns. The only lock nesting stays handles before completions,
and no mutex is held while the user event is triggered.

GuestHttp2 covers a queued completion before sceHttp2DeleteTemplate and
before sceHttp2Term: the completion is no longer consumable, a late send
returns the invalid-id error without queuing, and the removed handles are
rejected.
2026-10-11 16:57:12 +02:00
Tharun Balaji 4337b43f54 fix(libSceHttp2): validate SSL setter handles 2026-10-11 16:57:12 +02:00
Claude bd0998a7a8
fix(build): keep libc.prx needed by every executable that links a prx
Ubuntu's GCC links with --as-needed, so a test that calls nothing in
libc.prx directly dropped it from DT_NEEDED and satisfied the prx
libraries' __cxa_* and __gxx_personality_v0 references from the static
libstdc++ instead. Those copies interpose libc.prx's, so exceptions
thrown inside the prx libraries were searched by libgcc and resumed by
the guest unwinder, which aborted guest_kernel_stack_protect. libc now
propagates to every consumer of a prx with --no-as-needed on Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 14:56:57 +00:00
lorkydey 5bd43e3e8e build(libc): register filesystem statistics source separately 2026-10-11 16:55:03 +02:00
Ori Shamir 3f4438dcca fix(pad): keep partial L2/R2 values from a controller
An SDL controller sets the L2/R2 bit whenever its trigger axis is above
zero, and BuildData then reported 255 for any set bit, so a partly
pressed trigger read as fully pressed. Report the analog value whenever
there is one; 255 remains for an injected press and for a bit without
an analog value.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 17:52:56 +03:00
QRMOE 90a14e6a1f
test(libc): cover strftime literal conversions
Exercise unknown, repeated and incomplete conversions, percent escaping and buffer boundaries.

AI-assisted: yes
2026-10-11 16:52:30 +02:00
QRMOE 1b9179501f
fix(libc): preserve strftime literal conversions
Normalize FreeBSD 11.4 literal conversions before host formatting.

AI-assisted: yes
2026-10-11 16:51:42 +02:00
Dean Galvin c1287d73c5 fix(agc): leave the depth surface out when no enabled test has its plane
DecodeState bound the depth surface whenever DB_DEPTH_CONTROL enabled a
depth, stencil or depth bounds test and either plane was valid. A stencil
test beside a depth-only surface (DB_STENCIL_INFO format invalid, depth
test off) tests nothing, but the surface was still attached and the
render extent was clamped to it. A draw into a 1920x1080 target with a
960x540 depth surface left bound then covered only the top-left quarter.

A test whose plane is present but invalid no longer binds the surface.
Such a draw renders without a depth attachment, as it already does when
both planes are invalid. DrawRejection follows the same rule.
2026-10-12 03:43:27 +13:00
xXPBSXx abf6f06be4 fix(rudp): provide the calls PPSA03490 still lacks
PPSA03490 (Demon Slayer) imports sceRudpGetMaxSegmentSize, sceRudpProcessEvents, sceRudpNetFlush and sceRudpNetReceived, which no library exports. The first three answer by the library's initialised state; sceRudpNetReceived is declared without an implementation because its signature is unknown. Adds one test and TechnicalDebt entries.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 16:37:32 +02:00
MarcZX100 e7c20b3033 feat(libc): export isnanf and __signbitl 2026-10-11 14:35:01 +00:00
Claude d7f1a6d3d5
fix(libkernel): translate host errno in the file functions' SCE errors
SceErrorFromErrno in the libkernel file functions passed host errno
values 1-34 through and turned every other value into EIO. Linux numbers
EAGAIN 11, which is FreeBSD's EDEADLK, so a read from an empty
non-blocking pipe returned SCE_KERNEL_ERROR_EDEADLK, and ENAMETOOLONG,
ELOOP, ENOTEMPTY, EDQUOT and EOVERFLOW, whose host values differ from
FreeBSD's, all became EIO.

Map those host values to the guest's FreeBSD numbers, as
SceIoErrorFromErrno in Open.cpp already does for EAGAIN, EDEADLK,
EDQUOT and EOVERFLOW. The guest constants the callers pass are all at
most 34 and never 11, or GUEST_ENOTEMPTY, so they are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 14:32:44 +00:00
Achraf Reyani 27599ccfbf fix(libc): align mspace allocations to 32 bytes
Clang's PS4 and PS5 targets set the default new alignment and the suitable
alignment to 32 bytes, so PS5 code may store to a fresh mspace block with
32-byte-aligned AVX instructions, as the guest heap already allows since
#1621. The mspace allocator aligned blocks to 16 bytes only. Every mspace
allocation is now aligned to at least 32 bytes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 23:32:41 +09:00
alfalfa-star 31de083006 test(agc): require every compiled mesh program to read NumWorkgroups
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 16:30:37 +02:00
QRMOE 97409a6d08
test(libc): cover dirname result length boundaries
Cover 16 paths with long leaves, exact-fit and overlong directory results, repeated separators, input preservation and guest errno. The regression reports 12 failures on unchanged main and passes with the accompanying fix.

AI-assisted: yes
2026-10-11 16:25:14 +02:00
QRMOE f133aaa4b0
fix(libc): check dirname result length
Find the directory component before checking the result buffer limit, matching FreeBSD 11.4. Preserve input and guest errno on success; overlong directory results still report ENAMETOOLONG.

AI-assisted: yes
2026-10-11 16:23:53 +02:00
Alberto Ruiz 029430690f test(json2): destroy the value before constructing over it
ValueClear constructs a Value, then calls the Value(const Object&)
constructor on the same object. The constructor allocates a new node and
overwrites the pointer, so the first node (56 bytes) is never freed.
LeakSanitizer reports it; destroy the value first.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01R5WJS4ZdQynAJesCZKH5hb
2026-10-11 16:21:15 +02:00
xXPBSXx 66165443c0 feat(libSceCesCs): add sceCesRefersUcsProfileCp1251 and sceCesMbcsUcsContextInit
PPSA15246 (Teardown) imports both from the module-named libSceCesCs-module and
stops at the loader without them. Cp1251 joins Cp1252 in sceCesSbcToUtf8 and
sceCesUtf8ToSbc; the context initializer succeeds without storing anything
because its layout is unknown (listed in TechnicalDebt.md).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 16:20:47 +02:00
XairRrR 2f140cb8b0 fix(agc): read zero for pixel inputs of parameters the vertex stage does not export
A pixel input whose SPI_PS_INPUT_CNTL offset names a parameter the
previous stage does not export failed validation ("graphics interfaces
disagree"), so the draw threw. No export writes that parameter slot for
the draw. radeonsi programs a pixel input without a matching vertex
output as OFFSET 0x20 with DEFAULT_VAL 0, so that it reads (0, 0, 0, 0)
(SI_PS_INPUT_CNTL_UNUSED in si_shader.h, applied in si_shader.c), and
rect-list draws already pass zero for such inputs.

Before the pixel stage of a draw is prepared, inputs that read a
parameter the previous stage's program does not export now read zero:
OFFSET bit 5 is set, DEFAULT_VAL and FLAT_SHADE are cleared, and an FP16
input also reads zero in its high half (USE_DEFAULT_ATTR1 set,
DEFAULT_VAL_ATTR1 cleared). Inputs that already read a default value
are unchanged.

Fixes #2975.
2026-10-11 16:14:12 +02:00
Alex 632338cd65 fix(libc): fmod leaves errno unchanged
fmod set errno (33) for 1.0, 0.0. FreeBSD msun never sets errno and
reports errors through floating-point exceptions only, so errno is now
saved and restored around the host call.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-11 10:07:19 -04:00
Celegans12 76fa2beceb perf(recompiler): reuse sorted sets for iteration selection merges
Seed each iteration-selection update from its first eligible successor
instead of rebuilding and intersecting the universe of block IDs.
Reuse the existing in-place intersection and sorted-insertion helpers
while preserving the original empty-successor and fixed-point behavior.
Keep a cache-neutral switch for same-binary output and timing comparisons.
Run the existing structurizer and control-flow fixtures in a separate
process with this optimization disabled as well as in their default mode.
2026-10-11 16:06:57 +02:00
Celegans12 f32bbf2e9e fix(cache): replace entries while Windows readers retain old files
Publish Windows cache entries with the POSIX rename operation so an
open delete-sharing reader keeps its original file after replacement.
Close the rename handle before returning and retain the existing
fallback only when the extended operation is unsupported.
Exercise old and new reader contents, deletion lifetime and temporary
file cleanup in the registered disk-cache regression on both platforms.
2026-10-11 16:03:37 +02:00
Celegans12 09894076d4 fix(agc): own resolved dispatch state through thread exit
The resolved-dispatch map was a nontrivial thread_local object.
MinGW can run its destructor after emutls frees the backing storage,
causing an access violation when a queue worker exits.
Use the existing ThreadOwned helper to destroy the heap-owned map
through its pthread key while keeping a trivial TLS pointer.
Reject FATAL output in both draw-cache test modes so a background
shutdown failure cannot pass only because the process returns zero.
2026-10-11 16:01:34 +02:00
lorkydey 1ead4a120c feat(libc): implement guest fstatvfs volume statistics 2026-10-11 15:57:20 +02:00
Scramblrrrr 56d08f2547 fix(agc): exclude host arena holes from write-watch proofs 2026-10-11 10:55:48 -03:00
QRMOE 10e822cf04
test(libkernel): cover omitted clock resolution
Cover 20 clock IDs, preserved guest errno, non-null unsupported clocks and the SCE null-output fault. The regression fails against main and passes with the accompanying fix.

AI-assisted: yes
2026-10-11 15:53:15 +02:00
QRMOE 7fdc5b4528
fix(libkernel): honor null clock_getres output
Return success for a null POSIX resolution output before inspecting the clock ID, matching FreeBSD 11.4 sys_clock_getres.

AI-assisted: yes
2026-10-11 15:51:43 +02:00
Sanjaysrinivas 3d31a8464a fix(agc): reclaim idle buffers on allocation OOM 2026-10-11 15:50:46 +02:00
fablevoid 17e03d3c0a fix(libc): fail fgets with a size of 0 or less like FreeBSD
The guest fgets handed the size straight to the host. With a size of 0
glibc and the Windows runtime return NULL without setting errno or the
stream error indicator, and a negative size goes to the Windows
invalid-parameter path. FreeBSD's fgets checks n <= 0 before reading:
it sets __SERR on the stream, sets errno to EINVAL and returns NULL,
leaving the buffer and the file position untouched.

fgets_nid_postfix now does the same before calling the host. The
FileStream flag it uses was only set for encoding errors so far and is
renamed from SetEncodingError/encodingError to SetError/guestError; it
already stays set until clearerr like __SERR.

guest_standard_streams checks sizes 0, -1 and INT_MIN (NULL, errno 22,
error indicator set and cleared by clearerr, buffer and position
untouched) and that a following read still returns the line; it fails
without the change.

Fixes #3084

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 13:49:43 +00:00
jweidenh 07297a54aa test(agc): verify rejected resource sets release storage images 2026-10-11 16:44:45 +03:00
XairRrR eba67d4130 fix(agc): render a slice of a 2D array color target into that layer of the array
A color view of slice N of a 2D array (CB_COLOR_VIEW SLICE_START, with
CB_COLOR_ATTRIB3 MIP0_DEPTH as the last slice) was rendered as a 2D
surface at the slice's address. The swizzle equations of the XOR tile
modes take the slice index (the detiler's slice bits), so the texels of
slice N of an array are not where a 2D surface at that address puts
them: a title that renders into array slices and then samples the array
read them scrambled.

The decoded target now keeps the array's address, its last slice and the
view's slice. A resident target that is a slice of an array attaches
that layer of the array's storage image, so the texels follow the
array's layout; storage images of 2D arrays are color attachments for
this, and an attachment view selects a layer. A slice whose array has
DCC, CMASK or an attachment proxy has no resident array image, and a
non-resident slice of an XOR-tiled array now throws instead of being
written in the 2D layout.
2026-10-11 15:44:20 +02:00
pushkarreddyy c3db0b0d15 perf(libSceAgcDriver): cap draw input snapshot allocation size
In #3338, Ratchet & Clank: Rift Apart (PPSA01474) hits a 36 GB / 5 s
memcpy stall at frame ~380 right after intro logos because the GPU
worker thread is blocked copying multi-gigabyte storage buffers on every
draw snapshot miss (specifically a 3.01 GiB streaming range
0x118f800000+0xbc200000 and a 232 MiB range 0x1171258040+0xe7fffc0
across 130,000 draws).

ShaderResources::PrepareDrawBindings now caps both per-allocation and
cumulative draw input buffer snapshot copies at 64 MiB by default,
overridable via APS5_DRAW_SNAPSHOT_MAX_MIB. Inputs exceeding the threshold
skip snapshotting and bind directly in place, preventing multi-gigabyte
memory copies while preserving standard small uniforms and draw arguments.
Budget allocation prioritises earlier descriptor bindings in deterministic
pipeline layout order.

Adds drawSnapshotCapTests in core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
verifying individual and cumulative capping, cross-platform cache behavior on
watched and compared hosts, and direct observation of subsequent CPU writes
on in-place bound ranges exceeding the cap. Exercised via --draw-snapshot-cap-only
registered as agc_draw_snapshot_cap in libSceAgcDriver/CMakeLists.txt.
2026-10-11 19:11:56 +05:30
DariusHQ 6ef110af48 feat(libc): implement wcstok
PS5MC (PPSA99420) stops at start-up on wcstok once sendfile is in. It
follows FreeBSD's three-argument wcstok over the guest's 16-bit wchar_t:
leading delimiters are skipped, the token ends at the next delimiter,
which is overwritten with 0, and *last is set to null when the string
runs out.
2026-10-11 16:41:50 +03:00
Lexroid 32a3047b5d fix(libkernel): run APR buffers past an unsatisfied wait on their own queue
sceKernelAprSubmitCommandBuffer ran the whole buffer on the submitting
thread, so a WaitOnAddress or WaitOnCounter that the submitter itself
satisfies after the submit returned never returned. A buffer now runs on
the submitting thread until such a wait; the rest of it, and every APR or
AMM buffer submitted after it, runs in order on one APR thread.
sceKernelAprWaitCommandBuffer and sceAmprAmmWaitCommandBufferCompletion
wait for that completion.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wu3nuU87RJwjkkmxqft3sD
2026-10-11 16:37:25 +03:00
Josip Parlov 93f5220d11 refactor(audioin): name X+4jdIS75P0 sceAudioInIsPadEmbeddedMic 2026-10-11 15:36:25 +02:00
Simon 69e3c1d115 fix(libSceNpTrophy2): accept a null details or data in GetTrophyInfo and GetGroupInfo
sceNpTrophy2GetTrophyInfo and sceNpTrophy2GetGroupInfo rejected a call
unless both outputs were given, although both already fill each output
only when it is not null. PPSA18391 (Clickteam Fusion) queries trophies
with a null details. Only a call with neither output is rejected now, as
in sceNpTrophy2GetGameInfo.
2026-10-11 15:35:56 +02:00
Josip Parlov 265c982eaa refactor(agc): name zARR5aCmkoY sceAgcDcbAtomicGds_0900 2026-10-11 15:33:55 +02:00
MarcZX100 afcaf91019 test(agc): cover hand-built VGPR register offset 2026-10-11 13:32:20 +00:00
Hannah Lyons 81e3e34637 test(libScePosixForWebKit): pin fnmatch bracket class syntax to FreeBSD 11 2026-10-11 09:31:23 -04:00
lorkydey 1fc9b4d93f feat(libkernel): query real-time alarms with getitimer 2026-10-11 15:30:33 +02:00
EdouardSence 95a92f35e1 feat(libSceJson2): add sce::Json::Parser::parse with a read callback
PPSA04540 (Rise of the Ronin) imports it. The characters the callback
returns are parsed as by the (text, size) overload.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:28:58 +02:00
Adelmo Junior 5334bd178c fix(libSceHttp): retain authority delimiter for partial URI builds 2026-10-11 10:28:39 -03:00
EdouardSence 3faaa4b8f0 feat(libSceJson2): add the sce::Json::Array copy constructor, clear, front and iterator::operator->
PPSA04540 (Rise of the Ronin) imports all four.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:28:30 +02:00
ducloc080202 ae07d4a7a1 fix(libc): quote the executable path in the throw-site test 2026-10-11 20:25:42 +07:00
ivica00 9b439b30e9 feat(libc): implement __powisf2
PPSA02456's FMOD plugin imports this float integer-power helper, which libc does not export.
2026-10-11 15:25:25 +02:00
JAB-dev 61a9f5dc14 feat(agc): render 1_5_5_5 UNORM color targets
CB_COLOR_INFO format 17 with UNORM and the standard component swap renders
into VK_FORMAT_A1R5G5B5_UNORM_PACK16, whose attachment and blend support
Vulkan requires. AMD keeps X in the low bits and Vulkan keeps R in the
high bits, so the exports are mapped with X and Z exchanged and the stored
bits follow the guest layout. PPSA06699 renders into this format.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-11 15:21:46 +02:00
Sanjaysrinivas 1fe527bbec fix(agc): route registered NGG workgroups
Defer registered NGG workgroup preparation until routing is known. Share the routing decision with static ABI resolution and draws. Gate the wave64 fixture on supported mesh subgroups; retain device-independent routing coverage.
2026-10-11 15:20:24 +02:00
DariusHQ bad19037a6 feat(libkernel): implement sendfile
PS5MC (PPSA99420) stops at start-up on sendfile. It follows FreeBSD 11:
headers, the file range and trailers go to a connected stream socket, the
file offset does not move, a non-blocking socket fails with EAGAIN after
a partial send, and *sbytes reports what was sent. The checks and the
point where *sbytes is written follow kern_sendfile.c.
2026-10-11 16:19:13 +03:00
DariusHQ b9fc448343 fix(libc): format positional arguments on Windows
The guest formatter threw on %n$ and *m$, which FreeBSD's vfprintf and
glibc accept. It now reads the arguments a numbered format names into a
table first, with the types their conversions give them, and follows
FreeBSD's rules for unnumbered conversions and unnamed arguments.
2026-10-11 16:19:13 +03:00
DariusHQ d9fe7ee614 fix(libc): accept the ' flag in Windows formatting
FreeBSD's vfprintf takes ' as the thousands-grouping flag. The Windows
formatter threw on it as an unsupported conversion. The guest's setlocale
only accepts the C locale, which has no thousands separator, so the flag
changes nothing: it is dropped before the host's printf sees it, and the
host's locale cannot add separators.
2026-10-11 16:19:12 +03:00
DariusHQ b1fe54e331 fix(libc): print 0 for %#.0o of zero on Windows
C and FreeBSD's vfprintf print a single 0 when # meets octal zero with a
precision of 0. The Windows formatter passed the conversion to the host's
printf, which printed nothing; it now asks for one digit instead.
2026-10-11 16:19:12 +03:00
David 88cd5bbde5 fix(libSceAgc): accept a hand-built GE_USER_VGPR register offset in sceAgcCreatePrimState
EVO Player (PPSA99039), Jelly5 (PPSA99505), Emby5 (PPSA99515) and
Nuvio PS5 (PPSA99997) stop on main 0f863c10 with

  what():  sceAgcCreatePrimState: invalid user configuration register offsets

All four build their shader headers by hand (EVO-PLAYER-PS5
evo_agc_shader_header.c, ported from ps5-xash3d-halflife) and store the
ge_user_vgpr_en special at 0x25c (GE_USER_VGPR1, value 0) instead of
0x262 (GE_USER_VGPR_EN), as analysed in #3457. They run on the console.

OpenAGC's reconstruction of the FW 5.50 sceAgcCreatePrimState
(src/game_compat.c at 3c7e8072) copies the four special register pairs
verbatim without checking their offsets; KytyPS5's offset checks
(src/libs/agc.cpp at 16a7fe68) are EXIT_NOT_IMPLEMENTED guards. The
special is now copied at the offset the header stores, not moved to
0x262; the driver reads neither register. GE_CNTL, VGT_SHADER_STAGES_EN
and a used VGT_GS_OUT_PRIM_TYPE are still required at their own
offsets because the driver reads them there, and the error now names
the special and the offset found.

With the change all four titles get past sceAgcCreatePrimState and stop
in the shader recompiler (GetImageResource dword 3 is not a valid
runtime value), as #3457 reported for EVO Player.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit aeaa5080d9595305aa73e74d966f989c88b79839)
2026-10-11 13:19:03 +00:00
David 6db0a4df7c fix(libkernel): sync read-only and directory descriptors on Windows
FreeBSD's fsync and fdatasync succeed on a descriptor opened read-only and on a directory. _commit needs write access, so both returned EBADF there. A read-only descriptor is now flushed through a write handle from ReOpenFile and a directory through a handle opened for it, as sceKernelSync already does.
2026-10-11 15:15:00 +02:00
Mouad-Scriptz-0 b63996f1ff fix(agc): read a merged program's vertex tables past its hidden user words
A merged (NGG geometry path) program's user data starts with eight
hidden words, so the vertex buffer and attribute table offsets of its
AGC header, which count from the first user SGPR, were read eight words
too early and found zeros. Killzone: Liberation (PPSA11142) stopped on
`AGC graphics: null vertex buffer table address` at the first frame of
its PSP game. The decoder now adds the hidden word count to the table
reads; the registers reported to the recompiler are unchanged, as it
already maps them from the first user SGPR. `agc_driver_graphics` gains
a merged and a plain layout case.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 13:13:01 +00:00
David 9c7aa0d61a feat(libc): implement ftrylockfile
Porpoise PPSA99764 stops after pthread_attr_* (#3494) with the
predicted `FAIL: unresolved ELF import h05OHOMZNMw from
libSceLibcInternal.prx` (idx 311, call site 0x8EC37); RetroArch
PPSA99169 imports it at idx 448 (call site 0xA4A27). h05OHOMZNMw is
ftrylockfile by tools/nid_names.py and aerolib.csv (zecoxao/sce_symbols
2883963a); ps5-payload-dev/sdk f5d40f02 declares
`int ftrylockfile(FILE *)` in include/freebsd/stdio.h.

ftrylockfile tries the same host CRT stream lock that flockfile,
funlockfile and every locking host stdio call on the stream take, so
no second lock exists beside the one stdio uses. It returns 0 when the
lock is acquired or already owned by the caller (recursive, released by
as many funlockfile calls) and -1 when another thread holds it, as
FreeBSD 8c639945 lib/libc/stdio/_flock_stub.c:89-104 does. Linux calls
glibc ftrylockfile. UCRT has no try variant of _lock_file, so Windows
calls TryEnterCriticalSection on the CRITICAL_SECTION that _lock_file
enters (__crt_stdio_stream_data::_lock, ucrt/inc/corecrt_internal_stdio.h,
same layout in Windows SDK 10.0.19041, 10.0.22621 and 10.0.26100). A
null or closed stream throws. The UCRT layout dependency is recorded in
TechnicalDebt.

guest_standard_streams covers trylock on an unlocked stream, re-entry
by the owner, failure from another thread while held (also after one of
two unlocks and while another thread holds flockfile), stdio calls
from another thread blocking on the trylock-held lock, release order,
and null and closed streams.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 18:42:23 +05:30
Superhe11 83c9eb7af1 fix(agc): keep uncached storage images out of the resource cache 2026-10-11 16:12:02 +03:00
EdouardSence 295e48f059 feat(libSceNgs2): export sceNgs2ReportRegisterHandler and sceNgs2ReportUnregisterHandler
PPSA04540 (Rise of the Ronin) imports both and now loads past them;
calling either throws until NGS2 produces reports.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:11:24 +02:00
EdouardSence 9f3cc31f77 feat(libSceRazorCpu): add sceRazorCpuPushMarker
PPSA04540 (Rise of the Ronin) imports it. Like sceRazorCpuPushMarkerStatic
it does nothing without a capture and returns 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 15:09:35 +02:00
thibaut db1f3c38ef fix(shader): drop masked selects proven unobserved through whole quad mode
A lane set contained in X is contained in WQM(X). Containment is proven
through BitwiseAnd and through ballots evaluated in the uniform entry
blocks, where every invocation is active. Under a whole quad mode mask the
masked lanes form whole quads, so implicit-LOD pixel samples, which only
read their own quad, do not observe them.

This removes the selects that kept the packed pixel ancillary input alive
after its fields were extracted in GTA V (PPSA04264) pixel shaders.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV
2026-10-11 15:05:49 +02:00
Scramblrrrr 3a80442635 fix(shader): validate conditional exits before accepting every fallback 2026-10-11 10:00:07 -03:00
Scramblrrrr 5781203184 test(shader): expect main to merge the shared exit tail without routing 2026-10-11 10:00:07 -03:00
Scramblrrrr 901c627862 fix(recompiler): preserve the guarded loop exit fallback before shared routing
Keep the AlxcBTW #24 fallback as a separate guarded attempt before enabling shared-exit and nested-continuation repairs. Add the reduced padded shader reported by orishamir on #2523 as an end-to-end regression; the abstract graph does not reproduce the same failure.
2026-10-11 10:00:07 -03:00
Scramblrrrr b0c86ec07f fix(recompiler): privatize shared continuations before loop gateways 2026-10-11 10:00:07 -03:00
Scramblrrrr e6c8e1e9c7 fix(recompiler): route shared loop exit selections in the guarded fallback 2026-10-11 10:00:07 -03:00
AlxcBTW 6500daa012 fix(recompiler): route loop exits that leave the loop before they meet
A loop whose exit paths leave the loop construct before they meet got
the nearest common post-dominator of its exits as merge, and
splitSharedMergeBlocks never separated it. An exit continues the
enclosing loop, so its path to that merge runs through the outer
header again, or an exit enters a block that a branch before the loop
also reaches. splitOneLoopMerge gave the loop a forwarding merge block
each round, the other path still bypassed it, and the post-dominator
stayed the same block until "CFG shared merge splitting exceeded
budget". These shapes from #2642 fail that way on main, on d59a9167,
with #2471 and with both:

  {{1}, {2}, {3, 4}, {2, 5}, {}, {1}}
  {{1}, {2, 3}, {4, 5}, {}, {3, 6}, {1}, {2}}
  {{1, 3}, {2, 4}, {3, 1}, {4}, {}}
  {{1, 2}, {3, 2}, {4}, {4, 1}, {}}
  {{1, 2}, {4}, {3, 1}, {4, 2}, {}}

When the plain and the privatized pass both fail, Structurize now runs
a third pass. It routes such a loop's exits through one junction with
routeLoopExits, as loops whose exits have no common post-dominator are
routed already, and gives an outer loop whose only latch lies in an
inner loop its own continue block. In that pass a loop exit conditional
that is neither a direct break or continue nor has an exit tail of its
own is structured as a selection, and an exit tail that the other arm
reaches is not used as one. Without that, graphs the routing unblocks
keep a conditional without merge (the rule from #2762) or a selection
entered past its header. Graphs that the first two passes structure
are unchanged, and when the third pass fails too, the second pass's
error is reported.

Differential fuzz against main, reducible graphs with 5 to 9 blocks,
each with 0 estimated words per block and again with one block at 1000
words (the privatizeSharedReturns path). Oracle: exact post-dominators,
requireStructuredBranches, merges dominated by their headers, the same
executions as the original graph, and spirv-val (SPIRV-Tools v2026.4,
Vulkan 1.3) on a module emitted from the structured graph.

- 200,000 random graphs. main structures 178,743 (0 words) and 178,750
  (1000 words); the output is identical on all of them. Of main's
  14,256 and 14,311 budget failures 13,527 and 13,596 now structure,
  and 2,576 and 2,565 of its refusals. No new output is invalid. The
  invalid outputs are main's 530, plus at 1000 words one graph that
  d59a9167 already turns from a budget failure into a back edge to a
  block that is not a loop header.
- 24,000 structured programs from orishamir/anyps5-cfgfuzz's
  generator (if/else, loops, break, continue, return). main structures
  21,093 and 21,022; the output is identical. 619 of 2,448 and 634 of
  2,429 budget failures now structure. No new output is invalid; the
  invalid outputs are main's 92.

agc_structurizer has the five shapes; requireOriginalBranches now
follows route variables. agc_shader_control_flow has two RDNA programs
of the first two shapes. The non-GPU tests and the 253 agc_driver GPU
tests pass on Windows (RTX 5070 Laptop).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:00:06 -03:00
AlxcBTW 5182c031a7 fix(recompiler): merge a loop selection where its arms meet in the iteration
A selection in a loop whose arms both reach their nearest common
post-dominator within the iteration got that post-dominator as its
merge. When an arm can also continue the loop, the post-dominator
follows the back edge: the continuing path re-enters the loop header
and reaches the outer selection's merge without passing the block where
the arms meet. In the loop {1}, {2, 4}, {3, 4}, {4, 5}, {1, 6}, {1}, {}
from #2642 (latches 4 and 5) the selections at 1 and 2 both merged at 4.
splitSharedMergeBlocks gave 2 a forwarding merge block, recomputed 4 for
it because 3 continues through 5, and repeated until "CFG shared merge
splitting exceeded budget: originalBlocks=9 currentBlocks=45
splitBudget=36".

When that post-dominator is inside the loop construct, findSelectionMerge
now takes the arms' nearest common post-dominator over the paths of the
iteration that reach it, so paths that leave through the continue block
or the loop's merge no longer move the merge past the arms' join. When
no arm leaves early the result is the same block as before. The loop
structures with two forwarding blocks and no clones or route variables;
so do three latches, the selections on the false side, and an if-else
whose one arm continues.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:00:06 -03:00
LeandroLP23 ce0239c940 fix(libkernel): return lseek errors for directory descriptors instead of throwing
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:59:57 +02:00
Hussein Kadhim cb6dcbf844 fix(libkernel): keep directory lseek off the shared lock and report offset overflow
lseek on a non-directory descriptor no longer takes the directory table lock when no directory is open, and a listing is read under the descriptor's own lock. SEEK_CUR with offset 0 only reports the position, and an overflowing SEEK_CUR offset reports EOVERFLOW.
2026-10-11 14:59:57 +02:00
Hussein Kadhim 7a68e11ab4 fix(libkernel): rewind Windows directory descriptors on lseek
lseek on a directory descriptor returned 0 without moving the listing, so getdents after lseek(fd, 0, SEEK_SET) reported nothing.
2026-10-11 14:59:57 +02:00
AlxcBTW bc517d6058 fix(shader): give an exact zero mix f16 sum -0 when rounding toward -infinity
With f16 rounding toward -infinity, v_fma_mixlo_f16 and v_fma_mixhi_f16
gave +0 for an exact cancellation such as 1.0 * 1.0 + -1.0, because the
f64 sum is computed to nearest. RDNA2 gives -0 there, as IEEE 754 does
for an exact zero sum rounded toward -infinity, measured on gfx1036 in
#2631. An exact zero sum now gives -0 in that mode unless both the
product and the addend are +0. A nonzero result that rounds to zero
keeps its sign, so a tiny positive sum still gives +0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:59:56 +02:00
AlxcBTW f22b9fa02a fix(shader): round v_fma_mixlo_f16 and v_fma_mixhi_f16 in every f16 rounding mode
The f16 forms of v_fma_mix threw for any FLOAT_MODE with an f16 rounding
other than to nearest even. ps5-opengl's shaders run with FLOAT_MODE
0xcc, f16 rounding toward zero with f16 denormals kept, so PPSA99005
stopped at its first draw (#2631).

The exact product-sum, already computed in f64 with round to odd, is now
rounded once in the mode's direction: scaled by the f16 step at its
exponent, truncated, floored or ceiled, and scaled back. A result beyond
65504 becomes infinity or 65504 as IEEE 754 gives for the direction. On
RDNA2 (gfx1036) -1.5 * 2^-24 + 2^-126 gives 0x8002 with round toward
-infinity, and this gives the same. Flushed f16 denormals still throw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 14:59:55 +02:00
ducloc080202 e9736282f7 fix(libc): name the throw site in unhandled exception reports 2026-10-11 19:59:31 +07:00
XairRrR 79c8d36901 fix(agc): reject constant color factors and memory-writing stages in split SWAP_ALT blends
Review follow-up to the 8_8 SWAP_ALT blending. The second channel of
such a target holds the guest's alpha. Vulkan applies the green blend
constant to it for CONSTANT_COLOR and ONE_MINUS_CONSTANT_COLOR, where the
guest's alpha equation uses the alpha constant. Decoding now throws for
these factors on a SWAP_ALT 8_8 target, unless the equation is MIN or
MAX, which ignore factors.

The second pass of a split draw runs every stage again, not only the
pixel shader, so a vertex or geometry stage that writes memory would
write twice. The memory-write check (now ShadersWriteMemory) covers all
the draw's stages.
2026-10-11 14:58:57 +02:00
jweidenh 82c04e4027 fix(shader): keep sRGB comparisons in the emulated runtime mode
(cherry picked from commit 5377951c552f2313c8f7a52b57bd7a54c5f7fb7f)
2026-10-11 12:54:54 +00:00
XairRrR 94cffec3a7 perf(agc-driver): prepare shader ABI variants before taking the preparation lock
A shader preparation transaction took the global writers lock when it
was constructed and kept it to its end. ResolveShaderAbi, reached from
sceAgcCreateInterpolantMapping and sceAgcLinkShaders, compiled its
variants inside such a transaction, so every game thread creating or
linking shaders waited behind one compile: Uncharted's stalled frames
spent about half a second each in shader registration.

The root transaction now takes the lock on its first Read, Edit or
Hold. ResolveShaderAbi prepares the variants before reading the
prepared state when its ABI was not committed yet. Registry
publication holds the lock as before: PublishRegisteredShader holds
it, and RegisterShader holds it before the driver mutex, so the lock
order is unchanged. Commit takes no lock: a transaction with changes
already holds it.
2026-10-11 14:54:48 +02:00
Hannah Lyons bf4cb4974d feat(libScePosixForWebKit): implement fnmatch 2026-10-11 08:52:48 -04:00
hugodearaujo bdf67fcc49 feat(libs): declare the PS VR2 exports PPSA15878 imports
Propagation: Paradise Hotel (PPSA15878) does not load on main: its
executable imports 15 PS VR2 functions that no library exports, the
first reported being sceVrTracker2GetPlayAreaOrientedBoundingBox
(snYs7Nf-RKk). Declare the nine libSceHmd2 reprojection and gaze
exports, three libSceVrTracker2 exports and three scePadVrController
trigger effect exports, without parameters, as throwing stubs. Names
come from the aerolib NID list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 09:51:00 -03:00
hugodearaujo a61e2d35dd fix(libSceSysmodule): return INVALID_VALUE for module id 0
Measured on a PS5 (firmware 13.60): sceSysmoduleIsLoaded,
sceSysmoduleLoadModule and sceSysmoduleUnloadModule with id 0, and the
Internal and InternalWithArg calls with id 0 or 0x80000000, return
0x805A1000 and leave the WithArg result untouched. They threw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 09:51:00 -03:00
Hannah Lyons 0e9a8dd949 feat(libkernel): export execv 2026-10-11 08:50:20 -04:00
MarcZX100 a9575dc70b fix(agc): normalize disabled user VGPR special offset 2026-10-11 12:49:38 +00:00
Abdulrahman Elkordy 8b0b78f529 test(libkernel): don't require restoring the directory time on Windows
The empty-path utimes check restores the working directory's write time
afterwards and requires the restore to succeed. With MinGW,
std::filesystem::last_write_time fails with EACCES when setting a
directory's time (a file's works), so guest_filesystem aborts there on
Windows. The restore stays, only its result is no longer checked.

Claude-Session: https://claude.ai/code/session_012SLQbhAiexxW6TtjYToW8a
2026-10-11 15:49:25 +03:00
ArjenS-LA 859736aa0e fix(net): preserve truncated UDP receives on Windows 2026-10-11 09:48:50 -03:00
MarcZX100 b316c9885d fix(libc): resume host foreign exceptions with host unwinder 2026-10-11 12:48:47 +00:00
MarcZX100 5550ca63dd fix(agc): wait for shutdown at shader ABI entrypoints 2026-10-11 12:48:40 +00:00
Hussein Kadhim d4301cf9b3 fix(libkernel): parse and print inet text addresses by the guest rules
inet_pton and inet_ntop no longer call the host resolver library, whose
accepted forms and output differ from the guest's (leading zeros,
zone ids, IPv4-embedded printing).

(cherry picked from commit 058d808ae7c43042d0ffd5fad76062a2df16b871)
2026-10-11 12:46:21 +00:00
pushkarreddyy 06f84010bb feat(libc): implement reallocf
Two catalog titles stop on the absent libSceLibcInternal export reallocf
(YMZO9ChZb0E) on main 0f863c10:

- PPSA97510 PSXS5 2.2.0
- PPSA98510 SwanStationPS5 1.1.3

    FAIL: unresolved ELF import YMZO9ChZb0E from libSceLibcInternal.prx

reallocf follows FreeBSD 11 lib/libc/stdlib/reallocf.c (freebsd-src
stable/11 5ed7eb0d97ba4436218e810f61bd059acba984c2) on top of the guest
realloc: it reallocates through the application heap, and when realloc
fails (the application allocator returns null or the default heap
rejects the size) it frees the block through the same allocator, sets
ENOMEM and returns null. Size 0 frees and returns null as realloc does
here, so the block is not freed twice. Other heap failures throw, as
for realloc. The NID matches tools/nid_names.py and aerolib.

The application heap tests cover grow, shrink, a null pointer, size 0
and failure with both the replacement and the default allocator.

Co-Authored-By: screamm <noreply@github.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 18:16:07 +05:30
Mouad a553e22638 feat(agc): write memory for WRITE_DATA with DST_SEL 3
Killzone: Liberation (PPSA11142) writes its frame fence with
`sceAgcDcbWriteData(dst 6, cache policy 3, write confirm)`, which the
SPRX-confirmed encoding turns into WRITE_DATA with DST_SEL 3 and a label
address in the title's memory that RELEASE_MEM and WAIT_REG_MEM then
use. The validator rejected DST_SEL 3 as the GDS; it now writes guest
memory like DST_SEL 5, resolves as a label, and the title runs past its
first frame. TechnicalDebt records where the semantics come from.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
(cherry picked from commit 9c53b7f6e8ce2ca81d8f0fa551d12632acfeb60d)
2026-10-11 12:45:26 +00:00
BharatYadav007 8355b1f7b8 feat(libc): implement setlogmask 2026-10-11 18:07:14 +05:30
Hannah Lyons 6aa0b4fb22 fix(libkernel_sys): create symlinks with CreateSymbolicLinkW on Windows 2026-10-11 08:31:59 -04:00
Adrià 1e8fff68c8
Merge pull request #3481 from sypher69/fix/fchdir-search-permission
fix(libkernel_sys): check fchdir search permission on Linux
2026-10-11 14:09:47 +02:00
Adrià 2220effbe4
Merge pull request #3482 from MarcZX100/codex/rx-cross-block-3475
fix(agc): retain cross-block R_X coordinate XORs
2026-10-11 14:02:02 +02:00
Adrià c253de1165
Merge pull request #3428 from MarcZX100/codex/fix-libkernel-open-empty-path-3308
fix(libkernel): reject empty sceKernelOpen paths
2026-10-11 13:55:48 +02:00
Adrià e783f19bc1
Merge pull request #3441 from MarcZX100/codex/fold-unordered-infinity-compares-3355
fix(recompiler): fold true unordered comparisons against f32 infinity
2026-10-11 13:55:17 +02:00
Adrià a5d75aa24e
Merge pull request #3490 from MarcZX100/codex/image-dimension-boundary-3460
test(agc): remove ambiguous 1D V wrap expectation
2026-10-11 13:54:57 +02:00
Adrià 7d7df0560e
Merge pull request #3491 from babyhuey/feat/libkernel-sys-symlink
feat(libkernel_sys): implement symlink
2026-10-11 13:54:51 +02:00
Adrià eaffdc402f
Merge pull request #3489 from MarcZX100/codex/carry-equeue-level-once-3115
fix(libkernel): report level-triggered equeue events once per wait
2026-10-11 13:54:44 +02:00
Adrià bc193544f4
Merge pull request #3487 from DariusHQ/feat/libkernel-underscore-ioctl
feat(libkernel): export _ioctl
2026-10-11 13:54:41 +02:00
Adrià 84f43dcdac
Merge pull request #3486 from MarcZX100/codex/carry-sigsetjmp-3432
feat(libkernel): implement sigsetjmp
2026-10-11 13:53:51 +02:00
Adrià fd1a66cab6
Merge pull request #3484 from AchrafReyani/feat/libkernel-pthread-mutexattr-gettype
feat(libkernel): implement pthread_mutexattr_gettype
2026-10-11 13:53:23 +02:00
Adrià 2e2c531441
Merge pull request #2258 from krishalivaibhav/codex/spirv13-image-regression
test(shader): cover SPIR-V 1.3 image compilation without a GPU
2026-10-11 13:53:14 +02:00
Adrià c5a304a824
Merge pull request #3478 from fable-void/pr/macos-write-watch-remap
fix(libc): watch direct memory mapped over its reservation on macOS
2026-10-11 13:52:58 +02:00
Adrià c68b887799
Merge pull request #3479 from MarcZX100/codex/carry-arc4random-3450
feat(libScePosixForWebKit): implement arc4random
2026-10-11 13:52:52 +02:00
Adrià 23f274e785
Merge pull request #3467 from MarcZX100/codex/rudp-context-queries-3073
feat(libSceRudp): report disconnected context queue state
2026-10-11 13:51:11 +02:00
Adrià 6731a610e7
Merge pull request #3470 from Techx3/trophy2-show-trophy-list
fix(libSceNpTrophy2): return success from sceNpTrophy2ShowTrophyList
2026-10-11 13:51:05 +02:00
Adrià 712ae61a02
Merge pull request #3465 from MarcZX100/codex/fix-empty-kernel-paths-3308
fix(libkernel): reject empty filesystem paths
2026-10-11 13:50:57 +02:00
Adrià 544b38d094
Merge pull request #3474 from 014-code/fix/agc-resource-cache-storage-eviction
fix(agc): evict resource-cache images with storage entries
2026-10-11 13:50:49 +02:00
Adrià daa13905cb
Merge pull request #3434 from Yuva1024/fix/agc-nvidia-pipeline-link-optimization
fix(agc): skip the background pipeline relink on NVIDIA's proprietary driver
2026-10-11 13:49:43 +02:00
Adrià 6fd350f075
Merge pull request #3464 from GustavoGamarra95/test/agc-a2c-normalized-exports
test(agc): cover UNORM16 and SNORM16 exports with alpha-to-coverage
2026-10-11 13:49:40 +02:00
MarcZX100 8a390b06df fix(agc): XOR overlapping R_X coordinate contributions 2026-10-11 11:49:23 +00:00
Adrià b33b1b8e66
Merge pull request #3458 from alfalfa-star/fix/agc-dcc-writeback-keys-reused
fix(agc): store a storage image's DCC keys at write-back only when not stored yet
2026-10-11 13:49:15 +02:00
Adrià 3a37a896fa
Merge pull request #3455 from YossiYad/carry/select-non-socket-descriptors
fix(libkernel): answer select on non-socket descriptors
2026-10-11 13:49:06 +02:00
jweidenh 6199661506 test(recompiler): verify BDA store boundary faults and written pages 2026-10-11 07:46:41 -04:00
Adrià 08e0079e4d
Merge pull request #3451 from LeandroLP23/fix/libc-time-strftime-freebsd-conversions
fix(libc): format %k, %l, %s, %v and %+ in strftime
2026-10-11 13:46:24 +02:00
Adrià e38b5e95d2
Merge pull request #3300 from lendinglibrary/fix/3212-dispatch-split
fix(agc): split a compute dispatch over the workgroup count limit
2026-10-11 13:46:20 +02:00
Adrià cafc074e1a
Merge pull request #3454 from GustavoGamarra95/refactor/share-procmap-query
refactor(agc): share the PROCMAP_QUERY lookup with GuestMemory
2026-10-11 13:45:42 +02:00
Adrià 7ff417f8b9
Merge pull request #3449 from hypermoist/feat/np-entitlement-game-trials-flag
feat(libSceNpEntitlementAccess): declare sceNpEntitlementAccessGetGameTrialsFlag
2026-10-11 13:45:07 +02:00
Adrià 8f47444853
Merge pull request #3446 from MarcZX100/codex/tolerate-process-time-clock-skew-3422
test(libkernel): tolerate process-time clock skew
2026-10-11 13:45:05 +02:00
Adrià 83929de897
Merge pull request #3444 from Pipodi/fix/fused-hull-header
fix(agc): select the registered back half for a fused hull header
2026-10-11 13:44:59 +02:00
Adrià 612e93651c
Merge pull request #3453 from LeandroLP23/fix/libc-scanf-suppressed-eof
fix(libc): return 0 from scanf when input fails after a suppressed conversion on Windows
2026-10-11 13:44:57 +02:00
Adrià 97fbc7e629
Merge pull request #3447 from sypher69/fix/thread-process-affinity-inheritance
fix(libkernel): inherit process affinity in new guest threads
2026-10-11 13:44:45 +02:00
Adrià 077eeb05ea
Merge pull request #3448 from Feuris/carry/agc-debug-raise-exception
feat(libSceAgc): implement sceAgcDebugRaiseException
2026-10-11 13:43:54 +02:00
notaxeltv ae425ed920 feat(libSceTextToSpeech2): return EOPNOTSUPP from remaining speech exports
Titles that call Open/Speak after a failed initialize should get the same unavailable-engine error instead of a throw.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-11 13:43:46 +02:00
Adrià e5d4f59dac
Merge pull request #3438 from ivica00/fix/srgb-bilinear-cube-compare
fix(shader): return 0 for 8-bit sRGB color comparison
2026-10-11 13:43:27 +02:00
Adrià ea31cff19c
Merge pull request #3436 from MarcZX100/codex/rmdir-dot-einval-3116
fix(filesystem): reject final dot removal paths
2026-10-11 13:42:56 +02:00
Adrià 22b1782e01
Merge pull request #3442 from babyhuey/feat/libkernel-pthread-getthreadid-np
feat(libkernel): implement pthread_getthreadid_np
2026-10-11 13:42:48 +02:00
David dce174749d feat(libSceAmpr): implement _Cnd_signal and _Cnd_init_with_name
Deathloop (PPSA01670), Minecraft Legends (PPSA05510) and GTA III
Definitive Edition import both from libSceAmpr. They take a pointer to
the handle slot and act on the conditions created by the libc _Cnd_init:
_Cnd_signal wakes one waiter through a libc helper, _Cnd_init_with_name
is _Cnd_init with the name ignored. _Thrd_id still throws.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-11 13:41:49 +02:00
MarcZX100 668a6db50d test(agc): avoid ambiguous row-boundary filtering 2026-10-11 11:34:47 +00:00
Hannah Lyons 6bc537ce01 feat(libkernel_sys): implement symlink 2026-10-11 07:31:49 -04:00
Hussein Kadhim 59517ef5f5 test(libkernel): cover blocking wait, edge and repeated AMPR equeue events
Document the level-triggered user event semantics of sceKernelWaitEqueue in TechnicalDebt.

(cherry picked from commit db79bee1e597effff34c72493ed893d4e750b95d)
2026-10-11 11:28:34 +00:00
Hussein Kadhim a9b7b20f8f fix(libkernel): report a level-triggered equeue event once per wait
A user event added with sceKernelAddUserEvent stays triggered until it is
deleted. The collection loop kept re-emitting it until the caller's event
buffer was full, so a wait with num > 1 returned the same event num times.
Like kevent, each event is now reported at most once per call; distinct
queued completions of one event are still delivered in order.

(cherry picked from commit db28ebbb7f078cb593cf6b7bb34b8db49dd94630)
2026-10-11 11:28:34 +00:00
AlxcBTW 66236674f0 fix(recompiler): keep lane 31 a shuffle without subgroup arithmetic
The half-wave scan rules for 32-lane hosts made lane 31 of a matched
scan a subgroup reduction and threw on a device without subgroup
arithmetic, where the read used to build as a shuffle of the scan. Such
a device now keeps the shuffle for lane 31; lane 63 still reads the
identity, which needs no arithmetic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 13:24:14 +02:00