fix(agc): bound a journal replay's graphics and compute pipelines apart #8542
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8542"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T15:52:58Z.
What
A journal replay keeps the last
APS5_PIPELINE_JOURNAL_ENTRIESentries (4096) of the loaded journal, the newest since #9836. That bound is there for the graphics pipeline store, which #9401 sizes to the title's working set. But the replay counts compute entries against it too, and truncates silently. So in a title that records both kinds, compute pipelines take graphics slots, and whatever the bound cuts goes unreported.This PR applies
APS5_PIPELINE_JOURNAL_ENTRIES(4096) to graphics entries only. Compute entries count separately against a newAPS5_PIPELINE_JOURNAL_COMPUTE_ENTRIES(1024), as agreed earlier in this thread. Each kind keeps its newest entries, as #9836 does for both together, and the recorded order is kept. When a replay leaves entries out, it says so, for example:ENVIRONMENT.mddocuments the new variable, and the journal debt entry names both bounds. The record format doesn't change, so the journal keeps #8365's format number.Why
@SleglJan found this with #8365. On PPSA11386, the default-cap seed held 1,322 entries: 628 graphics, 694 compute and their modules. The warm run replayed exactly the first 1,024 (481 graphics, 526 compute, 17 already present), and the load line still said 1,322.
Tested
Restacked onto
main77d536fb38, which now has #8365, asee0d52b98f; it also merges cleanly with currentmain31c727f622. The change is the same commit, replayed alone. The per-kind test from before is unchanged.Linux (Ubuntu 26.04.1, GCC 15.2), RTX 4070 Ti (NVIDIA 615.71.09), Release:
ctest -R pipeline_journal(agc_driver_pipeline_journal, which holds the per-kind replays,agc_pipeline_journaland_long_paths) passes 3 of 3 onee0d52b98f.Khronos validation (
VK_LAYER_KHRONOS_validation1.4.363, LunarG SDK) over the same 3 tests, on the base77d536fb38and onee0d52b98f: 3 of 3 pass on each, the tests created 17 and 20 Vulkan devices that the layer checked, and there is noVUID-message on either side.Windows 11 VM (GT 1030, R580, WinLibs GCC 15.2.0, Release):
agc_driver_pipeline_journal(the per-kind replays),agc_pipeline_journal,_long_pathsand_extended_pathspass 3 of 3 on the base77d536fb38and 3 of 3 onee0d52b98f.Earlier results, on the heads named in them (before the restack):
main's single newest bound fails 3 of 3 on the bounded-replay case (a replay bounded to 1 graphics and the default compute entries replayed 1 graphics and 0 compute pipelines). A bound that keeps the first entries of each kind fails 3 of 3 in the newest-entries test.cb2ba99693.Not tested: a title run.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-20T19:40:01Z.
Restacked on #8365's rebased head (30c643b8ca, on
main2185dbf92e). This commit is now de02531eea, with the same diff. #8365 now writes journal format 6, because #5656 took 5 onmain. On this head, the journal tests (agc_driver_pipeline_journal,agc_driver_graphics,savedata_memory_journal) pass 3 of 3, andtools/check_conventions.py --base upstream/mainpasses.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T06:13:28Z.
Windows run of this head (
de02531eea) and of #8365's head (30c643b8ca), which this PR is stacked on: Windows 11 Enterprise, NVIDIA GeForce GT 1030 (driver 582.66), WinLibs GCC 15.2.0 r7 (UCRT), Release,BUILD_TESTING=ON.agc_driver_pipeline_journalmain's merge base2185dbf92ealso passes 3 of 3 (1.2 to 1.7 s).The new cases write and replay journals past both limits, so the test takes about a second longer here. The 28.4 s run was the second of the first three. It didn't come back in six more runs, and the VM's disk is a qcow2 on NFS, so I take it as I/O on this machine rather than the change. I haven't confirmed that.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T11:06:03Z.
Restacked on #8365's new head
a2eb629939, which is rebased ontomain275e896797. This PR's commit is nowff8ec20cc1, and it applied unchanged. The journal format is 7, from #8365's commit, since #7869 took 6 onmain. The 4journaltests pass 2 of 2.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-21T18:51:31Z.
GTA V (PPSA04264), Windows 11, RTX 4090, open world: the graphics store overflows on its own. It settles at about 1,270 distinct pipelines after about 3 minutes, so the 1,024 LRU bound keeps evicting pipelines that are rebuilt right after, at about 200 ms each (up to 1.6 s) under the GPU mutex.
Last 330 s of one run each:
APS5_PIPELINE_STORE_ENTRIES=8192With
APS5_PIPELINE_JOURNAL_ENTRIES=100000, the whole journal (1,303 pipelines) replayed in 454 ms on 16 threads.So the graphics journal bound is tied to a store bound that is too small for this title. I plan a separate PR that grows the store adaptively, as #7189 does for the resource cache (a ghost list of evicted keys, doubling up to 16384, with a set value still fixing it), and sizes the graphics journal bound to match. It touches the same lines of
PipelineJournal.cppas this PR, so I'll build it on top of this one if it lands first, and keep the compute bound as you split it.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T18:53:43Z.
Thanks @tibzejoker, those numbers make the case. At about 1,270 distinct pipelines, a 1,024-entry store evicts pipelines the title rebuilds right away, and
APS5_PIPELINE_STORE_ENTRIES=8192cuts the blocking builds from 32.9 s to 2.9 s. The replay fits easily: 1,303 pipelines in 454 ms.An adaptive store with the graphics journal bound sized to match sounds right to me. This PR keeps the graphics and compute bounds separate, so yours only has to move the graphics one. One note for building on it: this PR is stacked on #8365 (compressed journal modules), which is on #8213, so its head carries their commits until they merge. If you base on this branch you'll carry them too. Once they land, rebasing onto
mainshould only drop them.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-21T20:48:00Z.
Follow-up: the store side is now #9401. It replays up to 16384 journal records, lets the replay grow the store instead of skipping once it is full, and grows the bound while evicted pipelines come back. In the GTA V open world, builds in play went from 80-153 to 42. It touches the same journal-bound line as this PR, so I'll rebase it onto yours if yours lands first.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-21T20:54:11Z.
Thanks @tibzejoker. 42 builds in play, down from 80–153, is a big drop. I trial-merged #9401's head with this PR: they conflict in
PipelineJournal.cpp, plus theARCHITECTURE.md,ENVIRONMENT.mdand AGC debt entries. That works either way: if #9401 lands first, I'll rebase this one onto it and keep its store bound.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by 00xDisaster on 2026-10-22T00:07:25Z.
Overlap note: #9440 changes the same bound line in
PipelineJournal.cpp— it keeps the last entries of the journal instead of the first, so the pipelines a title built last are the ones the replay builds, and it rewrites the file when it reachesAPS5_PIPELINE_JOURNAL_MAX_MIBinstead of refusing the record (it also touches the two bound rows ofdocs/dev/ENVIRONMENT.mdand the journal's debt entry).The changes compose: the per-kind bounds of this PR can be applied to the entries #9440 keeps. I will rebase onto whichever lands first.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-22T00:25:22Z.
Thanks @00xDisaster, agreed that they compose: this PR's per-kind bounds apply to the entries #9440 keeps. If #9440 lands first I'll rebase this onto it. I also left a review on #9440 about the record that triggers an eviction.
AI-assisted: yes (Claude Code)