Commit Graph

2799 Commits

Author SHA1 Message Date
Zheorgyan ed14c24bd7 test(agc): skip the exec host lanes vertex draw without vertex subgroups 2026-10-08 14:43:17 +02:00
Adrià 3c4bdda47a
Merge pull request #1379 from gjonn/fix/recompiler-image-load-missing-coordinates
fix(recompiler): read image address components the instruction omits as 0
2026-10-08 14:42:10 +02:00
Adrià 07c2405c35
Merge pull request #1371 from TibixDev/pr/depth-maintenance-precheck
fix(agc): reject depth maintenance before shader compilation
2026-10-08 14:37:01 +02:00
Adrià 072804fd33
Merge pull request #1288 from Celegans12/fix/agc-dcc-filled-keys-refresh
fix(agc): forget a DCC key fill once a refresh sees other keys
2026-10-08 14:35:47 +02:00
Adrià cba8d86da8
Merge pull request #1270 from Celegans12/fix/agc-unaligned-buffer-views
fix(agc): bind guest buffer views that start off a DWORD boundary
2026-10-08 14:34:45 +02:00
Adrià 0b3cc73e1c
Merge pull request #1112 from Celegans12/feat/agc-conservative-rasterization
feat(agc): implement overestimating conservative rasterization
2026-10-08 14:31:38 +02:00
Adrià 1081602d79
Merge pull request #1338 from TibixDev/pr/resource-rejection-details
fix(agc): include resource details in rejected draw diagnostics
2026-10-08 13:55:01 +02:00
Adrià 8087092234
Merge pull request #1350 from gjonn/feat/usbd-no-devices
feat(libSceUsbd): report a USB stack with no devices attached
2026-10-08 13:54:00 +02:00
Adrià 33a9199af1
Merge pull request #1326 from gjonn/fix/relinker-branch-into-cut-tail
fix(relinker): tolerate unwind ranges that split an instruction
2026-10-08 13:40:05 +02:00
Adrià 947a267f4d
Merge pull request #1302 from TibixDev/pr/ngs2-legacy-userfx
feat(ngs2): implement legacy submixer UserFx callbacks
2026-10-08 13:37:56 +02:00
Adrià fae39c6709
Merge pull request #157 from Pacuka/perf/linux-maps-cache
perf(agc): query guest page access with PROCMAP_QUERY on Linux
2026-10-08 13:36:08 +02:00
Adrià d393c3e754
Merge pull request #1346 from TibixDev/pr/disabled-color-targets
fix(agc): honor disabled color targets and their reset state
2026-10-08 13:36:03 +02:00
Gjon Gojcevic 53b3da5cea ci: retrigger checks (flaky guest_raise_exception timeout)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 13:34:39 +02:00
Gjon Gojcevic 6e5d70f0cd feat(libSceUsbd): report a USB stack with no devices attached
Init and exit succeed, the device list is empty, event handling waits for its timeout, and calls that need a device throw.
2026-10-08 13:34:39 +02:00
Adrià 4f41832dc0
Merge pull request #1320 from TibixDev/pr/temporary-storage-lifecycle
fix(appcontent): track temporary storage mounts
2026-10-08 13:31:44 +02:00
TibixDev e5aeec994d fix(agc): include resource details in rejected draw diagnostics
AI-assisted change. Graphics regression tests passed on Fedora 44.
2026-10-08 13:30:07 +02:00
Adrià a983fb5df5
Merge pull request #1348 from TibixDev/pr/null-pixel-input-state
fix(agc): ignore stale input state for null pixel shaders
2026-10-08 13:29:44 +02:00
Adrià f0cc6750db
Merge pull request #1343 from nikhilpanchal1/fix/recompiler-storage-only-constants
fix(recompiler): avoid illegal narrow constants during optimization
2026-10-08 13:28:34 +02:00
Gjon Gojcevic 90dcd6256c fix(relinker): tolerate unwind ranges that split an instruction
A static branch into a skipped function tail is accepted when an
instruction decodes there within its executable segment, so a range that
ends inside an instruction no longer stops code analysis.

The Windows TLS rewriter skips a non-FS segment-prefixed instruction that
starts inside an earlier collected instruction: it is an alternative
decoding from a range that begins mid-instruction, not a TLS access.
2026-10-08 13:20:32 +02:00
Celegans12 29c22442dc feat(agc): implement overestimating conservative rasterization
A draw whose PA_SC_CONSERVATIVE_RASTERIZATION_CNTL (context 0x313) was
not the default 0x6000 threw in DecodeState and the draw precheck.
0x6001 sets OVER_RAST_ENABLE and now decodes to Vulkan's overestimation
mode, chained to the pipeline's rasterization state and its key.

The device enables VK_EXT_conservative_rasterization only when its
primitiveOverestimationSize is at most 1/256 pixel and it rasterizes
degenerate triangles; elsewhere the pipeline throws. Overestimation is
accepted only when triangles reach the rasterizer: VGT_GS_OUT_PRIM_TYPE
behind a geometry shader, VGT_TF_PARAM's output topology behind
tessellation, VGT_PRIMITIVE_TYPE otherwise. Other 0x313 values and
centroid interpolation still throw.

Adds the agc_driver_conservative_rasterization GPU test and extends
agc_driver_graphics.
2026-10-08 13:20:22 +02:00
Nikhil Panchal 39e8e70caf fix(recompiler): guard narrow-type scanning bounds
Check module headers, instruction lengths and required operands before
scanning narrow types.

Cover malformed and byte-swapped modules while retaining the native
SPIR-V 1.3 conversion matrix.

Tested: Linux/llvmpipe CTest three times with SPIRV-Tools on and off,
cold-cache Vulkan regressions, and ASan/UBSan in all optimization modes.
2026-10-08 13:20:06 +02:00
Nikhil Panchal 43074a805e fix(recompiler): avoid illegal narrow constants during optimization
Skip CCP and Simplification for storage-only narrow types while keeping
the remaining passes and arithmetic-capable folding.

Add compiler and Vulkan readback regressions for default/full/none modes.

Tested: Linux/llvmpipe, full CTest with SPIRV-Tools on/off, ASan/UBSan
optimizer checks, and cold-cache Vulkan wave32/wave64 readback.

Fixes boykopovar/AnyPS5#1276
2026-10-08 13:20:06 +02:00
TibixDev 0d4db860a6 feat(ngs2): implement legacy submixer UserFx callbacks
Invoke the title callback on planar mixed samples and silence. Preserve per-voice callback data, reset registration on setup, and release the render guard on callback failure. Include behavioral tests and source references. Written with AI assistance.
2026-10-08 13:18:41 +02:00
Adrià b1c5f10df8
Merge pull request #1319 from TibixDev/pr/allocation-lease-deadlock
fix(memory): release the registry lock while waiting for a lease
2026-10-08 13:08:46 +02:00
Adrià 44ef694870
Merge pull request #1308 from TibixDev/pr/implicit-cube-extents
fix(agc): decode implicit six-face cube extents
2026-10-08 13:08:02 +02:00
Adrià Franch 18bc4b6d0e fix(agc): report a failed PROCMAP_QUERY instead of rescanning the maps
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 13:05:02 +02:00
Pacuka 3bea115487 perf(agc): query guest page access with PROCMAP_QUERY on Linux
describePages parsed the whole /proc/self/maps for every run it
reported. On kernels with the PROCMAP_QUERY ioctl (Linux 6.11+) each run
is now one ioctl on an open /proc/self/maps fd with
PROCMAP_QUERY_COVERING_OR_NEXT_VMA, which returns the covering or next
VMA and its read/write flags straight from the kernel, so the answer is
exact for host mappings too. A VMA starting above the cursor is a gap up
to its start and ENOENT is a gap to the end. Kernels without the ioctl
keep the line scan.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 13:04:56 +02:00
Celegans12 38e89df1a5 fix(agc): bind guest buffer views that start off a DWORD boundary
A V# whose base is not a multiple of 4 bytes from the start of its GPU
owner threw in GuestBufferMemory::Descriptor, because the shader added
the offset below the view only in whole dwords.

Descriptor now binds from the offset alignment below the view and
passes the whole remainder. Such a view's range covers the dwords
around it, and its descriptor region starts and ends on dword
boundaries, so a lone view copied to its own buffer binds the same way.

The buffer specialization records the V# base's low two bits. Raw
vector loads through such a V# join two dwords, glc dwordx2 loads
included, stores merge their bytes into both with compare-exchange
loops, and bounds checks include the second dword. s_buffer_load
ignores the low two bits, as SrtEvaluator does. Formatted accesses
whose element alignment (min(element bytes, 4)) the base breaks throw,
as they fault the wave on RDNA2, and so do atomics.
2026-10-08 13:01:27 +02:00
TibixDev 33555244c3 fix(appcontent): track temporary storage mounts
Preserve files across unmount, block new lookups until remount, and validate mount-dependent operations. Keep prior-run storage inaccessible after initialization.

Written with AI assistance.
2026-10-08 13:00:00 +02:00
Dean 084aeeb67a
Merge pull request #1515 from oneandonlydean/revert/1156-bundled-libc
revert: undo #1156's bundled libc lifecycle suppression
2026-10-08 23:58:39 +13:00
Adrià 615262f3cd
Merge pull request #1279 from TheAggie/fix/libkernel-send-nosignal
fix(libkernel): accept MSG_NOSIGNAL in send and sendto
2026-10-08 12:58:28 +02:00
Adrià b599fe0586
Merge pull request #1268 from Celegans12/fix/shader-wave64-half-wave-reductions
fix(shader): read the half-wave scans of wave64 reductions on any host subgroup
2026-10-08 12:58:18 +02:00
Celegans12 ccddd4f89b fix(agc): forget a DCC key fill once a refresh sees other keys
StorageTexture::MarkDirty skips the first write's uncompressed key
store while the image's filledKeys holds a clear code, and only an
upload or clearByKeysFill reset that fill. After a 0001 key fill, a
kernel storing 0000 over the keys and a storage write, the refresh of
write-watched memory read 0000, the keys the image was uploaded under,
so it did not upload again and kept the stale 0001. The write then
left the 0000 keys in memory, and a kernel reading them saw the clear
colour.

StorageTexture::ProvedKeys, the key read of Refresh and the fast
revalidation, now forgets the fill when it reads other keys while the
image has no results pending. An image with pending results keeps it,
since its write-backs treat those results as killed by that fill.
2026-10-08 12:55:45 +02:00
Adrià 81f31ef1a9
Merge pull request #1301 from TibixDev/pr/ngs2-atrac9-loops
feat(ngs2): parse forward ATRAC9 waveform loops
2026-10-08 12:53:11 +02:00
Adrià 4a14093ac9
Merge pull request #1291 from TibixDev/pr/savedata-directory-records
fix(savedata): use 32-byte directory records
2026-10-08 12:52:30 +02:00
Adrià 7c4dfac50e
Merge pull request #1293 from TibixDev/pr/savedata-progress-dialog
fix(savedata): keep progress dialogs running until closed
2026-10-08 12:50:48 +02:00
Dean Galvin 2096c66a91 revert: undo #1156's bundled libc lifecycle suppression
Since #1156 a title's bundled sce_module/libc.prx is loaded for its
exports but its init is suppressed, while titles still call its malloc,
which then returns NULL (#1500). On Linux, titles that bundle libc crash
at launch: one segfaults within 0.2 s, another stops with bad_alloc.

This reverts commit 2d6aff7a1e, reversing
changes made to e82e03f11e.
2026-10-08 23:49:41 +13:00
Adrià 4b2413fb57
Merge pull request #1278 from TheAggie/feat/libkernel-poll
feat(libkernel): implement poll for guest sockets
2026-10-08 12:37:49 +02:00
Adrià Franch 065280d58d fix(libkernel): map EPIPE on Linux and test send with MSG_NOSIGNAL on a closed peer
Case and test by hikazey in the PR thread.

Co-authored-by: hikazey <hikazey@users.noreply.github.com>
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 12:36:58 +02:00
Scott Schuster a2f9a50985 fix(libkernel): accept MSG_NOSIGNAL in send and sendto
send, sendto and sendmsg rejected every flag with EOPNOTSUPP, so callers
that pass FreeBSD's MSG_NOSIGNAL (0x20000) could not send at all. Accept
it: Windows sockets never raise SIGPIPE, and on Linux it maps to the
native MSG_NOSIGNAL. Other flags still fail with EOPNOTSUPP.

DOOM (PPSA99666) sends its upload server replies with MSG_NOSIGNAL and
closed every connection without an answer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 12:36:58 +02:00
Adrià 4ffc9a14f8
Merge pull request #927 from mugurc/libc-exceptions
feat(libc): exception runtime on macOS hosts
2026-10-08 12:35:51 +02:00
Scott Schuster 408e305ca0 feat(libkernel): implement poll for guest sockets
Translate the FreeBSD pollfd layout and flags to WSAPoll on Windows and
poll on Linux. Closed socket descriptors report POLLNVAL, a timeout below
-1 fails with EINVAL and a null array with EFAULT. Non-socket
descriptors, unknown event bits, POLLPRI on Windows and an infinite wait
without sockets throw; these are recorded in TechnicalDebt.

DOOM (PPSA99666) imports poll for its upload server.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 12:23:41 +02:00
Adrià e28fa01ca6
Merge pull request #1253 from popcoder565/feat/shader-system-opcodes
feat(shader): decode halt, trap return, code end, GWS and ordered count instructions
2026-10-08 12:19:38 +02:00
mugurc 0ae0bbf244 test(libc): reach the C personality through its guest export
Guest C built with -fexceptions binds __gcc_personality_v0 to
__gcc_personality_v0_nid_postfix, and the unwinder recognizes the frame
by that address. exception_c_cleanup links the host personality, so it
passed without the export.

The new test builds a call-site table by hand and drives the routine the
way the unwinder does: through the _nid_postfix symbol and through
CallPersonality. It covers the cleanup phase installing the landing pad,
the search phase continuing, ranges before and after the call site, a
call site with no landing pad, no LSDA, a signal frame, an unsupported
version, and an unknown personality. Without the export it fails to link.
2026-10-08 13:16:41 +03:00
mugurc 939c3d98f7 feat(libc): exception runtime on macOS hosts
On macOS the host keeps libc++abi: libc++ binds __cxa_throw two-level,
so moving only the personality into this runtime would leave the two
halves disagreeing on the exception header. The host personalities stay
libc++abi's and libunwind's, and libc.prx serves guest code:

- the guest's libstdc++ std::exception_ptr is modelled directly, since
  libc++'s differs, and the Itanium type_info layouts that libc++abi
  keeps private are declared for the runtime;
- guest frames are found through their PT_GNU_EH_FRAME, using a
  dl_iterate_phdr emulation over the ELF program headers that relinked
  images keep in __APS5DATA,__meta (written by relinker --macos, which
  comes in a later pull request);
- host frames are found by scanning __TEXT,__eh_frame;
- sceKernelGetModuleInfoForUnwind uses the same emulation and falls back
  to dladdr for host images.

The libc++ paths compile only with libc++/libc++abi and the rest only
on __APPLE__, so Linux and Windows builds are unchanged.
exception_c_cleanup throws from host code, which this runtime does not
serve on macOS, so it is not built there.
2026-10-08 13:16:41 +03:00
mugurc 1ac6866980 fix(libc): export the C personality to guest code
Guest C built with -fexceptions imports __gcc_personality_v0 for its
cleanup frames, and libc.prx did not export it. The routine becomes
__gcc_personality_v0_nid_postfix, the host __gcc_personality_v0
forwards to it as __gxx_personality_v0 already does, and
CallPersonality recognizes both names.
2026-10-08 13:16:41 +03:00
Adrià Franch ce5be8c2b4 test(agc): pin the AND and OR half-wave reductions in the pixel execution test
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 12:16:02 +02:00
Celegans12 9513703244 fix(shader): read the half-wave scans of wave64 reductions on any host subgroup
The GFX10 lowering of a wave64 reduction scans rows with DPP row_shr
1/2/4/8 and v_permlanex16_b32 under EXEC -1, then joins lanes 31 and 63
with a scalar op. The console fills lanes outside the entry EXEC with
the identity, but on the host they can be helpers that sit out subgroup
operations or invocations that were never launched: on 64 lanes (RADV)
the emulated chain reads 0 or stale values from them, and on 32 lanes
lane 63 throws since #997.

EmitReadLane now recognises the sequence on any host for UMin, UMax,
SMin, SMax, IAdd, AND and OR when the keys are the identity outside the
entry EXEC. On 64 lanes, lanes 31 and 63 become subgroup reductions of
the keys of invocations 0-31 and 32-63; on 32 lanes or fewer, lane 31
reduces all keys and lane 63 is the identity. It throws without
subgroup arithmetic or on a subgroup wider than the wave. VulkanDevice
reports GroupNonUniformArithmetic and ShaderValidation checks it.
2026-10-08 12:10:32 +02:00
Adrià 30e89cc6a0
Merge pull request #1266 from Celegans12/fix/agc-oversized-descriptor-sets
fix(agc): allocate oversized descriptor sets from a dedicated pool
2026-10-08 12:09:59 +02:00
Adrià 915e3b753f
Merge pull request #1264 from Celegans12/fix/shader-wave64-exec-host-lanes
fix(shader): mask EXEC copies to the host subgroup's lanes
2026-10-08 12:08:54 +02:00