Skip to content

perf(agc): start no collect epoch at a wait its own queue's stored label satisfies - #4900

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
TideOPL:perf/same-queue-label-epoch
Oct 14, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
TideOPL:perf/same-queue-label-epoch

Conversation

@TideOPL

@TideOPL TideOPL commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Driver::waitMemory starts a new collect epoch (GuestMemory::BumpCollectEpoch) when it returns, so after every WAIT_REG_MEM the next CollectWrites of a surface walks the write watch again instead of hitting the per-epoch memo.

The label-table path already skips the bump for a non-late hit whose store came from the waiting queue (hit->queue == queue). Such a label orders only that queue's own earlier work; it orders no store by the guest CPU or by another queue, so the memo taken before it is still valid.

The two storedSince returns (at entry and in the polling loop) answer the same question from the label-store history: the awaited value was stored by a label packet recorded after the wait was received. They kept the bump even when that store came from the waiting queue. Now they skip it in that case too, as the label-table path does. A store from another queue still bumps, and so does every wait that reads its value from memory.

Tested

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5070, driver 610.88, Windows 11
  • AI-assisted: yes. Written with AI assistance (Claude Code); I reviewed and tested it.

…bel satisfies

waitMemory starts a new collect epoch when it returns, so the next
CollectWrites of every surface walks the write watch again. The label-table
path already keeps the epoch for a non-late hit whose store came from the
waiting queue: such a label orders only that queue's own work, no store by the
guest or another queue. The two storedSince returns (at entry and while
polling) answer the same question from the label-store history but kept the
bump for a store of the waiting queue. They now keep the epoch in that case too.
@github-actions github-actions Bot added the agc libSceAgc* label Oct 13, 2026
@xXPBSXx

xXPBSXx commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built on main 88107b7de together with thirteen other open GPU PRs (their own commits cherry-picked, no merge commits), so only the tests that belong to this PR say something about it:

  • tests/execution/SameQueueLabelWait.cpp (agc_driver_same_queue_label_wait): 3 of 3 runs passed.

Not tested: no game run. The batch was built once, not per PR; nothing failed, so no bisect was needed.

AI-assisted (Claude Code).

@adriadam10

Copy link
Copy Markdown
Collaborator

Checked on Linux (build + ctest scoped to libSceAgcDriver, the new test passes). The new test agc_driver_same_queue_label_wait fails with the WaitMemory.cpp change reverted and passes with it. The two storedSince returns now skip the bump for a same-queue store, matching the label-table path (hit->queue == queue), and other-queue stores still bump. Also confirmed by @xXPBSXx on Windows (3/3 runs); merging once the full Build is green.

@adriadam10 adriadam10 self-assigned this Oct 14, 2026
@adriadam10
adriadam10 merged commit cc8cb39 into boykopovar:main Oct 14, 2026
10 checks passed
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.

3 participants