Commit Graph
5577 Commits
Author SHA1 Message Date
Dean 5850a6cd11 Merge pull request #1374 from gjonn/feat/tts2-unavailable
feat(libSceTextToSpeech2): report the speech engine as unavailable
2026-10-08 17:39:02 +13:00
Dean 2d0c53b637 Merge pull request #1209 from ZekkJJ/codex/reject-leading-zero-param-json
fix(libkernel): reject leading-zero numbers in param.json
2026-10-08 17:30:13 +13:00
Dean cf3823dffe Merge pull request #1354 from gjonn/feat/bluetoothhid-no-devices
feat(libSceBluetoothHid): add Bluetooth HID with no devices attached
2026-10-08 17:30:03 +13:00
Dean 9ba908c202 Merge pull request #1356 from gjonn/feat/pad-open-ext-special
feat(libScePad): report special controllers as not connected in scePadOpenExt
2026-10-08 17:27:00 +13:00
Dean 893af87af0 Merge pull request #1353 from gjonn/feat/mbus-no-devices
feat(libSceMbus): add the device service with no devices attached
2026-10-08 17:26:49 +13:00
Dean 4c380ae382 Merge pull request #1196 from MathiasDevelopes/feat/libc-hypot
feat(libc): implement hypot and hypotf
2026-10-08 17:21:39 +13:00
Gjon Gojcevic 5b10200b1a fix(agc): render 8_8_8_8 color targets with reversed component orders
COMP_SWAP 2 and 3 store a four-component export as ABGR and ARGB from the
lowest bits. Render such targets as RGBA8 and permute the pixel shader's
exports through the existing component mapping (0x1b and 0x93), as the
one-component swaps already do. Blending into them throws: the alpha
factors would read the wrong export component.
2026-10-08 00:18:47 -04:00
popcoder565andClaude Opus 5.5 f8c1e0c64f fix(libkernel): keep sceKernelRaiseException redirects out of NtContinue
A raised exception redirects the target thread to a stub that runs the handler and returns through RtlRestoreContext. On Windows 10 (19045) RtlRestoreContext restores in user mode only when the context flags are exactly CONTEXT_FULL | CONTEXT_SEGMENTS (CONTEXT_XSTATE aside); for the CONTEXT_FULL | CONTEXT_FLOATING_POINT context it was given, it calls NtContinue. When the next raise suspended the thread inside that system call, NtContinue then replaced the redirected context with the one it was restoring, so the handler never ran although sceKernelRaiseException had returned 0. guest_raise_exception lost such a delivery to its busy thread in about one run in five and hung until the ctest timeout.

The context is now read with CONTEXT_SEGMENTS, so the handler returns through the user-mode restore, and a raise that finds the thread inside NtContinue or NtContinueEx (an APC or an exception handler returning) resumes it and suspends it again.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 23:48:16 -04:00
Dean a9ba39c927 Merge pull request #1258 from MathiasDevelopes/feat/audioout2-mastering-setparam
feat(libSceAudioOut): accept sceAudioOut2MasteringSetParam
2026-10-08 16:35:16 +13:00
Scott SchusterandClaude Opus 5.5 831ba5d298 fix(agc): accept RB and primitive-group tuning fields
Accept PA_SC_MODE_CNTL_0.ALTERNATE_RBS_PER_TILE, CB_COLOR_CONTROL.DISABLE_DUAL_QUAD
and VGT_SHADER_STAGES_EN.MAX_PRIMGRP_IN_WAVE on the vertex path. They tune how the
hardware distributes work between render backends and waves and do not change the
rendered result. Mesa sets all three on GFX10.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:32:42 -05:00
MGXAeandarena-agent 049539ac3d fix(nid): reject libraries that define symbol versions
The patcher rewrites .dynstr in place and reorders .dynsym for
.gnu.hash, but .gnu.version_d kept pointing at name offsets that the
rewrite had recycled: a library carrying symbol version definitions
came out with renamed or blanked version names while its symbols
still advertised a version.

No library in the build defines symbol versions, so fail on
.gnu.version_d during the section scan and leave the input untouched
instead of carrying version remapping that nothing exercises. The
test covers the rejection and that a library without version
definitions is still patched.

Co-authored-by: arena-agent <[email protected]>
2026-10-08 03:04:07 +00:00
Hashaam ZafarandClaude Opus 5.5 f91e329140 fix(agc): require the widest subgroup for compute programs wider than the device
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 19:37:02 -07:00
hugodearaujoandClaude Opus 5.5 56e4ee3565 fix(voiceqos): return the console's sceVoiceQoSInit argument errors
Measured on a PS5 (firmware 13.60) through dlopen of
libSceVoiceQoS.sprx: a null block, any size other than exactly 0x40000,
and an app type other than 0x20000000 or 0x10000000 all return
0x804E0902 without touching the block, instead of throwing. A second
initialization returns 0x804E0905, as prosper reads from the module.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 23:34:15 -03:00
overlordxrz-source 7ecf00c63b fix(libkernel): return EINVAL for thread stack sizes below 16 KiB 2026-10-07 22:31:44 -04:00
overlordxrz-source cd51d8b1bf refactor(relinker): read the executable's DT_NEEDED entries in one place 2026-10-07 22:31:35 -04:00
Gjon Gojcevic 8d1d430599 feat(libSceTextToSpeech2): report the speech engine as unavailable
sceTextToSpeech2Initialize fails so titles skip narration; the other imported exports throw.
2026-10-08 15:31:10 +13:00
Gjon Gojcevic 54ed8e7f9c feat(libScePad): report special controllers as not connected in scePadOpenExt
Add scePadOpenExt for special ports, which return DEVICE_NOT_CONNECTED because the host has no special controller, and the extended read and report exports, which throw.
2026-10-08 15:31:10 +13:00
Gjon Gojcevic cb00552dd6 feat(libSceBluetoothHid): add Bluetooth HID with no devices attached
Initialization and callback and device registration succeed, no device ever connects, and calls that need a device throw.
2026-10-08 15:30:58 +13:00
Gjon Gojcevic 10e5b0c33a feat(libSceMbus): add the device service with no devices attached
Initialization and termination succeed, no device events are reported and device queries return no entries.
2026-10-08 15:30:58 +13:00
Claude 2a253b376b fix(libc): raise FE_INVALID from hypotf for a signaling NaN with infinity
hypotf now widens both arguments to double and calls the double hypot.
The float-to-double conversion raises FE_INVALID for a signaling NaN and
quiets it, so hypotf(sNaN, inf) returns +inf with the invalid flag set in
either argument order, matching the PS5 libc routine. Before, MinGW UCRT's
hypotf returned +inf without the flag and glibc's returned NaN.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01Scr6DkuJDqiUcJHr9mJv6T
2026-10-08 02:27:31 +00:00
xsvm 2daa034e87 perf(relinker): write in-place --to-intel substitutions directly
Each in-place substitution went through X64InstructionRewriter::Rewrite,
which copies the whole code segment and decodes every instruction in it
to adjust references. The converter only accepts equal-length
replacements, so the adjustment is always zero and the copy and scan are
wasted: conversion time grew by one segment scan per substitution. Copy
the replacement bytes into the segment instead.
2026-10-08 10:19:39 +08:00
Dean 9619edff72 Merge pull request #1375 from gjonn/fix/guest-raise-exception-host-lock-race
test(libkernel): fix host-mutex handshake race in guest_raise_exception
2026-10-08 15:19:00 +13:00
Dean b015323ef0 Merge pull request #1363 from gjonn/feat/share-running-status
feat(libSceShare): report no running share feature in sceShareGetRunningStatus
2026-10-08 15:18:42 +13:00
Dean 4979afbe1e Merge pull request #1347 from gjonn/feat/hmd2-unavailable
feat(libSceHmd2): add PS VR2 modules that report the runtime as unavailable
2026-10-08 15:18:06 +13:00
Dean 4e079c6c3e Merge pull request #1304 from ebarr24/codex/luna-save-data
fix(savedata): preserve mounted native saves during deletion
2026-10-08 15:17:55 +13:00
Dean 497bd113d5 Merge pull request #1243 from tv7/feat/player-review-dialog
feat(libSceCdlgPlayerReview): add the player review dialog
2026-10-08 15:17:45 +13:00
Dean 5afffae1e0 Merge pull request #1235 from CnRJay/fix/agc-host-import-remapped-range
fix(agc): retire host imports of ranges mapped again
2026-10-08 15:17:35 +13:00
Dean 39dd0b6cf0 Merge pull request #955 from JAB-dev/fix/audioout-deviceless-pacing
fix(audioout): keep ports without a device in real time
2026-10-08 15:17:24 +13:00
480b04801c fix(shader): compute V_FRACT_F32 from the exact fraction of |x|
Co-authored-by: Hashaam Zafar <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-07 22:06:57 -04:00
Ethan Barr 3b8f577162 fix(libc): keep guest demangle buffers on the application heap 2026-10-07 18:58:17 -07:00
Ethan Barr 0d27cbc83a fix(libc): bridge guest thread destructors to host ABI 2026-10-07 18:50:04 -07:00
Dextroid17 e920c9e64a fix(agc): decide an edge unit's CPU keep from the pages the unit overlaps
StorageTexture::writeBackLayers keeps the CPU's bytes for an edge unit when StoredOver
reports that the CPU wrote it since the unit's generation. That check read one generation
per 64 KiB block, so a store to another allocation sharing the block counted as a store
over this surface and the whole block was kept, discarding GPU results written into it.

The driver path in the same check already compares range pieces; the CPU path now does
the same. Each collect records the generation of every page it found dirty, and StoredOver
tests only the pages its range overlaps. A block with no page record keeps the previous
whole-block answer.

Measured on an RTX 3080 Ti, main at df16c4c2:

- agc_write_tracking stores at base + Block + 8, outside the queried range but inside the
  shared block. That case fails on main ("a CPU store outside the shared range counts for
  it") and passes here.
- Full suite 408 of 408 (Linux, CachyOS, GCC, Release, BUILD_TESTING=ON).

This does not cover the other half of #865: the report's finding 2, where the stamps fall
on the surface's own pages and the bytes under them are unchanged, still keeps the block.
No title was run here, so the fix is offered for the report's own repro.
2026-10-07 21:30:28 -04:00
Gjon Gojcevic b692e320c3 feat(recompiler): accept lwe on MIMG samples and gathers
The LOD warning lwe adds to the texel status is texture-streaming feedback,
which is not reported for the T# MIN_LOD_WARN either. Accept lwe on sample
and gather instructions as it already is on loads and stores; lwe on
image_get_lod still throws.
2026-10-07 21:18:19 -04:00
overlordxrz-source e66d78c626 fix(relinker): decode 0F A8-AA without a ModRM and MOV CR/DR without a memory operand
PUSH GS, POP GS and RSM (0F A8, 0F A9, 0F AA) have no ModRM byte, but fell in the 0F A3-AB ModRM range, so the decoder read the next byte as a ModRM and sized its displacement. MOV to and from control and debug registers (0F 20-23) ignore the ModRM mod field and always name a register, but were sized and reported as memory forms, including a RIP-relative disp32 for mod 00 r/m 101.
2026-10-07 21:14:30 -04:00
Gjon Gojcevic 2191d60393 fix(agc): lay out block-compressed thick volumes in blocks
ComputeThickLayout refused block-compressed formats. Compute the mip
chain, padding and mip tail from the volume's block dimensions, as the thin
layout does, so BC volumes in SW_4KB_S, SW_64KB_S and SW_64KB_S_X detile
like volumes of their blocks.
2026-10-07 21:13:13 -04:00
Gjon Gojcevic 16522d1812 fix(recompiler): read image address components the instruction omits as 0
An image load whose DIM field encodes fewer coordinates than the resource
(image_load 2d on a 3D texture) was refused. Pad the missing components with
0 so the load reads the first slice.
2026-10-07 21:07:06 -04:00
Gjon GojcevicandClaude Opus 5.5 b23b4d67f1 test(libkernel): wait for the host-blocked worker to take the mutex before relocking
In the host-blocked phase of guest_raise_exception, the redirected handler
runs as soon as the worker wakes inside pthread_mutex_lock, before it owns
hostLock. ExpectDelivery then returns and main relocks hostLock right away.
If main wins that race, the worker stays blocked in the previous round's
lock_guard, so it never sets started for the next round and main spins
forever. The run hangs until the 30 s ctest timeout, with only three
RunThread lines in the log.

The worker now publishes the round after it acquires the mutex, and main
waits for that before relocking.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 20:50:53 -04:00
Gjon Gojcevic a47fe27d28 feat(libkernel): implement select over libSceNet sockets
libSceNet registers a socket poller with libkernel; select polls the requested descriptors through it until the timeout and rewrites the descriptor sets.
2026-10-07 20:47:03 -04:00
TibixDev f2fe3f7165 fix(agc): reject depth maintenance before shader compilation 2026-10-08 03:39:05 +03:00
Gjon Gojcevic 5cf013a299 fix(libkernel): replace partly overlapped allocations with a fixed mapping
A fixed mapping without no-overwrite unmaps the registered pieces it overlaps before mapping, as it already did when the range lay inside registered allocations.
2026-10-07 20:31:08 -04:00
raghav314andClaude Opus 5.5 1a2bbc5d3e fix(videoout): create the window and the device when VideoOut starts
The driver created a windowless Vulkan device at the first dispatch and
replaced it with a windowed one at the first flip. The replacement built a
second device and re-imported every host import, and the first flip paid
for it.

VideoOut now creates its window when it starts (the first VideoOut call),
at the default 1920x1080 output, and attaches it to the driver
(AgcDriverAttachWindow) before the call returns. The driver creates its
device with that window, so GPU work and presentation use one device.
Present no longer creates or replaces a device. A device created by GPU
work before VideoOut started is still replaced, now in AttachWindow.

A failure to create the window or the device is thrown from that first
VideoOut call instead of terminating the presentation thread.

Tests:
- video_out_flip_tests onedevice: GPU work, then a flip, leaves one device.
- pacing makes its first presentation span vblanks with GPU work queued
  ahead of the flip; it relied on the device being created at the flip.
- unavailable expects the failure from sceVideoOutOpen.
- guest_video_out_wqhd_detection writes a param.json for the window title
  and is skipped without a display or Vulkan device unless
  ANYPS5_REQUIRE_DISPLAY is set.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 05:54:05 +05:30
Gjon Gojcevic 35e3b69a2b feat(libSceShare): report no running share feature in sceShareGetRunningStatus
The host never records or broadcasts, so the first status word is cleared and the call succeeds; a null status is rejected.
2026-10-07 20:21:26 -04:00
Gjon Gojcevic 9e4e3a8976 fix(libSceAgcDriver): do not raise an interrupt for RELEASE_MEM send-data-after-write-confirm
INT_SEL 3 waits for write confirmation before the data write and sends no interrupt; only the other non-zero values raise an end-of-pipe event.
2026-10-07 20:18:20 -04:00
Gjon Gojcevic a988b8b1d0 feat(libSceHmd2): add PS VR2 modules that report the runtime as unavailable
sceHmd2Initialize fails, so titles skip their VR set-up; the other libSceHmd2 and libSceVrTracker2 exports throw.
2026-10-07 19:58:01 -04:00
Gjon Gojcevic e6f4d2c178 fix(libSceVideoOut): ignore the reserved buffer pointers
Titles may leave the reserved pointers of a VideoOutBuffers entry uninitialized, so sceVideoOutRegisterBuffers2 no longer rejects them.
2026-10-07 19:50:12 -04:00
Dextroid17 4930202db6 fix(agc): keep dma-buf import off the NVIDIA proprietary driver
The dma-buf import probe corrupts the device on the NVIDIA proprietary Linux
driver: the import itself succeeds, the allocation right after it fails
(vkAllocateMemory, VK_ERROR_OUT_OF_DEVICE_MEMORY), and every later allocation on
that device fails with it. The probe runs while each device is set up, so every
GPU execution test on that driver fails.

Measured on an RTX 3080 Ti, driver 615.71.09, main at df16c4c2, ctest -j 16:

- without this change: 84 of 408 tests fail, all 84 of them agc_driver
  execution tests (84 of 166);
- APS5_WRITE_WATCH_IMPORTS=watch, which skips both probes but leaves
  context.dmaBufImport set: 408 of 408 pass, which places the probe, not the
  shared-backing imports, at the failure.

dma-buf import is now off on VK_DRIVER_ID_NVIDIA_PROPRIETARY, which stops the
probe and 815d2747's imports together. No test provides shared backing, so those
imports are not exercised here; they are left off rather than assumed to work on
this driver. The Recorder test device takes the same decision, so a developer
build behaves like the shipped one.

Tested: Linux (CachyOS, GCC, Release, BUILD_TESTING=ON), full suite 408 of 408
with the change, 324 of 408 without it. CI runs on lavapipe, whose driver id is
not NVIDIA, so the new condition does not fire there.
2026-10-07 19:40:56 -04:00
Gjon Gojcevic c95721f701 fix(libkernel): report AMPR completion events with the AMPR filter
AMPR events were registered and raised as EVFILT_USER. Titles that
dispatch their AMPR queue by filter ignore those events, so reads that
complete through WriteKernelEventQueue never finish. Add, delete and
trigger them with EVFILT_AMPR (-25).
2026-10-07 19:37:40 -04:00
TibixDev 1bcc744f80 fix(libc): unlock allocation registry while waiting without a callback
Release the registry mutex while yielding for an outstanding lease even before a GPU pin waiter is registered. This lets the lease holder finish a nested allocation lookup and release its lease instead of deadlocking against an unmap.

Validation: the deterministic concurrent unmap/lookup regression fails at the lease deadline before the fix and passes after it. Graphics and guest-memory CTests pass. Live Skyrim stacks captured this cycle in a compute upload flushing a storage texture.

AI-assisted implementation.
2026-10-08 02:31:14 +03:00
Dextroid17 9fce570e95 fix(relinker): name the second SELF container magic as a SELF input
ElfReader::ReadHeader names 0x1D3D154F as a SELF container, but dumps also
carry a second container magic, 0xEEF51454 (bytes 54 14 f5 ee), which fell
through to "Invalid ELF magic number: 54 14 f5 ee". That message reads as a
corrupt input rather than an encrypted one, so a user cannot tell that
decryption is what stands between them and a relink.

Both magics now report the SELF message. Measured on two retail dumps:
PPSA03671's eboot.bin and libcohtml.Prospero.prx are 54 14 f5 ee; PPSA28997's
eboot and modules are 4f 15 3d 1d.

Tested: Linux (CachyOS, GCC, Release, BUILD_TESTING=ON), relinker rebuilt. The
new case fails on the revert of the reader change with the exact message above
and passes with it; elf_header, elf_offsets, dynamic_segment,
string_table_bounds, guest_needed_modules, guest_module_directories and
linux_load_alignment still pass.
2026-10-07 19:28:04 -04:00
MerijnandClaude Opus 5.5 7f4f887a66 test(kernel): define the unwind fixture's .ehmeta without compiler extensions
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 00:54:43 +02:00