Skip to content

perf(agc): remember tables with a variant that needs a fresh lookup - #28968

Open
brajankw wants to merge 10 commits into
boykopovar:mainfrom
brajankw:perf/agc-reuse-tables-through-variant-lookup
Open

brajankw wants to merge 10 commits into
boykopovar:mainfrom
brajankw:perf/agc-reuse-tables-through-variant-lookup

Conversation

@brajankw

@brajankw brajankw commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

What

A dynamic-resolution variant with an unavailable representative could force the driver to rebuild unrelated entries in its image table. The driver now retries that representative on each use and applies the same borrowing checks it uses when building a table. The variant still rejects when the representative cannot be bound.

Part of #28913.

Tested

Windows 11, MinGW GCC 15.2.0, Vulkan SDK 1.4.363. ctest --test-dir build -R ^agc_driver_image_table_reuse -V -j 1 passed 13/13. The loader inserted VK_LAYER_KHRONOS_validation in all 13 tests. 0 VUID on the change.

Tests passed: agc_driver_image_table_reuse, agc_driver_image_table_reuse_draw_pipeline, agc_driver_image_table_reuse_plan_verify, agc_driver_image_table_reuse_rejected_variant, agc_driver_image_table_reuse_shared_table, agc_driver_image_table_reuse_retaken_depth_surface, agc_driver_image_table_reuse_retaken_cleared_depth_surface, agc_driver_image_table_reuse_retaken_mirrored_depth_surface, agc_driver_image_table_reuse_retired_depth_surface, agc_driver_image_table_reuse_entry_limit, agc_driver_image_table_reuse_entry_memo, agc_driver_image_table_reuse_records, agc_driver_image_table_reuse_records_narrow. The new fixture checks that a table continues to reuse valid siblings and rejects the same variant on build and reuse after its representative’s backing is released. The baseline run, remapping coverage and same-scene performance capture are pending.

Performance captures used the repository's video_out_flip_backlog scene on the same Linux machine with an NVIDIA GeForce RTX 3060 (driver 610.57.04). The test queues 180 flips of generated 259×137 buffers at 20 FPS. Each build was warmed once. Captures alternated main and PR head with APS5_TRACE_SECONDS=1:4.

The scene does not exercise the code changed by this PR. These captures only check capped presentation for regressions. The p99 ranges overlapped. No presentation regression was observed in this scene.

Build Presents Frame p50 (ms) Frame p99 (ms)
Main, first run 81 50.000 50.069
PR head, first run 81 49.999 50.049
Main, repeat 81 49.999 50.021
PR head, repeat 80 50.000 50.105

The first capture from each build is shown with its tools/trace_digest.py summary.

Main, first run and trace digest

seconds 1:4 from present 20: 81 presents, frame p50 50.0 / p90 50.0 / p99 50.1 / max 50.1 ms, GPU busy 0.0 ms per present
NVIDIA GeForce RTX 3060, NVIDIA 610.57.04, Linux 6.12.107+deb13-amd64, 259x137, commit e6d40cc, dropped: no

{"commit":"e6d40cce3e43","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"1:4"},"gpu":"NVIDIA GeForce RTX 3060","driver":"NVIDIA 610.57.04","os":"Linux 6.12.107+deb13-amd64","cpu":"13th Gen Intel(R) Core(TM) i5-13500T","cpu_threads":20,"memory_mib":31841,"resolution":"259x137","window":{"spec":"seconds 1:4","first_present":20,"ms":4049.993},"presents":81,"frame_ms":{"p50":50.0,"p90":50.014,"p99":50.069,"max":50.069},"gpu_busy_ms_per_present":0.0,"worker_busy_pct":{"queue worker 0x0":0.0},"phase_totals_ms":{"Driver.Present":110.5,"Driver.Present.acquire_image":1.965,"Driver.Present.device_setup":0.236,"Driver.Present.gpu_mutex_wait":0.348,"Driver.Present.inflight_wait":0.805,"Driver.Present.present_display_buffer":17.203,"Driver.Present.queue_present":88.519,"Driver.Present.release_and_callback":0.113,"Driver.Present.render_fence_wait":0.807,"Driver.Present.resize":0.283,"Driver.Present.validate":0.146,"Recorder.Submit":0.06,"VideoOut.Flip":3998.627,"VideoOut.Flip.completion_mutex_wait":0.105,"VideoOut.Flip.config_mutex_wait":0.085,"VideoOut.Flip.frame_limit":3932.702,"VideoOut.Flip.notify_game":1.025,"VideoOut.Flip.present":110.828,"VideoOut.Flip.validate":0.079,"VideoOut.Flip.vblank_wait":0.082,"VideoOut.Flip.window_prepare":0.777,"VideoOut.Flip.window_title":0.286,"Vulkan.Acquire":1.73,"Vulkan.Acquire.acquire_fence_wait":0.287,"Vulkan.Acquire.acquire_image":1.146,"Vulkan.Acquire.fence_reset":0.225,"Vulkan.Acquire.retired_swapchains":0.039,"Vulkan.Present":16.467,"Vulkan.Present.command_record_scale":8.295,"Vulkan.Present.pixel_upload":6.164,"Vulkan.Present.queue_submit":1.922,"Vulkan.QueuePresent":88.254,"Vulkan.QueuePresent.queue_present":88.028,"Vulkan.Retire":0.801,"Vulkan.Retire.wait":0.252},"top_phases_ms_per_frame":{"VideoOut.Flip":49.366,"VideoOut.Flip.frame_limit":48.552,"VideoOut.Flip.present":1.368,"Driver.Present":1.364,"Driver.Present.queue_present":1.093,"Vulkan.QueuePresent":1.09,"Vulkan.QueuePresent.queue_present":1.087,"Driver.Present.present_display_buffer":0.212},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.present-blit":162,"Graphics.Copy":81,"Graphics.Copy.bytes":31850496},"trace_dropped":false,"trace":"aps5-trace-e6d40cce3e43-1304347.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 77: 50.1 ms at 2850 ms: VideoOut.Flip (presenter) 50.0, VideoOut.Flip.frame_limit (presenter) 47.6, VideoOut.Flip.present (presenter) 2.3, Driver.Present (presenter) 2.3
  • present 71: 50.1 ms at 2550 ms: VideoOut.Flip (presenter) 50.0, VideoOut.Flip.frame_limit (presenter) 48.6, VideoOut.Flip.present (presenter) 1.4, Driver.Present (presenter) 1.4
  • present 54: 50.0 ms at 1700 ms: VideoOut.Flip (presenter) 50.0, VideoOut.Flip.frame_limit (presenter) 49.1, VideoOut.Flip.present (presenter) 0.9, Driver.Present (presenter) 0.9

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 77: 50.1 ms at 2850 ms, persistence 0.1 ms
  • present 71: 50.1 ms at 2550 ms, persistence 0.1 ms
  • present 87: 50.0 ms at 3350 ms, persistence 0.1 ms
  • present 54: 50.0 ms at 1700 ms, persistence 0.1 ms
  • present 37: 50.0 ms at 850 ms, persistence 0.1 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
presenter 50.0 (100 %) 0.0 (0 %) 0.0 0.1 VideoOut.Flip 49.4, VideoOut.Flip.frame_limit 0.6

Largest slices (ms per frame, inclusive, all threads): VideoOut.Flip 49.4, VideoOut.Flip.frame_limit 48.6, VideoOut.Flip.present 1.4, Driver.Present 1.4, Driver.Present.queue_present 1.1

Longest waits

  • Driver.Present.inflight_wait (presenter) 0.2 ms at 2700 ms, present 74
  • Driver.Present.inflight_wait (presenter) 0.1 ms at 2950 ms, present 79
  • Driver.Present.render_fence_wait (presenter) 0.0 ms at 1851 ms, present 57
  • Driver.Present.render_fence_wait (presenter) 0.0 ms at 2703 ms, present 74
  • Driver.Present.render_fence_wait (presenter) 0.0 ms at 2652 ms, present 73
PR head, first run and trace digest

seconds 1:4 from present 20: 81 presents, frame p50 50.0 / p90 50.0 / p99 50.0 / max 50.0 ms, GPU busy 0.0 ms per present
NVIDIA GeForce RTX 3060, NVIDIA 610.57.04, Linux 6.12.107+deb13-amd64, 259x137, commit 9088e85, dropped: no

{"commit":"9088e8583cef","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"1:4"},"gpu":"NVIDIA GeForce RTX 3060","driver":"NVIDIA 610.57.04","os":"Linux 6.12.107+deb13-amd64","cpu":"13th Gen Intel(R) Core(TM) i5-13500T","cpu_threads":20,"memory_mib":31841,"resolution":"259x137","window":{"spec":"seconds 1:4","first_present":20,"ms":4050.007},"presents":81,"frame_ms":{"p50":49.999,"p90":50.013,"p99":50.049,"max":50.049},"gpu_busy_ms_per_present":0.0,"worker_busy_pct":{"queue worker 0x0":0.0},"phase_totals_ms":{"Driver.Present":110.038,"Driver.Present.acquire_image":2.694,"Driver.Present.device_setup":0.183,"Driver.Present.gpu_mutex_wait":0.467,"Driver.Present.inflight_wait":0.736,"Driver.Present.present_display_buffer":23.892,"Driver.Present.queue_present":80.159,"Driver.Present.release_and_callback":0.159,"Driver.Present.render_fence_wait":1.082,"Driver.Present.resize":0.387,"Driver.Present.validate":0.165,"Recorder.Submit":0.079,"VideoOut.Flip":3996.845,"VideoOut.Flip.completion_mutex_wait":0.225,"VideoOut.Flip.config_mutex_wait":0.02,"VideoOut.Flip.frame_limit":3930.549,"VideoOut.Flip.notify_game":1.519,"VideoOut.Flip.present":110.411,"VideoOut.Flip.validate":0.136,"VideoOut.Flip.vblank_wait":0.109,"VideoOut.Flip.window_prepare":0.795,"VideoOut.Flip.window_title":0.492,"Vulkan.Acquire":2.322,"Vulkan.Acquire.acquire_fence_wait":0.418,"Vulkan.Acquire.acquire_image":1.477,"Vulkan.Acquire.fence_reset":0.318,"Vulkan.Acquire.retired_swapchains":0.057,"Vulkan.Present":22.83,"Vulkan.Present.command_record_scale":11.893,"Vulkan.Present.pixel_upload":8.131,"Vulkan.Present.queue_submit":2.667,"Vulkan.QueuePresent":79.811,"Vulkan.QueuePresent.queue_present":79.443,"Vulkan.Retire":1.12,"Vulkan.Retire.wait":0.349},"top_phases_ms_per_frame":{"VideoOut.Flip":49.344,"VideoOut.Flip.frame_limit":48.525,"VideoOut.Flip.present":1.363,"Driver.Present":1.358,"Driver.Present.queue_present":0.99,"Vulkan.QueuePresent":0.985,"Vulkan.QueuePresent.queue_present":0.981,"Driver.Present.present_display_buffer":0.295},"owned_draw_counts":{},"graphics_track":{"Graphics.Barrier.present-blit":162,"Graphics.Copy":81,"Graphics.Copy.bytes":31850496},"trace_dropped":false,"trace":"aps5-trace-9088e8583cef-1304680.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 59: 50.0 ms at 1950 ms: VideoOut.Flip (presenter) 50.0, VideoOut.Flip.frame_limit (presenter) 49.3, VideoOut.Flip.present (presenter) 0.7, Driver.Present (presenter) 0.7
  • present 35: 50.0 ms at 750 ms: VideoOut.Flip (presenter) 50.0, VideoOut.Flip.frame_limit (presenter) 49.3, VideoOut.Flip.present (presenter) 0.6, Driver.Present (presenter) 0.6
  • present 61: 50.0 ms at 2050 ms: VideoOut.Flip (presenter) 50.0, VideoOut.Flip.frame_limit (presenter) 48.8, VideoOut.Flip.present (presenter) 1.1, Driver.Present (presenter) 1.1

Persistent spikes (frame time above the fastest frame that separates it from a longer frame; one entry per stall, not per frame)

  • present 59: 50.0 ms at 1950 ms, persistence 0.1 ms
  • present 90: 50.0 ms at 3500 ms, persistence 0.1 ms
  • present 61: 50.0 ms at 2050 ms, persistence 0.1 ms
  • present 35: 50.0 ms at 750 ms, persistence 0.0 ms
  • present 29: 50.0 ms at 450 ms, persistence 0.0 ms

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
presenter 49.9 (100 %) 0.0 (0 %) 0.1 0.1 VideoOut.Flip 49.3, VideoOut.Flip.frame_limit 0.6

Largest slices (ms per frame, inclusive, all threads): VideoOut.Flip 49.3, VideoOut.Flip.frame_limit 48.5, VideoOut.Flip.present 1.4, Driver.Present 1.4, Driver.Present.queue_present 1.0

Longest waits

  • VideoOut.Flip.completion_mutex_wait (presenter) 0.0 ms at 351 ms, present 27
  • Driver.Present.render_fence_wait (presenter) 0.0 ms at 1701 ms, present 54
  • Driver.Present.render_fence_wait (presenter) 0.0 ms at 201 ms, present 24
  • Driver.Present.render_fence_wait (presenter) 0.0 ms at 1551 ms, present 51
  • Driver.Present.render_fence_wait (presenter) 0.0 ms at 2552 ms, present 71

Checklist

Created with GPT-6.2 Sol in Codex.

Summary by CodeRabbit

  • Bug Fixes
    • Improved image-table reuse across queues and collection updates, while ensuring descriptor changes and pending memory writes are reflected.
    • Improved handling of unavailable image variants and mixed-entry tables to help preserve correct image selection.
    • Tables are reused only when their contents and tracked memory remain compatible.

Take exclusive ownership of an exact table while proving and replaying it. Recollect unchanged snapshot ranges at a new queue ordering point and keep mixed tables within their original collect epoch.
Share mixed tables when their tracked snapshot ranges prove current. Re-resolve volatile entries on the consuming queue so pending image writes are visible without rebuilding the other descriptors.
Bind variants against the representative that resolved on this use. Retry unavailable representatives without dropping unrelated sampled entries.
@coderabbitai

coderabbitai Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Image Table Reuse

Layer / File(s) Summary
Shared cache and freshness checks
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
A mutex-protected cache stores up to four tables. Reuse checks table state, collection epochs and positions, queried ranges, and pending writes.
Representative and variant resolution
core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
Fresh and reused table resolution share substitution validation. Rejected entries retain role-specific metadata, and cross-epoch sharing is limited to eligible sampled ranges.
Queue and variant execution tests
core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp, core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
Tests cover rejected variants and shared-table reuse across queue dispatches, including descriptor changes and tracked writes. CTest registers both new modes and retains the untracked-mutation mode.

Possibly related issues

  • boykopovar/AnyPS5#28913 — The tracking issue identifies this PR as part of the image-table and texture reuse work.

Possibly related PRs

Suggested reviewers: celegans12, oneandonlydean

Change: Refactor

Merge Risk: Minimal · up to b90ed

This change shares image-table reuse across queues and rejects dynamic-resolution variants whose representative cannot be bound. No concrete correctness, data-integrity or availability problem was found, and the new tests exercise the changed paths. The merge risk is minimal.

Security architecture risk: Minimal · up to b90ed

AGC can now reuse eligible image tables across queues, but a cache hit still has to match the current Vulkan device, descriptors, and resource state. An unavailable representative still prevents its variant from binding without forcing otherwise valid entries to be rebuilt. The review did not establish a new security or failure-containment issue.

Security review details

Security Blast Radius

  • observed — The new sharing scope is queue workers in the same AGC process. A hit still requires the same Vulkan device, guest descriptor words, image shapes, and depth-compare flags. Tables with rejected, substitute, or partner entries are excluded from cross-epoch sharing.

Trust Boundaries and Controls

  • observed — Before reusing host textures, ShaderResources checks guest-memory generations and table state, checks for range overlap when the pending-write serial has changed, and reads cached texture entries under the texture-cache mutex. When the erasure counter changes, it resolves the entries again and checks their object identity before use.

Dependencies

  • observed — GuestMemory can satisfy a collection request with a memoized observation that meets the caller's epoch or shared ordering-time requirement. ShaderResources checks the saved write generations separately; successful collection does not by itself authorize reuse.

Resilience and Maintainability Implications

  • observed — A failed table freshness or texture validation leaves the taken record out of the shared cache and takes the normal resolution path. If only a representative was unavailable, table resolution can reuse valid siblings and rerun lookup for that representative. Both fresh build and table reuse reject the dependent variant unless the current representative binds and passes the variant's sampler compatibility checks.
  • observed — The new fixtures check that a later queue sees a tracked CPU write and that unaffected siblings remain reusable while a representative stays unavailable. The rejected-variant fixture does not restore the backing, so it does not establish recovery after remapping.
Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6890e4d2-0adc-47ac-a6c2-c9fcdf2ec453
Commits

Reviewing files that changed from the base of the PR and between 549b172 and b90edde.

Files selected for processing: 2

  • core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 6340 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/execution/ImageTableReuse.cpp
PR 6412 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
PR 7689 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9318 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
PR 9712 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 9897 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
PR 10492 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10497 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 10743 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11444 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 11551 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12575 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 12944 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13809 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_table_reuse_tests.cmake
PR 14032 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 14944 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 15548 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 16879 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 16935 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 16953 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 20041 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 20728 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 21199 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 22439 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 23242 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 24661 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 24735 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 27171 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28176 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28470 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28487 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28488 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28586 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28659 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28668 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28673 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28786 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp
PR 28787 core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp

@github-actions github-actions Bot added perf Performance change perf numbers missing perf pull request without a before and after summary line labels Dec 4, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

No verified blocking defect was found in the changed code; the author’s test and performance results were not independently verified.

What I ran

Reviewed head 9088e8583cef6953bc98824c737b090b483c0df0 using the pinned repo_read.py reader and the prepared diff. No tests or performance captures were run. The author reports 13/13 tests passed; the baseline and same-scene performance capture are pending.

python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 2660 2850
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 5125 5205
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7138 7305
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7300 7465
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7385 7590
python3 repo_read.py search 'CollectWrites(' core/libs/prx/libSceAgcDriver

Results

Check Result Note
Changed files passed Read 3 of 3 reviewed files
Tests not run Author reports 13/13 passed
Performance report not run Baseline and matched capture pending

Findings

Blocking

None.

Non-blocking

  • The description identifies this as a performance change, but its baseline and same-scene performance capture are pending. Add the required matched performance evidence before treating the performance claim as verified.

Not verified

  • Test results and validation-layer output reported by the author were not run or independently confirmed.
  • Performance impact was not measured.
  • description.md, commits.md, diff.patch, manifest.json, files.json, and the three changed files were read. No files were excluded by the bundle rules.

To get this to a good state

Nothing is required. Optional: attach the pending baseline and same-scene performance capture to support the performance claim.

@JJenkx

JJenkx commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Windows at this head (9088e8583cef): agc_driver_image_table_reuse, agc_driver_image_table_reuse_draw_pipeline, agc_driver_image_table_reuse_plan_verify, agc_driver_image_table_reuse_rejected_variant, agc_driver_image_table_reuse_shared_table, agc_driver_image_table_reuse_retaken_depth_surface, agc_driver_image_table_reuse_retaken_cleared_depth_surface, agc_driver_image_table_reuse_retaken_mirrored_depth_surface, agc_driver_image_table_reuse_retired_depth_surface, agc_driver_image_table_reuse_entry_limit, agc_driver_image_table_reuse_entry_memo, agc_driver_image_table_reuse_records, agc_driver_image_table_reuse_records_narrow pass, 3/3 runs. These are the CTests built from the changed ImageTableReuse.cpp.

Setup:

  • Windows 11 22621, Ryzen 9 5950X, MinGW-w64 GCC 15.2 UCRT r7, Release.
  • The exact PR head was built (not merged into main).
  • 3 runs through the shared FIFO.

The added test lines are not inside a platform guard.

AI-assisted: yes.

@github-actions github-actions Bot removed the perf numbers missing perf pull request without a before and after summary line label Dec 5, 2026
The host allocator can fill the address left by the rejected variant fixture before the dispatch tries to resolve it. Remove the guest allocation but keep its address inaccessible until the test finishes. Windows decommits the pages in the guest arena and POSIX protects the mapping with mprotect.
@brajankw

brajankw commented Dec 5, 2026

Copy link
Copy Markdown
Contributor Author

The Linux sweep found that a host allocation could reuse the rejected variant's address before dispatch. 6ef2299ff53 keeps that address reserved and inaccessible through both dispatches using page protection on POSIX and decommit on Windows. The original and revised heads both passed all 13 reuse tests on the RTX 3060 here, with zero VUIDs.

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this; the performance evidence below is optional, and the formal decision remains open because the reported capture does not exercise this change.

What I ran

Reviewed head 6ef2299ff53cffd4c662f15665d0539e642a09eb using repo_read.py at the pinned head. No build or tests were run. Reader commands:

repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 2660 2850
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 5115 5195
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7110 7409
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7240 7410
repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7411 7580
repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2460 2505
repo_read.py cat core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp 2630 2660

The initial reader call could not log to the read-only run directory; subsequent reads disabled logging. No base merge-preview check was run. No local toolchain or environment measurements were taken.

Results

Check Result Note
Source review passed Relevant changed paths inspected
Automated tests not run Would require executing the test target
Negative control not run No test or source mutation performed
Performance evidence not run Author reports the capture scene does not exercise this change

Negative control

Not run; no source mutation or test execution was performed.

Findings

Blocking

None.

Non-blocking

  • The reported performance capture is for a scene the description says does not exercise the changed cross-queue table reuse. Its results therefore do not establish the performance effect of the shared cache. The description also says the matching performance capture is pending. (Changed cache lookup: ShaderResources.cpp:2757.)

Sources

Not verified

Read all three paths listed under reviewed in files.json. Read the full included CMake test-registration file and the changed test sections; for the large ShaderResources.cpp, read the relevant changed hunks and surrounding functions through the pinned reader, not the whole file. files.json lists no excluded paths; the full source file was not included in files/ because it exceeded the review-folder size limit. Author-reported test and hardware results were not independently run. Performance on a workload exercising this change was not verified.

To get this to a good state

Nothing is required. Optional: provide a matched baseline and PR capture on a workload that exercises cross-queue image-table reuse, with the required summaries, traces, and digest output.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Dec 5, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Dec 6, 2026

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

Nothing blocks this; the points below are optional.

What I ran

Reviewed head 549b172a11a5521545dc123bbf053e1c66e4e660 against the prepared diff. No merged preview was run. I used the pinned repo_read.py reader for targeted source ranges and inspected the prepared diff and test configuration. I did not run tests or compile code.

python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 2660 2840
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 5100 5205
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7125 7415
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7275 7414
python3 repo_read.py cat core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp 7415 7565

Results

Check Result Note
Source review passed Core cache and revalidation paths inspected
PR tests not run Author reports 13/13 passed
Performance capture not run Relevant capture is reported as pending

Negative control

Not run; I did not execute tests or alter code under test.

Findings

Blocking

None.

Non-blocking

  • The performance evidence does not establish the change’s impact. The description says the supplied video_out_flip_backlog scene does not exercise the changed code and that baseline, remapping coverage, and a same-scene capture are pending. A representative capture would help evaluate this performance change. Changed cache creation and sharing logic.

Sources

Behavior claims about cross-queue table reuse and revalidation are based on the pinned source ranges in ShaderResources.cpp and the reuse path. Test coverage was inspected in agc_driver_image_table_reuse_tests.cmake and selected ranges of ImageTableReuse.cpp.

Not verified

  • No tests or performance captures were run by this review. The test results and captures in the PR description are author-reported.
  • ShaderResources.cpp and ImageTableReuse.cpp were read selectively, not in full. The CMake test configuration was read in full. All three changed files listed as reviewed in files.json were inspected; no files were excluded by rule.
  • Windows and physical-console behavior were not independently verified.

To get this to a good state

Nothing is required.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Dec 6, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Dec 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants