Repository navigation
Conversation
…is forgotten Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…son memo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ordering point Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t epoch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
daf7c89 to
b00f936
Compare
|
Data point on Windows from a game: Metal Gear Solid 4 (PPSA18194), gameplay from a save, i9-10850K, RTX 3080 10 GB (610.74), MinGW GCC 15.2, Release. Local stack: #6188, #6187 + #6192, #6273, #6077, and this PR's code commit (8f2c04e) on top; A/B is the same stack without it, 900 s each,
The key ranges here sit in Windows host imports smaller than 1 MiB, so they were never write-watched and every target lookup scanned them twice (the refresh, then Tested with AI assistance (Claude Code). |
|
SWAG (PPSA22102) check: the untracked population is small here, no hot-path reduction Stack tested: #6187 + #6209 combined at Measured Setup: Squirrel with a Gun Worker sampler, inclusive share of samples (function anywhere in the stack, all PCs aggregated, counted once per stack). Baseline final/mid2 -> stack final/mid2:
Method note: this aggregates every PC of a function. My earlier #7947 comment quoted only the hottest PC, which understates multi-PC functions there (e.g. Untracked population, per 10 s window: Timing, same setup, steady tail medians (last 20 x 10 s windows): AI-generated analysis (not measured) The proof only pays when target key ranges are not write-watched. On SWAG nearly all sub-1 MiB host imports are back in the write watch (6223-6332 of ~6240), so there is almost nothing for the memo/proof to elide, unlike the MGS4 ranges in ps54all's comment. What changes instead is when the worker blocks: DCC path counts that do involve untracked comparisons go down ( Artifacts (I will drag them in): |
|
swag-run26-baseline-symbolized.txt |
What
Stacked on #6187; only the last two commits are this PR. Independent of #6192, except that both add a test at the same place in
CMakeLists.txtandtests/Recorder.cpp, a trivial conflict for whichever lands second.ProvedClearKeysandProvedCurrentDccKeysskip the scan of a surface's DCC keys while the key range is unchanged since the last scan, proved byCollectWritesandUnchangedSince. Over keys the write watch does not cover (on Windows, every host-pointer import of the guest mapping, #1441),CollectWritesreturns 0, so no proof is ever kept and every use scans the keys again.In RetroArch's Flycast core (PPSA99169) on Windows: 3.7 million key scans per 10 s (72 GB read, 2.2 s), with 0 proved and every one counted unstable.
NewestStamp(driver stores into the keys),ForgetStamp(perf(agc): an untracked comparison memo holds until memory it covers is forgotten #6187) and the recorder's newest pending write note over the keys. A scan that is otherwise stable becomes the proof with that stamp, and a later call with the same stamp returns the proved keys without scanning.compareUntracked,docs/dev/ARCHITECTURE.md): a CPU store into untracked memory is seen at the next ordering point. Pending GPU writes still make a scan unstable, as before.Tested
Windows 11, NVIDIA GeForce RTX 5070 Ti, MinGW-w64 GCC 15.2.0, on main
8cd937e29with #6187; rebased onto main92e50418fwith #6187 (only a CMake test list conflicted), where the full suite passes 1276 of 1296, 14 skipped, failing only the known tests below andagc_driver_multisample_fill_host_only, which passes when run alone.ctest: 1233 of 1249 pass, 14 skipped.guest_call_trace_abortandwindows_backtrace_reportfail, and fail the same way on plain main here.agc_driver_prepared_graphics_prebuild_0/_1andundeliverable_host_exceptionfail under my test runner because it skips their environment changes and pass pattern; run with those, they pass.agc_untracked_key_proofs(agc_driver_recorder_tests --untracked-key-proofs-only): keys in an untracked allocation. In one collect epoch the secondProvedClearKeysand the secondProvedCurrentDccKeyscome from the proof; after a store into the keys and a new epoch the keys are scanned again and read as changed. Without this change the test fails with "a second key proof over untracked memory in the same collect epoch scanned the keys again".ProvedClearKeyschange alone did not move it measurably; with theProvedCurrentDccKeyschange as well, 65.3% and 66.9% of real time against 68.0% and 68.0% (that stack also had perf(agc): fast revalidation over untracked memory proves a surface by its stamp until the next ordering point #6192). I have no measurement ofmainalone.Related: #6060 keeps Windows imports of private write-watched memory on
GetWriteWatchwhen a start-up probe allows it; key ranges it keeps watched never reach this path.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code