Commit Graph
6138 Commits
Author SHA1 Message Date
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
Hashaam ZafarandClaude Opus 5.5 81798c8df6 fix(tools): keep the pr_overlap tree key for the merge commit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 18:10:12 -07: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
kallmek3nny 34a6b04a41 docs(user): clarify bundled module runtime paths 2026-10-07 20:55:51 -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
MerijnandClaude Opus 5.5 b86370285b fix(kernel): throw on unsupported unwind tables in sceKernelGetModuleInfoForUnwind
Once an image has .ehmeta, an eh_frame_hdr version other than 1, an
eh_frame_ptr encoding other than absptr or pcrel, a 64-bit record length,
an eh_frame_ptr outside the image or a missing terminator now throw
instead of returning the empty answer. The test queries a fixture DLL
whose .ehmeta it can break, since the unwinder reads the same section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 00:54:43 +02:00
MerijnandClaude Opus 5.5 e975d9a926 fix(libkernel): report guest unwind tables in sceKernelGetModuleInfoForUnwind
On Windows the call returned no eh_frame_hdr for every address, so a
title's own libc (its libunwind) found no frame information and
terminated on the first C++ exception thrown in guest code. PPSA12544
died that way after its intro cinematic: IL2CPP raised an
AmbiguousMatchException that Unity catches and logs, and the runtime
called terminate instead. For an address in a relinked guest image the
call now returns the PT_GNU_EH_FRAME segment named by .ehmeta, the
eh_frame it points to and its size, and the image as seg0; host images
keep the empty answer.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 00:52:14 +02:00
overlordxrz-source f4ef1cd6ec fix(relinker): do not add the F6/F7 TEST immediate to EVEX instructions
The decoder adds the TEST immediate of opcodes F6 and F7 when ModRM.reg
is 0 or 1. The check excluded VEX and two-byte opcodes but not EVEX, so
an EVEX.0F F6 (VPSADBW) whose ModRM.reg is 0 or 1 was given an extra
imm8 and decoded one byte too long. VPSADBW has no immediate (Intel SDM
Vol. 2B, VPSADBW).
2026-10-07 18:51:05 -04:00
TibixDev efe59e0249 test(libc): resolve the library address in the TLS destructor test
Use dlsym to avoid identifying the executable PLT entry as the shared-library function in non-PIE builds. Fedora 44 Release guest_force_tls_destructor passes. Written with AI assistance.
2026-10-08 01:39:37 +03:00
TibixDev 97f16be342 fix(savedata): keep progress dialogs running until closed
Opening a save progress dialog immediately reported FINISHED. Skyrim
waited for RUNNING before writing SAVEDATA.DAT and never resumed. Keep
progress-bar mode running through polling and progress updates until
Close, retaining the existing automatic responses for other dialog modes.

Add lifecycle regression coverage for repeated polling, completion,
reopening, result metadata and ordinary selection dialogs. The test
failed on the previous implementation and passes with the fix on Fedora
44 Release. Correcting the live dialog state recovered a blocked Skyrim
save without restarting its session.

Written with AI assistance.
2026-10-08 01:37:34 +03:00
TibixDev 2085f4560d fix(savedata): use 32-byte directory records
The 36-byte SceSaveDataDirName declaration placed every search result
after the first at the wrong address and could overrun guest arrays.
Skyrim read an empty directory name for its second save and aborted
when mounting it. Use the 32-byte layout also used by the native dialog,
KytyPS5 src/libs/libSaveData.cpp and fpPS4 ps4_libscesavedata.pas.

Add a regression using two maximum-length names, a guest buffer guard,
and mounts of both returned records. It detects the previous overrun.
Fedora 44 Release search, dialog, delete and PS4-save tests pass. Skyrim
now mounts and reads the second save instead of rejecting its name.

Written with AI assistance.
2026-10-08 01:34:20 +03:00
JAB-devandClaude Opus 5.5 7f4ed6cedc style(audioout): remove the comment in queueAudio
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 00:32:05 +02:00
Ethan Barr e41050f71c fix(savedata): reject deleting mounted native saves 2026-10-07 15:13:43 -07:00
hugodearaujoandClaude Opus 5.5 a156104cba fix(rtc): parse RFC 2822, RFC 850 and asctime text like the console
Measured on a PS5 (firmware 13.60) through dlopen of libSceRtc.sprx.
The weekday is required in any case or length, month names may be
full, RFC 2822 and RFC 850 share one lenient grammar with 2-digit years
split at 50, and the asctime zone is ignored. Zones come from a name
table, a military letter, or +HHMM without a range check. Text the
console rejects returns a parse error with the tick untouched, and an
invalid calendar date returns 0 with only the offset applied to the
tick, as the console does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 19:08:10 -03:00
hugodearaujoandClaude Opus 5.5 32dd014efe fix(rtc): parse ISO text in sceRtcParseDateTime by the RFC 3339 rules
On a PS5 (firmware 13.60) every input that starts with a digit gets the
same result and tick from sceRtcParseDateTime as from
sceRtcParseRFC3339, except that leading spaces and tabs are skipped
first. A string without a zone, or with a space instead of T, is a
parse error rather than UTC.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 19:04:17 -03:00
hugodearaujoandClaude Opus 5.5 fcfe9b56a3 fix(rtc): match sceRtcParseRFC3339 to the console
Measured on a PS5 (firmware 13.60) through dlopen of libSceRtc.sprx:
an empty fraction is accepted, any digits past the sixth are dropped,
text after the zone is ignored, the offset is applied without a range
check, and a 60th second returns 0 with the tick only shifted by the
offset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 19:04:17 -03:00
Adrià df16c4c256 Merge pull request #940 from CnRJay/feat/image-gather-1d-array
feat(shader): implement 1D array gathers
2026-10-08 00:02:35 +02:00
Adrià c73ee448d5 Merge pull request #903 from Celegans12/fix/agc-dcc-keys-on-first-write
fix(agc): store uncompressed DCC keys at the first write of a fast-cleared image
2026-10-07 23:42:16 +02:00
clem-gbandClaude Opus 5.5 7a33ba272a test(agc): import the released block again from a second device
Without the host import release, a device created after another was
destroyed freed the leftover imports through the destroyed device and
the process crashed (SIGILL on NVIDIA). The teardown test now runs a
second device over the same guest block once the first is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018RNrNcixatky8U4LfC7Ew5
2026-10-07 23:41:49 +02:00
clem-gbandClaude Opus 5.5 c411489c9b fix(agc): release host imports before the device is destroyed
The host import registry is a function-local static that device
teardown never emptied, so every import still registered kept its
VkBuffer and VkDeviceMemory past vkDestroyDevice
(VUID-vkDestroyDevice-device-05137 in 23 execution tests).
ClearHostImports destroys the device's imports and resets the
registry; ~State calls it next to ClearImageMirrors.

Closes #1236

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018RNrNcixatky8U4LfC7Ew5
2026-10-07 23:41:49 +02:00
Adrià 539cbd881d Merge pull request #943 from alfalfa-star/feat/linux-direct-memory-dmabuf-import
feat(agc): import shared direct memory through udmabuf on Linux
2026-10-07 23:38:09 +02:00
Adrià 4c16e5a0d0 Merge pull request #935 from CnRJay/feat/agc-swizzle-modes-d-t-4kb-x
feat(agc): detile the display, T and 4 KiB XOR swizzle modes
2026-10-07 23:27:45 +02:00
Adrià FranchandClaude cfaa336dad test(agc): pin newest-fill order and unfilled keys in pending key reads
Co-Authored-By: Claude <[email protected]>
2026-10-07 23:24:14 +02:00
Celegans12 b8d3060351 fix(agc): store uncompressed DCC keys at the first write of a fast-cleared image
A storage image uploaded under fast-clear DCC keys left the clear code
in guest memory until its write-back, so a title kernel that read the
keys after a draw or dispatch into the image saw the clear code.
PPSA26344's DCC retile kernel copies such keys into its display
buffer's metadata every frame, and the flip presented the clear color.

MarkDirty now stores uncompressed keys the first time an image uploaded
under a clear code is written, unless the title filled the keys with a
clear code since, and the image's uploaded keys become uncompressed.
While they are, Refresh and the fast revalidation read the keys as the
recorded work writing them leaves them: from the bytes pending uniform
fills and driver key stores note (NotePendingFill) when those already
make the keys read uncompressed (bytes that differ, 0xff, or a byte the
format can't use as a clear code), otherwise after waiting for that work.
2026-10-07 23:24:14 +02:00
Karan Shrivastava 954d6f19b1 fix(libSceRtc): answer out-of-range years in sceRtcGetDosTime
A year before 1980 or after 2107 cannot be packed into the DOS time, so
GetDosTime threw. Following the disassembly-derived fpPS4
reimplementation of the PS4 library, it now returns INVALID_YEAR after
writing 0 for an earlier year and 0xff9fbf7d, the largest encodable
time, for a later one. The TechnicalDebt entry now records fpPS4 as the
source for the SetDosTime year decode as well.
2026-10-07 17:18:42 -04:00