Commit Graph
14017 Commits
Author SHA1 Message Date
Yunus Shaikh 8cd0b37a5f Merge main into fix/agc-defer-unpreparable-abi-stages-v3
Brings #5872 (shader preparation on first use), main's async driver log and its geometry subgroup checks. The prepared-shader modes are the union of both lists. With this branch, the pipeline ABI of a lazily registered shader it cannot prepare leaves the stage deferred instead of throwing, so LazyRegistration now requires the stage to stay deferred with no prepared entry after that call; its dispatch and shutdown failure checks are unchanged. StderrCapture flushes the async log when it starts and before it reads, since a deferral's log line can otherwise still be queued. The undecodable-state check now matches the decode's VGT_SHADER_STAGES_EN reason rather than one message, which main's subgroup output check now gives first.
2026-10-16 06:25:28 -07:00
billybobpicklioandClaude Opus 5.5 2132abc698 test(agc): register the draw descriptor recorder tests with CTest
agc_driver_recorder_tests --draw-descriptors-only (drawDescriptorWriteTests and
drawSnapshotTableSetTests) had no CTest entry, so CI never ran it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 09:17:24 -04:00
Claude 19c82d2ec0 Merge upstream/main into claude/brave-ride-lz92qi
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RoU3ZF76A6uR8sCA7NMLch
2026-10-16 13:08:13 +00:00
Loyalburrito d026466ccf Merge pull request #1 from loyalburrito/claude/brave-ride-lz92qi
feat(ssl): run TLS 1.2 client connections over Mbed TLS
2026-10-16 18:35:46 +05:30
MarcZX100 81e3db853c fix(agc): drain library builds before device replacement 2026-10-16 13:02:11 +00:00
Romans Pokrovskis 7b55f6ffcc test(agc): exercise VCC-backed sampler words on Vulkan 2026-10-16 15:59:37 +03:00
hugodearaujo 5106b98df6 fix(libkernel): count page-table entries the way the console does
A PS5 (firmware 13.60) reports 8192 entries per side. It takes one cpu entry for each 2 MiB granule holding a committed mapping of any protection, and one gpu entry for each 1 GiB region holding a GPU-accessible mapping plus one for each granule of such a mapping that is not a whole granule of direct memory at a 2 MiB-aligned physical address. Shared granules and regions count once. sceKernelGetPageTableStats reported 2048 entries and charged each range per granule, CPU-accessible ones only to the cpu side.
2026-10-16 09:49:46 -03:00
Adrià 82ddae75b6 Merge pull request #6800 from adriadam10/fix/async-log-bounded-atexit
fix(agc): bound the async log's exit flush
2026-10-16 14:30:35 +02:00
Adrià FranchandClaude 37db6a80b7 fix(agc): bound the async log's exit flush
On Windows the atexit handlers of a DLL run after the process has ended
its other threads, so the logger thread can be gone with lines still
queued and the unbounded Flush waits forever (guest_shader_link timed
out on 4 of the last 7 completed main builds since #6371). Run the bounded
FlushAtEnd there instead.

Co-Authored-By: Claude <[email protected]>
2026-10-16 14:30:15 +02:00
simonbronk b0f3ff18a5 fix(release): preflight note destinations before writing 2026-10-16 14:21:40 +02:00
AlxcBTW e74484e0fb perf(agc): spin before blocking on the GPU mutex and the draw committer hand-offs
At the Minecraft Dungeons II title the queue-0 worker, the draw committer and the compute worker
hand work to each other 49,000 times per 10 s through the GPU mutex, the committer's condition
variable and DrawPipeline::Drain, and each hand-off that has to wait costs a kernel wake-up. The
three workers are busy 21-34 % of the time: the GPU idles because the chain of hand-offs is slow,
not because a thread runs out of CPU.

GpuMutexType::lock retries try_lock for a window before it blocks, the committer polls its item
count for the window before it waits on its condition variable, and Drain polls for twice the
window before it waits for the committer. A hand-off that completes within the window costs no
wake-up. The window is 150 us on machines with at least 8 logical processors and 0 below that;
APS5_HANDOFF_SPIN_US sets it (0 turns it off). Ordering and the lock's semantics are unchanged.
The test agc_handoff_spin covers the window policy, the spin helpers and contended locks, and
docs/dev/ARCHITECTURE.md describes the spin.
2026-10-16 14:19:43 +02:00
AlxcBTW 2a15be09c9 perf(agc): pre-sync the DCC key writers of a dispatch's images before the GPU mutex
The stage-A pre-sync of a dispatch listed only the surfaces that stage B reads on the CPU. The DCC
keys of an image that a recorded kernel writes were not in the list, so stage B waited for that
kernel in WaitForKeyWriters with the GPU mutex held and every other worker queued behind the wait.
At the Minecraft Dungeons II title the pre-sync fired once in 296,000 dispatch checks while
WaitForKeyWriters synchronized 400 times per 10 s.

PresyncSurfaces now also returns the key range of every image binding (PresyncSurface::dccKeys).
presync waits for a key range only while recorded work writes it, the key-store memo does not
already give its value (DccKeyWritersPending) and, under the mutex it takes for a moment anyway, the
pending stores do not give the keys either (DccKeyWriterNeedsSync, the test WaitForKeyWriters makes
before it synchronizes). Which keys the dispatch reads, and when, is unchanged: the locked lookup runs
as before and finds nothing pending.

APS5_NO_DCC_PRESYNC=1 leaves the key ranges out. The [presync] line counts key ranges checked,
pre-syncs that only the keys required and the outcomes of WaitForKeyWriters. The test
agc_driver_dcc_key_presync covers a kernel that writes the keys, a recorded fill of the keys and
nothing pending, and skips with the reasons check_skips.py expects when the device has no timeline
semaphores or no host import.
2026-10-16 14:18:46 +02:00
Ondra97 37e62ddb3b fix(savedata): skip identity comparisons for missing paths 2026-10-16 14:16:07 +02:00
Alex ColliniandClaude Opus 5.5 5fb23f78de docs(debt): record how spanned barriers are checked and the full-subgroup rule
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 14:12:58 +02:00
Alex ColliniandClaude Opus 5.5 641e53b5f3 test(agc): run the LDS mask waterfall in both wave modes
The test set neither mode, so ctest ran only the two-lane form. It now
recompiles each program two-lane and then spanned through
SpirvTarget::spannedWaves, checks that the spanned module asks for full
subgroups, and skips the spanned pass on a device without full 32-lane
compute subgroups.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 14:12:58 +02:00
Alex ColliniandClaude Opus 5.5 7a6cc71786 feat(agc): carry spanned waves in the target and require full subgroups
APS5_SPANNED_WAVE is now read once by the driver, which sets
SpirvTarget::spannedWaves only on a device with 32-lane compute subgroup
control and computeFullSubgroups. The recompiler no longer reads the
environment. The field is part of the cache key and of the request
serialization (version 32), so a cached or replayed module keeps the mode
it was built in.

A spanned module numbers its lanes SubgroupId * 32 +
SubgroupLocalInvocationId, which needs two full 32-lane subgroups. The
artifact records this as fullSubgroups (disk cache and pipeline identity
included), and the driver creates those pipelines with
REQUIRE_FULL_SUBGROUPS. Compute pipeline captures accept the flag with a
required subgroup size.

The two-lane fallback now catches only SpannedWaveUnsupported, thrown for
a shuffle wider than 32 bits; other emit errors surface as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 14:12:58 +02:00
Yunus Shaikh 51d4babc64 Merge main into perf/shader-image-table-reuse-v3-pr 2026-10-16 05:09:29 -07:00
Adrià FranchandClaude 6c67548618 test(agc): enable shaderStorageImageMultisample on the recorder test device
Co-Authored-By: Claude <[email protected]>
2026-10-16 14:08:45 +02:00
codingreapermapsandClaude Opus 5.5 5c42e97f47 feat(agc): write a multisampled color target through a storage image
A program that stores to a 2D multisampled texture writes the samples of
its host multisampled color target through a storage view. Targets are
created without storage usage; the first storage binding that resolves
to a target moves it to an image with storage usage, copying its samples
once, and keeps the previous image until the target is released. Storage
usage needs the device's shaderStorageImageMultisample feature and its
format at the target's sample count. A surface no draw rendered to is
created from its uniform color memory, as for sampling; other color
memory still throws.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 14:08:35 +02:00
Adrià eb901bcf4e Merge pull request #6784 from milescoviello/fix/journal-mesh-output-size
fix(agc): journal the mesh output primitive size
2026-10-16 14:03:21 +02:00
Adrià 127e5bf826 Merge pull request #5872 from Sam-mon7/perf/lazy-shader-prepare
perf(agc): allow shader preparation on first use
2026-10-16 14:01:24 +02:00
al3w0f205 cc941b9767 feat(libSceKeyboard): export missing firmware functions from database 2026-10-16 06:52:37 -05:00
Yunus Shaikh e448df1ea8 fix(agc): record a relocatable draw variant's shared words by run
tagVariantRuns recorded each capture region's shared words under the
region's index, then split the region into runs where the user-data
base its words were read through changes. Everything that reads the
entries counts runs: validateVariant builds its regions one per run
(appendEntryRegions), so its runs.size() == regions.size() check always
held and VouchSharedRegions' ranges were taken as run indices by the
pending-write sync, the overlap checks and validateCaptured.

With a split ahead of a region in a supplied table block, the vouch
covered a run of the earlier region instead of the table's: that run
was neither synced nor compared, so a draw-cache hit could reuse the
variant after its guest words changed, on the strength of the table's
write stamp alone, while the table's own run was compared in full.

The shared words are now recorded per run, as the dispatch path does,
from each run's own words. An unsplit variant records what it did
before, and SameCapturedWords, which compares word positions, sees the
same merged entries.

tagVariantRuns moves to Driver's public members, beside
ClassifyIndirectDraw, so the relocation test can check that a split
variant's shared words name the run that holds the table's words.
2026-10-16 11:50:58 +00:00
Adrià c8044c3a7a Merge pull request #5914 from fdfawef324/codex/vertex-lane-bounds
fix(shader): fold fixed 32-lane vertex bounds
2026-10-16 13:47:56 +02:00
Adrià bba8b293ba Merge pull request #5899 from ps54all/feat/shader-image-store-d16-sint
feat(shader): store D16 data to SINT storage images
2026-10-16 13:45:23 +02:00
milescovielloandClaude Opus 5.5 2d5f761cb5 fix(agc): discard pipeline journals written before the mesh field
The layout guards only build on Linux with libstdc++, so a Windows or
macOS build of main after #5884 wrote journals whose mesh records lack
outputPrimitiveSize under the new shader-cache source version. The
journal format is now 3, so such a file is discarded instead of being
read with the new codec. MarcZX100 pointed this out.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:45:11 +00:00
ArjenS-LA ef3c83d6be fix(tools): resolve named audit imports through NIDs 2026-10-16 04:44:34 -07:00
mopgobopotandClaude Opus 5.5 8eb7f51340 test(web): cover ZIPs made on Windows
Backslash names and MS-DOS attributes from an MS-DOS host, a .. escape written with backslashes, and a Unix-host name with a backslash.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 14:44:01 +03:00
mopgobopotandClaude Opus 5.5 8e09b35dcf fix(web): give packaged app0 files a Unix mode when the input ZIP has none
Output entries are written with a Unix host, but the source entry's external attributes were copied as is. ZIPs made on Windows carry only MS-DOS attributes, so app0 files were recorded with mode 0000 and Info-ZIP unzip extracts them unreadable. Entries without a Unix mode now get 0644.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 14:44:01 +03:00
mopgobopotandClaude Opus 5.5 99bbf93d66 fix(web): accept backslash separators in ZIPs made on Windows
Windows PowerShell's Compress-Archive stores entry names with \ as the separator and an MS-DOS host. The converter rejected every such ZIP as an unsafe path. Entries from an MS-DOS host now have \ turned into / before the path is validated, so .. and the other unsafe names are still rejected. Unix-host names keep rejecting \.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 14:44:01 +03:00
Alex ColliniandClaude Opus 5.5 adf516f6f1 docs(debt): record why a spanned wave's LDS lock loop ballots per host subgroup
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:43:36 +02:00
Alex ColliniandClaude Opus 5.5 a015284ee9 fix(recompiler): ballot a spanned wave's LDS lock loop within its host subgroup
The lock loop that emulates 64-bit LDS atomics runs only on the lanes
the guest's exec mask keeps, so a spanned wave's barrier-based ballot
there was not reached by both host subgroups. When one subgroup had no
active lane the other one paired its barriers with unrelated ones and
left the loop with lanes still pending, or the GPU hung (Ghost of
Yotei, program 0x80003af600). The elect and the lock are already per
host subgroup, so each subgroup now loops until its own lanes are done.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:43:36 +02:00
Alex ColliniandClaude Opus 5.5 6006d4566a test(agc): run an LDS bitmask waterfall under partial exec masks
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:43:36 +02:00
Alex ColliniandClaude Opus 5.5 4adfa5fc72 docs(debt): record the Yotei device loss with APS5_SPANNED_WAVE=1
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:43:36 +02:00
Alex ColliniandClaude Opus 5.5 bd6ed97f6d fix(recompiler): keep spanned wave invocations running after a BDA fault
A spanned wave64 program exchanges ballots and shuffles through
workgroup-scope barriers. When a BDA fault stopped one invocation early,
the other 63 would wait at the next barrier forever. Spanned programs
now keep every invocation running and read zeros after a fault, as
programs with wave LDS barriers already do.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:43:36 +02:00
Alex ColliniandClaude Opus 5.5 80e3d90ed6 feat(recompiler): run single-wave wave64 compute programs at one lane per invocation on 32-lane hosts
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:43:36 +02:00
Claude e37137241d feat(ssl): run TLS 1.2 client connections over Mbed TLS
sceSslConnect performs the client handshake on the host socket that the
guest number maps to in the libkernel or libSceNet socket table, and
sceSslRead and sceSslWrite carry application data. Session state comes
from the context's memory pool, and the server is verified against the
CAs loaded with sceSslLoadCert; a loaded client certificate is sent when
the server asks for one.

libkernel exports KernelLookupSocketNative_nid_no_patch, which checks
its own socket table before the one libSceNet registers. Pools take a
lock so connections can allocate outside the library lock.

TLS 1.3 is compiled out. A missing CA, a verify callback, would-block
sockets and every failure whose console code is unknown throw, as
recorded in the libSceSsl debt entry.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01RoU3ZF76A6uR8sCA7NMLch
2026-10-16 11:37:32 +00:00
milescovielloandClaude Opus 5.5 b1e88d5995 fix(agc): journal the mesh output primitive size
#5884 added MeshConfiguration::outputPrimitiveSize, and #5875's pipeline
journal guards the layouts it encodes. The two merged separately, so on
Linux with libstdc++ PipelineJournal.cpp no longer compiles:
MeshConfiguration is 40 bytes, ShaderStages (which holds an optional
one) 112. The guards now name those sizes, and the recipe codec writes
and reads the new field, so a replayed line-strip geometry pipeline
keeps its two-vertex primitives.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 11:36:25 +00:00
Adrià 65d56a297c Merge pull request #5804 from MarcZX100/codex/pixel-interlock-terminate-2009
fix(agc): stop pixel invocations on BDA faults when supported
2026-10-16 13:35:18 +02:00
MrMha 6737423d02 fix: finish directory writer cleanup when cancellation rejects 2026-10-16 15:31:07 +04:00
XairRrR 04eff348aa fix(agc): include the host stage in the CMASK clear's host-access barriers
DispatchCmaskClear made earlier host writes available with a source stage of
ALL_COMMANDS and made its results visible to host reads with a destination
stage of ALL_COMMANDS. ALL_COMMANDS does not include the host stage, so the
host access bits were unsupported by their stage masks
(VUID-vkCmdPipelineBarrier-srcAccessMask-02815, dstAccessMask-02816) and the
host side of the dependency was not formed. Both barriers now add the host
stage, as the CMASK fill after them already does.

AI-assisted: yes
2026-10-16 13:30:50 +02:00
MrMha 7a09d070c5 fix: classify every explicit export alias in import audits 2026-10-16 15:29:00 +04:00
hugodearaujo 9bd554a64e fix(agc): note where a map-time settle blocks, and expect settles only for dma-buf imports
An import made at map time settles inside the guest's map call, so the mapping thread waits while the kernel maps the pages. A device that imports shared memory through host pointers settles nothing, so the test expects a settle only for a dma-buf import.
2026-10-16 08:28:23 -03:00
MrMha d40347def7 fix: preserve quoted Git filenames in overlap detection 2026-10-16 15:27:44 +04:00
Adrià aff725bf6d Merge pull request #5886 from ymatrix1/fix/shader-unnormalized-sampler-without-mip-filter
fix(agc): read an unnormalized sampler without a mip filter at its base level
2026-10-16 13:25:42 +02:00
Adrià 645644c488 Merge pull request #5884 from AnthonyClemens/fix/agc-geometry-line-strip-output
feat(agc): draw line-strip output of NGG geometry programs as mesh lines
2026-10-16 13:25:36 +02:00
Adrià 0615cd2b82 Merge pull request #5875 from adriadam10/perf/agc-pipeline-journal
perf(agc): journal the pipelines of a run and build them ahead on the next one
2026-10-16 13:19:18 +02:00
Adrià Franch d8c2b71d12 docs(debt): D16 SINT image stores measured on RDNA2 2026-10-16 13:18:43 +02:00
ps54allandClaude Opus 5.5 a18d6e9a6b feat(shader): store D16 data to SINT storage images
image_store with D16 data to a storage image of a SINT format threw
"stores 16-bit data to an image of a SINT format", both when the
descriptor is decoded and in the SPIR-V image emitter, and the runtime
image modes left out the SINT conversions for such images. God of War
Ragnarok (PPSA08330) stops on it in compute shader 0x1052a17900 right
after its MFSR setup.

Each 16-bit half is now converted like the D16 format buffer stores
(EmitD16StoreComponent): sign-extended, then saturated to the
component width as for 32-bit data. The buffer form was measured on
RDNA2 in #331; the image form is not measured (TechnicalDebt).

agc_driver_image_store_sint now stores D16 data with DMASK 0xf and 0x5
to all eight SINT formats and after an image_atomic_add on 32_SINT,
instead of expecting the refusal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-16 13:18:38 +02:00
XairRrR 3659e9a99a fix(agc): rasterize nothing for an attachment-free draw with an empty screen scissor
A draw without color or depth targets takes its framebuffer extent from
PA_SC_SCREEN_SCISSOR_BR. When that rectangle is empty the hardware still runs
the vertex stage but produces no pixels; it no longer throws. The framebuffer
is one pixel in the empty dimension and the screen scissor clips it to nothing.

AI-assisted: yes
2026-10-16 13:17:00 +02:00