Commit Graph
3047 Commits
Author SHA1 Message Date
Yunus Shaikh aa2b7ce7ef fix(agc): keep a refused heap's mirror once its range has left the write watch
A heap mirror whose range had left the write watch was dropped and its
range planned again. When the host import budget refused the range, that
plan was a per-build copy, and past APS5_ADDRESS_COPY_MAX_MIB (64 MiB) the
copy stopped the process ("an address-based build copies ... past ..."),
where refreshing the mirror in full would have carried on.

Plan such a range again only when the import path takes it now. A cached
address space whose heap or sparse mirror has left the watch is rebuilt
only if importing the mirror's range succeeds, and the rebuild then finds
that import; otherwise the space is kept and the mirror refreshed in full,
every block counted as written. A build that plans its ranges tries the
import first, so acquireMirror keeps the existing mirror of a range that
reaches it, and a sparse mirror whose pieces are unwatched is refreshed in
full instead of planned again.

SetAddressCopyLimit sets the copy cap in-process, as SetHostImportBudget
sets the budget. The heap and sparse unwatch tests set it below the heap
the old plan would copy: the refused heap's mirror is kept and refreshed in
full (its unwatched block and a watched block the CPU wrote both reach it),
and once the budget holds the heap the next build imports it and releases
the mirror.
2026-10-16 03:55:11 +00:00
xXPBSXxandClaude Sonnet 5.5 905a0dffb2 docs(debt): list the NGS2 custom module id 0x20 of PPSA35169
Trails in the Sky 2nd Chapter creates a custom rack with module id 0x20, which Custom.cpp rejects; the module and its structure are unknown (#4246).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-16 05:45:49 +02:00
xXPBSXxandClaude Sonnet 5.5 4dc23f9c14 docs(debt): list the unimplemented AJM codec 23 of PPSA21480
Broken Sword - Shadow of the Templars: Reforged stops at AJM decoding codec 23, which is not one of the codec ids known in Ajm.cpp (MP3 0, ATRAC9 1, M4AAC 2, Opus 24).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-16 05:45:41 +02:00
Kovalev Vladislav caae92c12c fix(agc): read uncompressed FMASK images from guest memory 2026-10-16 09:40:41 +06:00
David e44e828f61 docs(debt): say where fchdir checks search permission
The fchdir entry still said FreeBSD's search-permission check was not
modelled, although it has run on Linux since 0e4d94ce3 and now runs on
every host but Windows.
2026-10-16 07:20:14 +04:00
Nithishvelan M e92484a251 feat(libSceUserService): implement sceUserServiceGetAccessibilityKeyremapEnable and sceUserServiceGetAccessibilityZoom 2026-10-16 08:42:16 +05:30
hypermistandClaude Opus 5.5 20edd079e4 fix(libc): store the sign of gamma in an exported signgam from lgamma
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 16:11:02 +13:00
Nicolas AboschandClaude Opus 5.5 6ce90a7286 perf(libkernel): keep the sleep wake include and debt entry off lines other PRs change
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 23:42:41 -03:00
Yunus Shaikh bc27ba7d07 docs(agc): describe the settle of Windows imports under 1 MiB
ARCHITECTURE.md and the debt entry describe how imports under 1 MiB are
settled without waiting and return to the write watch, which the debt
entry listed as not implemented.
2026-10-15 19:42:17 -07:00
Yunus Shaikh 356d2a9dfa fix(agc): plan a sparse heap again when its mirror's range has left the write watch
A sparse heap mirror, made for a heap with uncommitted pages, is
refreshed from the write watch through its committed pieces. The check
that a reused heap mirror's range is still watched covered the heap
mirrors acquireMirror reuses and the cached space's heap runs, not
sparse ones: once a committed piece left the watch, refreshSparseMirror
threw "a sparse heap mirror's range is no longer write-watched" from
acquireMirror's reuse and from a cache hit's sparse refresh.

refreshSparseMirror now returns false when a piece is no longer
watched. Both callers already take false as not reusable: acquireMirror
makes the mirror again, finds the range unwatched, drops the stale
mirror and leaves the range to a copy, and a cache hit gives up the
cached space.

agc_sparse_heap_mirror_unwatch mirrors a 1 MiB reservation with 256 KiB
committed, takes one committed block off the write watch and stores new
bytes there from the CPU; the next build must not reuse the mirror and
must serve the new bytes. agc_sparse_heap_mirror_unwatch_no_space_cache
runs the same without the address-space cache. Without the fix both
throw. They are registered on Linux; the Windows path uses the guest
arena as the existing sparse heap test does and has not run on Windows.
2026-10-16 01:52:33 +00:00
Nicolas AboschandClaude Opus 5.5 82dd286192 perf(libkernel): end short sleeps when the GPU or a flip completes
A sleep of 1 ms or less returns once the AGC driver sees a GPU batch
complete (a thread waits on the recorder's timeline semaphore), runs a
batch's completion actions, or VideoOut completes a flip. A thread
returns early at most 8 times in a run of back-to-back sleeps; the run
restarts when the thread submits AGC work or did not sleep for the
requested time. APS5_NO_SLEEP_WAKE=1 keeps every sleep in full.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 22:50:57 -03:00
Yuri Olive 630ab4c20b feat(libSceHttp): implement sceHttpUriCopy 2026-10-15 22:46:40 -03:00
JJenkx 522696d1ce fix(agc): retain front-half offchip LDS enable during shader fusion 2026-10-15 21:42:43 -04:00
Yuri Olive b27e4c9710 feat(libScePad): export missing firmware pad interfaces 2026-10-15 19:24:39 -03:00
Adrià 7b20318e89 Merge pull request #5882 from billythemenace2/fix/agc-msaa-target-without-msaa-enable
fix(agc): rasterize a multisampled target without MSAA_ENABLE at the pixel center
2026-10-15 23:58:24 +02:00
Yuri Olive 783da344a7 docs(libSceRtc): list sceRtcInit and sceRtcEnd as silent stubs 2026-10-15 18:56:38 -03:00
Felipe Arce 46d49131e7 feat(libkernel): support EVFILT_READ on the read end of a pipe
kevent threw for any descriptor that is not a guest socket. The read end
of a pipe now gets the descriptor knote, following FreeBSD 11's
filt_piperead: data is the number of buffered bytes and EV_EOF is set
once the write end is closed. GuestSockets::Ready falls back to the new
PipeReadState for a descriptor that is not a socket, and WaitAny waits on
the pipe with ppoll on Linux or in 1 ms WSAPoll slices on Windows, only
when the queue holds a pipe. On Windows the equeue waker now starts
Winsock itself, since a queue can wait on a pipe before any socket exists.
2026-10-15 21:56:19 +00:00
Yuri Olive 51e9e5e825 feat(libSceRtc): implement the remaining firmware exports 2026-10-15 18:54:39 -03:00
Karim Ibrahim 411dc0748f feat(libkernel): set and read IPV6_V6ONLY on a guest socket 2026-10-15 17:48:41 -04:00
MarcZX100 881facc4fa fix(agc): refuse native MSAA index buffer reads 2026-10-15 21:35:59 +00:00
Adrià f35c13fc95 Merge pull request #5833 from Ondra97/codex/fix-windows-vector-io-lock
fix(libkernel): serialize Windows vectored file transfers
2026-10-15 23:15:38 +02:00
Adrià 65262da1e0 Merge pull request #5856 from ErenYeager1836/fix/ime-keyboard-duplicate-open-error
fix(libSceIme): return error codes instead of throwing on duplicate open or close
2026-10-15 23:15:29 +02:00
Yunus Shaikh ac9ccfb89c fix(agc): keep the host import budget off the device report until an import fails
The host heap's VK_EXT_memory_budget report lowered a set
APS5_HOST_IMPORT_MIB of 6400 MiB to 4480 MiB on Resident Evil Village
(PPSA01556), where 6400 MiB runs without a vkAllocateMemory failure, and
85,047 imports were refused. A set APS5_HOST_IMPORT_MIB is now never
lowered by the report, and the default is held to the report only once
an import's vkAllocateMemory has failed. The failure ceiling is
unchanged. The first time the report would lower the budget, a [gpu]
host import budget line prints the heap's reported budget and usage and
the live imports, and the refusal line names where its budget came from.
2026-10-15 21:04:31 +00:00
Adrià f27697f083 Merge pull request #5847 from akkadbakkad89/feat/kevent-ev-flags
feat(libkernel): implement kevent EV_DISABLE, EV_DISPATCH and EV_FORCEONESHOT
2026-10-15 23:01:10 +02:00
Adrià 006388ea7c Merge pull request #5846 from SeifKaroui/fix/avplayer-loop-warning
fix(avplayer): defer loop warnings until frame delivery
2026-10-15 23:01:04 +02:00
Adrià ab88420409 Merge pull request #5845 from pushkarreddyy/feat/libSceAgc-default-cx-state-flat
feat(libSceAgc): implement sceAgcGetDefaultCxStateFlat
2026-10-15 23:00:59 +02:00
Adrià 90dea83b59 Merge pull request #5718 from ErenYeager1836/fix/savedata-dialog-native-state-checks
fix(libSceSaveDataDialog.native): validate dialog state in close, get result and terminate
2026-10-15 23:00:55 +02:00
Adrià 7758abac13 Merge pull request #5841 from simonbronk/feat/line-reads-through-2d-array
fix(shader): read explicit-LOD and level-zero 2D-array samples through 1D T#s as measured
2026-10-15 23:00:50 +02:00
Adrià 8b99f0177c Merge pull request #5848 from wachi35676/refactor/libSceAgc-name-interpolant-mapping-10000
refactor(agc): name dbOlWdppb4o and vieBRwlh1Lw the _10000 interpolant mappings
2026-10-15 23:00:46 +02:00
Adrià 7663bc63bb Merge pull request #5092 from MrMha/fix/scripting-heap-694
feat(libc): provide the runtime scripting allocator hooks
2026-10-15 22:58:23 +02:00
Adrià c10aa036d2 Merge pull request #5821 from SandstromPL/fix/agc-sampler-aniso-minmax-reduction
fix(agc): accept a min or max reduction sampler with anisotropic filtering
2026-10-15 22:58:19 +02:00
Yunus Shaikh e9ff3b1768 fix(agc): plan a heap again when its mirror's range has left the write watch
A heap mirror is refreshed from the write watch. acquireMirror checked
the watch only when it made a mirror and reused an existing one as it
was. Once part of the range left the watch, the next address-based build
threw "a heap mirror's range is no longer write-watched" from the
refresh, and a build served from the address-space cache threw the same
from its heap runs. A range leaves the watch for good when a host import
that does not keep the watch covers it: on Windows a direct import of
private memory that is not settled (below the 1 MiB settle floor, or any
when imports cannot be settled), elsewhere any import while imports are
compared.

A heap mirror now records the unwatch serial at which its range was last
seen fully watched. Its reuse, and a cache hit over it, compare that
serial with GuestMemory::UnwatchSerial and look at the watch again only
when a range has left it since. A mirror whose range is no longer
watched is not reused, the cache is not taken (before its imports are
stamped), and the pass plans the range again: an import if the budget
allows, else a copy. A refused heap mirror also drops the registry's
stale one, whose buffer would stay allocated otherwise.
2026-10-15 20:40:32 +00:00
mattogepetoandClaude Sonnet 5.5 3f8337e730 fix(libSceSysmodule): test and document unknown module ids
sceSysmoduleIsLoaded, sceSysmoduleLoadModule and sceSysmoduleUnloadModule
return success for an id missing from the module table, because titles that
load or unload such an id aborted otherwise (b4db9fdd6, a2520aa07). Nothing
tested or recorded it, and two commented-out throws were left in the code.

Remove the commented-out throws, list the three functions under Silent stubs
in the library's technical debt file, and test that unknown ids succeed
without changing state while the internal variants still throw.

Written with AI assistance (Claude).

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-15 22:33:13 +02:00
HILAL El MehdiandClaude Opus 5.5 2a9390aa11 docs(debt): correct Windows GUI logging description
Since ab3e92605 the entry stub gives each missing standard handle
anyps5.log beside the executable, and the crash report writes to the
standard error handle, so it reaches the log too. The entry now records
only what is still lost: the stub's errors about the executable path or
about waiting for the previous LoadExec process, written before the log
is opened, and output to the missing handles when the log cannot be
created.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0154rPujpieMaCnZ6WMobg7M
2026-10-15 21:39:42 +02:00
billybobpicklioandClaude Opus 5.5 a0347cfed5 feat(agc): draw line-strip output of NGG geometry programs as mesh lines
A geometry program with VGT_GS_OUT_PRIM_TYPE 1 was refused as an
unsupported output assembly. Each primitive export of an NGG line-strip
program is one line whose indices are packed like a triangle's, so the
mesh module now declares OutputLinesEXT with PrimitiveLineIndicesEXT for
it. A subgroup gets VGT_GS_MAX_VERT_OUT - 1 lines per input primitive and
at least GE_MAX_OUTPUT_PER_SUBGROUP line slots; fast launch keeps using
PRIM_AMP_FACTOR. The output size is part of the cache, draw, validation
and pipeline keys, and the request serialization version becomes 31.
Triangle-strip geometry is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 15:39:35 -04:00
JJenkx 7777219ee1 feat(libkernel): support cpuset affinity by guest thread ID 2026-10-15 15:25:34 -04:00
Codex ced0305455 fix(libkernel): return EINVAL for invalid mutex priority attributes 2026-10-15 21:34:35 +03:00
Adrià 44df216321 Merge pull request #5834 from xXPBSXx/fix/agc-register-default-owner-v2
fix(libSceAgcDriver): return 0 from sceAgcDriverRegisterDefaultOwner
2026-10-15 20:34:25 +02:00
Adrià dee15e2ec6 Merge pull request #5810 from mohammad-alosta/fix/libSceNgs2-listener-transform
fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener
2026-10-15 20:34:07 +02:00
Adrià c503db8d87 Merge pull request #5800 from fdfawef324/codex/frame-dump-io-best-effort
fix(agc): disable optional BMP dumps after host I/O failures
2026-10-15 20:32:15 +02:00
Anthony 2b567cda34 fix(libc): count wide collate string elements 2026-10-15 15:30:40 -03:00
Adrià b7cedd900d Merge pull request #5803 from YossiYad/fix/videodec2-avc-parameter-sets
fix(libSceVideodec2): hold an AVC unit of parameter sets for the next slice
2026-10-15 20:18:10 +02:00
JJenkx 4c2b12439f fix(audio-propagation): preserve existing destination mixes 2026-10-15 14:17:17 -04:00
Get-fix 8c34587598 fix(relinker): search libc.prx for libkernel-only Windows executables
AnyPS5 exports some libkernel functions, such as __error, from
libc.prx, which libkernel.prx links. On Linux they resolve through that
dependency. On Windows, the import stubs search only the listed
modules, and libc.prx was listed only when libSceLibcInternal.prx was
needed. A PS4 homebrew that needs libkernel.prx but no C library (the
OpenOrbis graphics sample) failed with "unresolved ELF import
9BcDykPmo1I". libc.prx is now also listed when libkernel.prx is needed.
PS5 executables need libSceLibcInternal.prx and convert unchanged.
2026-10-15 21:02:31 +03:00
Yunus Shaikh 57ceb9e370 fix(agc): keep the guest's sample order where pixel (0,0)'s locations stand in for a 2x2 grid
Village's 2x checkerboard puts its two samples at x = +4/16 and -4/16
and swaps their indices on odd rows. On a device without a 2x2 sample
location grid every pixel takes pixel (0,0)'s locations, so the odd
rows hold the console's sample 1 in sample 0 and the reverse: a pass
that reads the samples by index, as checkerboard reconstruction does,
exchanges the two half-pixels of every odd row, and SampleID, sample
masks and exported coverage name the wrong samples there.

Such a pattern holds one set of positions in every pixel, so drawing
with pixel (0,0)'s locations is exact up to the order of each pixel's
samples. The draw now keeps the guest's order: the pixel shader reads
SampleID, applies the sample mask and exports coverage through each
pixel's order, and every render pass drawing with the stand-in puts the
samples of its multisampled attachments in the stand-in's order before
it and back in the guest's after it. Color targets do that through a
storage view of their texels as unsigned integers, depth through a copy
and a per-sample pass writing FragDepth, and stencil through
VK_EXT_shader_stencil_export or one pass per bit.

It needs shaderStorageImageMultisample with a storage view of the color
format, sampleRateShading, and a depth format FragDepth writes back
exactly (16-bit or 32-bit float); otherwise, and for patterns whose
pixels hold different positions, the stand-in alone is used, and the
log line says why. Devices with the grid are unchanged.

Recompile requests carry the order as serialization version 32 (#6470
takes 31), and the shader cache format becomes 40 (open pull requests
take 37 and 39).
2026-10-15 17:53:11 +00:00
RickandClaude Opus 5.5 6c5686d7ea feat(libSceImeDialog): take the dialog's text from the host keyboard
sceImeDialogInit wrote "Slayer" into an empty text buffer and the
dialog finished on the second status poll, so a title never got text
from the user: ProsperoRadio's search typed "Slayer" by itself and
found no station.

The dialog now runs until the user answers on the host keyboard, the
way #4756 made sceImeOpen's panel-less IME take it. While no IME panel
is open, libSceIme hands the game window's text and editing keys to
a sink that the dialog registers. Typing edits the text up to
maxTextLength without splitting a surrogate pair, Enter writes it to
the title's buffer and finishes with end status 0, and Escape finishes
with 1. Abort still finishes with 2. A second Init reports busy, and a
null parameter or buffer or a maximum length outside 1 to 2048 is
refused, as in shadPS4.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-15 19:52:28 +02:00
Ondra97 1fee29b6ad fix(libSceNet): inherit nonblocking mode on accepted sockets 2026-10-15 19:29:41 +02:00
Alex ColliniandClaude Opus 5.5 349420af7f docs(agc): record the measured effect of dropping entries with released textures
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 19:28:43 +02:00
Adrià 3bb409b603 Merge pull request #5784 from gguerra26/fix/macos-m1-andn
fix(relinker): lower ANDN in Rosetta conversion
2026-10-15 19:25:06 +02:00
Alex ColliniandClaude Opus 5.5 49919d7f32 fix(agc): drop resource-cache entries that hold released sampled textures
A resource-cache entry keeps every sampled texture of its descriptor sets alive. The sampled texture cache passes over textures something else holds and, past its ceiling, drops them anyway; textures it makes without caching are never in it. Entries holding either kept them alive with no budget counting them, bounded only by the 1,024-entry and 65,536-element counts, until device memory ran out.

The texture cache now marks such textures released. ResourceCache::Insert refuses descriptor sets holding one and hands the entries that hold one back to the caller, like RemoveImage does for evicted storage images.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 18:56:30 +02:00