Commit Graph

553 Commits

Author SHA1 Message Date
TibixDev 4f23830d89 fix(libc): resolve guest filename case on host filesystems
Resolve ASCII case differences in guest paths and mount aliases while preferring exact names and rejecting ambiguous fallback matches. Preserve new filenames and host roots. Five filesystem tests pass; Skyrim now loads its INI and shader archives, initializes Vulkan and uploads intro textures instead of dereferencing null shader metadata. Written with AI assistance.
2026-10-08 14:33:17 +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à 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à 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
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
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 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à 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
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
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
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à 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
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
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à 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
Adrià 3069680b70
Merge pull request #1130 from Celegans12/feat/agc-ordered-pixel-shader
feat(agc): implement primitive-ordered pixel shaders with fragment shader interlock
2026-10-08 12:01:03 +02:00
Adrià Franch 2e0b7bb90e docs: record the s_sethalt 0 measurement in TechnicalDebt
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 11:49:24 +02:00
popcoder565 f11080ceef chore: move the s_sethalt debt entry below the libSceAudio3d entries
#1398 and #1399 both rewrite the sceRtcParseDateTime entry that the s_sethalt entry followed. It now follows the libSceAudio3d entries, which no open pull request edits, so either can merge first without a conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:49:17 +02:00
popcoder565 67b28480d8 chore: move the wave control decode test and s_sethalt debt entry off shared lines
#1372 adds its test after the vop1 decode tests and #1314 its debt entry after s_setkill, the places where this branch added its own. The wave control decode test now precedes the vop1 decode tests and the s_sethalt entry follows sceRtcParseDateTime, so either pull request can merge first without a conflict.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:49:17 +02:00
popcoder565 a5717b6613 feat(shader): decode halt, trap return, code end, GWS and ordered count instructions
s_sethalt with SIMM16[0] clear is a no-op; s_sethalt 1, s_sendmsghalt, a reached s_code_end, s_rfe_b64, the ds_gws_* instructions and ds_ordered_count throw with the reason at translation. Linear decoding stops at s_code_end like at s_endpgm, so code padded with s_code_end after a final backward branch decodes. Encodings from LLVM SOPInstructions.td and DSInstructions.td, checked against the gfx10 MC tests; semantics from the RDNA 2 ISA guide.
2026-10-08 11:49:06 +02:00
Adrià 73ac9ef7f4
Merge pull request #1218 from hashaam1217/feat/relinker-rip-relative-stubs
feat(relinker): relocate RIP-relative operands into --to-intel stubs
2026-10-08 11:40:17 +02:00
Adrià b36718214c
Merge pull request #1206 from CnRJay/feat/http-ssl-and-callbacks
feat(libSceHttp): accept the SSL version, SSL error and redirect and cookie callback calls
2026-10-08 11:38:43 +02:00
Adrià b680d5adac
Merge pull request #1198 from Sanjaysrinivas/feat/shader-conditional-exchange
feat(shader): add LDS conditional exchange
2026-10-08 11:34:31 +02:00
Celegans12 e1d4e699be feat(agc): implement primitive-ordered pixel shaders with fragment shader interlock
DecodeState and the draw precheck rejected DB_SHADER_CONTROL bit 16,
PRIMITIVE_ORDERED_PIXEL_SHADER (POPS), which runs the ordered section
of overlapping pixels' shaders in primitive order. The bit now reaches
the recompiler as a pixel stage field, and such a pixel shader declares
PixelInterlockOrderedEXT and runs its whole body between
OpBeginInvocationInterlockEXT and OpEndInvocationInterlockEXT; an
invocation that a BDA read fault kills ends the interlock first. The
POPS collision SGPRs read 0, so a title skips its POPS wait and runs
its per-collision loop once. An image_load still reads a sampled
binding, which misses an earlier overlapping primitive's image_store in
the same draw. The device enables VK_EXT_fragment_shader_interlock when
it has fragmentShaderPixelInterlock; without it the recompile throws,
as does a nonzero POPS_OVERLAP_NUM_SAMPLES. The field is part of the
recompile cache key, the draw key and the serialized request (version 10).
2026-10-08 11:18:46 +02:00
Adrià Franch 274b070ac2 docs: mark the VRSQRTPS/VRCPPS native-site count as predating RIP-relative followers
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 11:10:42 +02:00
Hashaam Zafar a571a7f100 feat(relinker): relocate RIP-relative operands into --to-intel stubs
SHA-1 and SHA-256 instructions with a [rip+disp32] operand, and
instructions with one that a short site absorbs, now move into the
stub. The stub records each displacement as a relocation relative to
the site, and the Linux, guest and Windows placements resolve it once
the stub address is known. Indirect branches through [rip+disp32]
still fail the relink.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 11:10:38 +02:00
Adrià e3d5e79eb8
Merge pull request #1126 from Fishybeing/fix/libc-utf16-conversions
fix(libc): parse and collate guest wide strings as 16-bit units
2026-10-08 11:09:24 +02:00
Adrià ac951f8d09
Merge pull request #1215 from polysius/fix/agc-versioned-nid-names
refactor(libSceAgc): name exports after the versioned SDK names their NIDs hash to
2026-10-08 11:05:42 +02:00
Sanjaysrinivas 34d4cf1796 fix(shader): preserve LDS conditional addresses
Use the shared atomic bounds check instead of wrapping at 64 KiB.
Expect zero returns and unchanged LDS for aligned out-of-range accesses,
and record the gfx1035 hardware measurements.
2026-10-08 11:04:26 +02:00
Adrià e82e03f11e
Merge pull request #1093 from kjhq/fix/libkernel-sync-access-denied
fix(libkernel): flush only the paths the guest changed in sceKernelSync on Windows
2026-10-08 10:58:55 +02:00
Claude 3ed954fb90 feat(libSceHttp): accept the SSL version, SSL error and redirect and cookie callback calls
No request reaches the network, so sceHttpsSetSslVersion has no TLS
connection to configure, sceHttpSetRedirectCallback and
sceHttpSetCookieRecvCallback register callbacks that are never called,
and sceHttpsGetSslError reports error 0 with detail 0. A null errNum or
detail returns SCE_HTTP_ERROR_INVALID_VALUE like sceHttpGetLastErrno.
Signatures follow shadPS4.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:57:14 +02:00
Adrià 0e173a4634
Merge pull request #1143 from AchrafReyani/feat/libc-bad-weak-ptr
feat(libc): implement std::bad_weak_ptr and _Throw_bad_weak_ptr
2026-10-08 10:30:41 +02:00
kjhq bb1a4cbec4 fix(libkernel): flush only the paths the guest changed in sceKernelSync on Windows
Opening a volume needs administrator rights, so the volume flush skipped
every volume in a normal user session. The libc, libkernel, save data and
app content file functions now record each host file and directory they
change. On Windows sceKernelSync flushes the recorded paths that changed
since the previous call, plus their changed parent directories, through
handles a normal user can open. Linux still calls sync().
2026-10-08 08:27:22 +00:00
Fishybeing 5b0d28392c fix(libc): parse and collate guest wide strings as 16-bit units
wcstod, wcstof, wcstold, wcstol, wcstoll, wcstoul, wcstoull, wcscoll and wcsxfrm still forwarded to the host's wchar_t functions, which use 32-bit units on Linux. The wcsto* functions now parse the ASCII prefix of the guest string with the narrow parsers, as the C locale accepts only ASCII white space and digits. wcscoll compares like wcscmp and wcsxfrm copies, as strcoll and strxfrm do in the C locale.
2026-10-08 10:27:00 +02:00
Adrià f6c33f0d04
Merge pull request #1131 from orbz22/feat/kernel-vectored-io-windows
feat(kernel): implement vectored file IO on Windows
2026-10-08 10:18:29 +02:00
Adrià c081eb90dc
Merge pull request #1116 from Fishybeing/fix/libc-utf16-strings
fix(libc): read guest wide strings as 16-bit units
2026-10-08 10:15:55 +02:00
Adrià 1c3f55628d
Merge pull request #1122 from TideOPL/feat/agc-copy-data-gpu-clock
feat(agc): copy the GPU clock counter with COPY_DATA
2026-10-08 10:12:18 +02:00
Adrià da4027399e
Merge pull request #1125 from TideOPL/feat/ppsa16064-missing-exports
feat(libs): add the unimplemented exports PPSA16064 imports
2026-10-08 10:01:59 +02:00
Achraf Reyani df570de6d5 feat(libc): implement std::bad_weak_ptr and _Throw_bad_weak_ptr
BnMAMrsfVWo is _ZSt19_Throw_bad_weak_ptrv. Replace the unknown stub
with a throw of a guest std::bad_weak_ptr, and add its type info,
vtable, destructors and what().

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 10:00:54 +02:00
TibixDev 48bb99d477 fix(agc): decode implicit six-face cube extents
Treat equal BASE_ARRAY and DEPTH as a six-face cube. Measured with image_load, image_sample and image_get_resinfo on RX 6600 gfx1032 using base slices 0, 5 and 6. Partial cube ranges still throw because filtered sampling differs from load bounds.

Graphics tests and GPU snapshot/storage sampling tests pass for all six faces at each tested base.

Assisted-by: OpenAI Codex
2026-10-08 11:00:04 +03:00
Adrià 7fccb7ff5f
Merge pull request #1051 from fisherjoey/fix/linux-unwritable-host-import
fix(agc): skip Linux host imports of ranges not mapped read-write
2026-10-08 09:53:40 +02:00
Adrià Franch e8697e6938 docs: record the Windows positioned and vectored IO deviations in TechnicalDebt 2026-10-08 09:53:01 +02:00
Raihan Abdul Majid a38df0f020 feat(kernel): implement vectored file IO on Windows
sceKernelReadv, sceKernelWritev, sceKernelPreadv and sceKernelPwritev threw on Windows. They now gather or scatter through one host buffer and issue a single read or write, with the same argument checks and error codes as the Linux path. Positioned transfers restore the file offset afterwards, as pread and pwrite do on POSIX, and report ESPIPE for handles that are not disk files. guest_file_vector now runs on Windows as well.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UTjpbMX7BUFMZZaxJE98zV
2026-10-08 09:52:49 +02:00
TideOPL 23e0363e59 feat(agc): copy the GPU clock counter with COPY_DATA
COPY_DATA rejected source select 9 (GPU clock count) and any cache
policy bits. PPSA16064 (Minecraft Dungeons II, Unreal Engine)
calibrates its GPU timer at start-up with a submission of five
COPY_DATA packets, control 0x06016209: GPU clock source, memory
destination, 64-bit count, source and destination cache policy 3. The
submission was rejected and the title aborted.

The clock source now writes the same counter as a RELEASE_MEM
timestamp (the host steady clock in 10 ns ticks), read when the packet
runs, through the direct execute path and through ResolveStore for
stores recorded on the GPU. A 32-bit count writes its low half. The
source and destination cache policy fields are accepted and ignored,
as for WRITE_DATA and DMA_DATA. The reference clock (source select 10)
and the other unimplemented sources still throw.

agc_driver_pm4 runs the title's packet twice and checks a nonzero,
non-decreasing counter and an 8-byte resolved store, and that source
select 10 is still rejected.
2026-10-08 09:47:53 +02:00
Adrià 1e1e1390b5
Merge pull request #1123 from TideOPL/fix/agc-command-buffer-null-cursor-down
fix(libSceAgc): treat a null cursor_down as a buffer limited by its top
2026-10-08 09:41:38 +02:00
Fishybeing cd39c8db54 fix(libc): read guest wide strings as 16-bit units
The guest's wchar_t is 16 bits, but wcslen, wcscmp, wcsncmp, wcscpy, wcsncpy, wcschr, wcsrchr, wcsstr, wcspbrk, wcsspn and the wmem functions forwarded to the host's wchar_t functions, which use 32-bit units on Linux. Implement them on char16_t. The wide conversions that still use the host's wchar_t are listed in TechnicalDebt.
2026-10-08 09:39:55 +02:00
Adrià Franch 80456dac90 docs(debt): say the Linux host import check does not cover shared file mappings
Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-08 09:37:52 +02:00