Skip to content

perf(agc): validate draw-shape reuse on current main - #63

Closed
JJenkx wants to merge 4 commits into
mainfrom
validation/astro-shape-reuse-b1
Closed

JJenkx wants to merge 4 commits into
mainfrom
validation/astro-shape-reuse-b1

Conversation

@JJenkx

@JJenkx JJenkx commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

Closed: upstream feature merged

Upstream #494 merged as f59d91ffc35b99502f7106ffd800190a974c31c1 on October 14. Current main eea428ca8 includes its updated admission policy: once a shape is resident, another key is admitted only after that key has been seen before (Driver::admitDrawKey). It therefore avoids inserting every one-off replacement that this draft’s retirement follow-up addressed. The measured local experiment below established no Astro FPS gain. Closing the superseded fork integration rather than replaying the old admission policy onto current main. The branch and historical results are retained. The old baseline recommendation below applies only to that historical comparison; use a separately validated current-main build for new tests.

What

Refresh Michon's draw-shape reuse proposal (boykopovar#494, source 5fe165d371c) on main b1d07f8b123, preserving author/co-author credits, shared stage results, raw user-data-tail tracking and the newer instanced-tessellation cache guard. This is a fork validation branch, not a duplicate upstream submission. It merges cleanly with main f785b88a625, which now includes boykopovar#5792.

Admit a changing draw key when its key or shape was seen before, using separate bounded sightings tables. Preserve main's key-only admission when data hits are disabled. Refresh current user words, merged pointers and raw tail continuation on a donor decode, and validate captured reads before stage reuse.

Retire a one-off key when a newer key replaces its shape. Repeated keys remain cached, including keys promoted by a direct hit and entries whose stage variants rotate. This prevents streams of per-draw keys from keeping every superseded shape entry until a capacity eviction. Capacity and validation rules are unchanged. The branch includes the separate AudioOut2 lifetime repair (#61 / upstream boykopovar#5971) for native shutdown; it introduces no title-specific behavior or additional switches beyond boykopovar#494.

Tested

Current head d8417359e0a builds full Linux libraries. Ten selected cases pass without skips on Radeon RX 6650 XT / RADV Mesa 26.2.4; eleven pass on lavapipe, including tessellation. They cover draw reuse with/without pipeline libraries, changing user words, repeated keys separated by one-off keys, register-key fuzzing, prepared graphics/prebuild modes, prepared shaders and raw fragment/vertex tails. Two Radeon checks with data hits disabled also pass.

The same changing-user-word fixture fails against unchanged main's draw-cache code. Removing shape admission fails decode reuse; restoring the older disabled-path policy fails admission. In the retention follow-up, disabling retirement fails the one-off-entry assertion, and removing exact-hit promotion fails the repeated-key assertion. Final restored code passes.

Radeon's direct tessellation case crashes in Mesa's pipeline optimizer on both baseline 8e57bb2d9e9 and the candidate, including with data hits disabled. It bypasses the changed driver draw cache and is excluded from the ten passing Radeon cases; lavapipe passes it.

Native PPSA21564 -lvl hub_crashsite on the current head reaches standing Astro/HUD301 and a legible CRASH SITE banner with full decode/stage comparison enabled. Reported intervals contain 1,370,657 data-only hits, 841,013 stage-result comparisons and 1,363,917 one-off replacements, with no verifier mismatch. Normal close exits 0 and restores the temporary kernel setting. No input or audio-quality check was performed. Verification forces fresh stages for comparisons, so its counters are not FPS evidence.

Timing: no improvement established

Same Ryzen 9 7950X / RX 6650 XT / RADV host, existing converted app, warm shared shader/pipeline caches, 3072×1728 Crash Site, pipeline enabled, no input. Each capture used only APS5_TRACE_SECONDS=180:60, no other trace/profile/verifier flag, and terminal-attached game output. Baseline 8e57bb2d9e9 is main b1d07f8b123 plus the same AudioOut2 lifetime repair.

Metric Baseline 8e57bb2d9e9 First candidate 441920a955d Current retention d8417359e0a
Presents 188 154 186
Window seconds 60.127 60.307 60.121
Mean frame interval 319.826 ms 391.607 ms 323.229 ms
Frame p50 318.893 ms 384.098 ms 321.622 ms
Frame p99 449.704 ms 570.836 ms 452.246 ms
GPU busy / present 179.863 ms 203.376 ms 179.565 ms

The first candidate was 22.44% slower by mean frame interval in this initial sequence. Retention removes most of that observed penalty, but its first capture remains about 1.06% slower than baseline. No gameplay FPS gain is established, and this stays a draft experiment. The baseline remains the recommended game-testing build.

There is one capture per version, in first-candidate / baseline / retention order, without repeat statistics. The elapsed-time windows begin at different present indices (1206 / 1052 / 1295), so animation timing is not identical; the comparison tool flags that difference. All default event buffers overflowed: phase totals include work omitted from detailed traces. These results do not prove a statistically established code-only regression or gain. Complete summaries and traces remain local along with private title assets/logs; none are committed.

CI

The previous-head build (441920a955d against main b1d07f8b123) completed partially: Linux 1,139 passed / 57 skipped / one failed (agc_driver_recorder, dma-buf probe cannot open /dev/udmabuf); both draw-reuse cases passed. Windows passed 777 / 442 skipped, zero failures. Those results do not validate the new retention commit. Fresh full Linux/Windows CI is running for current head d8417359e0a against current fork main. Its eligibility checkout will identify the exact tested main revision; the native comparison above remains pinned to main b1d07f8b123.

Checklist

Latest full CI update: run 38631413195 tests this published head merged into f785b88a625922cbd2969dee878b45f8e11620df. Linux completed with 1144 passed, 57 skipped and two failures: agc_driver_recorder rejects the runner’s failed /dev/udmabuf import probe (permission denied), and guest_user_service aborts because its old event test calls before initialization. Upstream subsequently reverted that obsolete test in boykopovar#6043. Windows also completed: 780 passed, 444 skipped, with guest_user_service failing at the same obsolete event assertion (exit 0xc0000409). These failures remain recorded; the Linux run is not green.

JJenkx and others added 4 commits October 14, 2026 15:20
…code and stages

The draw key now has a shape: the key without the user words the stages read.
A draw whose key misses but whose shape has an entry copies that entry's decode,
re-reads only the user words (and merged-stage pointers), and reuses each
compiled stage whose captured reads still hold, compiling the rest.

APS5_NO_DRAW_DATA_HITS=1 disables it; APS5_VERIFY_DRAW_DATA_HITS=1 also decodes
and compiles in full and throws when the results differ.

A shape keeps its previous entries and only points at its newest key, so
draws of one shape that alternate between stable user words keep their own
key hits. The shape is passed only when data hits are on, so
APS5_NO_DRAW_DATA_HITS=1 keeps the previous behaviour exactly.

Rebased onto main a8b032b by CouchRiv (the conflicts with boykopovar#639 resolved; built and tested on Linux with an RTX 4070 Ti and RADV, and on Windows with an RTX 5080), and onto main 6ac63bf by gjonn (main's free-function decoder with its static-ABI mode, its incremental register key as the shape key).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: CouchRiv <270190108+CouchRiv@users.noreply.github.com>
Co-Authored-By: Gjon Gojcevic <7807870+gjonn@users.noreply.github.com>
@github-actions github-actions Bot added agc libSceAgc* prx Other PRX libraries docs Documentation labels Oct 14, 2026
@JJenkx JJenkx closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs Documentation prx Other PRX libraries

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants