Repository navigation
perf(agc): start no collect epoch at a wait its own queue's stored label satisfies - #4900
Conversation
…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.
|
Windows test (MinGW GCC 15.2, Release, Windows 10, RTX 4080 SUPER). Built on main
Not tested: no game run. The batch was built once, not per PR; nothing failed, so no bisect was needed. AI-assisted (Claude Code). |
|
Checked on Linux (build + ctest scoped to libSceAgcDriver, the new test passes). The new test |
What
Driver::waitMemorystarts a new collect epoch (GuestMemory::BumpCollectEpoch) when it returns, so after everyWAIT_REG_MEMthe nextCollectWritesof 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
storedSincereturns (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
System: Windows 11 (26200), Ryzen 7 7800X3D, RTX 5070, WinLibs GCC 15.2, Release,
BUILD_TESTING=ON, onmainc13dc7e (rebased onto the currentmainbefore opening).New execution test
agc_driver_same_queue_label_wait: one compute submission with 16RELEASE_MEMlabel writes, each followed by aWAIT_REG_MEMon its value, behind a spin dispatch so the labels are still recorded (not in memory) when the waits are processed. It comparesGuestMemory::CollectEpochBumps()with the same submission without the waits, three times.mainit fails: 34-36 bumps with the waits against 18-19 without (16 extra bumps for 16 waits).Suite:
ctest -R "^agc": 451 tests, all pass;agc_driver_stencil_ref_exportis skipped, as onmain.Minecraft Dungeons II (PPSA16064), gameplay at the Squid Coast spawn, standing still. This is not a clean-
mainA/B: the title needs patches that are not inmainyet to reach gameplay (fix(agc): take an HTILE fill from a value in memory as a depth fast clear #3816, fix(agc): render all attachment layers with dynamic rendering #3763, perf(agc-driver): join the imports of adjacent large ranges when a buffer is bound across them #4515/perf(agc-driver): join the imports of adjacent ranges of any size that a buffer is bound exactly over #4517, an older head of feat(agc): depth planes sampled as 2D arrays, cubes and integer views #425 and local ones). Both sides are the same build with the old behaviour restorable by a local switch, captured with the feat(agc): record a present window as a Chrome trace and a summary line #4526 trace,APS5_TRACE_SECONDS=25:15opened 25 s after the HUD appears, runs interleaved:Resources.Prepareon queue 0main)The graphics queue processes about 1,300 waits per second there (
[packets]epoch bumps from waits: 13,444 per 10 s). The gain is small, about 2% at p50, and shows as fewer write-watch walks in the resource builds' pre-collect pass. p99 was higher with the change in these four runs (130-134 against 121-126 ms); I have not separated that from run-to-run noise. I can attach the four traces.tools/check_conventions.py --base origin/mainpasses.Not run: Linux, AMD.
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)