Commit Graph
1257 Commits
Author SHA1 Message Date
AlxcBTW 350b8d2b88 fix(agc): keep the template of another address when a dispatch move is refused
Read-only addresses are not part of the dispatch key, so the fresh build after a refused
move replaced the template that serves the other address, and the two addresses
rebuilt each other. A refused dispatch now uses or builds an entry under the exact key
(read-only bases included) and leaves the movable template alone. The [dispmove] line
counts the rebuilds after a refusal, the builds inserted beside the template and the
dispatches served by an exact entry. Restores the MarkGpuWrites comment.
2026-10-17 13:52:16 +02:00
AlxcBTW 89d255c5f3 perf(agc): serve compute dispatches whose read-only buffers moved from the cached template
The content key of a compute stage leaves the base address and size of its
read-only guest buffers out, as a draw's key does. A template hit whose such
buffers moved is proved the way a draw's is (ShaderResources::MovedDispatchBuffers:
read-only, read in place when built, in reach, nothing pending over the new range)
and binds snapshots of the new ranges in a descriptor set of its own, kept with the
batch that records the dispatch. A refused proof builds the dispatch fresh, as
before. APS5_NO_DISPATCH_MOVE=1 turns the path off, APS5_DISPMOVE_MAX_KIB caps the
bytes snapshotted per dispatch.

A template whose storage image lies over memory that a depth surface covers is no
longer proved from stamps (fastRevalidate): cachedStorageTexture answers such a
binding with the plane's colour mirror, copied in from the depth image for every use,
and nothing stamps the appearance of a depth surface after the build. The full walk
decides, and a stale image can no longer be copied over the depth image.

Tests: Graphics.cpp (verdicts of the proof), execution DispatchMove (real device:
moved, exact, shortened, stored-over, own-output and written-range refusals) and
DispatchMoveDepth (a depth surface appearing over a template's plain storage image,
planes inside and outside the write watch, imports watched and unwatched).
2026-10-17 09:08:47 +02:00
Dean f8b22edfb7 Merge pull request #6988 from MarcZX100/codex/stabilize-preparation-scope-settle-6984
test(agc): wait for preparation workers before linking
2026-10-17 19:51:49 +13:00
Dean 2bfe0045d8 Merge pull request #5940 from zmeizy/claude/pknorm-f16-denormal-inputs
fix(shader): flush v_cvt_pknorm_*_f16 denormal inputs by FLOAT_MODE
2026-10-17 18:21:25 +13:00
Dean 52ed3da697 Merge pull request #6744 from Ondra97/codex/fix-store-untracked-lifetime
test(agc): wait for the tested surface's pending image
2026-10-17 17:56:11 +13:00
Adrià 49f5dc1a58 Merge pull request #5979 from alfalfa-star/perf/agc-rect-list-indirect-gpu
perf(agc): draw an indirect rect list from its records on the GPU
2026-10-17 06:53:38 +02:00
Dean 739eb2eab4 Merge pull request #6993 from thuanquang/fix/gpu-map-on-fiber-thread
test(agc): map GPU memory on fibers with and without a host stack
2026-10-17 16:36:47 +13:00
Dean 2a2724ae75 Merge pull request #6359 from Amoenus/codex/test-untracked-store-pending-owner
test(agc): wait for the actual image in repeated untracked stores
2026-10-17 16:36:25 +13:00
Dean bfcf02e3a8 Merge pull request #6385 from Neithennn/fix/store-over-untracked-neighbour-wait
test(agc): keep waiting for the neighbour copy case's result
2026-10-17 15:58:07 +13:00
thuanquangandClaude Opus 5.5 d5dbce438a test(agc): map GPU memory on fibers with and without a host stack
Since #6003 a fiber with a context of 64 KiB or more runs on the
context itself, so the 64 KiB fiber of agc_driver_gpu_map_on_fiber
imports its mapping on a host thread on Windows too, and the test's
Windows-only expectation of no thread failed. The test now also maps
on a 16 KiB fiber, which keeps a host stack and imports on it on
Windows, and expects one import thread for the 64 KiB fiber on every
platform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 09:50:32 +07:00
Adrià c9cabcaf84 Merge pull request #6008 from zmeizy/claude/ldexp-f32-denormal-modes
fix(shader): translate v_ldexp_f32 in f32 denormal modes 1 and 2
2026-10-17 04:14:45 +02:00
MarcZX100 871232eede test(agc): wait for preparation workers before linking 2026-10-17 02:00:23 +00:00
Adrià fd9e577d98 Merge pull request #6007 from zmeizy/claude/cmp-f32-denormal-modes
fix(shader): translate f32 compares in f32 denormal modes 1 and 2
2026-10-17 03:10:56 +02:00
Dean 7fcc15cb42 Merge pull request #6452 from Amoenus/codex/fix-indirect-fixture-alignment-main0c
test(agc): align the indirect arguments block at run time
2026-10-17 13:53:44 +13:00
Adrià 85643f75e7 Merge pull request #5997 from Ondra97/codex/fix-storage-evicted-views
fix(agc): release sampled views after storage eviction
2026-10-17 01:56:35 +02:00
Adrià 4a9c1d5cd0 Merge pull request #5982 from milescoviello/fix/depth-surface-later-level
fix(agc): treat a view past a depth surface's first level as memory
2026-10-17 01:15:56 +02:00
alfalfa-starandClaude Opus 5.5 ac64ea4524 test(agc): require the GPU route for the indirect rect-list draws
agc_driver_rect_list_indirect compared the indirect draws' output with
the direct draws only, so it also passed when the records were read on
the CPU. Its records lived in a static array that is not guest memory,
so every indirect draw fell back to the CPU path as not imported.

The records now sit in a registered 64 KiB guest allocation, the test
turns on APS5_PROFILE_DRAW and reads the indirect-draw counters through
the new Graphics::IndirectDrawCounts, and it requires all four indirect
draws on the GPU path. It fails with APS5_NO_RECT_INDIRECT=1 and with
the IndirectDraw.cpp and Draw.cpp changes reverted (4 non-vertex path).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:20:51 +02:00
Romans Pokrovskis a0c51d5778 feat(agc): import uniform multisampled DCC fast clears 2026-10-16 21:13:39 +02:00
Adrià db7d9de5e4 Merge pull request #5405 from Pipodi/feat/spanned-wave64-compute
feat(recompiler): run single-wave wave64 compute programs at one lane per invocation on 32-lane hosts
2026-10-16 21:05:55 +02:00
Adrià daf8913128 Merge pull request #5905 from hugodearaujo/fix/agc-prewarm-mapped-dma-buf
fix(agc): settle dma-buf imports on Linux on the settle queue
2026-10-16 21:05:30 +02:00
Adrià 57865eb292 Merge pull request #5881 from codingreapermaps/feat/agc-msaa-storage-write
feat(agc): write a multisampled color target through a storage image
2026-10-16 21:05:25 +02:00
Adrià 0936dc910a Merge pull request #5943 from zmeizy/claude/f16-conversion-float-mode
fix(shader): round and flush f16 conversion results by FLOAT_MODE in every denormal mode
2026-10-16 20:39:11 +02:00
Adrià 93e54cedd3 Merge pull request #5950 from mrfelek/test/sparse-dmabuf-skip-large-limit
test(agc): skip the sparse dma-buf import tests when udmabuf size_limit_mb is above 1024
2026-10-16 19:40:40 +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 <noreply@anthropic.com>
2026-10-16 14:12:58 +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 <noreply@anthropic.com>
2026-10-16 14:08:35 +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
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
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
2026-10-16 13:43:36 +02: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
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
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 <noreply@anthropic.com>
2026-10-16 13:18:38 +02:00
Adrià Franch 89333e056f test(agc): wait for the pipeline to empty between descriptor rounds 2026-10-16 12:53:38 +02:00
MichonandClaude Opus 5.5 ccfee8e260 perf(agc): dispatch-cache recipe hits as ordered commit items (APS5_PIPELINE_DISPATCH)
With pipelined draws, a DISPATCH_DIRECT on queue 0 whose dispatch-cache entry hits with a
recipe runs as an ordered commit item instead of draining the pipeline first. Misses, reads
that overlap writes still pending in the pipeline, verified data hits and writes that cannot
be ranged still drain. A dispatch that is resolved ahead (or adopted from a group resolved
ahead) and copy kernels keep the drained path; with the switch on, queue 0 does not resolve
dispatch groups ahead, since that drains the pipeline at every group. Off by default.
agc_driver_pipelined_dispatch counts drains per opcode (each dispatch drains with the switch
off); agc_driver_pipelined_dispatch_item checks that repeated dispatches do not drain, and that
a dispatch whose descriptor table a pending fill retargets drains and reads the new buffer.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-16 12:53:34 +02:00
Adrià FranchandClaude 1ad590fc05 test(agc): give the new program of compute_pipeline_outside_gpu_mutex its own module
Pipelines are now shared by every program that recompiles to the same
module, and a leading s_nop recompiles to the same one, so the second
dispatch reused the first pipeline. The new program also stores to the
second word.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-16 12:52:28 +02:00
Adrià FranchandClaude Fable 5.1 4aafda8e3b perf(agc): journal the pipelines of a run and build them ahead on the next one
A graphics pipeline the store builds or a compute pipeline a dispatch builds is
appended to pipelines.journal next to the shader cache entries, as the
materialized result of each stage (the specialized SPIR-V, bindings and push
constants) plus the recipe the pipeline was built from: the stages'
identities, vertex input layout, descriptor set layout keys and the state
fields the Pipeline constructor reads. When a VulkanDevice is created with a
window (a headless device waits for its first draw or dispatch, since the
window's device usually replaces it first) the journal is loaded and its
pipelines are built on a pool of threads while the title loads, so the first
draw or dispatch of a configuration seen on an earlier run finds its pipeline
resident instead of compiling it on the queue worker.

The pipeline stores key on RecompileResult::Identity, a hash of the module
words, specialization constants, subgroup width and bindings that is the same
on every run (SharedSpirv::ContentHash, computed once per shared module),
rather than on the process-lifetime variant ids; a generated stage is keyed
like any other. CachedPipeline builds outside the store's mutex and the
library parts and link are built outside the library store's mutex, so replay
threads and queue workers build in parallel; a concurrent build of the same
key keeps the first inserted. A replayed pipeline enters the store at its
least recently used end and a full store takes none, and its optimized relink
waits for the first draw that binds it, so the title's own pipelines come
first in both. The compute pipeline creation moves into
VulkanDevice::createComputePipeline, shared by dispatches and the replay. The
store key also covers the color component mapping, the depth target's sample
count and a depth bias clamp, which the constructor reads.

The file names the device it was written for (the properties the driver's
pipeline cache file is named by) and starts over for another; a torn tail is
cut at a record boundary; two runs sharing the directory take turns on a lock
file and keep each other's records; a read failure never starts the file
over. A device cancels its replay before it is replaced or destroyed, and a
replaced device destroys its pipelines then rather than at the driver's stop.

APS5_NO_PIPELINE_JOURNAL=1 disables it; APS5_PIPELINE_JOURNAL_THREADS,
APS5_PIPELINE_JOURNAL_ENTRIES (the first recorded), APS5_PIPELINE_STORE_ENTRIES
and APS5_PIPELINE_JOURNAL_MAX_MIB bound it; APS5_PROFILE_DRAW prints a
[pipeline-journal] summary. APS5_VERIFY_SET_LAYOUTS=1 now also checks a
dispatch's set layout against the one described from its shader. The lavapipe
test suite, which shares one cache directory, runs with the journal off except
for the journal's own tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01P6hw3kRAuQdfcU9YCZgaoK
2026-10-16 12:52:28 +02:00
Adrià f8d4ce340b Merge pull request #4943 from TheAggie/perf/agc-draw-relocation-main
perf(agc): find cached draws across moved user-data pointers
2026-10-16 12:13:51 +02:00
Romans Pokrovskis 90b191e5bc test(agc): cover pending surface identity in the shared wait 2026-10-16 11:50:50 +02:00
NeithennnandClaude Opus 5.5 dc2f8fb461 test(agc): wait for a result pending over the neighbour copy surface
The NeighbourCopied wait accepted any pending result once the surface
image was live, so a pending result of the source surface could end it.
It now waits for a pending result overlapping the surface's range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 10:53:24 +02:00
Ondra97 bf861be946 test(agc): wait for pending result on the tested surface 2026-10-16 10:50:01 +02:00
Romans Pokrovskis b15060bd9d test(agc): wait for the second-store image itself to be pending 2026-10-16 11:31:37 +03:00
Adrià 7758abac13 Merge pull request #5841 from simonbronk/feat/line-reads-through-2d-array
fix(shader): read explicit-LOD and level-zero 2D-array samples through 1D T#s as measured
2026-10-15 23:00:50 +02:00
Adrià c10aa036d2 Merge pull request #5821 from SandstromPL/fix/agc-sampler-aniso-minmax-reduction
fix(agc): accept a min or max reduction sampler with anisotropic filtering
2026-10-15 22:58:19 +02:00
Adrià FranchandClaude d92ebfa882 fix(agc): validate mesh index descriptors on cached draws (reapply #5791)
Reapplies #5791 (reverted by #6552). agc_driver_mesh_index_cache now skips
on llvmpipe like agc_driver_mesh does: llvmpipe aborts compiling these mesh
programs (LLVM ERROR: Cannot emit physreg copy), which is what turned main's
linux job red.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 22:43:15 +02:00
Adrià FranchandClaude b8db74198e Revert "fix(agc): validate mesh index descriptors on cached draws" (#5791)
agc_driver_mesh_index_cache aborts on the linux job (lavapipe, LLVM 20.1.2:
"LLVM ERROR: Cannot emit physreg copy instruction") on every main push build
since the merge (first red: 38777177302). The PR was merged on a
windows-only run after a linux-red batch was split.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-10-15 22:15:16 +02:00
Sam c8bedff055 test(agc): check that lazy registration defers preparation
The lazy mode of agc_driver_prepared_shaders only checked dispatch output and failure reporting, which eager preparation also produces. Read the registered snapshot through Driver::RegisteredShaders: registration leaves it deferred with no prepared artifact, and the first dispatch prepares it.
2026-10-15 19:26:59 +01:00
Sam 96070188b9 perf(agc): allow shader preparation on first use
APS5_LAZY_SHADER_PREPARE=1 keeps registration validation and decoding but skips queueing the preparation. Draws and dispatches prepare a deferred snapshot on first use and cache it; explicit ABI resolution still prepares its stages. Titles that register thousands of shaders at boot no longer hold every prepared shader in memory before the first frame.

Cover lazy dispatch, metadata and failure cases in both asynchronous and synchronous modes.
2026-10-15 19:26:20 +01:00
Adrià 03c4cb5e78 Merge pull request #5791 from Ondra97/codex/fix-draw-mesh-index-cache
fix(agc): validate mesh index descriptors on cached draws
2026-10-15 19:25:11 +02:00
milescovielloandClaude Opus 5.5 92f170c673 fix(agc): treat a view past a depth surface's first level as memory
A depth surface is one level: the driver rejects draws that render a
depth mip. A sampled or storage view at the surface's address and extent
that starts at a later level, or a storage access to a later level, does
not touch that level, so it is not the depth plane. DepthSurfaceTexture
and DepthSurfaceStorage still sent such views to the surface, which
rejected the level. Forspoken (PPSA03984) builds a depth pyramid from its
1984x1116 D32 depth surface with a compute shader that samples one level
of a five-level R32F view and stores the next, and stopped there.

Both now leave such views to the texture and storage caches, as they
already do for a view of another extent or format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-15 16:55:31 +00:00
Romans Pokrovskis 4fe92c9c23 test(agc): align indirect argument storage at runtime 2026-10-15 18:54:28 +03:00