Skip to content

fix(agc): report draw cache validation miss reasons - #954

Open
Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/23550
Open

Thimo188 wants to merge 1 commit into
mainfrom
upstream-pr/23550

Conversation

@Thimo188

@Thimo188 Thimo188 commented Dec 2, 2026 •

Copy link
Copy Markdown
Owner

Imported from boykopovar/AnyPS5#23550, originally opened by JJenkx.

Source commit: 1eb68bccbb012081619888aa1b3102b65619198b. The import branch preserves this fetched upstream PR snapshot. The description and validation below are copied from upstream; no new code changes or test runs were made for this import. Original reviews, discussions, and attachments remain at the linked upstream PR.


What

Draw-cache reports group six validation refusals under gate. A saved Hamster workshop run ended an interval with 121,626 such misses, leaving the cause hidden.

Count the existing selected EntryOutcome alongside that aggregate and report inaccessible memory, queued labels, unfinished image publication, and changed publication/pending/forget serials separately. Selection, validation and synchronization stay as they are. The counts describe failed lookups using the same first layout-compatible candidate as the existing classification, rather than every attempted variant. Existing interval reset and cache locking cover the new counters.

Tested

Main bf10f075132a and change 1eb68bccbb01: full Release SDK/relinker builds and the same six draw-cache reuse/verification and user-word data-hit tests on Linux 7.2.14, GCC 16.2.1, AMD Radeon RX 6650 XT/RADV Mesa 26.2.7. ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, Khronos validation 1.4.363 and VK_LOADER_DEBUG=layer were set on both arms. All 12 cases passed: 24 confirmed layer insertions, no skips or VUID- errors. Pinned Vulkan-Headers version 335. Frozen SDK hashes and patched/unpatched module identity were checked.

Native PPSA06652 01.009.000, saved workshop, APS5_TRACE_DRAW_CACHE=1 with APS5_PROFILE_DRAW unset: normal close, exit 0 after 222.6 seconds. In all 22 report intervals the six detailed counts sum exactly to the existing gate count. Total: 1,063,404 flushing image, 37 publish moved, the other four zero. Original inputs, SDK and kernel settings remained intact; no native process remained. This is diagnostic validation, not a title speedup claim.

Example new output:

[draw-cache] validation misses (10 s): inaccessible 0, queued label 0, flushing image 104656, publish moved 3, pending moved 0, forget moved 0

Source patch, paired builds, complete GPU logs, native counter intervals and provenance, SHA-256 c3efb221b44bbcef3b13063a0ace827ea0e4a1f415ae14ad6d38f39203381c5c. Download and all 37 payload hashes verified. Game binaries and raw game traces are excluded.

Branch overlap scan completed. Eleven PRs with base conflicts required manual shared-file review; their indexed heads matched live GitHub heads, and none adds these outcome counters. The branch merges cleanly with d7e3a494470b; its four upstream files are unchanged since the tested base.

The six focused Linux cases are agc_driver_draw_cache_reuse, agc_driver_draw_cache_reuse_verify, agc_driver_draw_cache_reuse_entry_verify, agc_driver_draw_data_hit_user_words, agc_driver_draw_data_hit_user_words_verify, and agc_driver_draw_data_hit_user_words_table_keep.

Independent Windows/NVIDIA evidence: artor410's report tested this head on main ded746ea12, Windows 11 Pro 26300, RTX 3070 Ti, NVIDIA 610.88, WinLibs GCC 15.2.0 r7 and Khronos 1.4.363. The author reports 27/27 selected draw-cache/data-hit tests passing on both sides, the layer inserted in every test and no VUIDs. Those short tests do not exercise the new 10-second counter reports; no title or full-suite run is claimed by that report.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.7, Linux 7.2.14; independently reported NVIDIA RTX 3070 Ti, driver 610.88, Windows 11 Pro 26300 (linked above)
  • AI-assisted: yes

Summary by CodeRabbit

  • Improvements
    • Draw-cache reports now include counts for validation misses, broken down by the type of entry that missed.
    • Validation misses are tracked even when trace or profile reporting is disabled.

@coderabbitai

coderabbitai Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Draw Cache Validation Misses

Layer / File(s) Summary
Outcome counter contract
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Dispatch/DispatchCache.hpp, core/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hpp
EntryOutcome adds Count. DrawEntryCounters adds a validation-miss counter array sized by EntryOutcome::Count.
Miss attribution and reporting
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cpp, core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCacheStatistics.cpp
Draw lookup saves the specific outcome for applicable gate misses and increments the matching counter. When gate misses are nonzero, the report appends counts for inaccessible, queued label, flushing image, and moved publish, pending, and forget positions.

Change: Feature

Merge Risk: Minimal · up to 1eb68

This change adds diagnostic counters that break draw cache gate misses down by validation reason in the existing report. It does not change cache selection or validation behavior. No concrete merge-blocking risk was found.

Security architecture risk: Minimal · up to 1eb68

Draw-cache reports can now explain why a lookup was refused. AgcDriver still applies the same validation checks and reports through the same trace and profiling controls.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Usage-based review receipt

  • Mode: Continue automatically
  • Reviewed files: 4
  • Waived: $1.00 (charged $0.00)
  • View usage details

Note

This review exceeded your plan’s limits and used usage-based reviews—free during trial, billed after paid activation unless disabled. Manage usage-based reviews.

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: de2a4ebc-420d-4240-895f-da72ddeca9dd
Commits

Reviewing files that changed from the base of the PR and between 4131f51 and 1eb68bc.

Files selected for processing: 4

  • core/libs/prx/libSceAgcDriver/Execution/include/Driver/Dispatch/DispatchCache.hpp
  • core/libs/prx/libSceAgcDriver/Execution/include/Driver/Draw/DrawCache.hpp
  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCacheStatistics.cpp
  • core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawLookup.cpp

Limit details: You’ve used all 10 included reviews currently available.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants