Commit Graph
20967 Commits
Author SHA1 Message Date
hypermistandClaude Opus 5.5 7b1c9cac71 test(libs): pin the 29 firmware constant returns
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-22 21:47:59 +13:00
hypermist 1cca65b4d7 Merge remote-tracking branch 'upstream/main' into fix/libs-firmware-constants-4 2026-10-22 21:47:34 +13:00
Yunus Shaikh e8172f8078 fix(libkernel): leave unmeasured scePthreadMutexattrSetkind inputs unimplemented
A null or uninitialized attribute, and a kind outside 1 to 4, threw
std::invalid_argument. They now go through NotImplemented_nid_no_patch,
as pthread_rwlockattr_settype_np's unmeasured types do. FreeBSD 11
libthr stores an unknown kind unchecked and answers a null attribute
with -1 and errno EINVAL, so scePthreadMutexattrSettype's
SCE_KERNEL_ERROR_EINVAL would match neither answer.
2026-10-22 01:44:01 -07:00
hypermistandClaude Opus 5.5 928094e49d test(libkernel_sys): pin the 20 firmware constant returns
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
2026-10-22 21:37:53 +13:00
hypermist 0837188696 Merge remote-tracking branch 'upstream/main' into fix/kernel-sys-firmware-constants 2026-10-22 21:37:38 +13:00
Adnan Khan f3dcf6d8be fix(relinker): skip unreadable candidates and fold case for --windows in the needed-module report 2026-10-22 14:02:37 +05:30
Federico Marras eb4b6c9f21 Merge remote-tracking branch 'upstream/main' into feat/kernel-sys-pthread-scope-atfork
# Conflicts:
#	core/libs/CMakeLists.txt
#	core/libs/prx/libkernel_sys/Export.Discovery.cpp
#	docs/dev/debt/libkernel_sys.md
2026-10-22 10:31:05 +02:00
Jota 893dba7850 fix(tools): read check_main_sync paths from the top of the repository 2026-10-22 05:29:25 -03:00
SebastianandClaude Opus 5.5 f2766b2447 docs(debt): drop the unmodelled O_EXCL reopen from the named semaphore entry
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QnkpF2oEMofseVz9Z7WEAC
2026-10-22 08:29:03 +00:00
Federico Marras 0bfda65256 docs(libSceAvPlayer): record the unmeasured order of the trick speed checks after the source check 2026-10-22 10:28:32 +02:00
hypermist b98f2f82e1 Merge remote-tracking branch 'upstream/main' into feat/npcommon-runtime
# Conflicts:
#	core/libs/prx/libSceNpCommon/PendingExports.cpp
2026-10-22 21:27:04 +13:00
frankea 6ba72890ad perf(shader): walk each construct when checking the structured constructs
hasStructuredConstructs tested every block of the graph against each merge header, and searched every block for a block's innermost loop, with dominator binary searches each time. Under APS5_FORCE_STRUCTURIZER_FALLBACK, Ghostrunner's compute shader 0x200c520000 becomes a 32,490-block reach-flag graph with 6,647 merge headers, and the check took 44 to 50 s of the 49 to 55 s.

The innermost loop is now searched among the loop headers only. Every other block failed the loop-header test first, so the candidates and their order are unchanged.

When constructsFollowDominance holds for the structural graph, the member checks visit only the blocks dominatedBlocks finds from the header, stopping at its merge, and for a loop also from its continue block, in block order. Only a block in the header's construct or in the loop's continue construct can fail a member check. A construct block is dominated by the header and not by the merge, so some path from the entry reaches it without the merge, and from the last header on that path every block is dominated by the header, so the walk reaches it. A continue-construct block is dominated by the continue block and is reached from it the same way. The walk finds every such block, and the blocks it skips passed every check, so the result is unchanged. Otherwise every block is checked as before, and APS5_NO_PERF_DOMINATOR_TREE keeps the old loop.

On an M4 Pro the check takes 0.27 s instead of 44 to 50 s on that graph, and the forced fallback takes 5.1 to 5.4 s instead of 49 to 55 s. The default structurization of the shader makes one check, which takes 0.03 s instead of 0.36 s.
2026-10-22 04:27:00 -04:00
frankea 231be5cc7c perf(shader): test a selection construct's members by dominance
After each split, every selection header that needs no work still walks its construct (dominatedBlocks) to learn which predecessors of its merge lie inside. On Ghostrunner's compute shader 0x200c520000 that is 1.7 million walks.

When every block is reachable from the entry and the predecessor lists match the successor lists, and the merge M neither is the header H nor dominates it, the walk finds exactly the blocks that H dominates and M does not, other than M. A block the walk reaches is dominated by H and reached from the entry on a path that avoids M, because some path to H avoids M. A block that H dominates and M does not lies on a path from the entry that avoids M, and from the last H on that path every block is dominated by H, so the walk reaches it. splitOneSelectionMerge checks those conditions once per pass and then asks the dominator sets directly; otherwise it walks as before. Only membership in the construct is used, so the split and its order are unchanged.

On an M4 Pro the shader's structurization takes 12 to 15 s instead of 18 s, and 176 s before this series.
2026-10-22 04:27:00 -04:00
frankea 3606824314 fix(shader): find strongly connected components without recursion
computeStronglyConnectedComponents visited blocks recursively, one stack frame per block on the deepest path. The reach-flag fallback turns Ghostrunner's compute shader 0x200c520000 into a graph of 32,490 blocks, and with APS5_FORCE_STRUCTURIZER_FALLBACK the visit overflowed agc_shader_replay's 2 MiB stack after 4 s.

The visit now keeps its frames in a vector. It enters successors in the same order and closes components in the same order, so the components, their entry blocks and the irreducibility verdict are unchanged.
2026-10-22 04:27:00 -04:00
frankea d30b78f47b perf(shader): build the structurizer's dominator trees instead of iterating dominator sets
recomputeAnalyses runs after every merge split, and its dominator and post-dominator fixpoints intersected a bitset of every block for every block until nothing changed. They now build the tree with the Cooper-Harvey-Kennedy iteration over a reverse post-order from a virtual root above the entry block, or above every exit for post-dominators, and write each block's sorted set as its parent's set plus the block itself.

The sets are the same. When every block is reachable from the virtual root, the greatest fixpoint of the old equations is the dominance relation of that rooted graph, which the tree describes. When a block is unreachable from the entry, or cannot reach an exit, the old fixpoint runs as before.

The post-dominator tree also keeps each block's immediate post-dominator, and FindNearestCommonPostDominator climbs it when both blocks have one: the sets are the tree's paths, so the deepest common block is the one the set intersection found. Blocks added or cloned after the analysis have no parent and take the set path, as before.

APS5_NO_PERF_DOMINATOR_TREE turns both off, and the structurizer and control-flow tests also run with it set. On an M4 Pro the structurization of Ghostrunner's compute shader 0x200c520000 takes 18 s instead of 37 s.
2026-10-22 04:27:00 -04:00
frankea 32be418b33 perf(shader): look up the structurizer's sorted block lists instead of scanning them
Merge splitting re-examines every selection header after each split, so the lookups behind each examination run millions of times on a large graph. On Ghostrunner's compute shader 0x200c520000 (4,750 blocks growing to 10,170 over 1,302 splits) agc_shader_replay spent 173 s in splitSharedMergeBlocks. A profile put most of it in linear membership tests and in FindNearestCommonPostDominator, not in the analyses.

Loop bodies, construct blocks, selection regions and strongly connected components are sorted, so membership in them is now a binary search. The traversals that tested membership in the list they were building (selectionRegion, reachableWithin, naturalLoopBody) and externalEntryEdges test a bitset instead, and selectionRegion reads its sorted result from the bitset. dominatedBlocks tests the header once and pushes a successor only before it is visited. FindNearestCommonPostDominator skips a candidate whose post-dominator set is smaller than the other common post-dominators and checks the rest in one pass over the set. remapIds sorts only when the map broke the order.

Each change keeps the same sets in the same order and the same first candidate, so the structured graph is unchanged. On an M4 Pro the shader's structurization takes 37 s instead of 176 s.
2026-10-22 04:27:00 -04:00
Lindamea1andClaude Opus 5.5 93170e6049 fix(libSceCommonDialog): return ALREADY_SYSTEM_INITIALIZED from a second sceCommonDialogInitialize
A second sceCommonDialogInitialize returned 0x80B80004
(ALREADY_INITIALIZED), the code each dialog's own Initialize returns.
The common-dialog system initializer returns 0x80B80002
(ALREADY_SYSTEM_INITIALIZED), as shadPS4 and the SDK error names have
it, so callers that accept only SCE_OK or ALREADY_SYSTEM_INITIALIZED
treated a second call as a failure. The header keeps
ALREADY_INITIALIZED for the dialog libraries that return it. The test
pins the literal instead of the header constant, and the debt entry
records that a repeated call's value is not measured on a console.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 09:24:22 +01:00
Dean 7e2ba73e4c Merge pull request #7961 from milescoviello/fix/copied-region-transfer-src
fix(agc): give copied guest buffer regions transfer-source usage
2026-10-22 21:19:52 +13:00
eliasbruno124-dev 17bc1bc3dc fix(agc): wait for leased writers before indexed-copy parameters
(cherry picked from commit 1b2d6c53a1adc6a6c4dcb77cd04eaa83301ec6be)
2026-10-22 13:46:54 +05:30
sevenandClaude Fable 5.1 f9e1d2fc24 perf(agc): replace the indexed 16-byte copy kernel with a buffer copy
Recognise the compute kernel that copies count 16-byte elements from a
source V# to a destination V# at offsets read from a one-record constant
buffer, and run it through the copy HLE like the other two copy kernels.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-22 13:46:54 +05:30
seven f83abf796a perf(agc): stage written buffer elements up to 8 MiB on discrete GPUs 2026-10-22 13:46:52 +05:30
Kyon 785e715651 feat(libSceJemspace): declare purge and statistics printing exports 2026-10-22 09:09:06 +01:00
Itamar Medyoni 89031ca7b9 fix(libkernel): reject clocks libthr does not accept in pthread_condattr_setclock
FreeBSD 11 libthr's pthread_condattr_setclock returns EINVAL for any clock
other than CLOCK_REALTIME, CLOCK_VIRTUAL, CLOCK_PROF and CLOCK_MONOTONIC.
scePthreadCondattrSetclock stored any clock id; it now answers
SCE_KERNEL_ERROR_EINVAL for the others, and pthread_condattr_setclock
EINVAL through it.
2026-10-22 11:04:09 +03:00
NeppoloandClaude Opus 5.5 32a7a8a35b fix(shader): validate and optimize SPIR-V on a host thread when the stack is short
SPIR-V validation and optimization ran on the thread that asked for the
shader, on whatever stack it ran. Guest fibers run on contexts the title
allocates in guest memory, without a guard page, and libSceFiber keeps a
context of 64 KiB or more as the fiber's stack. SPIRV-Tools passes
recurse: validating and optimizing a 410-word compute shader used 12,352
bytes of the stack, and the recompiler's shaders reach hundreds of
thousands of words. Demon's Souls (PPSA01341 01.007.000) on Windows died
with an access violation in its job-worker deque code 48 to 535 s after
start in 3 of 3 warm runs on main: the crash reports show the faulting
job fiber's frame holding SSARewriter::GetReachingDef and
SSARewriter::AddPhiOperands return addresses where the function had
stored its own constants.

ValidateAndOptimizeSpirv now runs inline only when the frame lies inside
the thread's stack bounds with at least 256 KiB below it, and otherwise
on a host thread that it joins, rethrowing the thread's exception. The
bounds come from GetCurrentThreadStackLimits on Windows, which reads the
TIB bounds libSceFiber sets to the fiber context, and from
pthread_getattr_np elsewhere, whose bounds a fiber's stack lies outside
of; the check is the one the GPU-map import already uses. The optimizer
takes no lock, so the joined thread cannot wait on its caller.

agc_driver_optimize_on_fiber optimizes a compute shader from a fiber
running on a 64 KiB context and requires that it use at most 8 KiB of it
(3,040 bytes with this change, 12,352 inline) and start one host thread,
that an ordinary thread start none, and that both return the same
module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VRha8dpbww6k7dyu43RVyr
2026-10-22 10:03:25 +02:00
zaryabzip b9e5dc160f feat(libScePosixForWebKit): forward the --wrap exports with implemented targets
__wrap_access, __wrap_getcwd and __wrap_getenv forward to libc;
__wrap_clock_gettime, __wrap_lstat and __wrap_mmap forward to libkernel.
2026-10-22 13:03:12 +05:00
SimoneandClaude Opus 5.5 e7ea986aa7 test(json2): build a decimal-comma locale for the numeric locale test
Linux runners have no decimal-comma locale, so guest_json_numeric_locale
skipped there. Build xx_COMMA from a charmap and an LC_NUMERIC source
shipped with the test as a CTest fixture, point the test at it with
LOCPATH and try it first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:03:09 +02:00
Simone ebd1a14e30 Merge main into codex/json-numeric-locale
# Conflicts:
#	core/libs/prx/libSceJson2/Export.cpp
#	docs/dev/debt/libSceJson2.md
2026-10-22 10:02:59 +02:00
simonbronkandClaude Opus 5.5 bf0806ecd6 fix(agc): retire an unwritten native multisample depth surface on guest access
A guest read over the depth or HTILE range of a native multisample depth
surface threw even when the host had not written the surface since its
import. Its samples are then still the clear value the import took from
the guest HTILE, so the guest bytes already describe it. Retire such a
surface and its guards instead, and keep the refusal for a surface the
host wrote: draws with depth or stencil writes, depth/stencil copies and
storage write-back.

Onimusha: Way of the Sword (PPSA27836) imports a 4-sample D32 target,
draws into it once with depth tests only and no color target, then reads
the memory back as a structured buffer in a compute dispatch.

Unblocks PPSA27836.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:02:25 +02:00
SimoneandClaude Opus 5.5 106e73669d feat(libkernel_sys): implement the scePthreadBarrier, cpuclockid, concurrency and msync forms
Forward scePthreadBarrier*, scePthreadBarrierattr*, scePthreadGetcpuclockid,
scePthreadGetconcurrency and sceKernelMsync to libkernel's POSIX
implementations and return POSIX errors as SCE kernel errors.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:01:06 +02:00
SimoneandClaude Opus 5.5 5177cdb9ac feat(libSceVoice): implement mute-all, bitrate and port update
Implement sceVoiceSetMuteFlagAll, sceVoiceSetBitRate and
sceVoiceUpdatePort on main's port model. They return the
not-initialized, port-range and missing-port codes of the other port
calls, validate bitrates against the table sceVoiceCreatePort uses and
throw where the console's code is unknown.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 10:00:23 +02:00
Kyon ac1dfaf7ef feat(libSceJemspace): declare eleven pending exports 2026-10-22 08:57:25 +01:00
Yunus Shaikh 9587c4467b test(agc): share the pipelined fill blocker with its lambda and end each case on an empty pipeline
agc_driver_pipelined_fill failed under load with "a satisfied WAIT_REG_MEM
skipped an overlapping queued write" (8 of 72 runs, 12 copies pinned to two
cores, on main d6eafa54d0). When SatisfiedWaitKeepsUnrelatedQueuedWork
returned, the draw pipeline still counted one item: the queue had gone idle
before the committer popped its last item, which cleared within half a
millisecond. SatisfiedWaitDrainsOverlappingQueuedWork then saw two
outstanding items as soon as it queued its blocker, and its wait ended
before the WAIT_REG_MEM asked for a drain.

Finish() now waits until the draw pipeline is empty, so each case starts on
an empty one. The blocker also takes #9647's shape: its state is shared with
the queued lambda, and each case waits for the blocker to finish, so no
lambda can read a blocker that went out of scope. That shape alone still
failed 5 of 72 loaded runs; with the empty-pipeline wait, 144 loaded and 20
unloaded runs passed.

The 500 ms sleep in SubmitBehind stays. It lets the queue worker pass the
scratch fill's DISPATCH on an empty pipeline and block on the GPU lock the
test holds. Without it the worker drains behind the unreleased blocker, and
all 72 loaded runs failed with "the queue worker never reached the fill".
No counter shows that state to wait on.
2026-10-22 07:54:41 +00:00
Santhosh Kumar 6133773304 docs(libSceFreeType): follow requested bitmap debt placement 2026-10-22 13:23:42 +05:30
primesoul-web 4d98d9a2cd Merge upstream/main: adopt the restored UsbStorage ABI over the no-device path
Take main's restored signatures (the firmware-database sweep of 2026-10-21):
the typed UsbStorageCallback across the register/unregister family, the
UsbStorageDeviceInfo-typed device-info query, IsExist's three-argument bool
form (succeeds and reports non-existence with no device attached), and
RequestMap's six parameters with the trailing reserved pair dropped. The
no-device answers and the argument validation are unchanged; the guest test
passes an APS5_VABI callback and pins the exists out-parameter.
2026-10-22 07:49:05 +00:00
xXPBSXxandClaude Sonnet 5.5 02eee49df4 docs(debt): make the NpSns entry and its note agree on three names
The first entry in the libSceNpSns debt file lists 24 names, but Export.cpp declares 21. The note two entries below says that sceNpSnsFacebookCreateRequest, sceNpSnsFacebookDeleteRequest and sceNpSnsFacebookGetAccessToken are omitted from this module because another module declares them. They are declared in libSceNpManager (Export.cpp, since f04d16d702), not in libSceNpSnsFacebookDialog by #6977 as the note still says. The three names are removed from the entry so that it names exactly the 21 declared functions, and the note now names libSceNpManager. No code changes.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-22 09:27:23 +02:00
bluandClaude Opus 5.5 7b391f8889 Merge branch 'boykopovar:main' into fix/agc-vertex-format-widen
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 00:22:52 -07:00
Adnan Khan 00d6b33126 feat(relinker): report needed modules shipped outside the module directories 2026-10-22 12:48:19 +05:30
EdouardSenceandClaude Opus 5.5 8f6f1eac86 fix(libSceNgs2): throw for a custom Gain module with an option
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 09:11:01 +02:00
krishalivaibhavandClaude Opus 5.5 81ae747acd feat(libScePad): answer the tracker DualShock 4, Blaster and Move queries
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 12:38:04 +05:30
ArjenS-LA 4fb4187bd3 fix(libkernel): classify Windows directory links by app0 scope 2026-10-22 00:02:38 -07:00
TamaleroandClaude Opus 5.5 793e51a915 fix(agc): require full coverage only for metadata pass targets with CMASK or DCC keys
A CB fast-clear eliminate or DCC decompress pass whose viewport or scissor
did not cover a color target was refused ("CB metadata pass over part of a
color target") even when that target had no CMASK and no DCC keys. Such a
pass leaves the target's texels unchanged: RunColorMetadataPass touches a
target only through its CMASK clear or its DCC keys, so for a target with
neither, the covered area does not matter.

Marvel's Guardians of the Galaxy (PPSA01748) issues fast-clear eliminates
over three 1920x1080 targets without CMASK or DCC while PA_SC_MODE_CNTL_0
still enables a 480x270 viewport scissor left from an earlier pass, and
stopped in its first level on that refusal.

The coverage check now applies only to targets with a CMASK or DCC keys;
FMASK decompress (which requires a CMASK) and resolves are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 00:01:08 -07:00
Ondra97 64d0571a20 Merge remote-tracking branch 'origin/main' into codex/fix-ult-finalize-allocation 2026-10-22 08:53:25 +02:00
Ondra97 3b60592ce4 test(libSceUlt): disarm allocation fault before throwing 2026-10-22 08:53:06 +02:00
Jota 2e2445d622 fix(tools): read pr_overlap paths from the top of the repository 2026-10-22 03:45:04 -03:00
Jota a22f220857 fix(tools): check environment references from a subdirectory 2026-10-22 03:45:02 -03:00
Yunus Shaikh b23cbb5bb8 Merge main into feat/libkernel-sys-libthr-names
# Conflicts:
#	core/libs/prx/libkernel_sys/Export.Discovery.cpp
2026-10-21 23:43:23 -07:00
Jota 600efd95be fix(relinker): leave an already executable autorun output's mode alone
Autorun added the execute bits with an unconditional chmod, even when the
output already had them. On macOS a chmod changes the file's ctime, and
Rosetta then throws away its translation of an x86_64 executable and
translates it again on the next exec, about 0.11 s per run on an M2 Max.

autorun_exit_status paid that on every POSIX run: it chmods the child and
also renames it once per quoting case, and a rename changes the ctime too.
On the x86_64 macOS relinker job it takes 5 s at the median and timed out
once at its 20 s limit, against 0.2 s on arm64. Autorun now only calls
chmod when an execute bit is missing, and the test runs symlinks to
itself instead of copying and renaming the executable. It also checks
that the executable's ctime does not change and that Autorun still makes
a non-executable output executable.
2026-10-22 03:29:42 -03:00
Ondra97 0e0a93bab5 test(libSceFreeType): preserve SFNT outputs on query errors 2026-10-22 08:28:42 +02:00
Ondra97 6b221e4e30 fix(libSceFreeType): guard SFNT metadata host writes 2026-10-22 08:24:06 +02:00
memob 3f698c1016 perf(libSceNetCtl): reuse host interface queries until Windows reports a change
PPSA34501 calls sceNetCtlGetInfo often enough that GetAdaptersAddresses and its
RPC took about a fifth of a game thread at the Kino der Toten spawn. The
answers are now kept per address family and for the IPv4 interface, and
dropped when an address, interface or route change notification arrives.
2026-10-22 02:23:54 -04:00