Commit Graph
12196 Commits
Author SHA1 Message Date
Zenodeon 540c3a10c6 fix(agc): preserve registered array slices on CPU write-back 2026-10-15 17:08:14 +04:00
Adrià 73e924acd4 Merge pull request #5750 from NaitikJoshiPro/pr/agc-queue0-idle-wait
fix(agc): queue 0 waits instead of spinning when every queue is idle
2026-10-15 15:08:03 +02:00
Adrià 0c32e8dd02 Merge pull request #5741 from IshmamDC217/fix/relinker-load-file-ranges
fix(relinker): check PT_LOAD and uncovered PT_SCE_RELRO file ranges
2026-10-15 15:07:43 +02:00
Adrià 73d6424d6b Merge pull request #5735 from mugurc/fix/libscefiber-host-stack-macos
fix(libSceFiber): map fiber host stacks on hosts without MAP_STACK
2026-10-15 15:05:24 +02:00
hypermistandClaude Opus 5.5 44d31ef9db fix(agc): read GPU timing queries without waiting on unwritten ones
readGpuTiming runs after the batch's fence, so every timestamp the batch
wrote is already available. It still passed VK_QUERY_RESULT_WAIT_BIT, so a
timed range whose end stamp was never written (a BeginGpuTiming whose
EndGpuTiming did not run) made vkGetQueryPoolResults wait forever on the
reaping thread under APS5_PROFILE_GPU or a performance trace. Without WAIT_BIT the call returns
VK_NOT_READY and the batch's timings are dropped, as other failures are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
2026-10-16 02:05:18 +13: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
alosta 868d8bd24c fix(libSceNgs2): support listener transforms in sceNgs2GeomCalcListener
Restore world-to-listener matrix construction instead of rejecting
non-default orientation, translation or flags.

- Build an orthonormal row-major matrix from position, orient_front
  and orient_up; apply the right-handed axis flip for flag 1.
- Store the negated dotted translation in each matrix row.
- Validate unknown flags, invalid or non-finite input, short
  orientation axes, and unrepresentable translation without changing
  the output.
- Preserve finite velocity and positive finite sound speed.
- Update NGS2 geometry tests and the libSceNgs2 technical debt note.

AI assistance: yes
2026-10-15 15:03:25 +02:00
hypermistandClaude Opus 5.5 e54d2f35fe fix(agc): check GPU-side indirect dispatch group counts against the device limit
A DISPATCH_INDIRECT read on the GPU took its group counts unchecked. A count
buffer that a skipped producer never wrote (PPSA08427: 0xffffffff left by
skipped depth-plane passes) launched up to 2^32 groups and kept the GPU busy
until the title hung. The CPU path already refuses counts above
maxComputeWorkGroupCount.

- Recorder::RecordDispatchArguments copies the three counts from the import
  into a 12-byte indirect buffer with a one-thread kernel
  (DispatchArguments.comp), all three 0 when one exceeds the device limit, as
  RecordMeshArguments does for mesh indirect records.
- VulkanDevice records the dispatch from that buffer; without the kernel the
  import is read directly, as before.
- agc_driver_indirect_dispatch_limit: 0xffffffff groups run nothing, one group
  still runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
2026-10-16 02:03:15 +13:00
MarcZX100 32fe3aa8b9 fix(relinker): accept matching defined relative symbols 2026-10-15 13:01:05 +00:00
gguerra26 9b92c55edf fix(relinker): lower ANDN in Rosetta conversion 2026-10-15 15:00:43 +02:00
Adrià e534fd98b6 Merge pull request #5715 from ErenYeager1836/fix/web-browser-dialog-error-codes
fix(libSceWebBrowserDialog): return error codes instead of throwing in initialize and terminate
2026-10-15 15:00:27 +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
Get-fix f7ec358ec4 test(relinker): convert the SCE module extent fixtures for every target
The two fixtures were converted for Windows only. They now run for
Linux, Windows and macOS. The syscall scan of a module with data after
its code fails on all three without the fix, and the loader path
without PT_INTERP fails on Windows and macOS, so the macOS code
analysis stays under test.
2026-10-15 15:57:49 +03:00
Adrià 2b8a685dfe Merge pull request #5683 from MarcZX100/codex/rosetta-scalar-compare-5642
fix(relinker): isolate Rosetta scalar compare hazards
2026-10-15 14:57:14 +02:00
Adrià 54ee3c0945 Merge pull request #5675 from fogydes/fix/test-windows-fixed-base-error-mode
test(relinker): suppress Windows error dialog in occupied base collision check
2026-10-15 14:56:20 +02:00
Adrià f3c00ad28e Merge pull request #5670 from fogydes/fix/relinker-cfg-address-overflow-guards
fix(relinker): prevent address overflow and signed UB in CFG, GOT access, and entry point analysis
2026-10-15 14:55:50 +02:00
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
Get-fix 38fd195e9a feat(libSceFreeType): implement the six FreeType functions OpenOrbis samples use
PS4 homebrew built with the OpenOrbis toolchain draws text through the
PS4 libSceFreeType: the font, keyboard, threading, system and SDL2
samples stop at start-up with "unresolved ELF import GNsiLzm4SH8"
(FT_Init_FreeType) and the five other functions they import.

FT_Init_FreeType, FT_New_Face, FT_Set_Pixel_Sizes, FT_Get_Char_Index,
FT_Load_Glyph and FT_Render_Glyph now call the bundled FreeType. The
guest reads FreeType's structures directly with the LP64 layout, where
FT_Long and FT_Pos are 64 bits, so the face, size, charmap and glyph
slot it receives are copies in that layout, updated after each call;
outline points are converted and written back before rendering. Guest
font paths are resolved and the file is read into memory. The face
index is masked as FreeType does before it is narrowed, and character
codes are truncated to 32 bits as FreeType does. The bundled FreeType's
own functions are kept out of the library's exports.
2026-10-15 15:52:17 +03:00
umangandClaude Opus 5.5 47f7118241 fix(agc): sample a depth surface's stencil plane through an R8_UNORM view
Vulkan cannot view a stencil aspect as UNORM, so an 8-bit UNORM view of
a stencil plane threw. Copy the stencil aspect through a buffer into an
R8_UNORM image of the surface's extent and sample that. The copy is kept
on the surface and refreshed when the surface was written since, or while
it is the bound depth target.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 14:51:43 +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
Joey Fisher 6b14169a45 fix(agc): resolve a GPU-read indirect dispatch at the gate when the run writes its arguments
The dispatch look-ahead stopped before every DISPATCH_INDIRECT whose
arguments an earlier dispatch of the run may write, or whose earlier
dispatches have unknown writes. That stop protects a CPU read of the
arguments at the resolve, which only the thread-dimensions, misaligned and
APS5_NO_GPU_INDIRECT paths make. A GPU-read indirect dispatch never reads
its arguments on the CPU, so the stop left it and every dispatch behind it
to be captured when the worker reached them, after the GPU mutex waits
between dispatches. That is the late read the group capture exists to
avoid: by then the title had re-armed the gate and reused its table slots,
and the capture read descriptors the title had not written yet. The
look-ahead now stops only before an indirect dispatch whose arguments it
would read on the CPU; the path choice is shared with dispatchIndirect.

AgcDriverDispatchesAdoptedAhead_nid_postfix counts the dispatches adopted
from the look-ahead so a test can tell a gate-time capture from a late one.
Two tests check through it that both dispatches of a gated group are
captured at the gate: one whose writer stores the indirect arguments
through a registered binding, and one whose writer stores them through a
binding misaligned in its host import.
2026-10-15 06:50:57 -06:00
Adrià FranchandClaude 57ce03944d fix(agc): keep the draw key trace map out of module teardown on Windows
Co-Authored-By: Claude <[email protected]>
2026-10-15 14:48:04 +02:00
thuanquangandClaude Opus 5.5 f40acdb2c6 fix(relinker): list converted modules correctly for a relative output path
The runtime layout printed ../app0/sce_module/... under app0/ when the
output path contained . or .. components (./out.elf), because the module
paths are normal and the output directory was not.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 19:44:50 +07:00
fogydes 2210200232 fix(libkernel): reject unknown event flag creation attributes 2026-10-15 18:14:45 +05:30
Adrià FranchandClaude bc3f81c198 test(libc): pin vasprintf allocation failure; move debt line off the section end
Co-Authored-By: Claude <[email protected]>
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
fogydes 33d93315f7 fix(libSceRtc): use safe tick addition in local clock and validate null pointer checks 2026-10-15 18:10:25 +05:30
hypermistandClaude Opus 5.5 4f608a8c49 feat(libc): add exact long double and BSD math exports
copysignl, fdiml, fmodl, remainderl, remquol, logbl, ilogbl, rintl, roundl,
lroundl, lrintl, llrintl, sqrtl, modfl, nanl, scalblnl, fmal, rint(f),
lrint(f), llrint(f), drem(f), scalbln(f), scalb(f), finite(f),
__fpclassifyl, __isinfl, __isnanl, __isnormall, _LDtest, _Dclass, _FDclass,
_LDclass and _LDsign, matching the libc.prx bundled with PPSA08427 bit for
bit, including NaN propagation, errno and FreeBSD fmal special cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
2026-10-16 01:38:41 +13:00
Adrià Franch d17895ed84 test(agc): size the case table for the neighbour case added on main 2026-10-15 14:26:21 +02:00
Adrià Franch 9c765fa0fa test(agc): keep the sampled output surface alive until the queued read finishes 2026-10-15 14:26:14 +02:00
MarcZX100 da1a739368 test(agc): cover repeated untracked storage writes after sampling 2026-10-15 14:26:14 +02:00
Yunus Shaikh 695ec6cc4f test(agc): resolve the pipeline ABI of stages that only their use can prepare
Four prepared-shader modes, run with the recompiler's failure memo off
so a second preparation would show as a second front-end build:

- compute: a shader that calls user-data pointers is resolved twice and
  prepared once, then its dispatch links the callees and every lane
  holds 3 * (5 + 64); a shader whose registration preparation failed
  still throws its stored failure from the ABI call.
- pixel: a waterfall whose T# pointer is a phi of user data and a
  ballot is logged once with its reason, resolved again without a
  second preparation, and resolved for another state inside a
  ShaderPreparationScope that commits. A draw of it fails at use with
  the same reason, and the ABI call then throws the driver's failure.
- stages: the same chain in a vertex shader that registration leaves
  alone, through ResolveShaderAbi inside a scope and through
  ResolveGraphicsStagesAbi.
- rectangle: sceAgcDriverResolveGraphicsAbi with a pixel shader
  deferred at registration and with one deferred at its ABI call.
2026-10-15 05:18:11 -07:00
Yunus Shaikh 8c55d15aa4 fix(agc): leave a stage the title's pipeline ABI cannot prepare to its first use
sceAgcDriverResolveShaderAbi and sceAgcDriverResolveGraphicsStagesAbi
prepare every stage when the title creates its pipeline, and threw when
the recompiler could not: Resident Evil Village stops there on a pixel
shader whose T# pointer is a phi of user data and a ballot, and a
compute shader that calls user-data pointers stopped the same way
although its dispatch links the callees.

ResolveShaderAbi and PrepareGraphicsStages now catch the failure inside
their own preparation transaction, so the ShaderPreparationScope that
libSceAgc opens around the call still commits. The shader is logged
once, marked deferred like a shader deferred at registration, and the
ABI key is recorded, so a repeated call prepares nothing. The draw or
dispatch that uses the stage prepares it as before and fails there if
it cannot. ResolvePreparedGraphics skips the rectangles of a deferred
stage that has no artifact yet, which also lets a stage deferred at
registration through sceAgcDriverResolveGraphicsAbi.

Driver failures, ProcessShutdown and a failure stored by the shader's
registration preparation still propagate.
2026-10-15 05:18:11 -07:00
Adrià de663b8841 Merge pull request #6333 from milescoviello/fix/pm4-tests-recompiler-includes
fix(agc): link agc_driver_pm4_tests against the shader recompiler
2026-10-15 14:16:40 +02:00
fogydes c836b3b55b fix(libkernel): protect app metadata state across threads and validate icon stream read 2026-10-15 17:46:34 +05:30
JJenkx ad78fbcdf7 fix(libkernel): stabilize virtual-query layout across hosts 2026-10-15 08:16:22 -04:00
Adrià f728e37955 Merge pull request #5702 from AlexOfTheForest/test/runtime-layout
test(cli): cover RuntimeLayout file tree output
2026-10-15 14:15:39 +02:00
hypermistandClaude Opus 5.5 6103a3e0b9 feat(libc): implement the __std vectorized algorithm helpers
__std_find_trivial(_unsized), __std_count_trivial, __std_min/max/minmax_element,
__std_reverse_trivially_swappable, __std_reverse_copy_trivially_copyable and
__std_swap_ranges_trivially_swappable_noalias for 1-, 2-, 4- and 8-byte
elements, matching the libc.prx bundled with PPSA08427 including the rescan of
the first aligned block in the unsized find.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Q8tinbP1MUpUaDsbNWnGnu
2026-10-16 01:15:23 +13: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à e53927780c Merge pull request #5671 from oneandonlydean/fix/unwatch-hook-blocks
fix(agc): save pending storage results in every 64 KiB block that leaves the write watch
2026-10-15 14:13:48 +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
milescovielloandClaude Opus 5.5 2c9ab96a0b fix(agc): link agc_driver_pm4_tests against the shader recompiler
Since #5364, Draw/DrawRegisterKey.hpp includes Shaders/ShaderRegistry.hpp,
which reaches ShaderMemory.hpp and its "Recompiler.hpp". tests/Pm4.cpp
includes DrawRegisterKey.hpp, but agc_driver_pm4_tests only links
libSceAgcDriver, libc and libkernel, so the recompiler's include
directories are not on its path and Pm4.cpp no longer compiles. The test
targets that already reach ShaderMemory.hpp link shader_recompiler_agc_driver;
this one now does too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 12:06:06 +00:00
Jan ŠléglandClaude Opus 5.5 c191342fa1 fix(shader): repeat phi folding until no phi folds
ConstantFolder::Fold visits each instruction once, in block order. A loop
header phi whose back-edge value is a later phi that folds to it in the
same pass, such as the header phi of an inner loop in which an S# is
copied out and back, is visited before that phi folds and stays a phi of
its one definition and itself. Later folds run only after read-lane or
masked-select elimination changed the program, and since #4150 the one
after masked-select elimination only runs in programs where a
PackedAncillary builtin still has live uses.

These phis reach resource tracking, which compares descriptor dwords as IR
values, so the phi of an S# and the S# itself become two samplers. Two
PPSA11386 (007 First Light) pixel shaders each had 21 direct samplers for
6 distinct S# values; at two heap slots each they exceed the 32 sampler
slots, and the shaders stopped at their first draw with "shader sampler
pairs exceed runtime heap capacity".

After its pass over the instructions, Fold now folds the phis of its
blocks again until a pass folds none. Each fold turns a phi into an
Identity, so the loop ends. Replayed on an older local branch with #4150's
restriction in place, the captured requests plan 6 samplers each, one per
distinct S#, and recompile. agc_shader_memory compiles an S# copied out
and back in three nested loops and sampled before and inside them, with
and without a masked write: one sampler and one sampled pair each, two of
each before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 14:03:34 +02:00
Dean Galvin af4e074a02 fix(agc): save pending storage results in every 64 KiB block that leaves the write watch
On Windows the write watch is dropped in whole 64 KiB blocks
(WriteWatchCoverage::Exclude), but the unwatch hook was given the page
range of the import. An image with results pending in the same block as
an imported page, outside that page, lost the watch without its guest
bytes saved, and storing its results threw.

The hook now gets the span of blocks Exclude drops (ExcludedSpan, the same
block math), so every image with results pending in those blocks saves its
bytes first.
2026-10-15 14:01:01 +02:00
Adrià Franch c9a96a548c fix(agc): pass the native HTILE clear extent after the pipeline drain 2026-10-15 14:00:57 +02:00
Romans Pokrovskis 9e27d0b623 fix(agc): bound native HTILE clears to the kernel offset span 2026-10-15 14:00:57 +02:00
Romans Pokrovskis 06b787f25d test(agc): refuse a mask with an uncleared HTILE key 2026-10-15 14:00:57 +02:00