Commit Graph
1268 Commits
Author SHA1 Message Date
Dean 7c4ff2df70 Merge pull request #464 from oneandonlydean/fix/relinker-exact-reciprocals
fix(relinker): lower VRSQRTPS and VRCPPS to correctly rounded results for --to-intel
2026-10-04 14:45:23 +13:00
Dean Galvin 097566d547 fix(relinker): lower VRSQRTPS and VRCPPS to correctly rounded results for --to-intel
RSQRTPS and RCPPS are approximations whose low bits differ between Intel
and AMD. Intel returns 0x3F7FF000 for 1/sqrt(1.0), and two Newton-Raphson
steps on it settle on 0.99999994 instead of 1.0. PPSA21564 renormalises
its spring quaternions that way: an identity quaternion keeps w at
0.99999994 with a zero axis, its axis-angle conversion then normalises the
zero axis into NaNs, and the NaN bone poses reach keyframed physics bodies.
A NaN body later moves to an invalid broadphase cell and the game crashes
a few seconds into its hub level.

--to-intel now replaces the VEX.128 register forms with an out-of-line stub
that computes 1/sqrt(x) with SQRTPS and DIVPS (1/x with DIVPS), keeping
the upper half of the destination cleared and the scratch register intact.
A site with no room for the jump, including one followed by a branch
target or a RIP-relative instruction, keeps the native instruction and is
reported as kept instead of failing the relink.
2026-10-04 14:40:16 +13:00
Dean 396b282315 Merge pull request #339 from DotDebian/feat/cpu-time-clocks
feat(libkernel): support the CPU-time clocks in clock_gettime and clock_getres on Windows
2026-10-04 14:21:40 +13:00
Dean 40a9e455ea Merge pull request #430 from adriadam10/feat/relinker-sha1-lowering
feat(relinker): lower SHA-1 instructions for --to-intel
2026-10-04 14:14:08 +13:00
Dean fafec33471 Merge pull request #380 from DotDebian/fix/progress-count-sopp-shared-opcodes
fix(tools): count the debug branches and s_ttracedata_imm as decoded shader instructions
2026-10-04 14:13:51 +13:00
Dean e6505d8a93 Merge pull request #312 from RomainROCH/codex/fix-save-memory-metadata
fix(savedata): report memory metadata write failures
2026-10-04 14:13:01 +13:00
Dean 7384588c35 Merge pull request #411 from MichonGoddijn231849/fix/writelane-ignores-exec
fix(shader): v_writelane_b32 ignores EXEC
2026-10-04 14:06:16 +13:00
Dean d77b96fd44 Merge pull request #403 from MichonGoddijn231849/perf/pending-image-index
perf(agc): index the pending storage images by guest range
2026-10-04 14:06:00 +13:00
Dean d43b12c34e Merge pull request #433 from adriadam10/fix/relinker-sse4a-upper-qword
fix(relinker): zero dst[127:64] in EXTRQ and INSERTQ lowerings
2026-10-04 14:05:41 +13:00
Dean 40b1c7a6f9 Merge pull request #432 from adriadam10/fix/relinker-vex-rip-relative
fix(relinker): report RIP-relative operands of VEX, EVEX and 0F38/0F3A instructions
2026-10-04 14:05:25 +13:00
Dean deb7e0dfff Merge pull request #363 from DotDebian/test/sopk-cmpk-compares
test(shader): cover the s_cmpk compares and count them as tested variants
2026-10-04 14:05:04 +13:00
Dean ad473fa569 Merge pull request #389 from DotDebian/feat/mimg-sample-d-cl-o
feat(shader): decode image_sample_d_cl_o
2026-10-04 14:04:47 +13:00
Dean 0207f9ca9a Merge pull request #388 from DotDebian/fix/mimg-sample-lod-clamp
fix(shader): let image samples clamp their LOD on devices with shaderResourceMinLod
2026-10-04 14:04:31 +13:00
Dean 0df090c30b Merge pull request #386 from DotDebian/feat/vop3p-integer-dot
feat(shader): implement the integer dot products
2026-10-04 14:04:14 +13:00
Dean ea07493147 Merge pull request #372 from DotDebian/feat/shader-s-wakeup
feat(shader): decode s_wakeup as a no-op
2026-10-04 14:03:57 +13:00
Dean b19e9761fa Merge pull request #348 from julienlgy/feat/lib-sce-audio3d-port-close
feat(libSceAudio3d): add missing sceAudio3dPortClose stub
2026-10-04 14:03:40 +13:00
Dean 1137cffb72 Merge pull request #429 from RomainROCH/codex/fix-rfc3339-offsets
fix(rtc): reject invalid RFC 3339 timezone offsets
2026-10-04 14:03:23 +13:00
Dean 1964aad443 Merge pull request #428 from RomainROCH/codex/fix-posix-semaphore-limits
fix(libkernel): enforce POSIX semaphore count limits
2026-10-04 14:03:06 +13:00
Dean 12db9a8fcf Merge pull request #420 from MichonGoddijn231849/fix/ajm-batch-job-size
fix(ajm): a decode job fits the 64-byte batch titles allocate
2026-10-04 14:02:48 +13:00
Dean dfac4ab1ec Merge pull request #412 from arreina/pr/pixel-position-export
fix(shader): reject position exports without vertex input info
2026-10-04 14:02:31 +13:00
Dean e656baf20b Merge pull request #398 from Pouare514/fix/libc-fopen-enoent
fix(libc): return NULL with ENOENT for missing files in fopen
2026-10-04 14:02:14 +13:00
Dean d0bec2e448 Merge pull request #378 from DotDebian/fix/posix-file-errno
fix(libkernel): return -1 and set errno from the POSIX open, stat, unlink and rmdir
2026-10-04 14:01:57 +13:00
Dean a6cdfa1c7f Merge pull request #352 from arreina/pr/savedata-delete-dir-name
fix(savedata): reject invalid directory names in sceSaveDataDelete
2026-10-04 14:01:40 +13:00
Dean e5676b3f0e Merge pull request #315 from RomainROCH/codex/fix-semaphore-overflow
fix(libkernel): avoid semaphore count overflow
2026-10-04 14:01:19 +13:00
Dean e50c18a42d Merge pull request #314 from RomainROCH/codex/fix-fgetpos-error
fix(libc): propagate file position errors
2026-10-04 14:01:01 +13:00
Dean 1dd1be67e3 Merge pull request #262 from RomainROCH/codex/fix-aligned-delete
fix(libc): release aligned allocations through the application heap
2026-10-04 14:00:42 +13:00
Dean 85959469a4 Merge pull request #478 from oneandonlydean/fix/libc-unwind-c-personality
fix(libc): run the cleanups of frames that use the C personality
2026-10-04 11:34:58 +13:00
Dean 1e54dae613 Merge pull request #466 from oneandonlydean/perf/agc-shared-dcc-keys
perf(agc): keep a surface's storage image when another descriptor names uncompressed DCC keys
2026-10-04 11:34:41 +13:00
Dean 53d1ebc10f Merge pull request #459 from oneandonlydean/perf/agc-own-stack-verify
perf(agc): answer verifications of the caller's own live stack without a page query
2026-10-04 11:34:24 +13:00
Dean c416d9e221 Merge pull request #458 from oneandonlydean/perf/agc-dcc-keys-without-wait
perf(agc): read DCC keys behind the driver's own pending key store without a wait
2026-10-04 11:34:07 +13:00
Dean 0990e9a695 Merge pull request #456 from oneandonlydean/feat/shader-replay-code-words
feat(agc): let agc_shader_replay write a request's code words for other disassemblers
2026-10-04 11:33:49 +13:00
Dean 7fc6f0e10c Merge pull request #445 from oneandonlydean/fix/recompiler-readfirstlane-empty-exec
fix(recompiler): v_readfirstlane_b32 of an empty EXEC reads lane 0
2026-10-04 11:33:32 +13:00
Dean b6673c793c Merge pull request #444 from oneandonlydean/perf/agc-lazy-check-messages
perf(agc): build check failure messages only when a check fails
2026-10-04 11:33:15 +13:00
Dean 98004c632d Merge pull request #443 from oneandonlydean/fix/agc-write-data-pfp
fix(agc): accept WRITE_DATA with ENGINE_SEL = PFP
2026-10-04 11:32:58 +13:00
Dean d8e2609831 Merge pull request #442 from oneandonlydean/fix/agc-host-page-query-gap
fix(agc): describe the pages after a gap in a Linux host page query
2026-10-04 11:32:41 +13:00
Dean be7d33be9c Merge pull request #441 from oneandonlydean/fix/agc-partial-block-write-coverage
fix(agc): keep a surface's results in the 64 KiB block it shares with its neighbour
2026-10-04 11:32:24 +13:00
Dean 3bc8e94324 Merge pull request #439 from oneandonlydean/fix/agc-dma-copy-on-gpu
fix(agc): record large memory-to-memory DMA_DATA copies on the GPU in queue order
2026-10-04 11:32:07 +13:00
Dean 1961af9f9c Merge pull request #415 from oneandonlydean/perf/recompiler-srt-memo-table
perf(recompiler): memoize SRT evaluation in a flat table and inline IrValue's hot accessors
2026-10-04 11:31:50 +13:00
Dean 27c5026367 Merge pull request #414 from oneandonlydean/fix/recompiler-descriptor-phi-split
fix(recompiler): split image reads whose T# or S# is a Phi of SRT reads
2026-10-04 11:31:33 +13:00
Dean 0990ee4e93 Merge pull request #410 from oneandonlydean/perf/agc-interleaved-vertex-copy
perf(agc): copy the interleaved attributes of a vertex buffer once per draw
2026-10-04 11:31:16 +13:00
Dean d8243c3502 Merge pull request #418 from oneandonlydean/fix/relinker-linux-argv
fix(relinker): hand the guest the real argv on Linux
2026-10-04 11:30:37 +13:00
Dean 7f5c3ec9b7 Merge pull request #417 from oneandonlydean/fix/agc-flip-after-gpu
fix(agc): complete a flip only once the frame's GPU work has finished
2026-10-04 11:30:22 +13:00
Dean fc2cbb25ac Merge pull request #413 from oneandonlydean/fix/recompiler-early-return-merge
fix(recompiler): give an early-return selection that joins its parent's merge a merge of its own
2026-10-04 11:30:06 +13:00
Dean ef1d2c03bc Merge pull request #408 from oneandonlydean/perf/agc-flat-queue-registers
perf(agc): keep a queue's registers in flat arrays instead of a std::map
2026-10-04 11:29:51 +13:00
Alexey ccd60ce0ca Merge pull request #477 from oneandonlydean/ci/lavapipe-avx-caps
ci: run lavapipe at the AVX level on every Linux runner
2026-10-03 22:50:16 +03:00
Dean Galvin 1e945e7615 ci: run lavapipe at the AVX level on every Linux runner
agc_driver_vopc_compare failed on every Linux runner with an
AVX512-FP16 Xeon (Sapphire, Emerald and Granite Rapids) and passed on
AMD EPYC and Ice Lake runners. Ubuntu 24.04's lavapipe compiles with
LLVM 20.1.2, which on these CPUs merges a masked fcmp ult/uge on half
vectors with the same compare of swapped operands, so v_cmp_nle_f16,
v_cmp_nlt_f16 and v_cmpx_nle_f16 return the result of their mirror.
The recompiler's SPIR-V is the same on every device and correct.

GALLIUM_OVERRIDE_CPU_CAPS=avx keeps LLVM off AVX-512, so every runner
compiles the tests the same way.
2026-10-04 06:08:37 +13:00
Dean Galvin 6670c52571 fix(libc): run the cleanups of frames that use the C personality
GCC gives C code built with -fexceptions, and cleanup-only functions
after link-time optimization, the C personality __gcc_personality_v0.
The unwinder accepted only its own C++ personality, so an exception
thrown through such a frame was never caught.

libc now provides the C personality, which never catches and installs
the frame's cleanup landing pad in the cleanup phase, and the unwinder
calls it for those frames.
2026-10-04 05:32:55 +13:00
Dean Galvin a431082abc perf(agc): keep a surface's storage image when another descriptor names uncompressed DCC keys
PPSA21564's galaxy map renders a 1920x1080 surface as a color target whose
CB names DCC keys at one address and then writes it from a compute shader
whose T# names keys at another. Both key ranges read uncompressed every
frame, but the storage cache remade the surface's image whenever a
descriptor named metadata other than the image's, so the image was
flushed, destroyed, created and uploaded twice a frame (1231 constructions
in a 56 s scene), with the views and draw recipes built on it thrown away
each time.

A descriptor naming other keys now keeps the image when the move is
unobservable: the image's own keys and the named keys both read
uncompressed, and its content was neither uploaded nor filled under a
clear code. That is exactly the content an image made under the named
keys would hold once this one's pending results were stored. Any other
case (a fast clear of either key range, a register clear, an image
holding a clear) still remakes the image as before, so clears of the new
keys reach it and pending results are stored first.

Every proof that stands in for a lookup checks the same rule: the sampled
view hit, the fast revalidation of views and storage elements (storage
elements now record their descriptor's keys), the own-object refresh, and
the draw recipe's resident targets. Named-key scans keep per-image proofs,
so a repeated check costs no scan while the key bytes are unstamped.

agc_dcc_key_sharing drives KeysServeSurface, the rule ServesKeysAt uses,
through a model of the storage cache.
2026-10-04 03:20:46 +13:00
Dean Galvin 5a8165282f perf(agc): answer verifications of the caller's own live stack without a page query
Driver::Submit checks the title's submission packet, which the title
passes on its own thread stack. Host thread stacks are neither registry
mappings nor write-watched, so no page-state cache covers them and on
Linux every check scans /proc/self/maps line by line: about 1.5 ms per
submission on the render thread of PPSA21564 (66% of that thread's
samples in perf at the title).

A range between the calling thread's current frame and its stack's top
holds the frames of every caller, so it is mapped readable and writable
for as long as the call lasts; verify() now accepts it without a query.
A thread on another stack (a fiber's, a signal stack) has its frame
outside the thread's bounds and still gets the page query, as does any
range that runs past the stack's top or starts below the frame.

GetCurrentThreadStackLimits needs _WIN32_WINNT 0x0602 on MinGW, as
libkernel already sets; GuestMemory.cpp is compiled by several targets,
so the definition is a property of the source file.
2026-10-04 03:02:25 +13:00
Dean Galvin fb6b131def perf(agc): read DCC keys behind the driver's own pending key store without a wait
A CB metadata pass (and a resident target's register-clear check) read the
DCC keys with CurrentDccKeys, which waited for the GPU whenever recorded
work wrote the key range. In the intro video of PPSA21564 about 800 passes
per 10 s waited about 1.8 ms each, and every one of those waits was behind
a key store whose result the driver already knew: its own uncompressed key
store, or a title fill of uniform keys recorded on the GPU.

Pending-write notes now carry a serial in recording order, and the key
memo remembers the note of the store it describes. When the newest
pending note over the keys is that store's own note, nothing recorded
after it writes the keys, so they read as the store's keys without a
wait. Any later writer, a range the store does not cover, or a unit
shadow over the keys waits as before.
2026-10-03 21:45:10 +13:00