Commit Graph
14017 Commits
Author SHA1 Message Date
thuanquangandClaude Opus 5.5 499e2db905 fix(shader): link a table call whose descriptor load sits before its loop
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 00:53:38 +07:00
Adrià 8625038579 Merge pull request #6150 from BasilF-dev/basil/wolverine-barrier
fix(agc): defer unrouted vertex barriers
2026-10-18 19:53:21 +02:00
Dean c3591adf97 Merge pull request #7510 from AlxcBTW/pr/crash-stack-words-v4
feat(libc): dump the faulting thread's stack words in Windows crash reports
2026-10-19 06:52:21 +13:00
AlxcBTW 33fea9e1ba Merge main into pr/profile-windows 2026-10-18 19:49:54 +02:00
Adrià c34e9d855c Merge pull request #6160 from fma-rc/feat/agc-fs-table-calls
feat(agc): link calls through the AGC FS table
2026-10-18 19:44:10 +02:00
Yunus Shaikh 8a1e737182 test(agc): run the host import lifetime tests on another settle family
agc_driver_host_import_lifetime takes the settle alias path only on a
device whose graphics family has a single queue, such as AMD's Windows
driver; elsewhere the settles share the graphics family and make no
alias. agc_driver_host_import_lifetime_other_family runs the same tests
with the settles forced onto another queue family, as
agc_import_settle_deferred_other_family does, so a device with spare
graphics queues covers that path too. It is registered on Windows and
skips where the device has no other queue family.
2026-10-18 10:41:37 -07:00
LeandroLP23 e22b41c56c fix(agc): keep a retired import with its settle batch until it is reaped
forgetSettle handed back an import's settle batch only while the batch
was still running. A batch the GPU had finished but that had not been
reaped yet still held its aliases, so retireImport released the import
at once, freeing its memory before the alias bound to it was destroyed.

Hand back any busy batch. The import then stays with its batch until
the batch is reaped or an unmap releases it, and both destroy the
aliases first. A finished batch now keeps its imports' Vulkan objects
until it is reaped (#7601).
2026-10-18 10:41:36 -07:00
Yunus Shaikh 4c475452d4 fix(agc): destroy settle aliases before an unmap releases their imports
On Windows a host import under 1 MiB is settled by a batched 4-byte
read. When the settle queue is in another queue family than the
import's, as on AMD's Windows driver with its single graphics queue,
the batch reads through an alias buffer bound to the import's memory.
Reaping the batch destroys those aliases before it drops the imports
retired while the batch held them.

An unmap that needs such an import (releaseSettleRetired) waited for
the batch and then released the import, destroying its buffer and
freeing its memory while the alias was still bound to that memory; the
alias went at the next reap. Destroy the batch's aliases first, as
reapSettleBatches and drainSettles do.
2026-10-18 10:41:36 -07:00
frankea fb020d215b feat(libSceSsl): apply the verify options, run the verify callback, add ALPN, non-blocking sockets and sceSslClose
sceSslConnect verifies the server's chain under MBEDTLS_SSL_VERIFY_OPTIONAL and returns the first failure the connection's verify options select, with the SSL_ERROR_* codes KytyPS5 lists. The initial options are all five checks, so a connection whose title never sets them fails closed: with no CA loaded it returns SSL_ERROR_UNKNOWN_CA instead of throwing. The result is final for the connection: a failure sends close_notify, later sceSslConnect calls return the same code, and sceSslRead and sceSslWrite throw. A verify callback runs once after the handshake, outside the session lock, with the connection id, that code, handles to a copy of the peer chain that the context's certificate readers accept, the chain length and the user argument; a negative return fails the connect with SSL_ERROR_APPLICATION_VERIFICATION_CALLBACK_CHECK. The ALPN list set with sceSslSetAlpn is split on commas and offered, sceSslGetAlpnSelected returns the protocol the server chose, and the minimum version floors the handshake at TLS 1.2. A socket that would block returns SSL_ERROR_WANT_POLLIN or WANT_POLLOUT from connect, read and write and the next sceSslConnect resumes the handshake; the BIO maps a reset to MBEDTLS_ERR_NET_CONN_RESET, which returns SSL_ERROR_SOCKET_CLOSED, and tells a blocking socket's expired receive timeout, which returns SSL_ERROR_READ_TIMEOUT, apart from a non-blocking would-block. sceSslClose sends close_notify once and marks the connection closed. The debt entry records the default options and the situation-to-code choices as unverified and drops the title IDs.
2026-10-18 13:37:58 -04:00
MarcZX100 e541cc9546 test(relinker): assert Windows symbolic rejection 2026-10-18 17:35:36 +00:00
thuanquangandClaude Opus 5.5 f65b4bbe91 fix(shader): test an empty exec mask in s_subvector_loop_begin with one compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-19 00:35:16 +07:00
MarcZX100 2f7eb66c65 test(relinker): keep symbolic fixture on Linux output 2026-10-18 17:34:06 +00:00
MarcZX100 86d3c085e9 fix(relinker): reject Windows DF_SYMBOLIC modules 2026-10-18 17:30:25 +00:00
Adrià Franch b8692a74f2 fix(agc): route the sRGB expand copy through AllocateImageMemory 2026-10-18 19:29:55 +02:00
Gustavo Ariel Gamarra Rojas 57fc04be01 fix(agc): place repacked and stencil copies in host memory after a refused reclaim
Repacked copies and depth stencil copies allocated device-local memory
directly and stopped the title on a refusal; they now take the same
allocation path as the other images. Device buffers choose their host
fallback type the same way, the host placement line carries the cumulative
MiB, and the debt file records that a placed image stays in host memory
for its lifetime.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas cfde713e10 fix(agc): release the texture caches before placing any image in host memory
Textures, storage textures, block, depth and depth plane copies and
attachments now share one allocation path: the pool trims its idle tiers,
releases the texture caches, retries device-local memory and places the
image in host memory only when that retry is refused too. Block and depth
plane copies no longer fall back on their first refusal.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas 9b2339e735 fix(agc): reclaim the buffer pool before placing an attachment in host memory
Render, depth and multisampled targets and attachment proxies that the
driver refuses device memory now go through the buffer pool's recovery:
the pool releases its idle allocations and the attachment is retried in
device-local memory. Only a second refusal places it in host memory, and
that placement is logged with the bytes reclaimed.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas 79b6f79745 fix(agc): fall back to host memory for render, depth and copy images refused device memory
Depth targets, depth plane copies, multisampled and render targets, block and
depth copies and attachment proxies allocated device-local memory without the
fallback, so a full device-local heap still stopped the title at them.
2026-10-18 19:29:47 +02:00
Gustavo Ariel Gamarra Rojas ad11cb1b3e fix(agc): place device memory in host memory when the driver refuses a device-local allocation
The budget check in DeviceMemoryType trusts VK_EXT_memory_budget, which lags
behind the driver: with the device-local heap nearly full the budget can still
report room, the allocation fails with VK_ERROR_OUT_OF_DEVICE_MEMORY, and the
title stops. Device buffers (after the pool's reclaim and retry), textures and
storage textures now retry in a host memory type allowed by their requirements.
2026-10-18 19:29:47 +02:00
Adrià 218aa8f00b Merge pull request #6082 from meh7an/perf/agc-draw-snapshot-upload-chunk
perf(agc): copy small draw snapshots into a per-recorder upload chunk
2026-10-18 19:28:06 +02:00
AlxcBTW 0730563b1c test(agc): keep the deferred failure report test independent of log coalescing
Identical deferred write-back failure lines are now coalesced, so the
test throws a distinct message per failure to count every printed line.
2026-10-18 19:28:05 +02:00
Adrià 09acc80f7e Merge pull request #6145 from MarcZX10/codex/fix-agc-atomic-gds-size
fix(libSceAgc): reserve complete atomic GDS packets
2026-10-18 19:28:01 +02:00
Dean 19bb30cee8 Merge pull request #7602 from MarcZX10/codex/agc-overlay-test-gpu-selector
fix(tests): honor ANYPS5_GPU in performance overlay fixture
2026-10-19 06:22:32 +13:00
SandstromPLandClaude Opus 5.5 81561867fc Merge upstream/main into fix/relinker-plt-before-code
Resolve the docs/dev/debt/relinker.md conflict with #5994: keep its
sce_module syscall-scan entry, which now also stops at the end of the
last unwind function when the PLT comes before the code (it calls the
same FindSceCodeEnd), and its /libexec/ld-elf.so.1 start in the code
analysis entry, with this PR's end for a PLT before the code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 22:51:57 +05:30
Evgeniy Kazarin 5a1590c9f8 fix(libc): resolve the final Windows path component 2026-10-18 13:15:04 -04:00
MarcZX100 e88f7fc157 fix(libkernel): return errno when Windows CPU clock queries fail 2026-10-18 17:14:22 +00:00
Adrià f03a2da5ee Merge pull request #5668 from babyhuey/fix/libc-keep-host-standard-streams
fix(libc): keep the host standard stream when a guest freopen of it fails
2026-10-18 19:11:47 +02:00
Adrià FranchandClaude Sonnet 5.5 e751268ad9 test(relinker): provide libkernel.prx to the native guest preinit load
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-18 19:09:58 +02:00
Ayamullah Khan 6574ade033 fix(relinker): pop the guest preinit thunk registers in reverse order
The Windows deferred preinit thunk pushed r12, r13 and r14 and then
popped r12, r13 and r14, so the caller got r12 and r14 back swapped.
InitializeDeferredModule keeps the module base, table and count live
across the call to the thunk, so a compiler that keeps any of them in
r12 or r14 sees corrupted loader state after opening a deferred module
that has a preinit array. Pop in reverse push order instead and pin the
new bytes in test_guest_preinit.
2026-10-18 19:09:47 +02:00
Ayamullah Khan 36baa5fcad test(relinker): run the guest preinit test with verify_asan_link_order=0
guest_preinit loads the instrumented guest_module_args_host.prx into Python, so in an ANYPS5_ENABLE_ASAN build it needs the same verify_asan_link_order=0 as the other module tests; without it, it fails with "ASan runtime does not come first in initial library list". add_asan_test_options does nothing outside ASan builds.

Signed-off-by: Ayamullah Khan <[email protected]>
2026-10-18 19:09:47 +02:00
Ayamullah Khan 9c43211664 fix(relinker): run guest preinit arrays before the module initializer
Converted guest modules never ran their DT_PREINIT_ARRAY entries: the
reader validated the array and the unused-NID filter kept its targets,
but no writer emitted or ran it. ld.so runs a shared object's preinit
array only for the main executable, so the Linux output runs the
entries from the DT_INIT stub before the module initializer; the macOS
and Windows outputs run them before the initializer in their startup
stubs, and the deferred Windows output exports a thunk that runs them
before the initializer for runtime-loaded modules. A module with a
preinit array and no initializer is still rejected, since the Linux
stub exists only with one.
2026-10-18 19:09:46 +02:00
Adrià 3aebaa7de6 Merge pull request #6124 from yripper/feat/macos-guest-arena
feat(libc): reserve the guest arena on macOS
2026-10-18 19:09:43 +02:00
MarcZX100 40bc17cb86 fix(libkernel): return errno when Windows CPU clock queries fail 2026-10-18 17:04:35 +00:00
Evgeniy Kazarin 87a486fb30 fix(libc): preserve lookup in case-sensitive Windows directories 2026-10-18 13:03:41 -04:00
Evgeniy Kazarin 211af5dc9e chore: record performance-series PR metadata
Complete the publication checklist and series cross-links for #7467.
No source or test changes.
2026-10-18 13:03:41 -04:00
Evgeniy Kazarin cabd834bc5 perf(libc): avoid repeated Windows path component scans 2026-10-18 13:03:41 -04:00
Adrià f890e21a81 Merge pull request #6111 from Kernel-Hunter/fix/rosetta-rdtscp-processor
fix(relinker): report processor 0 from RDTSCP under --to-rosetta
2026-10-18 19:00:12 +02:00
milescovielloandClaude Opus 5.5 de4deb44a1 test(agc): print hex values of failing checks in hex
Four tests printed a value with std::to_string after "0x", so a decimal number
read as a hex one. The anchor of a differing anchored BDA read, guest + 0x100,
was reported as 0x140733498786049 instead of 0x7fff12340101. They now print
these values in hex.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 16:58:32 +00:00
Adrià e1dae23e01 Merge pull request #6107 from YossiYad/fix/libc-closed-standard-descriptors
fix(libc): open closed standard descriptors on /dev/null when libc loads
2026-10-18 18:58:19 +02:00
Adrià 84b7ef9de3 Merge pull request #6181 from MarcZX10/codex/document-guest-clock-scale-6172
docs(dev): describe the guest clock scale switch
2026-10-18 18:58:07 +02:00
Adrià b5ab10185b Merge pull request #6121 from fdfawef324/claude/mc-np-state-callbacks
feat(libSceNpManager): register NP state callbacks and report signed-out from sceNpCheckCallback
2026-10-18 18:57:53 +02:00
AlxcBTW 78869e5a47 test(libc): drop the stack bound case, it also passes without the bound 2026-10-18 18:57:49 +02:00
milescovielloandClaude Opus 5.5 1f9ac40808 fix(shader): print the shader hash of a SPIR-V emission failure in hex
The SPIR-V emission failures printed the shader hash with std::to_string
after "hash=0x", so the hash read as a hex number that was the decimal one.
Shader 0x1173ae1000 was reported as hash=0x74955231232. Both now print it in
hex, as the driver's own messages print the shader address.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-18 16:56:23 +00:00
Adrià e1338ff5ea Merge pull request #5999 from mazen320/fix/retroarch-windows-select-and-8_8-uint
fix(libkernel,agc): unblock RetroArch Windows select and 8_8 UINT
2026-10-18 18:53:13 +02:00
AlxcBTW 6af893fea4 Merge main into fix/bda-unaligned 2026-10-18 18:53:03 +02:00
Adrià FranchandClaude Sonnet 5.5 827df2d907 fix(libSceAudioOut): lock the per-port output mutex in sceAudioOutSysClose
main replaced g_outputMutex with g_outputMutexes[], so the Sys close no longer compiled. Mirror sceAudioOutExClose: range-check the handle, lock its mutex.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-18 18:52:46 +02:00
primesoul-web 5dd106ef20 test(libs): assert the GameUpdate null-label error and pin the mastering states layout
guest_gameupdate still asserted the throw that sceGameUpdateGetAddcontLatestVersion
no longer raises for a null entitlement label since it answers 0x80412803, so the
test aborts; it now asserts the error, the same change #5919 makes. The mastering
states layout is pinned with compile-time size checks for the descriptors, the
compressor and limiter states and both states structs, as #6380 suggested.
2026-10-18 18:52:36 +02:00
primesoul-web 3f03bc0e24 feat(libs): finish the CesCs conversions and the AudioOut, AudioIn and GameUpdate exports
libSceCesCs goes to 17 of 17: three-byte EUC-JP JIS X 0212 (0x8F)
characters convert through a table read from the Unicode consortium's
JIS0212.TXT, both directions, so sceCesEucJpToUcs2, the MbcsStrTo*
and *Get*Len forms and the context conversions accept them, and a
character with cells in both JIS X 0208 and JIS X 0212 still encodes
to the two-byte form. sceCesRefersUcsProfileCp1250 returns a profile
with the Windows-1250 table of Microsoft's bestfit1250.txt, accepted
by the SBC and context conversions.

The AudioOut HDMI bitstream Sys family follows the Ex ports: SysOpen
opens a port only for mode 5, the TrueHD MAT route EVO-PLAYER-PS5
reads from the firmware 12.70 mode tables, paced at 192 kHz with no
host device; SysConfigureOutput accepts the observed HDMI MAT switch;
SysClose closes a Sys port. sceAudioOut2MasteringGetState fills the
states by states id with the descriptors KytyPS5 declares, SetParam
answers a null parameter with the mastering invalid-API-parameter
error, Set3DLatency follows KytyPS5's output validation (0x80268001
above 2, any user), SetSystemDebugState records the debug state id,
and GetSpeakerArrayCoefficients returns the front pair KytyPS5 and
prosper both return.

sceAudioInOpen accepts param 0x10 as float mono like KytyPS5; HqOpen
answers a longer grain or a lower rate with the invalid-size and
invalid-frequency errors; AsyncOpen also accepts the 384-sample grain
SharpProspero documents. sceGameUpdateGetAddcontLatestVersion answers
a null entitlement label with 0x80412803, as prosper does.
2026-10-18 18:52:36 +02:00
AlxcBTW 5dbdd6b797 Merge main into pr/input-analog-keys 2026-10-18 18:51:35 +02:00
Adrià FranchandClaude Sonnet 5.5 3b5c41b20f fix(libc): ilogb special cases match PS5 libc.prx (0 -> INT_MIN, inf/NaN -> INT_MAX)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-18 18:49:34 +02:00