Commit Graph
14017 Commits
Author SHA1 Message Date
hypermistandClaude Opus 5.5 e9f4dbfcf5 fix(libc): check the C11 runtime constraints in snprintf_s and vsnprintf_s
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 23:43:55 +02:00
Adrià Franch 135ae36712 test(libkernel): open the truncate race files by relative path
The guest VFS does not map absolute host paths on Linux, so sceKernelOpen failed there.
2026-10-18 23:42:07 +02:00
davidamsellemandClaude Opus 5 eccc81b505 test(agc): measure pipeline cache hits against the bytes a pipeline adds
vkGetPipelineCacheData is not stable in size on a driver that keeps
pipelines: RADV grows a loaded cache by 8 bytes on the first create and
shrinks it by 8 on a later hit, so an exact size match reports a hit as a
miss and agc_pipeline_cache_file fails on hardware. lavapipe keeps
nothing, so every size stays equal, the probe reads that as a device that
does not store pipelines and the test skips, which is why CI never saw
this.

Size each pipeline in an empty cache first and treat a change below half
that as a hit, and skip on a device where a pipeline adds nothing.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-18 23:40:20 +02:00
simonbronkandClaude Opus 5.5 752cca10fe fix(agc): import native multisample depth whose HTILE is not ITERATE_256
The initial import of a native multisampled depth target only proceeds
when every HTILE word proves the same clear value, so no compressed Z
planes are read from guest memory. ITERATE_256 only changes how the DB
and the texture unit walk compressed MSAA Z planes (Mesa
ac_descriptors.c: "TC-compatible MSAA HTILE requires ITERATE_256").
The HTILE footprint (Addrlib) and the HTILE clear words (Mesa
radv_get_htile_fast_clear_value) do not depend on it. The import no
longer requires it; the texture's ITERATE_256 must still match the
target's.

Unblocks PPSA27836 (Onimusha: Way of the Sword), which samples a
four-sample D32 target with pipe-aligned HTILE and ITERATE_256 off.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 23:38:21 +02:00
Ondra97 f7aeed2eb0 fix(libkernel): serialize Windows ftruncate with file transfers 2026-10-18 23:36:25 +02:00
thibautandClaude Opus 5.5 55bb2c7932 perf(shader): fold masks, shifts and field extracts through bits they do not use
The constant folder now knows which bits a value can hold (masks, merges,
shifts, field extracts, 16- and 8-bit widenings, selects) and which bits a
user reads:

- a mask that clears no bit the value can hold is dropped, and so is a
  merged part with no bit under the mask;
- And(And(x, a), m) becomes And(x, m) when m keeps no bit outside a, and a
  mask rewrite is folded again;
- a field extract, shift, mask or 16-bit truncation reads through masks
  that keep the bits it reads and through merged parts that hold none;
- a right shift of a left shift by the same amount becomes a mask;
- BitFieldUExtract(x, 0, n) is x when x has no bit at or above n;
- Or of two masked parts of one word becomes the word under the union of
  the masks (the word itself when they cover it);
- a field extract of a left shift reads the unshifted word.

These patterns come from 16-bit halves of 32-bit registers (f16 and packed
math), which the translator splits and merges per instruction.

Test: agc_constant_bit_test gets six cases (repeated, narrower and wider
masks, a mask under a merge, half extractions, halves that rejoin); all six
fail on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XBXM4pgkMHYEtqN1EQni2P
2026-10-18 23:33:46 +02:00
Adrià 0bc3003f89 Merge pull request #6282 from Ondra97/codex/fix-font-face-lifetime
fix(font): serialize shared FreeType face lifetime
2026-10-18 23:27:19 +02:00
Adrià defd27abb8 Merge pull request #6266 from meh7an/perf/memory-coarse-write-stamps
perf(memory): skip 4 MiB runs no write stamped since a range check
2026-10-18 23:27:14 +02:00
Adrià 5768b25925 Merge pull request #6244 from xXPBSXx/fix/pthread-destroyed-einval
fix(libkernel): return EINVAL for pthread mutex and cond operations on a destroyed object
2026-10-18 23:27:09 +02:00
Adrià 88defdafa1 Merge pull request #6268 from DavidFB-creator/fix/conventions-unknown-nid-collisions
feat(tools): flag Unknown exports whose NID is already a symbol in the tree
2026-10-18 23:27:04 +02:00
Adrià b6403ddd6d Merge pull request #6176 from mitul72/perf/shader-integer-folding
perf(shader): fold integer compares by value sets and known bits
2026-10-18 23:26:59 +02:00
Adrià 946e9d936b Merge pull request #6212 from milescoviello/fix/agc-inverted-scissor
fix(agc): treat an inverted scissor rectangle as empty
2026-10-18 23:26:54 +02:00
Adrià 1158cb8aab Merge pull request #6255 from LeandroLP23/fix/agc-kill-demoted-quad-pixels
fix(shader): kill demoted quad-mask pixels when the pixel program returns
2026-10-18 23:26:48 +02:00
Adrià 8256d3a1f3 Merge pull request #6134 from fdfawef324/claude/agc-prepare-dump-name
fix(agc): name preparation-failure shader dumps apart from dispatch captures
2026-10-18 23:26:43 +02:00
Adrià c7f67e5cf3 Merge pull request #6144 from freshstart2066-create/feat/libc-safe-wide-strings
feat(libc): implement safe wide string and concatenation functions
2026-10-18 23:26:38 +02:00
thibautandClaude Opus 5.5 3e5499310c fix(shader): round normalized storage image writes to nearest even
Vulkan lets a device return either neighbour when it converts a float to a
normalized texel, and devices differ: for a product of 123.50003, NVIDIA and
Intel both store 123, and on GTA V's FSR1 RCAS compute pass the two vendors
stored different bytes for the same inputs.

Writes to unorm and snorm storage images whose components share one width
now clamp the value (NaN to 0), round value * scale to nearest even in the
shader and store level * c, where c is the smallest float not below
1 / scale. The exact product of that float with the scale lies in
[level, level + 0.01) for 8-, 10- and 16-bit unorm and snorm, so a device
that rounds to nearest and one that truncates both store the level. The
format comes from the image descriptor through specialization constants
(StoreQuantizeBase, four per written storage image), so other formats keep
the plain write.

Test: agc_driver_image_store_unorm_rounding stores values next to the
midpoints between levels, edge values and NaN/infinities to 8_UNORM,
16_16_UNORM, 8_8_8_8_UNORM, 8_8_8_8_SNORM and 16_16_16_16_UNORM images; it
fails on main on an RTX 4090 and on an Intel UHD 770 and passes on both with
this change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XBXM4pgkMHYEtqN1EQni2P
2026-10-18 23:22:45 +02:00
valenciana-nc 84d77798c2 fix(libkernel_sys): reject root names in symlink targets and test target restrictions
Replace the leading-slash absolute-target check with a root-name/root-directory
check so Windows targets like C:/ or \\server\share are rejected too, and
add guest tests covering rejected (.. , ../x, a/../b, a/../../x, /abs, plus
C:/ and UNC paths on Windows) and accepted (sub/dir, a..b, ...) targets.
2026-10-18 21:21:40 +00:00
thuanquangandClaude Opus 5.5 e0da1fb1c9 test(libkernel): time blocking waits from before the writer thread starts
PipeRead (guest_kqueue) and the blocking read in guest_socket_events took
their start time after creating the thread that writes after 50 ms, so a
main thread preempted between the two measured less than the writer's
sleep and failed the 40 ms check although the wait did block until the
write.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 04:18:05 +07:00
mitul72 ba4571a253 fix(agc): name in-place draw inputs and multisampled targets in pass hazards
A recorded draw's pass access listed its shader-resource reads, indirect
arguments, storage images and resident color targets, but not the index
and vertex ranges it binds in place from host imports
(DrawInputs::inPlaceReads) nor its multisampled color targets (null in
RecordedDraw::targets). A later draw writing those ranges through a
shader buffer, or a pass sharing the multisampled target under another
pass key, found no hazard: the break between the passes recorded no
barrier, or the later draw continued the pass, so its writes could land
before the earlier draw fetched its inputs, and the two passes' attachment
writes and store operations on the multisampled image were unordered.

The in-place input ranges join the pass reads, and MultisampleTargetView
reports the target's image, which joins the pass attachments as written.
2026-10-18 23:14:36 +02:00
Adrià 0d1c299a91 Merge pull request #6277 from hypermoist/fix/window-lane-spills
fix(recompiler): read lane spills back through relative-addressing window registers
2026-10-18 23:14:35 +02:00
Adrià 2da2284def Merge pull request #6270 from YossiYad/fix/agc-register-defaults-pairs
fix(libSceAgc): return the console's register-defaults table and type pairs
2026-10-18 23:14:29 +02:00
Dean bd7cd1be18 Merge pull request #7500 from AlxcBTW/pr/input-analog-keys
feat(libScePad): analog keyboard input with a stick modifier and stick and trigger ramps
2026-10-19 10:10:26 +13:00
Dean e1248700d9 Merge pull request #7646 from oneandonlydean/revert/6112
revert(relinker): run guest preinit arrays before the module initializer (#6112)
2026-10-19 10:10:20 +13:00
valenciana-nc 7408e55478 fix(libkernel_sys): reject parent-directory components in symlink targets
symlink_nid_postfix blocked absolute targets but accepted relative
targets containing '..' unchecked. The target is stored verbatim and the
host OS follows it when the link is later opened through the guest path
resolver, so symlink("../../../../..", "e") followed by
sceKernelOpen("e/etc/passwd", ...) reads host files outside the guest
root. Reject any '..' component, mirroring the absolute-target handling
above it.
2026-10-18 21:09:38 +00:00
Mehran 9824c46fe0 feat(libs): let relinked Windows games opt into mimalloc 2026-10-19 00:08:47 +03:00
Adrià 2d7619cf99 Merge pull request #6258 from erm14254/fix/shader-ordered-count-wave64
fix(shader): add the ordered count of a first active lane in the upper wave64 half
2026-10-18 23:08:08 +02:00
MarcZX100 2d2c21a04b test(agc): skip unavailable shadow checks 2026-10-18 21:06:07 +00:00
Adrià 967f0b95c5 Merge pull request #6210 from TheAggie/perf/agc-present-epoch
perf(agc): the presenter takes the newest collect epoch, so an untracked display image keeps its comparison memo
2026-10-18 23:00:51 +02:00
Adrià 3a14fdb321 Merge pull request #6241 from Ondra97/codex/fix-semaphore-canceled-wakeup
fix(libkernel): preserve semaphore wakeups across cancellation
2026-10-18 22:59:45 +02:00
David 9f4cd87a61 Merge remote-tracking branch 'origin/main' into fix/netctl-default-route-macos
# Conflicts:
#	core/libs/tests/GuestNetCtl.cpp
2026-10-19 00:56:11 +04:00
Adrià ff2fc57153 Merge pull request #6248 from mugurc/feat/libscesystemservice-loadexec-macos
feat(libSceSystemService): LoadExec on macOS hosts
2026-10-18 22:50:27 +02:00
Adrià c7e28608b1 Merge pull request #6232 from ANONYMOUSZED-beep/feat/image-table-pointer-chains
feat(shader): follow pointer chains from image-table records to the T#
2026-10-18 22:50:22 +02:00
Savvanis SpyrosandClaude Opus 5.5 45a2e3dd4a fix(relinker): resume scans after undecodable bytes between PS4 unwind functions
In PS4 executables and modules the bytes between unwind functions are
16-byte slots of function tails and padding, and a tail can begin inside
an instruction, such as a lone REX byte before a 15-byte NOP. The
syscall and call-site scans decode the executable segment linearly, so
such a slot failed the relink with "Cannot decode instruction".

For images with a PT_SCE_DYNLIBDATA segment the scans now receive the
unwind function ranges. Outside every range an undecodable byte is
skipped and decoding resumes at the next byte, and a decoding that would
cross into a range ends at its start, so gap bytes cannot change how a
function is decoded. Inside a range a decode failure still fails the
relink, and images without unwind ranges are scanned as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 23:45:49 +03:00
Adrià Franch 24bc68375d fix(agc): refuse storage access to a Z texture whose HTILE was partially filled 2026-10-18 22:44:21 +02:00
m.peau 69afb0569f fix(agc): sample undrawn multisampled Z and D 64 KiB swizzle textures, and Z ones whose HTILE is cleared 2026-10-18 22:44:13 +02:00
thuanquangandClaude Opus 5.5 2c75b6c5b2 test(libkernel): give the positioned close test a real 300 us head start
With WinLibs, std::this_thread::sleep_for under 1 ms returns at once, so
close raced the reader in every round and a run where all 60 rounds lost
the race aborted. The test now waits with PreciseSleepUs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 03:41:16 +07:00
Dean Galvin c3b9001592 revert(relinker): run guest preinit arrays before the module initializer (#6112)
This reverts commit 376c040294.
2026-10-19 09:38:31 +13:00
Adrià 6e27fc8f07 Merge pull request #6233 from milescoviello/fix/spawn-missing-program
fix(libSceLibcInternal): fail posix_spawn with ENOENT when the program is not there
2026-10-18 22:37:14 +02:00
Adrià 1288433e8e Merge pull request #6184 from MarcZX10/codex/cache-inaccessible-guest-pages-6183
fix(agc): cache inaccessible guest pages
2026-10-18 22:37:09 +02:00
Yunus Shaikh 340f3aa13a Merge main into fix/agc-sample-location-grid-exact
Resolves MultisampleTarget against #6635: the sampled view takes the requested view type and keeps the sampled-only usage when the target has a storage view for the guest's sample order.
2026-10-18 13:37:01 -07:00
Dean e8ad642fe6 Merge pull request #6620 from hamb3r/perf/precise-sleep-until-qpc-fastpath
perf(libc): add steady_clock fast path in PreciseSleepUntil
2026-10-19 09:32:22 +13:00
Dean ca1c4c89cd Merge pull request #6635 from hamb3r/fix/shader-msaa-array-descriptor-shape
fix(shader,agc): support multisampled 2D array descriptor image shape and runtime views
2026-10-19 09:32:18 +13:00
milescovielloandClaude Opus 5.5 388527d6b2 fix(agc): reimport a multisampled target recreated with another pipe-bank XOR
RADV gives each image its own pipe-bank XOR when it creates it. When Ruffle
recreates a 4x render target on the same memory, the next draw names the
same surface, DCC and CMASK with another XOR, and the resident target refused
it as a changed layout ("multisampled DCC target layout or metadata
changed"). A use that differs from a resident DCC target only in that XOR now
keeps the target's image, views and cached textures, takes the new layout,
and reimports its contents from the current DCC and CMASK metadata the way a
first use does, clearing the image to that color after the work already
recorded against it. Any other layout change is still refused.

Reusing the image keeps memory flat: Ruffle's cache_as_bitmap__avm2_button
recreates its 864x864 4x target 28 times in 32 s.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 20:29:54 +00:00
Adrià ae4d901a57 Merge pull request #6179 from milescoviello/perf/verify-read-probe
perf(agc): answer small guest read checks without /proc/self/maps
2026-10-18 22:27:37 +02:00
AlxcBTW f0ec9bd2a0 Merge remote-tracking branch 'origin/main' into pr/input-analog-keys 2026-10-18 22:27:23 +02:00
Faryan Rezagholi d2e0624764 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 2026-10-18 22:26:59 +02:00
Faryan Rezagholi cdccc34523 feat(libkernel): log guest exception context 2026-10-18 22:26:45 +02:00
Amr Yasser e10616b17b fix(web): publish converter and libraries from one release 2026-10-18 23:26:42 +03:00
Yunus Shaikh 363e8d9472 Merge main into fix/agc-lookup-log-fits-build 2026-10-18 13:26:18 -07:00
billythemenace2andClaude Opus 5.5 2e363d375a fix(libkernel): redirect a raise only once the target leaves host code
On Windows, sceKernelRaiseException suspends the target and redirects it to
the guest handler wherever it stopped, except inside NtContinue or
winpthreads. A target stopped inside host code (a C runtime call, a host
library) can hold a host lock there; a handler that then waits, as a
collector's thread-stop handler does, keeps it held, and every host thread
that needs the lock stops with it. SONIC SUPERSTARS stopped at frame 65 this
way: its "UDS" thread was redirected inside the stderr write of a trophy
message and parked in sceKernelWaitEventFlag holding the stream lock, and the
driver's logging threads blocked on it.

A target running code of a module other than the executable or a guest
module is now resumed and suspended again until it is back in guest code,
for up to the existing retry limit; a target blocked in an ntdll wait is
still redirected there, as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-18 21:24:44 +01:00