Repository navigation
Conversation
|
@TheAggie I had a variant of this running locally when #6192 went up, and measured it at Astro Bot's title (PPSA21567, the Design difference. Instead of a stamp taken in
On a microbenchmark (16 untracked sampled surfaces) this took At the title it saved nothing. Setup:
The one window of the title intro before the press agrees:
So the proof does what the counters promise:
But a revalidation costs the same either way. Solving the two rows, a full walk costs only about 7 µs more than a fast proof here, and the other ~580 µs of each On safety, both runs show the same three I'm not opening this as a competing PR: at this title it doesn't buy anything over #6192, and #6192 has measured gains on Flycast. If you do want the stamp to outlive the epoch for hinted ranges, the test I used ( AI-assisted: yes |
…is forgotten Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…son memo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…y its stamp until the next ordering point APS5_VERIFY_UNTRACKED_PROOFS=1 runs the full walk beside every such proof and counts disagreements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n a collect epoch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@fdfawef324 thanks for measuring this at Astro Bot's title, and for the detailed write-up. Your table matches what #6192 claims and no more. It removes the On letting the proof outlive the epoch for hinted ranges: I'd keep #6192's stamp with the epoch in it, because of the race you describe (a store between the lookup's read and the capture whose mark another hint walk consumed). Your I've rebased #6187 and #6192 onto current AI-assisted (Claude Code) |
56cede7 to
2d03040
Compare
|
@TheAggie MGS4 (PPSA18194) data on Windows, plus a small extension that may belong in this PR. What we saw. With #6192 (and #6187) on our test stack, MGS4 gameplay still takes the full walk for about 25.8k of 140k revalidations per 10 s, all Extension. On Windows, #4878 already keeps write-watch marks of unwatched blocks as a hint, and std::array<std::uint64_t, 4> untrackedRangeStamp(std::uint64_t address, std::size_t bytes) {
const auto epoch = GuestMemory::CollectEpoch();
if (epoch == 0 || bytes == 0 || (GuestMemory::ForgetSerial() & 1u) != 0) return {};
+ const auto hint = GuestMemory::UntrackedHint(address, bytes);
const auto* recorder = Recorder::Active();
- return {epoch, GuestMemory::NewestStamp(address, bytes), GuestMemory::ForgetStamp(address, bytes), recorder != nullptr ? recorder->NewestWriteNote(address, bytes) : 0};
+ return {hint != 0 ? hint | (1ull << 63u) : epoch, GuestMemory::NewestStamp(address, bytes), GuestMemory::ForgetStamp(address, bytes), recorder != nullptr ? recorder->NewestWriteNote(address, bytes) : 0};
}A CPU store is still seen at the next ordering point: Measured (Windows 11, RTX 3080, NVIDIA 610.74, i9-10850K; our integ stack with #6192/#6187; one build, the change switched off by an env var for the control; 540 s each, the same save, medians of the last 18 windows of 10 s in gameplay):
Frame rate does not move here: MGS4's draw thread is bound by other phases. Feel free to fold it in if it fits your PR; if you would rather keep #6192 as is, I can open it separately once this one merges. AI-assisted (Claude Code); the runs and numbers above are ours. |
|
GTA V (PPSA04263, 01.010.002) on Linux, Performance mode, prologue bank, measured on this head (2d03040). #7515 is merged in both builds of each pair for its counters; the desktop pair also has #7646, since main c4c2b3a does not start without it (#7636). Merging onto main hits one hunk in
Two runs per build, alternating, 120 s windows after the load. GPU time per present is unchanged on both machines, so the gain is on the CPU side. On the desktop the draw committer is the bottleneck, and
Not tested: Windows, AMD GPUs, Fidelity mode. AI-assisted: yes |
What
Stacked on #6187; only the last two commits are this PR.
A cached resource template is reused only after
ShaderResources::Revalidateproves its textures and storage images current. The fast proof (fastRevalidate) answers from write stamps; a surface in memory the write watch does not cover (on Windows, every host-pointer import of the guest mapping, #1441) has none, soCollectWritesreturns 0, the fast proof fails withcollect, and the full walk repeats every texture lookup.In RetroArch's Flycast core (PPSA99169) on Windows: 2.06 million of 2.2 million revalidations per 10 s took the full walk for that reason, and revalidation took 15.2 s of thread time per 10 s in all.
captureValidation), each surface over untracked memory also records a stamp: the collect epoch,NewestStamp(driver stores into the range),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 range. Storage images get the same, instorageUntracked.fastRevalidateaccepts such a surface while its stamp is unchanged, instead of failing withcollect, and leaves it out of theUnchangedSinceAllquery. Everything else in the fast proof is as before: the keys, the pending-image scan and the cache checks still run.compareUntrackedalready uses for untracked memory: a CPU store there is seen at the next ordering point (docs/dev/ARCHITECTURE.md, "Untracked storage image comparisons"). A collect epoch of 0 or a forget in progress gives no stamp, so the full walk runs.APS5_VERIFY_UNTRACKED_PROOFS=1runs the full walk beside every fast proof that involved an untracked surface and reports how often it disagreed.Tested
Windows 11, NVIDIA GeForce RTX 5070 Ti, MinGW-w64 GCC 15.2.0, on main
8cd937e29with #6187; rebased onto main92e50418f(only a CMake test list conflicted), where the full suite passes 1277 of 1296, 14 skipped, failing only the known tests below.ctest: 1229 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_driver_multisample_fill_host_onlyfailed once in the parallel run and passed three times out of three run alone.agc_untracked_revalidate(agc_driver_recorder_tests --untracked-revalidate-only): a sampled template over an untracked allocation proves on the fast path twice in one collect epoch; after a CPU store and a new epoch it takes the full walk. Without this change the test fails with "a sampled template over untracked memory took the full walk in the same collect epoch".APS5_VERIFY_UNTRACKED_PROOFS=1: 1,600,000 fast proofs over untracked memory checked by the full walk, 0 disagreed.ANYPS5_PRESENT_MODE=immediate, unprofiled, on the local stack described in perf(agc): an untracked comparison memo holds until memory it covers is forgotten #6187 with perf(agc): an untracked comparison memo holds until memory it covers is forgotten #6187 included: two runs each, audio produced at 63.1% and 62.6% of real time without this change against 65.3% and 66.9% with it. Fast proofs per 10 s went from 0.13 million of 2.2 million revalidations to 1.96 million of 2.48 million; the committer's lookup phase went from 9.75 to 5.75 µs per draw. I have no measurement ofmainalone.Related: #6060 keeps Windows imports of private write-watched memory on
GetWriteWatchwhen a start-up probe allows it; memory it keeps watched never reaches this path, so this PR matters for what stays untracked (imports through views, devices whose probe fails). I have not measured how much of the Flycast workload #6060 would cover.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