Commit Graph
164 Commits
Author SHA1 Message Date
Dean 930a681f2a Merge pull request #9879 from thuanquang/fix/linear-target-import-creation
perf(agc): create the host import of a linear color target in registered memory
2026-10-27 08:18:22 +13:00
Adrià e38fcb00dc Merge pull request #9989 from milescoviello/fix/result-memo-budget
fix(shader): bound the bytes the recompiler's result memos hold
2026-10-26 15:23:48 +01:00
Adrià 7992f03293 Merge pull request #9703 from frankea/perf/structurizer-construct-walk
refactor(shader): walk each construct when checking the structured constructs
2026-10-26 13:48:49 +01:00
Adrià 97934af20b Merge pull request #9702 from frankea/perf/structurizer-split-search
fix(shader): structurize a 4,750-block graph before Unreal's render thread watchdog fires
2026-10-26 11:54:10 +01:00
milescovielloandClaude Opus 5.5 8868e09624 fix(shader): bound the bytes the recompiler's result memos hold
Every shader source keeps up to 256 materialized results of
Recompile(request, capture) in its result memo, and as many patch
recipes in its masked memo, with no limit on their bytes. In Ghost of
Tsushima's opening the memos held about 500 MiB after 5 minutes and
kept growing, at a 13 % hit rate.

Each memo entry now counts the bytes its result's vectors keep (the
bindings' vectors included; the module is shared with the prepared
module cache), plus its patch recipe in the masked memo. A result held
by both tables counts once in each. Past a budget, 256 MiB unless
APS5_RESULT_MEMO_MB sets another (0 sets none), the least recently used
entries of both tables of all sources are dropped until three quarters
of the budget is left. The recency stamps come from one clock for all
sources and both tables so they compare across them. The profile line
also reports the trimmed and held entries and their MiB.

The trim takes its lock blocking and repeats, re-reading the bytes held,
until they are within the budget, so the insertion that pushed them
over has its trim run after any other; it stops when nothing is left to
drop.

SetResultMemoBudget and ResultMemoBytes let agc_shader_result_memo_budget
check that a memo over its budget keeps the most recently used results
and drops the oldest one, with the masked memo off. A one-shot hook
inside the trim (SetResultMemoTrimHook) lets
agc_shader_result_memo_budget_threads insert two results from other
threads after the trim has read the bytes held: the memo must still end
within its budget. agc_shader_result_memo_budget_masked, with the masked
memo on, checks that a first result counts its masked entry too and that
a trim empties the masked memo.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 05:04:18 +00:00
Dean d31f372e33 Merge pull request #10062 from imellag/fix/agc-moltenvk-destroy-at-idle
fix(agc): destroy buffers and memory on MoltenVK only while the graphics queue is idle
2026-10-26 14:28:45 +13:00
Adrià 9c6d153dec Merge pull request #10419 from iamthehimansh/split/macos-build
build: compile FileStream, error categories, thread priority and two tests on macOS
2026-10-25 22:35:29 +01:00
thuanquang 6adad6733c Merge main into fix/linear-target-import-creation 2026-10-26 02:07:34 +07:00
Adrià 5d48c6233e Merge pull request #9401 from tibzejoker/perf/grow-pipeline-store
perf(agc): size the pipeline store to the title's working set
2026-10-25 19:07:59 +01:00
Adrià 7b7d445bfb Merge pull request #9439 from milescoviello/feat/trace-calls-file
feat(libc): write the called imports to APS5_TRACE_CALLS_FILE every 10 seconds
2026-10-25 17:42:50 +01:00
fogydes df18d83072 docs: add the spawn role variable and shorten the waitpid debt 2026-10-25 13:57:18 +01:00
Himansh Raj 3a1d61c5d4 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 17:00:47 +05:30
Adrià 75227c7cdc Merge pull request #10423 from meh7an/perf/shader-masked-result-memo
perf(shader): reuse a memoized result by patching its copied words
2026-10-25 11:50:14 +01:00
Adrià 35e65fb861 Merge pull request #9252 from MarcZX10/docs/trace-label-packet-coverage
docs(agc): describe label trace packet coverage
2026-10-25 11:34:48 +01:00
Himansh Raj 6809dc7b80 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 16:00:54 +05:30
Adrià 654cb0bb4c Merge pull request #9965 from ebarr24/ws/ppsa01746-step1
perf(agc): pipeline queue-0 DMA_DATA by default
2026-10-25 11:06:26 +01:00
Himansh Raj 97d91fa983 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 14:10:23 +05:30
Adrià 6f58a046b1 Merge pull request #9599 from shahulmubeen-a/feat/agc-skip-shader-file
feat(agc): skip the draws and dispatches of the programs listed in a file, re-read while the title runs
2026-10-25 09:32:14 +01:00
Himansh Raj a01a4354db Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-25 12:31:32 +05:30
milescovielloandClaude Opus 5.5 a938dd8f20 feat(libc): write the called imports to APS5_TRACE_CALLS_FILE every 10 seconds
A traced run that ends without a crash or an abort never reports which
imports it called. With APS5_TRACE_CALLS_FILE set, the first traced import
starts a thread that rewrites that file every 10 seconds with every import
called so far, most called first.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 00:15:39 +00:00
thibautandClaude Opus 5.5 ad047899bb perf(agc): grow the pipeline store from 1024 up to 4096 entries
The graphics pipeline store kept a fixed 1024 entries and the pipeline journal replayed at most
1024 records, and a replayed pipeline that found the store full was dropped. A title whose
working set is larger rebuilt the rest at the draw on every run, and evicted pipelines it kept
using were rebuilt again and again.

The bound now starts at 1024 and doubles up to 4096: a journal replay that does not fit grows it
instead of dropping the pipeline, and so does eviction churn (a ghost list of evicted keys, checked
every bound/32 evictions: more than half of them came back). It never shrinks during a run;
APS5_PIPELINE_STORE_ENTRIES still fixes it. The journal loads its last 4096 records by default
(APS5_PIPELINE_JOURNAL_ENTRIES). Resident pipelines are bounded by count, not bytes.

agc_driver_recorder_tests --benchmark-pipeline-store-memory [count] (opt-in, not registered)
builds count graphics pipelines with one fragment module each through CachedPipeline and prints
process private bytes and VK_EXT_memory_budget heap usage before and after: with the triangle
shaders about 59 KiB host and no device memory per pipeline on an RTX 4090, 100 KiB host and
8 KiB device-local on a UHD 770.

Tests: agc_pipeline_store_growth (fails on main), agc_pipeline_store_fixed_bound,
agc_pipeline_store_replay_growth (replays on one thread: the mock Vulkan is not thread-safe).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017SNUYRd7sRKZrMYpquAsnU
2026-10-25 02:02:41 +02:00
Dean Galvin a5e015f7b7 Merge main into fix/linear-target-import-creation 2026-10-25 12:56:51 +13:00
Shahul Mubeen AandClaude Opus 5.5 e75a166184 fix(agc): ignore skip-file tokens that are not whole hexadecimal addresses
strtoull took the valid hex prefix of a token and ignored the rest, so a
malformed token such as "123garbage" selected program 0x123, and an
overflowing token was not detected. A token now has to be a whole 64-bit
hex number (with an optional 0x prefix); any other token is reported and
ignored. The test adds a list with a malformed token whose prefix is the
first program's address and an overflowing token.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:14:58 +05:30
Shahul Mubeen AandClaude Opus 5.5 49b68167fa feat(agc): skip the draws and dispatches of the programs listed in a file
APS5_SKIP_SHADER_FILE names a file of hex program addresses (whitespace
separated, # starts a comment). Draws and dispatches that use a listed
program are dropped as with APS5_SKIP_SHADER. The file is re-read within
500 ms of a change, so passes can be switched off and on while the title
runs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 23:14:57 +05:30
Tharun Balaji ea65a95401 feat(agc): trace shader failures through draw submission batches 2026-10-24 18:58:54 +02:00
Adrià f863d6af28 Merge pull request #7814 from ionut27001/fix/videoout-output-status-resolution
fix(libSceVideoOut): report the output resolution from the host display as measured on a PS5
2026-10-24 16:58:48 +02:00
Adrià ce9471f191 Merge pull request #9836 from 00xDisaster/fix/pipeline-journal-no-workflows
fix(agc): keep the pipeline journal's newest pipelines when it is full
2026-10-24 14:13:50 +02:00
thuanquang 5575dc3108 Merge branch 'fix/linear-target-completion-stores' into fix/linear-target-import-creation 2026-10-24 19:09:41 +07:00
ionut27001 983a81d91b fix(libSceVideoOut): add APS5_OUTPUT_RESOLUTION to override the reported output resolution 2026-10-24 12:42:14 +02:00
Adrià 60465afd3a Merge pull request #7307 from Zenodeon/agc-submit-progress-pr
feat(agc): add opt-in bounded submission progress
2026-10-24 11:59:57 +02:00
Adrià 68ed66980e Merge pull request #9036 from dantdmdarealguy/docs/environment-row-corrections
docs(environment): correct the crash indirect memory, log timestamp, language and label flush rows
2026-10-24 11:34:14 +02:00
Adrià 6d025ee2cd Merge pull request #8657 from xXPBSXx/docs/environment-aps5-no-wgi
docs(env): document APS5_NO_WGI
2026-10-24 11:27:28 +02:00
Dean 2250381689 Merge pull request #9934 from Celegans12/feat/agc-nv-diagnostics-config
feat(agc): enable VK_NV_device_diagnostics_config behind APS5_NV_DIAGNOSTICS
2026-10-24 21:08:33 +13:00
Adrià FranchandClaude Sonnet 5.5 954bed036d docs(agc): order the progress switch row and keep the debt list contiguous
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-24 09:02:30 +02:00
Zenodeon dd72d997c7 docs(agc): register the submission progress switch 2026-10-24 09:02:30 +02:00
Himansh Raj b017223970 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 12:11:02 +05:30
Adrià cd0591c8f4 Merge pull request #7705 from AnthonyClemens/fix/agc-bound-depth-plane-copies
fix(agc): bound the sampled depth-plane copies
2026-10-24 08:36:48 +02:00
Himansh Raj 93fd73a56d Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 10:40:23 +05:30
Adrià 7966e590ef Merge pull request #8740 from Sam-mon7/feat/frame-replay
feat(agc): capture frames at the driver boundary and replay them offline
2026-10-24 07:03:41 +02:00
thuanquang fe1927d398 Merge remote-tracking branch 'origin/main' into fix/linear-target-import-creation
# Conflicts:
#	core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
2026-10-24 11:55:57 +07:00
Himansh Raj fc93f11b4b Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 09:30:22 +05:30
billybobpicklioandClaude Opus 5.5 1f11b8ab9b fix(agc): bound the sampled depth-plane copies
A depth plane copy (a depth surface sampled as several slices, an integer view or a cube) was
kept until the device went away, with a staging buffer of its own size, and a staging buffer it
outgrew was never freed. Every depth surface a scene ever sampled this way held its copy, so
device memory grew with each new scene (0.4-1.2 GB in RE2 after a level load).

The copies now share their image's ownership with the views they hand out, the recorder keeps
the image and the staging buffer until the recorded copy has run, and past
APS5_DEPTH_PLANE_COPY_MIB (default 256; 0 keeps every copy) the least recently used copies
leave the cache. A copy made again refills from the surface and guest memory as a new one does.
agc_driver_depth_plane_sampling_evicting runs the plane sampling cases with a 1 MiB budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 04:24:03 +02:00
Felipebmaitan b7640ae5a3 fix(job-manager): merge main and reconcile scheduler debt 2026-10-23 22:48:31 -03:00
Dean Galvin f59787b272 Merge main into fix/linear-target-import-creation 2026-10-24 14:02:06 +13:00
Himansh Raj e836e519a8 Merge remote-tracking branch 'origin/main' into split/macos-build 2026-10-24 06:20:19 +05:30
Adrià 11d6efa06c Merge pull request #9305 from tibzejoker/fix/bit-exact-reciprocal
feat(shader): bit-exact RDNA v_rcp_f32 behind APS5_EXACT_RCP
2026-10-24 02:47:43 +02:00
Ethan Barr ce6865fc0d perf(agc): pipeline queue-0 DMA_DATA by default
Queue-0 DMA_DATA packets drained the draw pipeline unless APS5_PIPELINE_DMA was set, so the packet worker waited on the committer at every small immediate store. Kena PPSA01746 issues 17-23k DMA_DATA packets per 10 s and 11329 of its 20134 pipeline drains per 10 s are opcode 0x50. enqueueDmaPacket now queues DMA_DATA stores and fills unconditionally, and keepsDrawPipeline keeps the pipeline for a copy or fill whose source and destination miss every queued write. The APS5_PIPELINE_DMA switch and its documentation are removed and the tests run the default path.
2026-10-24 02:35:37 +02:00
dantdmdarealguy 80bcb4bd24 docs(environment): correct the crash indirect memory, log timestamp, language and label flush rows 2026-10-23 19:14:56 -05:00
SamandClaude Opus 5.5 dbe034fdf8 fix(agc): end a captured frame once per EOP flip
An EOP flip reservation also ended a frame, and so did the submission
whose EOP release carries the reserved token, so a title flipping with
EOP releases counted each displayed frame twice: a capture of N frames
stopped after about N/2 and could start between the reservation and
the submission that flips. The reservation is now only recorded; a
frame ends at a CPU flip or at a submission that flips.

agc_driver_frame_capture_eop reserves and submits six EOP flips with
APS5_FRAME_CAPTURE_FRAMES=3 and checks that the capture starts after
the first flipping submission and holds three frames of one reservation
and one submission each.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:09:44 +02:00
SamandClaude Opus 5.5 95d2a76583 feat(agc): capture frames at the driver boundary and replay them offline
APS5_FRAME_CAPTURE=<dir> makes the AGC driver record a few frames of a
title: the shader registrations and ABI resolutions, video output and
EOP flip reservations it made since it started, a snapshot of every
readable guest allocation (the title image included) taken at a frame
boundary once the driver is idle, and for the next frames each
submission, flip and suspend point with the thread that made it, its
serial progress and the guest pages the write tracker saw the CPU write
before it. At the end it stores the presented display buffers as
reference images. APS5_FRAME_CAPTURE_AT_FLIP, _TRIGGER and _FRAMES pick
the frames.

agc_frame_replay maps the captured memory at its addresses and replays
the calls of each captured thread on a thread of its own, in captured
order, through the current build of the driver with no title running.
It paces GPU work to the in-flight depth the title had, releases GPU
waits that the title's CPU threads released without calling the driver
(AgcDriverAwaitedWaits), and reports frame times, released waits and
how closely the replayed display buffers match the references.

Tests: agc_frame_capture (file format) and agc_driver_frame_replay
(two captured frames of CPU writes and DMA copies replayed and
compared). Docs: BUILD.md, ENVIRONMENT.md and the libSceAgcDriver debt
file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-24 02:09:44 +02:00