Commit Graph
2746 Commits
Author SHA1 Message Date
Yunus Shaikh 9a48a9605c fix(libkernel): map a protected main stack up to its top on Linux
A protect below the main thread's stack mapping mapped only the
protected pages. Linux keeps a growing stack one guard gap (1 MiB by
default) above a readable mapping, so after a read-only protect, or a
protect later restored to read/write, at the bottom of the reported
stack the stack could no longer grow into the megabyte above it and a
deep enough call faulted where the console has stack pages. The pages
between the protect and the top of the stack are now mapped as well,
so the stack never has to grow past them.
2026-10-16 07:28:23 +00:00
Yunus Shaikh f697e1a41b docs(libkernel): move the host stack protect entry next to the other protect entries
The entry now sits with the other sceKernelMprotect entries for
DirectMemory.cpp, before the Windows guest module image protection one,
instead of after the setcontext entry, where #5918 adds its own.
2026-10-15 08:52:22 -07:00
Yunus Shaikh 5796ddfcfd fix(libkernel): commit a protect at the bottom of a host stack's reserve
HotSpot makes its stack guard zones with an RW protect of the lowest
pages of the thread's stack, then PROT_NONE, as it commits them on
native Windows (os::pd_create_stack_guard_pages, then os::guard_memory).
Below a host stack's guard page such a protect was only recorded, so the
pages stayed reserved: they could not be written after the RW protect,
and the zones never held.

A protect of reserved pages that starts at the bottom of the reserve and
stops short of the guard page now commits and protects them. The guard
page and the reserve above the range stay as they are, so the stack still
grows through the guard down to it, and the stack limit in the TEB still
follows the committed stack.

Windows moves the guard down by committing the pages below it as
read/write guard pages, committed or not. The zones therefore hold until
the stack is within one guard region of them (three pages on GitHub's
runners), and the pages the guard reaches then come in read/write. The
test checks both, and the debt entry says so.
2026-10-15 08:10:42 -07:00
Yunus Shaikh 3724c577d8 fix(libkernel): keep a host stack's guard page and reserve when protecting it on Windows
Committing the reserved pages of a host thread's stack before protecting
it, as the stack branch did for a range the arena doesn't own, also
cleared the guard page's PAGE_GUARD. The thread was left with no guard
and no reserve: an overflow ran into whatever lay below the stack instead
of raising a stack overflow, and the stack limit in the thread's TEB,
which Windows moves only when the guard page is hit, stopped following
the stack. A range that began inside the reserve also left the reserved
pages below it with no guard above them, so the stack could no longer
grow into them.

The stack branch now leaves the guard page and the reserved pages below
it as they are, and commits and protects only what lies above them;
reserved pages above the guard are still committed first. The protection
is recorded for the whole range, and a range of only reserved and guard
pages changes nothing on the host. The test protects the main thread's
whole stack and a reserved thread's whole stack and upper part, then
checks that the guard page is still there and that the stack grows
through it, also after a PROT_NONE protect of its lowest page. The debt
file records that those pages come in read/write as the stack grows.
2026-10-15 08:10:42 -07:00
Adrià d67b79a7e4 Merge pull request #5709 from fogydes/fix/libc-formatting-allocation-and-bounds
fix(libc): check allocation result in vasprintf and guard null pointer in strndup
2026-10-15 17:04:33 +02:00
Adrià 0e6a5e7a5c Merge pull request #5690 from SandstromPL/fix/savedata-mount3-invalid-dir-name
fix(savedata): return a parameter error from sceSaveDataMount3 for an invalid directory name
2026-10-15 17:04:04 +02:00
Adrià 162adb9da8 Merge pull request #5669 from MarcZX100/codex/signal-mask-128
fix(libkernel): honor all guest signal mask words
2026-10-15 17:03:59 +02:00
Adrià 8a253707e6 Merge pull request #5663 from al3w0f205/feat/libkernel-munlockall
feat(libkernel): add munlockall export
2026-10-15 17:03:54 +02:00
Adrià f5a55a11d0 Merge pull request #5662 from Roojool/contrib/g15-libc-pending
feat(libc): implement collate<wchar_t>::_Getcat
2026-10-15 17:03:49 +02:00
Adrià 9490a6da68 Merge pull request #5617 from Dripl1x/feat/socket-timeouts
feat(libkernel): apply SO_RCVTIMEO and SO_SNDTIMEO on a guest socket
2026-10-15 17:03:37 +02:00
Adrià 63b377b51b Merge pull request #5612 from JJenkx/feat/private-mutex-sharing
fix(libkernel): store mutex process-sharing attributes
2026-10-15 17:03:30 +02:00
Adrià 51b1d4a3a0 Merge pull request #5611 from JJenkx/fix/kernel-virtual-query-layout
fix(libkernel): stabilize virtual-query layout across hosts
2026-10-15 17:03:24 +02:00
Adrià 08290338aa Merge pull request #5599 from JJenkx/feat/libc-isfinitel
feat(libc): implement x87 long-double finite classification
2026-10-15 17:03:18 +02:00
Adrià b4a4fcac0e Merge pull request #5254 from 0xRickx/fix/libsceaudiodec-heaac
fix(libSceAudiodec): decode HE-AAC as the console does
2026-10-15 16:59:46 +02:00
Adrià ff23657f34 Merge pull request #2852 from alfalfa-star/feat/np-user-id-by-account-id
feat(npmanager): implement sceNpGetUserIdByAccountId
2026-10-15 16:34:37 +02:00
Adrià f7bc3732e0 Merge pull request #5712 from ErenYeager1836/fix/msgdialog-native-error-codes
fix(libSceMsgDialog.native): return error codes instead of throwing in initialize and terminate
2026-10-15 16:34:28 +02:00
Adrià 0dab493f5b Merge pull request #5816 from Nawasfadili/feat/libc-wide-and-unlocked-stream-io
feat(libc): implement wide and unlocked stream I/O
2026-10-15 15:58:44 +02:00
Adrià 56f5a6eef7 Merge pull request #5757 from hypermoist/perf/vector-window-unindexed-slots
perf(recompiler): keep the vector window's unindexed slots out of the array
2026-10-15 15:58:23 +02:00
Adrià 5c0cc1bba4 Merge pull request #5755 from AlexOfTheForest/fix/decoder-rip-far-indirect
fix(relinker): report RIP-relative operands of far indirect CALL and JMP
2026-10-15 15:58:16 +02:00
Adrià FranchandClaude e0b9572e3b ci(windows): find the CA bundle of Git for Windows under ucrt64 too
Git for Windows 2.56 (runner image 20261002) moved from mingw64 to ucrt64,
so the fixed SSL_CERT_FILE path no longer exists and the WinLibs CMake
fails the FFmpeg download with status 60 on every Windows build. Take the
bundle from whichever of ucrt64 and mingw64 exists.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 15:20:44 +02:00
Adrià 489466d3f9 Merge pull request #5734 from YossiYad/fix/strip-last-provoking
fix(agc): refuse last-vertex strips only for reads of a vertex slot
2026-10-15 15:03:44 +02:00
Adrià f0a1e3443b Merge pull request #5691 from xXPBSXx/fix/video-out-flip-rate-error-v2
fix(libSceVideoOut): return VIDEO_OUT_ERROR_INVALID_VALUE for a flip rate outside 0..2
2026-10-15 14:59:01 +02:00
Nithishvelan M cb5b3e22a2 fix(libSceMsgDialog.native): return error codes instead of throwing in initialize and terminate 2026-10-15 18:28:04 +05:30
Adrià e890b4a385 Merge pull request #5660 from milescoviello/fix/ngs2-empty-waveform-blocks
fix(ngs2): accept empty waveform blocks and matrix levels on a voice without a format
2026-10-15 14:54:20 +02:00
Adrià 3ee5371915 Merge pull request #5627 from AlxcBTW/fix/agc-htile-written-by-any-kernel
fix(agc): take depth fast clears from HTILE written by any kernel
2026-10-15 14:52:34 +02:00
Adrià a61c8a37e0 Merge pull request #5554 from Amoenus/codex/native-depth-htile-clears
fix(agc): apply completion-proven native depth clears
2026-10-15 14:51:07 +02:00
Adrià FranchandClaude bc3f81c198 test(libc): pin vasprintf allocation failure; move debt line off the section end
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 14:44:16 +02:00
fogydes ceb963c6dd fix(libc): check allocation result in vasprintf and guard null pointer in strndup 2026-10-15 14:43:04 +02:00
JJenkx ad78fbcdf7 fix(libkernel): stabilize virtual-query layout across hosts 2026-10-15 08:16:22 -04:00
Adrià 7a22c43027 Merge pull request #5695 from YossiYad/fix/relinker-executable-mode
fix(relinker): write Linux and macOS executables with execute permission
2026-10-15 14:15:08 +02:00
Adrià 1036905b5f Merge pull request #5565 from Dripl1x/feat/socket-options-nodelay-nosigpipe-nbio
feat(libkernel): answer TCP_NODELAY, SO_NOSIGPIPE and SO_NBIO on a guest socket
2026-10-15 14:11:15 +02:00
Adrià 264a528877 Merge pull request #5556 from Nixitov/feat/rtprio-thread
feat(libkernel): implement rtprio_thread and the pthread concurrency controls
2026-10-15 14:10:58 +02:00
Romans Pokrovskis 764f0ace02 test(agc): exercise native HTILE producers and clear refusals 2026-10-15 14:00:57 +02:00
Adrià 7bb2b1f973 Merge pull request #5598 from JJenkx/fix/guest-declared-host-import-registry
fix(relinker): record declared host imports in guest registries
2026-10-15 13:58:59 +02:00
AlxcBTW 139e3b86ed fix(agc): route native-owned depth binds before the HTILE read and store-back
A multisampled depth target is created as, or already is, the native depth owner, and a target whose HTILE overlaps a resident depth guard aliases one. Neither may have its HTILE read or rewritten by the generic store-back: the expanded words would be a guest write over the owner's range. DepthSurfaceView decides this before the store-back, which still runs before GpuMutex() and the surfaces mutex are taken. NativeMultisampleDepth binds the owner and a single-sample alias of its HTILE and checks the words stay untouched.
2026-10-15 13:55:39 +02:00
Adrià 23dcb82499 Merge pull request #5648 from Amoenus/codex/buffer-resource-vcc-tuple
fix(shader): accept buffer resource tuples ending in VCC
2026-10-15 13:55:14 +02:00
Adrià Franch 0a7193b5cd fix(libkernel): sigsuspend swaps and restores all four mask words 2026-10-15 13:54:05 +02:00
AlxcBTW cc022df348 fix(agc): take a slice of a depth array from its own HTILE only when its words are uniform
A fill or clear the driver recognizes over an HTILE drops the range's last-read generation, so the
next bind reads the words and stores them back even when the write tracker did not see the fill's
stores. A depth view of slice 1 or later reads the HTILE at its own address
(DB_HTILE_DATA_BASE + slice * HtileMetadataBytes); the HTILE word layout is only modelled for slice 0,
so such a slice takes the clear and the store-back only when all its words are equal and keeps its
fill-time fast clears otherwise. DepthTarget::slice carries DB_DEPTH_VIEW SLICE_START.

agc_driver_depth_fast_clear_submit: an unrecognized kernel clears the HTILE on two frames in a row and
both clears are taken; slice 1 with words that are not all equal is refused and stored back untouched;
slice 1 with equal words takes the clear. agc_driver_graphics checks the decoded slice.
2026-10-15 13:53:50 +02:00
AlxcBTW 3e61fcf1f9 fix(agc): read and store back the whole pipe-aligned HTILE outside the surfaces lock
The bind-time HTILE read covered one word per 8x8 tile from DB_HTILE_DATA_BASE, but main models the
HTILE as the pipe-aligned SW_64KB_Z_X metadata (HtileMetadataBytes, the extent HtileFillCovers takes):
at 1920x1080, 1856 of the 32400 tile words lie past the first tiles*4 bytes, so they kept ZMask 0
after a store-back. The read and the store-back now cover the whole metadata and run before the
surfaces mutex is taken, since both wait for recorded work over the range. The tests' HTILE arrays
hold the whole metadata.

PPSA25344 (Unreal Engine 5) decodes its depth through HTILE in its Nanite depth export after the
depth prepass and takes ZMask 0 as a tile holding the clear value; the new
agc_driver_depth_fast_clear_submit case checks that a draw after a fast clear leaves every word
expanded.
2026-10-15 13:53:50 +02:00
esatturan 4ddff7c6e5 fix(agc): take depth fast clears from HTILE written by any kernel 2026-10-15 13:53:49 +02:00
Adrià fdea36b836 Merge pull request #5524 from Amoenus/codex/native-depth-allocation-retirement
fix(agc): retire fully released native depth owners
2026-10-15 13:50:13 +02:00
Adrià FranchandClaude a8be2c8fee docs(ngs2): matrix levels debt line names the voice-without-format exception
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 13:49:09 +02:00
milescovielloandClaude Opus 5.5 c6e3af3258 fix(ngs2): accept empty waveform blocks and matrix levels on a voice without a format
A sampler voice set up with an all-zero format has no channels. Adding no
waveform blocks to it, or setting a matrix with no levels, threw
std::invalid_argument, which ends the title.

Accept both on such a voice: the empty add only applies RESET and the
CONTINUE state, and the empty matrix clears that matrix, which rendering
already treats as unset. Blocks with data, APPEND, and an empty matrix on
a voice with a format are still refused.

Steins;Gate Re:Boot (PPSA36591) clears a voice this way when a button is
pressed at its title screen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 13:48:54 +02:00
Adrià 38d2454486 Merge pull request #5559 from JJenkx/fix/guest-executable-import-dependencies
fix(relinker): select guest startup dependencies from required roots
2026-10-15 13:38:52 +02:00
Adrià 5050a23f38 Merge pull request #5473 from MarcZX100/type0-recompiler-followup-4779
fix(shader): accept TYPE=0 images during materialization
2026-10-15 13:37:52 +02:00
Adrià 5e7d09aafe Merge pull request #5538 from JJenkx/fix/ngs2-render-capacity
fix(ngs2): limit render writes to the configured grain
2026-10-15 13:29:33 +02:00
Adrià 821c69e504 Merge pull request #5509 from billythemenace2/fix/shader-cube-tsharp-2d-access
fix(shader): read cube T#s through DIM 2D image_sample and image_load as face 0
2026-10-15 13:25:34 +02:00
Adrià 39d3ae13eb Merge pull request #5304 from tv7/fix/stencil-ref-export-unused
fix(agc): drop an unused stencil test value export from draws without a stencil test
2026-10-15 13:24:56 +02:00
Adrià 0f0ca7b544 Merge pull request #5200 from nikowolf123/fix/agc-blend-reversed-component-order
feat(agc): blend into color targets with a reversed component order
2026-10-15 13:24:08 +02:00
Adrià 2693ac2f64 Merge pull request #5582 from JJenkx/fix/pad-command-file-access
fix(tools): preserve controller command access
2026-10-15 13:23:03 +02:00