Repository navigation
perf(memory): skip 4 MiB runs no write stamped since a range check - #6266
Merged
adriadam10 merged 1 commit intoOct 18, 2026
Merged
Conversation
This was referenced Oct 15, 2026
This was referenced Oct 15, 2026
This was referenced Oct 15, 2026
Closed
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
11 tasks done
11 tasks done
12 tasks done
This was referenced Oct 15, 2026
11 tasks done
11 tasks done
11 tasks done
This was referenced Oct 16, 2026
adriadam10
force-pushed
the
perf/memory-coarse-write-stamps
branch
from
October 18, 2026 19:35
b594d57 to
192d95c
Compare
|
This pull request is labeled |
TheBlenDed
pushed a commit
to TheBlenDed/AnyPS5
that referenced
this pull request
Oct 25, 2026
… since a range check) at b594d57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
GuestMemory::UnchangedSinceandUnchangedSinceAllanswer whether any 64 KiB block of a range was stamped after a generation. #1310 made that a tight scan of the block stamps, but the scan still reads every block of the range. Render targets are checked this way on every draw (StorageTexture::refreshProved, fromrefreshResidentTarget), and a 4K surface spans hundreds of blocks.The write tracker now also keeps the newest stamp of each run of 64 blocks (4 MiB), and
stampraises it with the block's stamp.unchangedskips a whole run whose newest stamp is not after the generation. It scans the other runs, and the partial runs at either end, block by block as before.initializeandstampwrite block stamps, so a run's stamp cannot fall behind its blocks.LeafBlocks.On the S2 page of Sonic Origins Plus's main menu,
UnchangedSincecost the queue worker (APS5 sampler, 15 s):Per frame that is 0.76 to 0.44 samples. That is about 0.6% of the worker's frame, so the frame times below move within run-to-run noise.
Tested
Windows 11 (10.0.26300), WinLibs GCC 15.2.0 (UCRT), Release, NVIDIA GeForce RTX 2080 Ti, driver 617.14.
agc_driver_draw_program_trace, is not run, because its test executable does not link under MinGW on main itself (__gxx_personality_v0is undefined); it does not contain the code changed here.agc_write_trackinghas a new check,CheckCoarseRuns, over a range of 192 blocks. A driver store inside whole runs and a CPU store into the last block must both be seen, and blocks outside the stored one must stay unchanged.stampleaves the run stamp alone.APS5_TRACE_SECONDS=200:15on the same machine in one session, caches warm. Traces attached.The median frame did not move. The mean and p90 differences come mostly from a few slow frames in the baseline's window (p99 160.8 against 135.1 ms), which is run-to-run noise at this size.
The FPS shown in the title went from 7.91 to 8.34 (median of six readings). The sampled pair, run an hour earlier, showed 7.55 and 7.51, so neither pair moves beyond run-to-run noise.
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)Traces and summary lines (baseline b593e36, this change b8acbb0, whose summary says a38ad5e):
coarse-traces.zip