Commit Graph
6138 Commits
Author SHA1 Message Date
Adrià FranchandClaude c572650575 test(libkernel): cover a sub-page shared backing offset and a gap after a direct mapping
Co-Authored-By: Claude <[email protected]>
2026-10-07 23:16:22 +02:00
Adrià FranchandClaude 0ed9059ff8 test(agc): enable dma-buf imports in the recorder test device
Co-Authored-By: Claude <[email protected]>
2026-10-07 23:14:53 +02:00
ChadandClaude Opus 5.5 b950ecd7e4 docs(agc): keep the swizzle equation table header as on main
The conventions check rejects changed code comments without a
TechnicalDebt change; the header line only listed the new modes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 16:11:05 -05:00
Claude ace10fdba3 feat(agc): detile the display, T and 4 KiB XOR swizzle modes
Textures in SW_256B_D, SW_4KB_D, SW_64KB_D, SW_64KB_S_T, SW_64KB_D_T,
SW_4KB_S_X and SW_4KB_D_X (tile modes 2, 6, 10, 17, 18, 21 and 22)
threw while their T# was decoded. They are detiled with address
equations generated from AMD addrlib's GFX10 swizzle patterns for the
same 16-pipe non-RB+ configuration as the 64 KiB XOR table, and share
the block shape and mip tail placement of the standard mode of their
block size. The pipe/bank XOR base check of the XOR and T modes now
uses the block size.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 16:11:05 -05:00
alfalfa-starandClaude Opus 5.5 00e6d078cb fix(agc): keep dma-buf imports write-watched when they leave write protection intact
The import write-watch probe imports private anonymous scratch pages
through VK_EXT_external_memory_host. On amdgpu that path resolves the
pages' write protection (the userptr is revalidated at every submission),
so the probe decides that imported ranges are compared instead of
watched, and every import is unwatched. Shared direct memory is never
imported that way: its imports go through udmabuf, which takes the
memfd's pages without touching the process page tables. Unwatching them
anyway left every surface in direct memory without write stamps: each
storage image refresh re-uploaded the whole surface ("untracked"), and
draw snapshots of imported ranges could never be reused. On PPSA14632
that was over 800 GiB of uploads in 90 s.

- HostImport records whether it is a dma-buf import, and the import
  decides watch or unwatch after the import by its kind (ImportWatched
  already absorbs the pages the import itself touches).
- A second probe, ProbeDmaBufImportWriteProtection, imports a sealed
  shared memfd scratch range through udmabuf: dma-buf imports stay
  watched when a GPU read of it marks no page written and a CPU store
  after that is still collected. Otherwise, or when the probe fails,
  they are compared like host-pointer imports.
- Both probes also report whether a CPU store after the GPU read was
  collected (ImportProbe::writtenByCpu).
- APS5_WRITE_WATCH_IMPORTS=watch or unwatch overrides both kinds.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 23:09:26 +02:00
alfalfa-starandClaude Opus 5.5 815d274736 feat(agc): import shared direct memory through udmabuf on Linux
On Linux, direct memory is a memfd mapped MAP_SHARED. amdgpu accepts only
private anonymous memory for a host pointer import (libdrm sets
AMDGPU_GEM_USERPTR_ANONONLY), so every import of direct memory failed with
VK_ERROR_INVALID_EXTERNAL_HANDLE and its ranges were copied.

When a host pointer import fails, the range's memfd slice is turned into a
dma-buf through /dev/udmabuf and imported with VK_EXT_external_memory_dma_buf.
The direct memory backing is sealed against shrinking and growing, as
udmabuf requires. libkernel reports the backing of a guest range through
GuestArenaSharedBacking. Without /dev/udmabuf, or past its size limit, the
range is copied as before. APS5_TRACE_HOST_IMPORT now prints the mappings
behind a failed import on Linux too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 23:09:16 +02:00
ChadandClaude Opus 5.5 f4edc9ae92 fix(recompiler): split image reads whose descriptor is a web of SRT Phis
SplitDescriptorPhi (#414) handles a T# or S# that is a Phi of SRT reads in
one block. A descriptor picked inside a loop through a jump table reaches
the read as a chain of Phis rooted at the loop header, so the plan threw
"GetImageResource dword 0 is not a valid runtime value".

When the one-block split does not apply, walk the descriptor dwords
together through the Phi web, give each distinct SRT descriptor an arm,
build a U32 selector Phi web carrying the arm index, and select between one
copy of the read per arm. Paths whose dwords hold a program-counter, EXEC
or ballot value fold onto the first arm (listed in TechnicalDebt); any
other descriptor that cannot be recomputed still throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 16:07:43 -05:00
Scott SchusterandClaude Opus 5.5 1dca7b4f40 perf(recompiler): load the written-page slot before the CAS
note_bda_write ran a device-scope compare-exchange on every probe, also
when the slot already held the page. The table lives in host-visible
memory, so each BDA store paid an atomic across PCIe, and nearly every
store hits a page an earlier store noted. Load the slot first and only
compare-exchange when it does not hold the page. The slots probed, the
pages recorded and the overflow report are unchanged.

DOOM (PPSA99666) presents through a compute kernel that stores about two
million pixels through raw pointers per frame: 248 ms per dispatch
before, 8.1 ms after, on an RTX 5070 Ti.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 16:07:13 -05:00
Claude 495aa94ec4 feat(shader): implement 1D array gathers
image_gather4_lz(_o) on a 1D array view threw. The 1D gather emulation
now takes the width from the array view's size, keeps the layer
coordinate and samples both texel centres of that layer, so 1D array
gathers return the same footprint as 1D ones.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 23:01:09 +02:00
Adrià 6c48acecb3 Merge pull request #285 from SP4C3B4R-8/feat/gds-guest-memory
feat(libSceAgcDriver): back the global data share with driver-owned guest memory
2026-10-07 23:00:32 +02:00
Adrià 2b9cd26dbe Merge pull request #933 from CnRJay/feat/agc-3d-xor-swizzle
feat(agc): detile 3D textures in SW_64KB_Z_X and SW_64KB_S_X
2026-10-07 22:53:31 +02:00
popcoder565 2e60f5585e refactor(recompiler): keep the BDA byte write helper beside the store path
The declaration, the state field and the definition of write_bda_bytes now sit next to EmitBdaStore and the other BDA write functions instead of next to the dword read functions, which #1267 extends at the same lines. No change to the emitted code.
2026-10-07 16:49:06 -04:00
Adrià 400ba7f5ec Merge pull request #924 from Adin-bima/feat/np-get-np-id
feat(libSceNpManager): implement sceNpGetNpId
2026-10-07 22:48:19 +02:00
Adrià 629724f103 Merge pull request #931 from CnRJay/feat/agc-1d-array-textures
feat(agc): implement 1D array textures
2026-10-07 22:43:42 +02:00
Celegans12 9af8e9e9f6 fix(agc): bound the upload buffers that recorder batches keep alive
A sampled texture upload keeps its staging, tiled and linear buffers
until the batch that recorded it completes. A draw whose image table
uploads thousands of textures records them all into one open batch,
so in PPSA26344 6.6 GiB of device buffers were live when the next
texture allocation failed with VK_ERROR_OUT_OF_DEVICE_MEMORY.

Recorder::Keep now takes the bytes an object holds, and the sampled
upload and the storage upload and write-back scratch paths pass theirs.
Before each sampled or storage texture lookup, BoundKeptBytes submits
the open batch once it keeps 512 MiB. While the batches in flight and
those a sync or reap of this hold already finished keep more than twice
that, it destroys the finished ones' objects, then waits for the oldest
in flight and releases its objects at once instead of at the unlock.
agc_recorder_kept_bytes checks these bounds on a mock device.
2026-10-07 22:37:12 +02:00
Celegans12 14b4edda8d fix(agc): allocate oversized descriptor sets from a dedicated pool
DescriptorCache::Allocate returned no set when a set needed more
descriptors of one type than a chain pool holds (4,096 storage
buffers, 1,024 sampled or storage images, 512 samplers). A build's
own set then fell back to a pool of its own, but PrepareDrawBindings
has no fallback and threw "draw snapshot descriptor allocation
failed", so a recorded draw with such a set and a snapshotted input
was skipped.

Such a set now gets a pool sized to it (maxSets 1, no
FREE_DESCRIPTOR_SET_BIT), which Free destroys. Every set's count of
each type is first checked against the device's maxDescriptorSet*
limit; other descriptor types throw. The [descriptors] profile line
counts the dedicated pools.
2026-10-07 22:37:10 +02:00
Adrià 2cc5735d30 Merge pull request #913 from adriadam10/feat/agc-submit-multi-acbs
feat(libSceAgcDriver): implement sceAgcDriverSubmitMultiAcbs
2026-10-07 22:29:47 +02:00
Adrià fb0d627ff6 Merge pull request #839 from merwie/fix/audioout2-read-grain-at-playback
fix(audioout2): read grains at the next push and play them behind a cushion
2026-10-07 22:29:12 +02:00
Adrià e674a6384d Merge pull request #760 from merwie/feat/kernel-raise-exception-windows
feat(libkernel): deliver sceKernelRaiseException on Windows
2026-10-07 22:27:39 +02:00
Adrià 832247b0a0 Merge pull request #283 from SP4C3B4R-8/fix/fiber-windows-stack
fix(libSceFiber): pin fiber contexts writable under write tracking on Windows
2026-10-07 22:25:25 +02:00
Dean 43b01023e6 Merge pull request #1084 from MathiasDevelopes/claude/mingw-link-flags
build(libs): strip the MinGW static runtime flags once for all libraries
2026-10-08 09:24:20 +13:00
Dean 9e965c5cd2 Merge pull request #1115 from Fishybeing/fix/rtld-nominmax
build(windows): guard NOMINMAX in Rtld.cpp
2026-10-08 09:23:49 +13:00
Dean 91b6a46222 Merge pull request #1197 from gookie-dev/fix/ngs2-state-outlives-exit
fix(libSceNgs2.native): keep the system list and its mutex alive through static teardown
2026-10-08 09:23:17 +13:00
Adrià 003e699b27 Merge pull request #910 from Pacuka/feat/smurfs-exports
feat(libs): add sceAudioInAsyncOpen and sceHttp2SetMinSslVersion
2026-10-07 22:23:15 +02:00
Dean 7e7ef7a73f Merge pull request #1247 from gjonn/feat/razorcpu-plot-value-bookmark
feat(libSceRazorCpu): add sceRazorCpuPlotValue and sceRazorCpuWriteBookmark
2026-10-08 09:22:46 +13:00
Dean f870e25588 Merge pull request #1222 from gjonn/fix/kernel-close-bad-descriptor
fix(libkernel): return EBADF from sceKernelClose for a descriptor that is not open
2026-10-08 09:22:15 +13:00
Dean 76543c2e89 Merge pull request #1020 from gjonn/feat/ngs2-parse-waveform-file
feat(libSceNgs2.native): implement sceNgs2ParseWaveformFile and parse 16-bit PCM waveforms
2026-10-08 09:21:16 +13:00
Adrià d964601c08 Merge pull request #844 from merwie/feat/agc-get-eq-context-id
feat(agc): implement sceAgcDriverGetEqContextId
2026-10-07 22:21:01 +02:00
Adrià d1750c665c Merge pull request #842 from merwie/fix/appcontent-no-download-data
fix(appcontent): report no download data space without a declared area
2026-10-07 22:18:48 +02:00
popcoder565 a4643ede97 perf(recompiler): probe the written-page slots of a BDA write in a loop
note_bda_write unrolled its 8 compare-exchange probes, and drivers inline it at every BDA store and atomic. The probes now run in a loop that tries the same slots in the same order and stops at the same slot, so the recorded pages and the overflow flag are unchanged. With the byte store helper, the agc_driver_flat_store binaries on an RTX 3060 go from 138,240 to 75,648 bytes (wave32) and from 225,152 to 130,560 bytes (wave64), and the cold run from 2.2 s to 1.2 s.
2026-10-07 16:18:43 -04:00
popcoder565 70a8844089 perf(recompiler): emit BDA byte stores through one looping helper
Every 8- and 16-bit BDA store and the unaligned path of every 32-bit store emitted one get_bda_write_pointer lookup and one note_bda_write per byte at the store site, five write lookups per 32-bit store. They now call write_bda_bytes, which loops over the bytes and does, per byte and in order, the same lookup, the store when it is mapped and the write note, so faults are recorded exactly as before. On an RTX 3060 the agc_driver_flat_store binaries shrink from 496,256 to 138,240 bytes (wave32) and from 928,384 to 225,152 bytes (wave64), and the cold run from 19.7 s to 2.2 s.
2026-10-07 16:18:43 -04:00
MerijnandClaude Opus 5.5 cd7735ceab fix(audioout): drop captured buffers of a port whose slot was reused
A captured grain stored only the port slot and data pointer, so a port
created in a destroyed port's slot before the next push mixed the old
pointer with its own format. Ports now carry a generation that the
capture records. TechnicalDebt notes that the last grain pushed before a
title stops is never played.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:13:30 +02:00
Celegans12 a0d4b45591 fix(shader): mask EXEC copies to the host subgroup's lanes
A wave64 graphics program on a 32-lane host runs one guest lane per
invocation, yet an EXEC written as a value keeps all 64 bits: the NGG
prologue's s_lshr_b64 exec, -1, 64 - count reads count 0 and sets -1.
A waterfall loop that copies EXEC with s_mov_b64 and retires one key
per pass then never empties its copy, since no ballot sets the lanes
the host lacks, and its v_readlane picks lane 32 and up.

readRawU32 now ANDs EXEC with a ballot of true when it is read as a
value (s_mov_b64, ALU sources, src_execz), and s_*_saveexec and
s_*_wrexec store that masked copy. EXEC's own words, threadBit and the
saveexec combination keep the raw words, so s_orn2_saveexec_b64 vcc,
exec still sets all 64 bits. On subgroups under 32 lanes the EXEC_LO
copies of agc_driver_scalar_sop1 now hold only the subgroup's lanes.
2026-10-07 22:11:59 +02:00
eliasbruno124-dev 971099aa15 fix(net): provide IPv6 unspecified address object 2026-10-07 22:11:33 +02:00
MerijnandClaude Opus 5.5 2654e3a4ca fix(kernel): drain raised exceptions when leaving an alertable wait
A raise that suspends the thread after its wait returned but before the
wait count drops queued an APC that only ran at the next alertable wait.
Pending APCs are now run right after the count drops. The 0 ms poll in
Condition::waitSignalUntil runs under queueLock and is no longer
alertable, and a target that exits during the raise returns ESRCH.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:11:29 +02:00
SP4C3B4R-8andClaude Opus 5.5 faa1cc59e1 test(libSceAgcDriver): run ds_append and ds_consume on the GDS through DMA_DATA
Counters are set with DMA_DATA immediate to GDS and read back with
DMA_DATA GDS to memory around two dispatches each of wave32, wave32 with
a partial EXEC, two wave32 waves in one group and wave64 with a partial
EXEC across both halves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:08:04 +02:00
krishnarayaandClaude Opus 5.5 33fe81b6f2 test(agc): skip the f64 and shader clock execution tests on devices without the feature
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-07 16:07:12 -04:00
Bloxive 457f852944 fix(libkernel): reject leading-zero numbers in param.json 2026-10-07 16:06:40 -04:00
Sanjaysrinivas dbf10824a7 docs(shader): avoid src2 PR overlap 2026-10-07 22:06:03 +02:00
Adrià FranchandClaude 78193c10f8 feat(libSceAgcDriver): implement sceAgcDriverSubmitMultiAcbs
Co-Authored-By: Claude <[email protected]>
2026-10-07 22:04:58 +02:00
Adrià c5e10184a2 Merge pull request #819 from ebosido444-ai/fix/overlap-multiline-depends
fix(tools): read multi-line Depends on lists in pr_overlap
2026-10-07 22:03:32 +02:00
Adrià db06102352 Merge pull request #375 from MichonGoddijn231849/fix/fragment-interface-validation
fix(agc): fragment SampleId, Layer, FragDepth and SampleMask interfaces
2026-10-07 22:02:11 +02:00
Adrià FranchandClaude 5b28b82af2 fix(libs): give sceAudioInAsyncOpen its signature and move the Http2 TechnicalDebt line
Co-Authored-By: Claude <[email protected]>
2026-10-07 22:01:29 +02:00
PacukaandClaude Opus 5.5 23398893cd feat(libs): add sceAudioInAsyncOpen and sceHttp2SetMinSslVersion
The Smurfs Dreams imports both and no library exports them, so eager
binding stops the title before it starts. sceAudioInAsyncOpen throws
like the other AudioIn opens that have no implementation;
sceHttp2SetMinSslVersion returns success like the other Http2 SSL
setters, as no request reaches the network.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:01:17 +02:00
SP4C3B4R-8andClaude Opus 5.5 7e7702c706 fix(libSceAgcDriver): keep the global data share out of the flexible memory budget
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:01:05 +02:00
SP4C3B4R-8andClaude Opus 5.5 a68b3481ab feat(libSceAgcDriver): back the global data share with driver-owned guest memory
Shader GDS accesses bind the same 64 KiB guest range that DMA_DATA packets
read and write, so both go through the existing CPU/GPU coherence tracking.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 22:01:04 +02:00
MathiasDevelopesandClaude Opus 5.5 e482eef759 feat(libSceAudioOut): accept sceAudioOut2MasteringSetParam
The host mixes without the console's mastering stage, so the mastering
parameters have nothing to configure, as with sceAudioOut2MasteringInit.
Accept them instead of aborting, keep throwing for a null parameter
block, and record SetParam next to MasteringInit in TechnicalDebt.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-10-07 21:58:15 +02:00
SP4C3B4R-8andClaude Opus 5.5 78cb1598ce test(libc): pinned shared pages stay writable and are collected as written
Also unpin the previous context when a fiber object is initialised again
without being finalised.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 21:57:20 +02:00
Adrià FranchandClaude b540327c29 docs(agc): keep the updated sceAgcDriverGetEqContextId TechnicalDebt entry
Co-Authored-By: Claude <[email protected]>
2026-10-07 21:53:35 +02:00
MerijnandClaude Opus 5.5 a089fe16ba test(agc): cover the misaligned event and the delivered context id
sceAgcDriverGetEqContextId is now checked with a misaligned event like
sceAgcDriverGetEqEventType, and on the end-of-pipe events the submit
test delivers: a graphics interrupt reports context 0 and a compute
interrupt context 0x20, the queues that raised them. The TechnicalDebt
line says why ident is returned and that KytyPS5 returns the event's
data instead.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-07 21:53:21 +02:00