Repository navigation
feat(agc): reuse unchanged untracked storage snapshots - #13809
Celegans12 wants to merge 6 commits into
Conversation
|
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.
|
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (4, not in the main baseline's validation pass)Validation IDs already present on main (5 IDs in 702 tests)Skipped (42)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
Windows GPU run of head Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, Radeon RX 6700 XT with AMD proprietary driver 26.10.1 (Vulkan 1.4.315), WinLibs GCC 15.2.0 UCRT r7, Ninja, Release,
AI-assisted: yes (Claude Code). |
f29465a to
3f34df7
Compare
There was a problem hiding this comment.
Correction (2026-11-01): the title-ID/log demand below is not a CONTRIBUTING requirement; Unblocks: none is allowed. The technical points below are unaffected.
Same series as #13784/#13793, so the same blocking points apply here.
-
No title, no number: "No title or performance claim", "Unblocks: none". This is a default-on change to the storage-buffer path (read-only untracked storage > the existing pool). It needs a title ID plus
tools/trace_digest.pysummaries of main and the change from the same machine and scene showing the copies being skipped and the frame cost moving. Without that it is added state and added checks per storage binding with no measured return. -
"Selected Windows ranges bypass the epoch memo even if arming refuses." That reads as a regression for the refused case: a range that was previously served by the per-epoch memo is now recopied every time arming fails (pending writes, pins, host access, non-resident blocks). Is there a test where arming is refused and the old memo still serves the range? If not, this can turn a memo hit into a full copy of a large storage buffer per draw.
-
The owned entries share the existing storage pool, and the tracked containing-range reuse now excludes owned entries (
!entry->second.owned.words.empty()continue). Two consequences worth stating with numbers: a large owned entry is invisible to the containing-range lookup that would have served sub-ranges, and it can evict other entries from the shared budget. Please add counters for reuse, refusal and eviction so a trace shows the net effect. -
As with the parents, the negative controls are against the historical 6a691f build and several earlier controls were not rerun on this head. The risk here is serving stale storage contents, so the mutants should be rerun on the submitted commit.
Please sequence after #13784 and #13793 and carry the evidence on whichever PR claims the benefit.
3f34df7 to
28ba6a5
Compare
|
@CnRJay I checked the refused-proof case you raised and restacked this on the updated #13793 in I also forced the old epoch-memo path in that fixture. It reused the unchanged copy, but after an untracked CPU write in the same epoch both test modes caught stale bytes, so I kept the conservative copy rather than restoring that memo without a stronger proof. The updated storage tests passed three times each on Windows/NVIDIA and Linux/llvmpipe with validation; the pinned-refusal subcase runs on Windows. The flush-stamp and containing-range mutants also failed at their intended assertions, and the restored candidate passed. I haven't measured a title or added the requested reuse/refusal/eviction counters yet, and the shared pool can still evict other entries. Would you take a look at the refusal tradeoff and the refreshed controls? I'm continuing with the remaining observability and performance questions. |
28ba6a5 to
2afa3ef
Compare
|
@CnRJay I restacked this on #13793's updated head and added separate storage trace counts for arm outcomes, proof checks, requested 64 KiB blocks, reuse, invalidation and capacity eviction. The trace marks unbound events and full totals as incomplete; The exact merge with main I still don't have title-scene performance, real-scene reuse or eviction rates, or tracing-overhead measurements. Refused Windows ranges continue to copy again because the old epoch memo returned stale bytes in the test-only control. Would you take a look at the separate counters and that remaining cost when you have a chance? |
2afa3ef to
b456564
Compare
|
@CnRJay I restacked this on the bounded #13784 and updated #13793 in |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (10, not in the main baseline's validation pass)Validation IDs already present on main (5 IDs in 715 tests)Skipped (51)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ NVIDIA GPU test: passedPR head
Unstable on main (4, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (10, not in the main baseline's validation pass)Validation IDs already present on main (5 IDs in 715 tests)Skipped (51)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
@CnRJay @TechLevelZero I merged the updated #13793 branch and current main, keeping the storage, draw and window-import test registrations. Eleven selected owned-storage, owned-draw and window-import tests passed on Windows with Vulkan validation enabled. Conventions and |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (10, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 751 tests)Skipped (52)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
bd731f7 to
4d2a864
Compare
Resolve list conflicts in RuntimeSwitches, the recorder test properties and ENVIRONMENT.md by keeping both sides, and keep main's !hostOnly argument on ReusableDrawSnapshot next to the new use argument on ArmOwnedDrawInput.
|
@Celegans12 I merged main into the branch (7cf278b) to clear the conflicts. All five were lists both sides appended to (RuntimeSwitches enum, names and getenv arrays, the recorder test properties, two ENVIRONMENT.md rows), and I kept both sides. In Draw.cpp CopyDrawInput the ReusableDrawSnapshot call keeps main's |
|
Ran the recorder, owned draw/storage and performance-trace GPU tests on Linux and NVIDIA's proprietary driver with the Khronos validation layer; the NVIDIA runs so far are on Windows or for older heads. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor
The five No new AI-assisted: yes (Claude Code) |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: separate storage proof counts from the owned draw input counter so storage eviction cannot disable draw-input reuse.
What I ran
Reviewed head 7cf278b2ff76b8e26326f7fa76e06958fe62c3ed. Read the prepared description, commits, manifest and diff, then targeted source and test ranges through repo_read.py. No test commands were run; author-reported test results are not independently verified.
Results
| Check | Result | Note |
|---|---|---|
| Change review | failed | Shared counter can become incorrect |
| Tests | not run | No commands run in this review |
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp:302allows storage snapshots to be kept as owned entries, while:199routes them through the same pool as the owned draw snapshots. The changed code increments the sharedownedDrawInputscounter for storage entries, and the existingeraseDrawSnapshotdecrements it for every owned entry. However,CopyDrawInputuses this counter as a gate before looking up an owned vertex/index snapshot. When storage entries are evicted or invalidated, the counter can reach zero while an owned draw input still exists, disabling reuse until another draw input is kept. Keep the shared counter’s semantics limited to draw inputs, or add a distinct storage count and update the gate.
Non-blocking
None.
Not verified
Did not run tests or builds. The author-reported Windows and Linux test runs were not independently verified. Did not read full text for core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp or core/libs/prx/libSceAgcDriver/tests/Recorder.cpp; reviewed the relevant changed hunks and targeted ranges through repo_read.py. All other changed files listed in the manifest were included in the review folder; no additional full-file reads were needed.
To get this to a good state
Separate storage ownership accounting from the counter used to gate draw-input reuse, then rerun the owned storage and owned draw input tests.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — changes requested
Changes are required before merge: fix the environment switch test setup so the override actually disables owned snapshots.
What I ran
- Reviewed head
efcfac0fccb78e0a88558cdbd402754a941d43f6; base ismain. No tests or build commands were run. - Read the prepared description, commits, manifest and full diff, plus targeted source and test ranges through
repo_read.py.
Results
| Check | Result | Note |
|---|---|---|
| Code review | failed | One verified test defect |
| Build and tests | not run | Author-reported runs only |
Findings
Blocking
- The disabled-switch test sets the runtime switch to
trueonly after the staticowneddecision has already been computed for the currentPrepareDrawBindingscall. Its subsequent epoch bump does not affect this test's first draw, and the test does not actually establish that the environment switch prevents owned reuse as claimed. The switch must be set before the decision is evaluated (or the test must exercise a freshShaderResourcesinstance after setting it).core/libs/prx/libSceAgcDriver/tests/Recorder.cpp:6741
Non-blocking
- None.
Not verified
- Did not run compilation or tests. The description reports author-run Windows tests, but these were not run during this review.
- Did not read every line of the changed test files; the included full text of
ShaderResources.cppandRecorder.cppwas excluded as too large and only targeted ranges were inspected. The other changed-file contents were read in the prepared diff or targeted ranges; excluded files are documented in the manifest. - Did not verify macOS runtime, title scenes, console behavior, performance, or tracing overhead.
To get this to a good state
- Correct the switch test so it disables the path before
PrepareDrawBindingsmakes its owned-path decision, then run the focused test.
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this review; the change’s core reuse path and trace-digest handling appear sound in the inspected code.
What I ran
No commands or tests were run. I reviewed head ca24aa1a04f8b05e2adeefed90802591e5006ed5 using the prepared diff and repo_read.py source reads.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | Core paths inspected |
| Tests | not run | Author-reported results only |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp and core/libs/prx/libSceAgcDriver/tests/Recorder.cpp was excluded as oversized; the relevant changed hunks were inspected in diff.patch. No tests were run, and runtime behavior on Windows, Linux, macOS, or console hardware was not verified. The description reports Windows test runs, but these were not performed in this review.
Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch; targeted ranges of core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp, core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp, core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp, core/libs/prx/libSceAgcDriver/Execution/include/PerformanceTrace.hpp, and tools/trace_digest.py. Excluded by bundle size: full ShaderResources.cpp and tests/Recorder.cpp.
To get this to a good state
Nothing is required.
# Conflicts: # docs/dev/ENVIRONMENT.md
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The reviewed changes look consistent with the stated goal; I did not run checks, and the PR description’s test results are author reported.
What I ran
Reviewed head 86042155c3177dc269c8f5f306ce382975a49979. No commands or checks were run. I read the prepared diff and targeted source at the pinned head; no merged preview was checked.
Results
| Check | Result | Note |
|---|---|---|
| Code review | passed | Core snapshot flow inspected |
| Tests | not run | Description reports prior Windows and Linux runs |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full text of core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp and core/libs/prx/libSceAgcDriver/tests/Recorder.cpp was excluded from the review folder; I read only the relevant ranges through the pinned reader. No runtime, test, build, console, title-scene, or performance checks were performed. The author’s reported test runs were not independently verified.
Files read: review/description.md, review/commits.md, review/manifest.json, review/diff.patch; all 16 changed files listed in review/manifest.json were reviewed through the diff and targeted source ranges where relevant. review/files.json was not present in the prepared folder listing.
To get this to a good state
Nothing is required.
ligmaSec
left a comment
There was a problem hiding this comment.
The trial merge onto c1601e56d5 conflicts in recorder, draw and trace files. Preserve the proof taken before copying, the refused-arming control, and the containing-range refusal when rebasing. The optional prefix and last byte both belong to the adjusted copy, so the existing protection tests for those positions are useful. Move the direct AGC debt edit into a fragment.
AI-assisted: yes.
What
Large untracked storage buffers marked read only are copied again after each collection epoch. Reuse an exact copy while native write-watch tokens and independent AGC proof hold. Flush the full adjusted range before lookup, capture proof before copying, and retain that original proof. Entries share the existing storage pool.
Selected Windows ranges bypass the epoch memo even if arming refuses; unchanged refused ranges therefore copy again. The old memo can return stale bytes after an untracked CPU write within the same epoch. Unsupported hosts keep the previous memo path. Refresh shared stamps after a flush and exclude owned entries from tracked containing-range reuse. Image proofs in #12921 remain separate. Trace summaries separate storage from draw counts for arms, proof checks, requested blocks, reuse, invalidation and capacity evictions. Requested blocks are an upper bound, not exact syscall counts. No title or performance claim.
#13784 and #13793 have merged, so this is one commit on
main. TheCopyDrawInputgate from #17889 keeps working: storage entries are counted by the same owned-entry counter, raised inKeepOwnedDrawInputand lowered ineraseDrawSnapshot. #9875 changes draw-range metadata; #9712 changes snapshot allocation; #7642 adds image-table lookup; #10442 tracks snapshotted reads; #12921 covers shader-resource proofs. The overlap scan could not complete 101 shared-file comparisons, including 43 with implementation files; review composition if those branches land.Tested
Based on
main92b4c42 (rebased 2026-11-15;trace_digestkeeps main's graphics-track table from #18949 next to the storage counts, and the summary line carriesowned_storage_countsnext to main'sgraphics_track). On that tip, the recorder, owned draw/storage, performance-trace,trace_digestandperformance_comparetests (145 in all) passed three times on Windows/NVIDIA RTX 3080 Laptop / 621.14 with validation 1.4.363 loaded and no VUIDs; only the twotrace_digestsymlink-loop cases skip on Windows. Linux was not rerun.Earlier rounds, exact merge with main
93dbd0f82a: Windows 11 / MinGW-w64 GCC 15.2.0, NVIDIA RTX 3080 Laptop, validation 1.4.363: ten focused tests passed three times; Ubuntu llvmpipe, validation 1.3.275: seven passed three times. No reported VUIDs or skips. Linux lacked asynchronous UFFD write protection and uses the non-owned fallback.Trace fixtures check separate draw/storage counts, an unbound event and storage entry-cap eviction. On earlier head
28ba6a5716, flush-stamp and containing-lookup mutants failed both storage tests; a test-only forced old memo returned stale bytes after a CPU write. Restored tests passed. The pinned refusal case is Windows-only.Not tested: macOS runtime, title scenes, console behavior, title performance or tracing overhead. No real-scene block or eviction rate is claimed.
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)