perf(agc): note only the ranges table-read V#s can reach as pending reach #23242
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/23242"
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 slopezjur on 2026-11-18T20:54:26Z.
What
An address-based use whose module stores through a V# read at run time (
gpuDescriptorstores, lowered to BDA stores) notes every writable imported region as pending reach inMarkGpuWrites. That is hundreds of MiB to GiB. CPU reads and cross-queue waits anywhere in those regions then wait for the dispatch, though the bytes they cover never change.This change narrows the note to the ranges the store's V#s can reach, when every store of the shader goes through a V# read from a table whose key is bounded.
Recompiler (
ResourceTracker): for each unplannedWrite/AtomicgpuDescriptorstore,MatchStoreTablechecks that the four V# dwords are scalar reads (through a pointer or a holder buffer) of the same base at consecutive offsets, then matchesaddend + stride × keywith the existingMatchAffineOffset(rejectingReadFirstLaneoffsets whose mask differs from the store's mask and rejecting combined scalar + first-lane addends that wrap 32 bits). The key bound comes from one of:ReadFirstLanephis of exec-masked selects, with the exact key list when it is a set of immediates.ReadFirstLaneand selects are unwrapped only when the store runs under the read's own mask, and never through a loop-carried phi;key < boundon a scalar branch that dominates the store, where the bound is an immediate or a snapshot source (user data or a flattened SRT read). A bound the shader reads itself withs_buffer_loadfalls back, because the GPU reads it live and the driver reads it at dispatch;Two values match only when they are one SSA value or one immediate, so a value read twice at run time is two values. A table offset that is not dword aligned is unmatched. A formatted or typed store is noted with the largest format, 16 bytes. The plan keeps the combined 32-bit register addend of the key offset. Planned buffer atomics (direct V#s) give a direct entry.
storesBoundedis set only when every store of the module is matched and the module has no other address store. When a store is not matched, the plan records the first such store's pc and the reason (not a V# handle, not a table read, split dwords, key not affine, table not evaluable, unbounded key, address store, table offset unaligned). The plan carriesstoreTables,storesBounded,storeMissandstoreMissPc; the disk-cache format goes to 99.Materializer: at dispatch it evaluates each table's base, row count, key list and bound source (checking the 4-dword holder width before decoding and running before the post-table descriptor epoch check so concurrent descriptor changes retry cleanly). More than 4096 keys, a holder that is not a 4-dword buffer descriptor, an unevaluable source, a key whose scaled offset plus combined addend can wrap in 32 bits onto other records (
offset wraps), a bound that is not a snapshot (live bound) and PS4 (GCN) shaders all fall back to the whole reach. Non-storing shaders leavestores.miss = StoreTableMiss::NoStoreswithout hashingstoreTables. The result goes on the invocation asstoreTables, is hashed into the unmasked snapshot when storing or falling back (masked memo lookups omit it so relocated tables patch frommaskedMemo), is counted with itskeyListallocations in both plan and result-memo byte budgets, and is carried through memo patches.Driver (
ShaderAddressResources.cpp):narrowToStoreWindowsreads only the accessed 16-byte V# records from guest memory when the use is recorded (reading contiguousstride == 16tables in one clamped copy and strided or listed-key tables per 16-byte record without allocating gap spans), merges overlapping or duplicate windows, and intersects their store extents with the reachable regions. Each bounds mode is handled, swizzled V#s included (index and offset MSB/LSB split, with the stride and the index stride). It keeps the whole reach when:A V# whose type is not a buffer drops the store (the GPU drops it as well), as does one with base 0 or no records. A record the holder does not cover with 16 readable bytes is skipped: the GPU reads its missing dwords as zero, and a V# of format 0 drops the store.
Controls:
APS5_NO_STORE_WINDOWSrestores the whole reach. UnderAPS5_PROFILE_DRAW, a[store-windows]line every 10 s counts each program's outcomes and compares the MiB noted with the whole reach. A use that falls back is keyed by the program that fell back and names its highest-key unbounded store's pc, reason and wanted record count consistently. This is the per-store counter discussed in #675.Tools and debt:
agc_shader_replay --memprints the store tables and, on a fallback, the store's pc, reason and wanted record count. The known gaps are recorded indocs/dev/debt/changes/perf-agc-store-windows.md.Tested
Windows 11 Pro 26300, RTX 4080 SUPER, driver 621.40 (621.24 on the pre-rebase comparison), WinLibs build, Vulkan validation layer 1.4.363.
AGC validation:
ctest -R "^(agc_|shader_)" -VwithANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer:Against
maine4936123117:e4936123117agc_shader_store_tables,agc_driver_store_windows,agc_driver_store_windows_disabled)agc_driver_store_over_untracked,agc_driver_cached_image_multisample_guardagc_driver_store_over_untracked(agc_driver_cached_image_multisample_guardis a known flake that failed 3 of 5 reruns on both builds)VUID-Rebased onto
main200446119c: 2178 total tests; after12070ceb01(fixingagc_shader_result_memo_waysandagc_shader_result_memo_ways_maskedfor 16-way result-memo sets), the only failures are pre-existing onmain(agc_driver_store_over_untrackedandagc_driver_linear_target_import_creation, which passes withAPS5_SETTLE_FLOOR_KIB=1024), with 0VUID-lines.Rebased onto
mainae0df0e03e(committed head733a14068f) with the same validation environment, the 15-test focused and result-memo suite (agc_shader_store_tables,agc_driver_store_windows,agc_driver_store_windows_disabled,agc_shader_memory,agc_shader_memory_coherent_atomic_loads, all fiveagc_shader_disk_cache*tests and all fiveagc_shader_result_memo*tests) passed 15 of 15 (layer inserted 4 times, 0 missing, 0VUID-lines), plusagc_shader_memory_tests --store-tablesunder bothAPS5_NO_MASKED_RESULT_MEMO=1andAPS5_VERIFY_MASKED_RESULT_MEMO=1(and negative check verifyingAPS5_NO_RESULT_MEMO=1fails on the memo-population assertion).Not tested: graphics-stage stores, Linux, AMD.
agc_shader_store_tablesandagc_shader_memory: hand-assembled RDNA fixtures cover:v_readfirstlane(32 keys), requiring the first compile to populate the result memo before checking relocated store-table reuse throughmaskedMemo(ResultMemoBytes()unchanged whenAPS5_NO_MASKED_RESULT_MEMOis unset, including inAPS5_VERIFY_MASKED_RESULT_MEMOmode);MetadataBytesaccounting forkeyListcapacity measured on the same copy before and after clearingkeyList;i < countwherecountis read from the table;StoreTableFallback::NotBufferfallback when a holder source evaluates withdwordCount != 4, and retry when the descriptor-scope epoch moves during store-table evaluation);OffsetWraps), alongside an immediate offset and a masked scale that cannot wrap (still bounded), and an unaligned table offset (Unaligned);OffsetWraps), a key, selected key list, and affine offset read under a restored mask (UnboundedKey/NotAffine) vs the store's own mask and forward-joined selects (bounded), and a formatted store (16-byte extent);s_buffer_loadkey bound (LiveBound);TooMany, reporting 4097 wanted records);Unmatched, reporting store pc andUnboundedKey).agc_driver_store_windows: holds a dispatch and checks that the output is pending while the table and an unrelated block are not, and that each lane's stored values are correct (both contiguous 32-record and non-contiguous listed-key(1, 3)pointer tables). WithAPS5_NO_STORE_WINDOWS=1(_disabled), the unrelated block is pending again.v_readfirstlanekey, so it actually takes the store-table path): cut after 8 bytes and after 12 bytes with a reachable V# in the cut record — key 0 stores into output with only output pending; key 3 stores nothing and leaves unreached blocks unpending.v_readfirstlane, loop-carried select, re-read key modified by the shader, and a live bound written by the shader before reading it.[12, 16)of the 16-byte format extent is marked pending while unreached blocks remain unpending.OOB_SELECTbounds modes (BoundsModes): verifiesOOB_SELECT0 (index < num_records && offset < stride: in-bounds store narrows, unboundedindex >= num_recordsand unboundedoffset >= stridedrop the store without falling back),OOB_SELECT1 (index < num_recordsonly: unboundedindex >= num_recordsdrops without falling back, boundedoffset >= stridenarrows to the offset extent, unboundedoffsetkeeps the whole reach),OOB_SELECT2 / 3 (unchecked / raw: boundedindexbeyondnum_recordsnarrows to the indexed extent, unboundedindexkeeps the whole reach), and zero-record V#s (records == 0) across all four modes0–3(drops the store and notes nothing).Ghost of Yōtei (PPSA26344):
Offline replay: on the four dumped DLC writers (
0x80003e8700,0x8000320800,0x800040ef00,0x800033ef00), 3 of 4 narrow;0x800033ef00(stride 632, unbounded key) falls back withoffset wraps.Unprofiled clean-commit A/B (after all soundness and rebase fixes):
mainalone does not reach the DLC screen in Ghost of Yōtei without the bindless heap PRs, so both arms are clean builds ("dirty": false) of the same local Yōtei test stack:2c8544cf0dbbis the stack and6f6921224a92is2c8544cf0dbbplus this PR (2be35fad4e), run interleaved for 330 s each withAPS5_BINDLESS_IMAGES=1 APS5_BINDLESS_LAZY=1 APS5_TRACE_SECONDS=270:5on warm shader caches (< 50shader-cache misses per run in Rounds 3–5):2c8544cf0dbb, warm n=3)6f6921224a92, warm n=3)Across all three warm DLC
seconds 270:5captures, the DLC screen is GPU-bound (~133 ms GPU busy per present), while CPU pending-reach and dispatch-resource overhead drops consistently on every run:GpuMutex.wait.hook555.4 → 288.6 ms (-48.0 %,[556.0, 604.6, 505.6]vs[270.8, 301.5, 293.4]),Driver.Dispatch.capture_resources768.3 → 539.7 ms (-29.8 %,[842.6, 766.6, 695.6]vs[517.4, 532.0, 569.6]), andDriver.Dispatch.lookup_cache1416.6 → 1018.9 ms (-28.1 %,[1351.0, 1446.0, 1452.9]vs[1035.9, 975.3, 1045.4]). Load crashes (0xc0000005during streaming) occurred on both arms (2 during2c8544cf0dbbcold warm-up, 1 on6f6921224a92Round 2) and were excluded byrunstats.py.tools/trace_digest.pysummaries, DLC screen (APS5_TRACE_SECONDS=270:5, median warm DLC run of each arm —sw1126-swinbase-5andsw1126-swinhead-4):2c8544cf0dbb): 27 presents, frame p50 190.2 / p90 202.2 / p99 217.9 ms, GPU busy 132.5 ms per present6f6921224a92): 26 presents, frame p50 190.9 / p90 198.7 / p99 208.3 ms, GPU busy 132.8 ms per presentSummary lines (
aps5-summary.jsonl, DLC screenseconds 270:5, median warm DLC run of each clean build —2c8544cf0dbbvs6f6921224a92):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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-18T22:59:36Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: fall back to the full reachable range when any indexed V# record lies outside its holder buffer.
What I ran
54071e677accc746fe52b09fab8fdacd19fa4033; no commands or tests were run.description.md,commits.md,diff.patch,manifest.json, and the changed files listed below. Excluded by the review bundle:core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppfull texts; their relevant diff hunks were read.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp:454-456: for holder-buffer tables,readableis clipped to the holder size, but the remaining records are zero-filled and still processed as valid descriptors. A bounded key can therefore select a record beyond the holder's declared extent; its actual V# is never examined, and the resulting pending reach can omit memory that the shader's table load/store path may access. If the available bytes do not cover every selected record, retain the full reachable range instead of narrowing.Non-blocking
None.
Not verified
diff.patch.To get this to a good state
Make incomplete holder-table reads trigger the conservative whole-reach fallback, then rerun the AGC validation and store-window tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T09:12:49Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the inspected code conservatively falls back to the full reachable range when table matching or evaluation is uncertain.
What I ran
Reviewed head
11be434cc70422fd603f6a73347b54c1b454d312usingrepo_read.pyto inspect the prepared diff and targeted source ranges. No commands or tests were run by me.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I did not run the reported Windows/Vulkan tests or independently verify the performance measurements. The changed
ShaderResources.cppandShaderMemory.cppfull texts were excluded from the review folder; I inspected the former’s changed call site through the reader and used the prepared diff for the latter. Other changed files marked included in the manifest were not all read in full.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T19:26:31Z.
Review: COMMENTED
Reviewed — comments
The core store-window implementation and its recompiler/materializer paths were inspected at
da7e912c49d5cf21df10420e9be31167eb7c508f; several changed files remain unread, so a formal merge decision is not justified.What I ran
Read the prepared review bundle and targeted source ranges using
repo_read.py. No build or tests were run in this review.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
No specific non-blocking code issue verified.
Not verified
Read:
description.md,commits.md,manifest.json,diff.patch;ShaderAddressResources.cpp; targeted diff and source sections forResourceTracker.cppandResourceMaterializer.cpp.Not read in full:
ShaderResources.hpp,ShaderDiskCache.cpp,StoreWindow.hpp,ShaderReplay.cpp,StoreWindows.cpp, and the remaining included changed files. The manifest marksShaderResources.cppandShaderMemory.cppas excluded for size; the changed lines in those files were visible in the diff, but their surrounding source was not read. No build, tests, or console behavior were verified.To get this to a good state
Nothing is required. Optional: complete review of the unread changed files and run the relevant validation suite before making a formal decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T09:12:03Z.
Review: COMMENTED
Reviewed — comments
The inspected code shows no verified blocking defect, but the review is incomplete because several changed files were not read in full.
What I ran
aeb1e3124e1a900ac94b79ab801c12ea14c225c5; no build or tests run.ShaderAddressResources.cpp,ShaderResources.cpp,ResourceTracker.cpp,ResourceMaterializer.cpp,StoreWindow.hpp, andStoreWindows.cpp.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Not verified
Full text was not reviewed for every changed file. In particular,
ShaderMemory.cppand the changed files for recompiler integration, disk cache, replay tooling, test registration, and documentation were not fully inspected. The description’s reported tests and performance measurements were not independently verified.To get this to a good state
Nothing is required. Optional: complete inspection of the remaining changed files and run the relevant checks before treating this as a formal approval.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T06:36:27Z.
Review: COMMENTED
Reviewed — no blocking findings
The change was reviewed at head
c14193e7e419accd83f510695e6ed7aec0a1bb90; no concrete blocking defect was verified, but this review is incomplete because several changed-file additions were not read and no checks were run.What I ran
No commands or tests were run. I used the review reader to inspect the prepared description, commit list, diff, manifest, selected changed-file ranges, and repository context at the pinned head. The PR description reports Windows and console testing; those results were not independently verified here.
Results
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Not verified
I read
ShaderResources.hpp,ShaderAddressResources.cpp,ResourceTracker.cpp,ResourceMaterializer.cpp,StoreWindow.hpp, selected sections ofShaderDiskCache.cpp,GuestBufferMemory.cpp, andRecorder.cpp, plus the prepared review documents. I did not read every changed line listed in the manifest. In particular, the additions inShaderResources.cppandShaderMemory.cppwere excluded from the prepared files, and I did not read all added lines in the other changed files. No build, test, or runtime check was performed. The author-reported tests and performance measurements were not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T04:19:29Z.
Review: CHANGES_REQUESTED
Reviewed — comments
Changes are required before merge: clarify or correct how cut records in holder buffers are evaluated, because the stated test expectation conflicts with the implementation.
What I ran
Reviewed head
58ba30d183e7e6766b8b3aaedab247bc9a5cc328against the prepared diff; no commands or tests were run.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp:254: For a holder buffer whose size cuts into the final table record,readablecopies only the in-bounds bytes into a zero-filled 4-dword record, thenrecord()treats that synthesized record as a valid V#. The changed test says the cut record must store nothing, but that behavior depends on its in-bounds first dwords decoding to a harmless V#. The reported test fixture puts a reachable V# in that record, so this path appears to produce a store window for it even though the GPU cannot read the full descriptor. Exclude records whose full4 * sizeof(uint32_t)lies beyondreadable, or otherwise ensure they cannot contribute a window; retain the test where the cut record contains a reachable descriptor.Non-blocking
None.
Not verified
Tests were not run; the Windows/Vulkan results in the description are author-reported. Read the prepared description, commits, manifest and diff, plus the changed implementation and test context.
ShaderResources.cppwas excluded from the prepared full-text files and inspected throughrepo_read.py.files.jsonwas unavailable through the reader, so other exclusion-rule details are not verified.To get this to a good state
Ensure a partially readable holder-table record cannot create a store window, and run the focused store-window tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-24T23:30:48Z.
Review: COMMENTED
Reviewed — no blocking findings
The change targets a concrete overbroad pending-reach behavior, but I could not complete source-level verification or run the tests in this read-only review.
What I ran
Read the prepared description, commits, part of the manifest, and selected ranges of the diff for head
480a1ab6ccfcd3deecbfb5235d4539f63d2cd27e. No commands or tests were run.Results
Findings
Blocking
None verified.
Non-blocking
Not verified
The review manifest and diff were only partially read. Changed repository files were not read from the pinned head, so logic, edge cases, security, performance, and test implementation were not verified. The provided full review-folder listing identifies 18 changed files: 16 included and 2 excluded from
files/because they were too large. No repository source files were read. No checks were run; test results in the description are author-reported.To get this to a good state
Nothing is required. Optional points: complete the targeted source review and run the focused tests on this exact head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T12:37:37Z.
Review: DISMISSED
Reviewed — changes requested
Changes are required before merge: make the store window cover every byte the V# can write in unchecked bounds modes, or fall back to the whole reach.
What I ran
12070ceb0128061801ea626a7d62de9c08c1372e; no commands or tests were run.description.md,commits.md,manifest.json, anddiff.patch. Read the changed driver pathsShaderResources.hpp,ShaderAddressResources.cpp, andShaderResources.cpp; recompiler pathsResourceTracker.cpp,ResourceMaterializer.cpp,Recompiler.cpp,ShaderDiskCache.cpp,ShaderDiskCache.hpp,ResourcePlan.hpp,Recompiler.hpp, andStoreWindow.hpp; test pathsShaderMemory.cpp,StoreWindows.cpp,agc_driver_store_windows_tests.cmake, andagc_shader_memory_tests.cmake; plusShaderReplay.cpp,RdnaDescriptorFormat.cpp,MemoryResourceHelpers.cpp,ResourceInfo.hpp, andCMakeLists.txt.Results
Findings
Blocking
mode == 0),storeExtentusesrecords * stride + 16 + soffsetas the maximum reachable end (core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp:421-423). In this mode the descriptor record count does not bound the store address; a store with a valid nonzero descriptor and an offset/index beyond that count can still write farther. The function can therefore return a narrow window that excludes an actual write, andMarkGpuWritesthen records pending reach only for that window. Use the mode’s actual address components and a conservative maximum, or fall back to the whole reach whenever the address cannot be bounded.Non-blocking
None.
Not verified
ShaderMemory.cppandShaderResources.cpp; only the changed hunks and relevantMarkGpuWritescontext were inspected. The remaining changed-file content was not read.files.jsonwas not available through the review reader, so itsreviewedlist could not be compared;list_filesshowed the changed files and inclusion status.To get this to a good state
Correct the unchecked-mode extent calculation or retain the whole reach for that mode, then add a regression test with a store beyond the descriptor’s declared record extent.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T18:01:14Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
2be35fad4e4e16c285420a63ab17b99a607adc28usingrepo_read.py. No commands or tests were run by this reviewer; performance and test results in the PR description are author reported.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
docs/dev/debt/changes/perf-agc-store-windows.md:5.Not verified
Read:
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp,core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp(changed area),core/shader/recompiler/Optimization/src/ResourceTracker.cpp,core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp(materialization area), andcore/shader/recompiler/StoreWindow.hpp; also the PR description and commits. The prepared review files list these changed files:ShaderResources.hpp,ShaderAddressResources.cpp,ShaderResources.cpp,ShaderMemory.cpp,agc_driver_store_windows_tests.cmake,agc_shader_memory_tests.cmake,StoreWindows.cpp,ShaderReplay.cpp,CMakeLists.txt,ResourcePlan.hpp,ResourceMaterializer.cpp,ResourceTracker.cpp,Recompiler.cpp,Recompiler.hpp,ShaderDiskCache.cpp,ShaderDiskCache.hpp,StoreWindow.hpp,ENVIRONMENT.md, andperf-agc-store-windows.md. Not every changed file was read, so their changes, the complete test suite, and console behavior were not verified. The diff excludes lockfiles, minified files,dist/,build/, and.svgby preparation rules.To get this to a good state
Nothing is required. Optional: clarify the synchronization assumption for CPU writes to a store table between recording and GPU execution.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-26T18:05:02Z.
Review: COMMENTED
Actionable comments posted: 8
2cf13b16-67d8-4890-8869-e1937301be94Reviewing files that changed from the base of the PR and between
37749b6cd5and2be35fad4e.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_store_windows_tests.cmakecore/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_memory_tests.cmakecore/libs/prx/libSceAgcDriver/tests/execution/StoreWindows.cppcore/libs/prx/libSceAgcDriver/tools/ShaderReplay.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ResourcePlan.hppcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.hppcore/shader/recompiler/StoreWindow.hppdocs/dev/ENVIRONMENT.mddocs/dev/debt/changes/perf-agc-store-windows.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T00:50:43Z.
Review: COMMENTED
Actionable comments posted: 2
441bf23e-d14b-4259-a6f7-d5a056d5ce2fReviewing files that changed from the base of the PR and between
2be35fad4eandc05df8af17.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/Recompiler.cppdocs/dev/ENVIRONMENT.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T00:56:52Z.
Review: COMMENTED
Reviewed — comments
The prepared diff and targeted code review show no verified blocking defect; the documented validation results are author-reported and were not run in this review.
What I ran
c05df8af1734976d4b9f8afe2035d8d7b955900fusingrepo_read.py.Results
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Not verified
To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T11:19:08Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: prevent the combined table-read and store-offset addend from wrapping before using it to bound reachable store windows.
What I ran
Reviewed head
f9ac9eb65d42f24527a3bd3661fdf797c3c001c2usingrepo_read.pythrough the prepared review bundle. No commands or tests were run.Results
Findings
Blocking
core/shader/recompiler/Optimization/src/ResourceTracker.cpp:2876addsregisterAddend + addendinuint32_twithout detecting overflow.ResourceMaterializer.cpp:1971-1974then uses that stored value inoffsetMayWrapto decide whether narrowed tracking is safe. If the addition wraps, the check can underestimate the greatest offset and allow the driver to note only a subset of the addresses the shader can write. Preserve the sum in a wider type or detect overflow and fall back to whole reach.Non-blocking
None.
Not verified
No tests were run. Read the review description, commits, manifest, diff,
ShaderAddressResources.cpp,ResourceTracker.cpp,ResourceMaterializer.cpp,StoreWindow.hpp, and the changedShaderResources.cppcall site. The full changed contents ofShaderResources.cppandShaderMemory.cppwere excluded from the review folder; their relevant hunks were inspected indiff.patch. Other changed files were not read in full, so their behavior is not verified. Author-reported test and performance results were not independently verified.To get this to a good state
Detect overflow in the combined addend and retain whole-reach fallback when the maximum reachable offset cannot be proven safe. Rerun the focused store-table and store-window tests on the updated head.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T11:26:55Z.
Review: COMMENTED
Actionable comments posted: 1
539b2260-89bc-4742-b707-829010f60bc5Reviewing files that changed from the base of the PR and between
c05df8af17andf9ac9eb65d.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/execution/StoreWindows.cppcore/libs/prx/libSceAgcDriver/tools/ShaderReplay.cppcore/shader/recompiler/CMakeLists.txtcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.cppcore/shader/recompiler/ShaderDiskCache.hppdocs/dev/ENVIRONMENT.mddocs/dev/debt/changes/perf-agc-store-windows.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-27T16:41:57Z.
Review: COMMENTED
Reviewed — comments
The review is incomplete, so a formal approval or change request is not justified.
What I ran
Reviewed head
b979b288cc6c8abbd07e7c47af194378146ba988from the prepared diff and targeted source reads. No commands or tests were run.Results
Negative control
Not run.
Findings
Blocking
None verified in the code inspected.
Non-blocking
None.
Sources
Inspected the prepared diff and targeted code in
ShaderAddressResources.cpp,ShaderResources.cpp,ResourceTracker.cpp,StoreWindow.hpp, andStoreWindows.cppat the pinned head.Not verified
The review did not read every changed line. Changed files read in part:
ShaderAddressResources.cpp,ShaderResources.cpp,ResourceTracker.cpp,StoreWindows.cpp. Changed files not read:ShaderResources.hpp,ShaderMemory.cpp,agc_driver_store_windows_tests.cmake,agc_shader_memory_tests.cmake,ShaderReplay.cpp,CMakeLists.txt,ResourcePlan.hpp,ResourceMaterializer.cpp,Recompiler.cpp,Recompiler.hpp,ShaderDiskCache.cpp,ShaderDiskCache.hpp,ENVIRONMENT.md, andperf-agc-store-windows.md. Tests, build, and behavior on other operating systems and hardware were not verified.To get this to a good state
Nothing is required. Optional: complete the review of the remaining changed lines and run the focused tests on this head.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-27T16:44:52Z.
Review: COMMENTED
Actionable comments posted: 1
cdd22bfe-5889-4a89-8ae0-e3a01385ea82Reviewing files that changed from the base of the PR and between
f9ac9eb65dandb979b288cc.core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/ShaderDiskCache.cppdocs/dev/ENVIRONMENT.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-28T17:35:57Z.
Review: COMMENTED
Actionable comments posted: 2
5db91532-9087-441e-bf45-2fdef08cbd57Reviewing files that changed from the base of the PR and between
b979b288ccand3aebd47369.core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hppcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/Optimization/src/ResourceMaterializer.cppcore/shader/recompiler/Optimization/src/ResourceTracker.cppcore/shader/recompiler/Recompiler.cppcore/shader/recompiler/Recompiler.hppcore/shader/recompiler/ShaderDiskCache.hppdocs/dev/ENVIRONMENT.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T17:37:22Z.
Review: COMMENTED
Reviewed — comments
The focused code paths and author-reported validation support the store-window approach, but I could not verify every changed file or run the checks in this review.
What I ran
Reviewed head
3aebd473691a764e230352c545b920856ff1e57cagainstmainusing the prepared diff andrepo_read.pyreader. No commands or tests were run. The description reports a focused 15-test pass on the stated Windows/NVIDIA setup; that result was not independently run here.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The prepared diff and manifest were read. Repository code read:
ResourceTracker.cpp(selected ranges),ResourceMaterializer.cpp(selected ranges),ShaderAddressResources.cpp(selected ranges), andStoreWindows.cpp(first 50 lines). Review-folder documents read:description.md,commits.md,manifest.json,diff.patch, andREADME.md. Changed files infiles.jsonmarkedreviewedwere not all read; in particular, the full additions in the recompiler, materializer, cache, test, replay-tool, and documentation files were not inspected.ShaderResources.cppandShaderMemory.cppwere excluded from the folder as too large and only their relevant changed hunk indiff.patchwas reviewed. Build and test results were not independently verified.To get this to a good state
Complete review of all changed lines and run the focused tests before making a formal approval decision.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T18:27:52Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation narrows pending GPU write reach using materialized store tables and falls back to whole reach when a table cannot be safely evaluated; no concrete blocking defect was verified.
What I ran
Reviewed head
733a14068f66c8a4a5eaf43147849564c00d5284using the prepared diff andrepo_read.pyreader. No tests or build commands were run. The description reports author-run Windows 11 / RTX 4080 validation; those results were not independently run here.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Not verified
Full review is incomplete. Read:
review/description.md,review/commits.md,review/manifest.json, relevant sections ofreview/diff.patch, andcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp. Excluded by review bundle:ShaderResources.cppandtests/ShaderMemory.cppfull texts; they were not read through the reader. Other included changed files and remaining diff hunks were not inspected. Author-reported test and performance results were not independently verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-02T21:02:55Z.
Review: COMMENTED
Reviewed — comments
The review is incomplete, so a formal merge decision is not justified; no blocking defect was verified in the code inspected.
What I ran
Reviewed head
f4f372fc87397fa94ebe50e6b676a3c7ead7dc99. I inspected the prepared description, commits, manifest and diff, plus relevant sections ofShaderAddressResources.cpp,ResourceMaterializer.cppandResourceTracker.cpp. No tests or builds were run.The reader failed because it could not append its log in the read-only run folder. I used the prepared file copies for the source sections inspected. No other checks were run.
Results
Negative control
Not run; no tests were executed.
Findings
Blocking
None verified in the inspected sections.
Non-blocking
No code feedback established from the partial inspection.
Sources
Inspected driver logic: ShaderAddressResources.cpp at the reviewed head. Inspected planning and materialization logic: ResourceTracker.cpp and ResourceMaterializer.cpp.
Not verified
files.jsonlists 19 reviewed files. Source sections were read in 3:core/libs/prx/libSceAgcDriver/Graphics/src/ShaderAddressResources.cpp,core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp, andcore/shader/recompiler/Optimization/src/ResourceTracker.cpp. The other 16 listed files were not read:core/libs/prx/libSceAgcDriver/Graphics/include/ShaderResources.hpp,core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp,core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp,core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_store_windows_tests.cmake,core/libs/prx/libSceAgcDriver/tests/cmake/agc_shader_memory_tests.cmake,core/libs/prx/libSceAgcDriver/tests/execution/StoreWindows.cpp,core/libs/prx/libSceAgcDriver/tools/ShaderReplay.cpp,core/shader/recompiler/CMakeLists.txt,core/shader/recompiler/IntermediateRepresentation/include/IntermediateRepresentation/IrMetadata/ResourcePlan.hpp,core/shader/recompiler/Recompiler.cpp,core/shader/recompiler/Recompiler.hpp,core/shader/recompiler/ShaderDiskCache.cpp,core/shader/recompiler/ShaderDiskCache.hpp,core/shader/recompiler/StoreWindow.hpp,docs/dev/ENVIRONMENT.md, anddocs/dev/debt/changes/perf-agc-store-windows.md. No runtime behavior, test results, or performance claims were independently verified.To get this to a good state
Nothing is required for the inspected code. The optional next step is to complete review of the remaining changed files before making a formal merge decision.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T18:47:59Z.
Review: COMMENTED
The narrowed reach depends on the table records used by GPU execution matching the records inspected while recording. The patch correctly falls back for an overlapping recorded writer and for a table the same dispatch could write. Please add coverage for the ordering case where a prior command writes the table before the draw or dispatch consumes it, and verify that the wider reach remains published until the table contents are known. That is the case where an incorrect narrowing can let a CPU read skip the wait for the real destination.
Source review of
557b25be0f. The lavapipe controls and the new store-window fixture are queued.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T19:08:02Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this in the inspected diff; the review remains incomplete because pinned source reads were unavailable.
What I ran
Reviewed head
557b25be0fd8f6821e09948faf035a560c273bd4. No merged-preview check or tests were run. The prepared diff and metadata were inspected. The pinned reader failed because it could not write its read log in this read-only run directory.Results
Negative control
Not run; no tests were run.
Findings
Blocking
None established in the inspected diff.
Non-blocking
None established.
Sources
Not verified
files.jsonlists 19 changed paths and no rule-excluded paths. The prepared diff was inspected in relevant portions, and the full text ofStoreWindow.hppwas read. The full text ofcore/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppwas unavailable infiles/; no changed files were read through the pinned reader. Therefore this is not a complete source review, and no claim is made about uninspected code or author-reported tests.To get this to a good state
Nothing is required from the author. A complete review needs the pinned reader to run in a directory where it can write its read log.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:24:02Z.
Review: COMMENTED
The new revision keeps the phi store-table leaves for the later deduplication pass and adds planning coverage. On the earlier
557b25be0frevision, scalar-buffer and bindless passed on both arms on Linux lavapipe. The two change-onlystore_windowscases both failed because lane 8 stored0x0through the table V#. All three verbose logs showed Khronos validation 1.4.369 inserted with zero missing-layer orVUID-messages. The revised runtime fixture is queued so we can see whether the phi fix also resolves that result.Source review at
827d468f78. The head trial-merges onto20eec59f1c.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T23:28:40Z.
Review: COMMENTED
Reviewed — no blocking findings
The prepared diff’s 19 changed hunks were reviewed, but full head context was unavailable for two changed files, so a formal decision is not justified.
What I ran
Reviewed head
827d468f7821bf28ac8212f7957cfee775695816. Read the prepared description, commits, manifest, diff, and available changed-file texts. Usedrgandsedfor targeted inspection. The pinnedrepo_read.pyreturned one source range; later reads failed because its log could not be written. No tests or builds were run.Results
Negative control
Not run; no test was executed.
Findings
Blocking
None identified in the reviewed material.
Non-blocking
None.
Sources
Not verified
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cppandcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp; their changed hunks were reviewed in the prepared diff.To get this to a good state
Nothing is required.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.