Skip to content

perf(agc): read DCC keys behind the driver's own pending key store without a wait - #458

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:perf/agc-dcc-keys-without-wait
Oct 3, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
oneandonlydean:perf/agc-dcc-keys-without-wait

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

What

A CB metadata pass (and a resident target's register-clear check) reads the DCC keys with CurrentDccKeys, which waits for the GPU whenever recorded work writes the key range (SyncThrough). In the intro video of PPSA21564 about 800 passes per 10 s waited about 1.8 ms each, and every one of those waits was behind a key store whose result the driver already knew: its own uncompressed key store (StoreUncompressedOnGpu), or a title fill of uniform keys recorded on the GPU (NoteKeysFillOnGpu).

  • Pending-write notes now carry a serial in recording order (Recorder::noteWrite and noteWriteOn).
  • The key memo remembers the serial of the store it describes (LastWriteNote, taken right after the store is noted).
  • CurrentDccKeys asks NewestWriteNote for the newest pending write over the keys. When that is the store's own note, nothing recorded after the store writes the keys, so they read as the store's keys without a wait.
  • Any later writer, a key range the store does not cover, or a unit shadow over the keys waits as before.

Tested

  • Linux (CachyOS, x86-64, RTX 4090): full build with BUILD_TESTING=ON and ctest pass (145/145).
  • New pendingKeyStoreTests in agc_driver_recorder_tests (GPU, run by hand like the rest of that executable): after a pending uncompressed key store, the keys (and a range inside them) read as uncompressed while the store is still pending; a later writer over part of the keys makes the read wait and the store lands; the keys of a pending fill read as the fill's keys without a wait, and a later, wider writer is waited for. With the PendingStoreKeys line removed from CurrentDccKeys it fails with "reading keys the driver's own pending store wrote waited for the GPU".
  • PPSA21564: on my integration branch since 2026-10-02 through repeated passes of my visual regression check (checkpoint frames, flicker, shimmer, video tearing, FPS).
  • feat(agc): host import windows, least-recent eviction under the budget #290 and perf(agc): draw cache keys on the user words a program reads, memoizes failures, serves data-only hits #291 also edit Recorder.*; each merges cleanly with this branch.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

…thout a wait

A CB metadata pass (and a resident target's register-clear check) read the
DCC keys with CurrentDccKeys, which waited for the GPU whenever recorded
work wrote the key range. In the intro video of PPSA21564 about 800 passes
per 10 s waited about 1.8 ms each, and every one of those waits was behind
a key store whose result the driver already knew: its own uncompressed key
store, or a title fill of uniform keys recorded on the GPU.

Pending-write notes now carry a serial in recording order, and the key
memo remembers the note of the store it describes. When the newest
pending note over the keys is that store's own note, nothing recorded
after it writes the keys, so they read as the store's keys without a
wait. Any later writer, a range the store does not cover, or a unit
shadow over the keys waits as before.
@github-actions github-actions Bot added the agc libSceAgc* label Oct 3, 2026
@oneandonlydean
oneandonlydean merged commit c416d9e into boykopovar:main Oct 3, 2026
3 checks passed
@oneandonlydean
oneandonlydean deleted the perf/agc-dcc-keys-without-wait branch October 3, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant