fix(agc): a driver store over an earlier store's range takes its piece slot #6868
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6868"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-16T15:02:50Z.
What
The write tracker keeps the byte ranges of up to four partial driver stores per 64 KiB block (
noteDriverStore). A store that did not fit forgot the oldest and set the block'sdroppedgeneration. From then onStoredOveranswered true andStoredAllSincefalse for every range of the block, for any generation before the forgotten store, whether a store had touched that range or not.A store whose range contains earlier stores' ranges now takes the place of one of them and frees the others, so a range stored again and again keeps one slot. Generations only grow, so the replaced stores answer nothing the new one does not:
StoredOverasks whether a newer store overlaps the range,StoredAllSincewhether newer stores join up over it. With slots replaced in place, the round-robin index would no longer point at the oldest slot, so a store that does not fit now forgets the slot with the lowest generation, as the round-robin did before.Where it shows: a storage image whose last 64 KiB block also holds the start of the next allocation, a buffer that several dispatches write in each frame.
MarkDirectWritesrecords the buffer's written range after each of them, the four slots fill with that one range within a frame, the next store forgets one, and the image's own part of the block reads as stored over although nothing wrote it. Its write-back then leaves that block to the CPU (the shared edge block rule of #441), and the image's texels there are replaced with older contents of that memory. An image uploaded through a CPU copy keeps the uploaded bytes, and #1599's comparison stores its results anyway; an image over a host import keeps no such copy above 1 MiB.In 007 First Light (PPSA11386) the image is the volumetric fog's temporal history (107x60x64, B10G11R11, 1.75 MiB, its end not 64 KiB aligned, no saved copy). The texels that come back hold bytes of another resource, Inf and NaN among them, and the fog pass blends them into the next frames. The screen shows a magenta and white wash over most of it during gameplay.
Several distinct partial stores in one block still fill the four slots and set
dropped; the technical debt entry records it.Related:
UnchangedSinceread the CPU page stamps and these store slots whenever a block's stamp is newer than the query. This change does not depend on it.noteDriverStoreunchanged and merge cleanly with this change; #6678 (open) adds a debt entry at the same place indocs/dev/debt/libSceAgcDriver.md, a placement conflict only.Tested
agc_write_tracking, new checkCheckRepeatedNeighbourStores:StoredAllSince);CheckSharedBlock's check that six distinct small stores, more than the four slots, still count as a store over the rest of the block passes unchanged.agc_repeated_neighbour_stores(new,agc_driver_recorder_tests --repeated-neighbour-stores-only): a 1024x512 RGBA8 storage image 8 KiB into its first block is uploaded and settles, is cleared on the GPU, the 24 KiB after its end take five driver stores, and the image is written back. Every texel the GPU wrote must be stored and the bytes after the image must be unchanged. It runs over watched memory and over a watched host import.main82ddae75b's GuestMemory.cpp and the new tests:agc_write_trackingfails at "repeated stores of the neighbour's bytes count for the first surface's part of the shared block", andagc_repeated_neighbour_storesat "over a watched host import: 2048 of 524288 texels the GPU wrote were not stored" (the image's 8 KiB in the shared block).agc_write_trackingfails at "a full block forgets a store newer than its oldest".ctest -R '^agc'on this branch: 617 tests, 1 failure.agc_driver_store_over_untrackedfails the same way onmain(reported on #5671).agc_driver_stencil_ref_exportskips itself on this machine.main4186f06a9with 007's bring-up stack, among it #6346 at b8251dcbb and #6465, and local diagnostics; #6346 makes the store slots decide whether the history is uploaded again, onmainthey decide whether its write-back stores its last block). Each run: the 59 frames after gameplay starts, every fog volume dumped after each frame's fog pass.MarkDirectWrites, anddroppedwas newer than the image.droppedmade a block read as stored over, over the whole run: 4,724 in a run without this change, 1,550 with it, 1,463 of them with four distinct stores in the block (the case in the debt entry), none of them on the fog volumes.aa8f73490):main452494439: both new tests pass 3/3 with the change and fail withmain'sGuestMemory.cpp(3/3 on the RTX 3070, 6/6 on lavapipe), with the same two failure messages as listed above: https://github.com/boykopovar/AnyPS5/pull/6868#pullrequestreview-5550648240StoredOver/StoredAllSincequeries agree exactly; with further arbitrary partial stores that may exceed the slot capacity, 122,880 more show no missed store and no complete coverage over a gap. The parent fails it (false overlap without history overflow), and a variant that replaces an overlapping, not only a contained, piece fails withlost an actual driver store: https://github.com/boykopovar/AnyPS5/pull/6868#issuecomment-6219929503Checklist
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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-16T16:24:41Z.
Review: COMMENTED
Red/green on lavapipe, the driver the Linux CI job uses, and on a second NVIDIA Linux machine.
Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04, i7-8700, GCC 15.2, Release,
BUILD_TESTING=ON. Headaa8f73490merged intomain452494439(clean merge). Device checked in theVulkan device:lines.The write-watch probe differs between the two, so the host-import case runs under different rules: the RTX 3070 logs
host imports resolve write protection: no ... imported ranges stay watched, lavapipe logsyes ... imported ranges are compared. Both run the watched-memory and the host-import cases.agc_write_trackingandagc_repeated_neighbour_storespass 3/3main'sGuestMemory.cpprepeated stores of the neighbour's bytes count for the first surface's part of the shared blockandover a watched host import: 2048 of 524288 texels the GPU wrote were not storedSo the host-import case catches the regression with either probe result.
agc_driver_store_over_untrackedis not affected by this change here. On the RTX 3070 it fails on every run with and without the change (the result did not reach a block the CPU left alone), as onmain. On lavapipe it is intermittent on both trees with a different message (the result was never held pending): 1 of 3 runs with the change, 2 of 6 withmain'sGuestMemory.cpp.Not run: Windows, AMD, the full suite, any title.
GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-16T16:25:35Z.
Independent interval-history check at exact head
aa8f734907686de67c0f16924e84ef5b4762f606, complementing the GPU report above. Ubuntu 24.04, kernel 7.0.0-38, GCC 13.3, Ryzen 9 9950X; production CPU tracker only.Compiled the unchanged
WriteTracking.cppwith the actualGuestMemory,GuestArena,GuestAllocationsandGuestWriteWatchobjects (-O2, function/data sections, linker garbage collection). The PR passes. Keeping the same test/support objects and replacing onlyGuestMemory.cppwithHEAD^fails atrepeated stores of the neighbour's bytes count for the first surface's part of the shared block.A separate scratch oracle keeps an unbounded list of driver-store intervals and their returned generations, then computes overlap and complete coverage by sorting/merging newer intervals. It uses the public
MarkWritten,StoredOverandStoredAllSince_nid_no_patchcalls. Memory is untouched by the CPU after initial registration/collection, so the history being compared is driver stores.Five seeds, each with 128 trials over two 64 KiB blocks:
StoredOverandStoredAllSince, including unrelated bytes, random prior-generation cutoffs and cross-block spans. All pass.Discriminating controls: the parent production object fails this oracle with
false overlap without history overflow. A scratch variant that replaces an overlapping piece instead of only a contained piece fails withlost an actual driver store. This checks that the coalescing repairs precision while retaining the containment requirement, rather than simply suppressing overflow effects.A traced stock pass shows successful
UFFDIO_REGISTER,UFFDIO_WRITEPROTECTandPAGEMAP_SCAN; these runs did not skip for lack of a write-watch backend. The worktree is clean. Scope: CPU range/generation bookkeeping at this head; no GPU write-back, title replay, #6346 composition or build on newer main was tested here.Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-16T16:33:28Z.
Thanks @jotitadev and @simonbbby: a second NVIDIA machine plus lavapipe for the red/green, and an unbounded-interval oracle with discriminating controls for the bookkeeping. Both are now listed under Tested.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T18:27:59Z.
I opened #7233 from current main to separate complete-write evidence from possible-write ranges in the DriverPieces tracker. It keeps their histories in independent slots and routes BDA page reports plus descriptor-bound direct/copy-back ranges through the possible-write path. The change touches the same tracker code as this PR but does not depend on its interval-retention behavior. If #7233 lands first, please rebase #6868 onto it and keep the containment/replacement rule for both histories; if #6868 lands first, I will rebase #7233 and preserve the separate possible-write ring.
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-17T18:33:29Z.
@MarcZX100 agreed. If #7233 lands first, I'll rebase this onto it and keep the containment/replacement rule for both histories.
The possible-write ring is where 007 First Light's case ends up. There the four slots fill with one
MarkDirectWritesrange, which #7233 routes as a possible write. Without containment in that ring, the next identical range setspossibleDropped, andStoredOveragain answers true for the image's part of the shared block. I'll run 007 with #7233 on top of this, with the rule on both rings, and report whether the fog-history wash stays fixed.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T00:12:03Z.
I folded the reported retention rule into #7233 at d88fbaa45 for both the exact-write and possible-write rings, preserving their separate slots. There is also a new assertion for repeated possible writes not invalidating the adjacent range. When convenient, could you try your 007 setup on the combined head and confirm whether the fog-history regression is gone? The PR descriptions now note that these changes need coordination before merge.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T16:20:38Z.
@SleglJan: a title-level datapoint for the containment reuse this PR introduced is on #7233 (comment). In Ruffle (PPSA68091), a word the driver rewrites every frame next to a 4x target's DCC fills the block's four pieces, and five of Ruffle's visual tests stop on
writes to a resident multisampled DCC target or its metadata are not implemented. With the shared change they run and match their expected images. I tested #7233 because this PR conflicts with my test stack in the debt file.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T17:55:43Z.
@SleglJan here's a Ruffle case that containment doesn't cover, for when you look at eviction. It's
blend_modes__shader_as_mask(Ruffle's visual test SWF) onmain385ed71f2c+ #6543 + #7250 + #7233, with a temporary print at the failingStoredOver.The resident 4x target's DCC is 0x4004606000+0x14000, so it ends at offset 0xa000 of block 0x4004610000. When the check fails, the range's generation is 6801. The block holds four pieces, all at or past 0xa000:
droppedis 6812. None of those pieces touches the DCC, butdropped> 6801 makesStoredOvertrue for the whole block. The pieces don't contain one another, so taking a contained piece's slot doesn't help.Something that keeps the extent of what was forgotten would help. One option: on overflow, merge the two nearest pieces into one range with the newer generation. That range would count for
StoredOver, but not as coverage forStoredAllSince. Do you plan to change eviction in this PR or #6346? If not, I can do it as a follow-up once they land. It's the only stop left in the 66 Ruffle visual tests I ran with #6543, #7250, #7233 and #7600.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-18T18:03:48Z.
@milescoviello thanks for the clear case. I don't plan to change eviction in this PR or in #6346, so please go ahead with the follow-up. This PR's rule is now part of #7233, which is agreed to land first, so a follow-up on top of #7233 is the natural place.
#6346 doesn't change eviction, but it touches the same code. It moves
StoredOver's slot check into aWriteTrackerhelper thatUnchangedSincealso uses. And on Windows, a private mapping now setsdroppedinstead of erasing the block's pieces, sodroppedhas to keep its whole-block meaning there. Whichever of the two lands second takes the rebase.Your shape for it sounds right to me, for both rings: on overflow, merge the two nearest pieces into one range with the newer generation, counted for
StoredOverbut not as coverage forStoredAllSince. One case to test: the two nearest pieces can be a resource's own last store and the next allocation's first store, touching at the resource's end. The merged range then makes the resource read as stored over, although no store after its own touched it. That's the same false answer that cost #6868's fog history its last block.Your print shows the four kept pieces but not the forgotten one (generation 6812). If that store overlapped the DCC, the stop is real and merging won't remove it. Logging the evicted range would tell you before you build anything.
When you have a branch, I can run it against 007 First Light's fog-history case and our
agc_write_trackingchecks on the RTX 3080 (Linux, write watching available). The same runs count the uploads where only a forgotten piece made a block read as stored over. In #6868's run with the change that was 1,550, 1,463 of them with four distinct stores in the block, and none on the fog volumes.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-18T18:42:00Z.
@SleglJan thanks, I'll do it on top of #7233.
You're right about the forgotten piece, so I'll log the evicted range first. If the 6812 store overlapped the DCC, the stop is real and there's nothing to build. I'll add the case you describe to the tests: a resource's own last store and the next allocation's first store, touching at the resource's end, must not merge into a range that reads as stored over the resource. Merging only pieces that leave a gap, or keeping touching pieces apart when another pair can merge, are the two ways I see to avoid it. I'll measure both against the Ruffle case. I'll ping you here with the branch for the 007 fog-history run and the upload counts. Thanks for offering.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T01:11:16Z.
@SleglJan the follow-up is ready, with the evicted-range log first as you suggested. Branch
fix/driver-store-merge(829be00343) is one commit on #7233's head 42cbe0c334. I'll open the PR when #7233 lands or is rebased, as MarcZX10 asked there.The forgotten piece. I logged each ring's last 8 evicted pieces, on the same Ruffle stack (
main385ed71f2c+ #6543 + #7250 + #7233). At the failing check, generation 6753,droppedwas 6764, and that came from the piece0xb000-0xc000, which doesn't overlap the DCC's part (0x0-0xa000). The DCC's own store (0x0-0xa000, generation 6750) had been evicted earlier, and it's older than the check. So the stop is false and worth fixing.Choosing the rule. I traced every driver piece store, whole-block store, block erase,
StoredOverblock check andStoredAllSinceblock check, and replayed the traces offline through candidate rules and through a tracker that keeps every piece. Replaying #7233's rule gives the logged answer in every check (293,996 of 293,996 infilters__bevel_full). No rule missed a store. False stored-over answers:shader_as_mask(74 checks)bevel_full(293,996)So nearest-pair merging was as bad as you expected. The extent idea fails exactly where you said: the first piece forgotten is usually the surface's own store, and merging it with any newer neighbour makes the surface read as stored over again.
The rule in the branch. When a ring is full, it merges the pair, among the four pieces and the new one, whose union raises the recorded generation of the fewest bytes. For different generations, that's the bytes of the union outside the newer piece. For equal generations, it's the gap. A surface's own store is large, so it stays exact while small stores past it merge with each other. That's your touching case: the next allocation's first store merges with what follows it, not with the surface.
The merged piece spans both with the newer generation. For coverage, it keeps the older of the two coverage generations when the pieces touch or overlap, because every byte was then stored since it. It proves nothing across a gap. My first version proved no coverage for any merged piece, and that broke #7233's "out-of-order split driver stores" check.
Tests (
agc_write_tracking, RTX 4070 Ti, Linux with write watching):CheckMergedPieceshas your touching case, the Ruffle label pattern, and coverage of contiguous merges but not gapped ones.CheckSharedBlock's "forgotten driver stores are taken as missing the range", and the "rest of the block" check in yourCheckRepeatedPossibleStores. They now require the opposite. A forgotten store still counts over its own bytes, and a full ring doesn't merge two distant pieces.GuestMemory.cppthe new checks fail.agc_driver_native_depth_bda_clearandagc_driver_native_depth_clears), nothing else.blend_modes__shader_as_masknow runs to the 32 s limit instead of stopping at 11 s. Its last frame still differs from the expected image (coarse 14.8), which I haven't looked at yet.filters__bevel_fullis unchanged (coarse 2.8).For your 007 run, if you still have time:
diag/driver-store-traceis the branch plus a trace hook (APS5_DIAG_TRACE=<file>) andtools/driver_store_replay.py <file>. The replay prints false and missed stored-over answers and coverage lost or wrongly claimed for each rule, against the unbounded tracker, and how often each rule differs from the logged answer. The traced rule differs in 0, which checks the replay against the build. The fog-history case and your count of uploads where only a forgotten piece made a block read as stored over would be the real benchmark.One note for #6346 now on
main: its Windows private-mapping path setsdroppedwith block-wide meaning. When I rebase onto #7233's rebase, I'll keepdroppedfor that path and only stop the ring from writing it.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T01:14:27Z.
@SleglJan a follow-up on the one open point above:
blend_modes__shader_as_mask's last frame differing from its expected image (coarse 14.8) isn't ours. Ruffle'stest.tomlfor it saysknown_failure = true, with the note "Shader masks unimplemented + a bug in color blending", so Ruffle's own renderer doesn't match that image either. The only thing that test shows here is that the false stop is gone.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T02:51:50Z.
@milescoviello I ran 007 First Light with your rule and your trace hook, twice. The fog case stays closed under it in both runs. The replay over the two traces splits:
No rule misses a stored-over answer in either run.
Setup:
main4186f06a9with 007's bring-up stack (open PRs, among them #6346 at b8251dcbb and #6465, and local fixes) and local diagnostics.WriteTracker::storedOverhelper, so thedroppedreads went from there. The Windows private-mapping path, which setsdroppedin arm (c), erases the block's pieces instead, as in your tree (you plan to keepdroppedthere). That path isn't compiled on Linux.StoredOverblock-check record went into that helper.UnchangedSincealso uses the helper (as onmainnow), so its checks are in the traces too. This tree has noRewatch, so that erase record has no place here.Runs (arm (c), with #7233's rule, for comparison):
dropped. I don't count uploads where only a merged piece does.agc_write_trackingfails in this tree at "forgotten driver stores are taken as missing the range". That is theCheckSharedBlockassertion your commit inverts in your test file, and this tree carries the old test. The binary stops there, so the later checks didn't run, among them the "rest of the block" one inCheckRepeatedPossibleStores.Replay (
tools/driver_store_replay.py):StoredOverblock checks, of which the unbounded tracker reads 115,643 as stored over.StoredAllSinceblock checks (its only caller here is the native multisample depth clear), so your coverage change isn't exercised here.Per block, from a small script over the same traces with your tool's rules:
droppedanswers all 690,188 later checks falsely.I haven't traced which caller makes run 2's most-checked block's checks, so I can't say what a false answer costs there.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T03:06:32Z.
@SleglJan thank you, that's the benchmark I couldn't run. Two runs that split this way settle it against my rule: it fixes the overflow collapse in run 2's hot block, but it costs thousands of false answers in the one block that has them in both runs, where #7233's rule has under 200.
I replayed my Ruffle traces through the same tool for the rows your runs favour (
blend_modes__shader_as_mask, 74 checks;filters__bevel_full, 293,996):So the forgotten-range rules are the only ones that win in all four traces, and none of them misses a stored-over answer. I'll switch the branch to them:
dropped. When that list is full, its two oldest ranges merge into one: the hull of both, with the newer generation.StoredOverreads the forgotten ranges like pieces. Coverage stays as conservative as #7233's, but per range: a forgotten range newer than the generation that overlaps the queried part denies coverage, instead of any forgotten store in the block doing so.droppedstays for #6346's Windows private-mapping path.On memory: a block entry is 112 bytes on #7233 and 136 in the branch. Four forgotten ranges per ring add 96 bytes, and four more ring slots per ring another 128. Entries exist only for blocks with driver stores. Unless you see a reason to prefer 8 slots, I'll start with 4 slots and 4 ranges (168 and 162 in your runs) and report the trace counts again; going to 8 slots is a one-line change if the 007 numbers make it worth it.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T03:17:16Z.
@milescoviello one number for the slot choice. In the two 007 traces from my last comment, 21,861 and 21,724 blocks had driver stores by the end of the run, and 6,729 and 6,710 of them had piece stores. A whole-block store creates an entry too, and nothing erases one on Linux, so the first two numbers are roughly the entry counts at the end. At your sizes:
Over these two traces, the extra slots take the forgotten-range rule from 168 and 162 false stored-over answers to 1 and 0. I don't see a reason against starting with 4 slots and 4 ranges. I can run 007 on the branch once it's pushed and post the counts for both settings.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T06:09:20Z.
@SleglJan thanks for the entry counts. About 2 MB for the ranges is cheap next to what they fix. The branch is pushed:
fix/driver-store-forget(3eb640f92a) is one commit on #7233's head 42cbe0c334: 4 slots and 4 forgotten ranges per ring, the two oldest ranges merging into their hull with the newer generation, and coverage denied only by a forgotten complete store that overlaps the queried part. It doesn't have #6346's Windows path, since #7233's head doesn't either.diag/driver-store-trace-forget(8984519c83) adds the same trace hook andtools/driver_store_replay.py. The traced build runs "4 slots, 4 forgotten ranges merging the two oldest", so that row should differ from the logged answer in 0 checks. The 8-slot row comes from the same trace.Tests (
agc_write_tracking, RTX 4070 Ti, Linux):GuestMemory.cppthe changed checks fail, first on "driver stores forgotten in the first surface's part count for the second surface's part".CheckForgottenPiecescovers the surface case, the gap between forgotten stores, the merge of the two oldest ranges once the list is full, the coverage of a surface stored after forgotten neighbours, and the label pattern.agc_driver_native_depth_clears, which fails the same way on 42cbe0c334 alone.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T07:53:11Z.
@milescoviello 007 on
fix/driver-store-forget, two runs: runs 3 and 4. Runs 1 and 2 were your merge rule, in https://github.com/boykopovar/AnyPS5/pull/6868#issuecomment-6258612024. These use the same harness and tree as run 2 there, without the upload logging.Setup:
main4186f06a9with 007's bring-up stack, local diagnostics, and #7233's tracker commits.WriteTracker::storedOverhelper. The Windows private-mapping path erases instead of settingdropped, as in your tree; it isn't compiled on Linux.StoredOverblock-check record computes its logged answer fromwhole,possibleWholeand the two piece rings only.StoredOveritself also checksforgottenandpossibleForgotten. So in your build, a check that only a forgotten range answers is logged as not stored over. That changes only the logged answer, not the replay's counts.agc_write_trackingfails in this tree at "forgotten driver stores are taken as missing the range". That is theCheckSharedBlockassertion your branch inverts, and this tree carries the old test.Replay (
tools/driver_store_replay.py), false stored-over answers. These traces have 2.9 M and 3.7 M checks, against 1.8 M in runs 1 and 2, so the counts aren't comparable with the 168 and 162 there.StoredOverblock checks (stored over by the unbounded tracker)Per block, for the current rule and the branch:
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T11:22:52Z.
@SleglJan thanks for runs 3 and 4, and for catching the hook. Across your four runs, "8 slots, 4 forgotten ranges merging the two oldest" gives 1, 0, 2 and 0 false stored-over answers, against #7233's 374, 690,534, 4,867 and 7,249, and no rule misses one. So I've moved the branch to 8 slots:
DriverPieceSlotsconstant, so they still overflow it. Each still evicts the same pieces as it did with 4 slots, inCheckSharedBlock,CheckRepeatedPossibleStores,CheckForgottenPiecesand the possible-interval checks.forgottenandpossibleForgottenin the logged answer, as in your port. The traced build's row ("8 slots, 4 forgotten ranges") should then differ from the logged answer in 0 checks.On the magenta wash and the green block: no rule misses a stored-over answer, so these rules differ from an unbounded tracker only by extra stored-over answers, never by stale reads. Arm (c) shows the same kind of green block at +11 to +13, so I don't think either comes from the tracker. With 8 slots there are also far fewer extra answers. I haven't attributed either one.
agc_write_tracking×3, the red check against #7233'sGuestMemory.cppand the write-tracker/MSAA set are queued behind two other jobs. I'll push both branches when they pass and post the new heads here.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T11:39:58Z.
@SleglJan both branches are pushed with 8 slots:
fix/driver-store-forget(4f4729b084), still one commit on #7233's head 42cbe0c334.diag/driver-store-trace-forget(5658904127), with the logged answer now including both forgotten rings.Tests (
agc_write_tracking, RTX 4070 Ti, Linux):GuestMemory.cpp, the updated tests fail at "driver stores forgotten in the first surface's part count for the second surface's part".DriverPieceSlots + 2pieces, so it still evicts the piece it checks.agc_driver_native_depth_clears, as on 42cbe0c334 alone.If you run 007 on it, the trace's "8 slots, 4 forgotten ranges" row should show 0 logged differences directly, without your port's change.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-19T18:14:59Z.
@milescoviello 007 with 8 slots, runs 5 and 6. Same harness and tree as runs 3 and 4, with the piece rings at 8 as in 4f4729b084.
Setup:
main4186f06a9with 007's bring-up stack, local diagnostics and #7233's tracker commits, then your 3eb640f92 and trace hook 8984519c8 by hand, with the logged answer including the forgotten rings.piecesandpossiblePieceshold 8,forgottenandpossibleForgottenstay at 4.The corner measure is new. Where those runs show the block, it gives 0.95 to 1.00 at run 4's +49 to +53 and 0.12 to 0.54 at +54 to +56, and 0.52 to 0.93 at arm (c)'s +11 to +13. It also gives 0.32 at run 4's +6, a green-tinted bloom frame without the block.
Replay (
tools/driver_store_replay.py), false stored-over answers. These traces have 2.0 M and 1.8 M checks, so the counts aren't comparable with runs 3 and 4.StoredOverblock checks (stored over by the unbounded tracker)Per block:
On the magenta:
One correction to "only by extra stored-over answers, never by stale reads". In a traced run on runs 3 and 4's build, false answers on that same part in two presents made a 1×1 float image there take its guest bytes again (two more uploads), and the next dispatch that read it got 3.8e-25 where it had read 0. The difference was too small to show on screen, but an extra stored-over answer can bring back stale bytes. That's one more reason to keep them rare, which 8 slots do.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T21:03:50Z.
@SleglJan thank you for runs 5 and 6. With 8 slots, "8 slots, 4 forgotten ranges merging the two oldest" gives 0 and 6 false stored-over answers, against 9,131 and 2,695 for #7233's rule. It differs from the logged answer in 0 checks, so the hook now logs what the build answers. And no rule misses one. That settles the slot count for me.
Thanks too for the correction, which I accept: I was wrong that extra stored-over answers can't cause stale reads. Your traced run shows a false answer making the 1×1 float image take its guest bytes again, and the next dispatch read 3.8e-25 where it had read 0. A false stored-over answer can overwrite a GPU result with older guest bytes. That makes keeping them rare part of correctness, not only cost, and I'll say so in the PR description.
On the magenta: run 5 shows it with no false answer in its whole trace, and run 6 before its first one. Your forced answers on that part were followed by no artifact. So I agree it doesn't point at the rings. Your lead on the post-processing pass that reads a surface no pass wrote in the frame sounds like the place to look.
The follow-up PR still waits on #7233. Its head moved to ac0a545fe, and in your run that still fails
agc_driver_native_depth_clearsinDriverDispatch. Once #7233 settles, I'll rebasefix/driver-store-forgetonto it and open the PR with your six 007 runs. I'll cite them as your measurements.AI-assisted: yes (Claude Code)
Pull request closed