Skip to content

perf(agc): validate host imports through their registered owner - #7466

Open
Dripl1x wants to merge 2 commits into
boykopovar:mainfrom
Dripl1x:codex/registered-host-import-owner
Open

Dripl1x wants to merge 2 commits into
boykopovar:mainfrom
Dripl1x:codex/registered-host-import-owner

Conversation

@Dripl1x

@Dripl1x Dripl1x commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What

This PR is part of a series of graphics and memory-management performance improvements for AnyPS5, with SuperTuxKart as the main profiling workload. This is item 03/10; the UI Lab startup/cache fix follows as a separate eleventh PR. Each topic's measurements are distinguished from the combined result.

Validate an existing single-range host import through its registered owner after an unrelated registry mutation. Keep full reconciliation for replaced owners, aliases, joined imports and adjacent ranges that can extend an import run.

Tested

Pinned benchmark base: 6447ed1ed7fd11c7eef60df336e8d66fac271188. Tested topic snapshot: a32fe0a42ca02bd0a77ecf03827324e6e633e866. Windows 11 Pro build 26300, Ryzen 7 5800H, RTX 3070 Laptop, NVIDIA 617.42. Frozen runtime module hashes and raw traces were verified. No opt-in optimization flags are required.

4/4 real Vulkan cases passed on main and this topic: import windows, unmap, retirement/readback and a second direct-memory mapping. Serial identity is checked immediately after unrelated registration, owner replacement and creation of an alias, before the next fill can repair a stale entry.

SuperTuxKart tutorial/menu, 1920x1080, warm caches, seconds 20-28:

Configuration FPS p50 ms p90 ms p99 ms
main control 9.509 104.114 110.231 113.153
This topic 9.404 103.048 113.510 131.862

Observed difference: -1.10% in one capture per configuration; this does not establish a repeatable isolated gain.

Trace summary lines
{"commit":"6447ed1ed7fd","dirty":false,"env":{"APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":44,"ms":8097.757},"presents":77,"frame_ms":{"p50":104.114,"p90":110.231,"p99":113.153,"max":113.153},"gpu_busy_ms_per_present":5.352,"worker_busy_pct":{"queue worker 0x0":3.181},"top_phases_ms_per_frame":{"Driver.Packet":3.294,"Driver.Packet.draw":2.701,"Driver.Draw":2.646,"Driver.Draw.shader_compile_and_link":1.561,"Shader.DrawStage":0.838,"Driver.Present":0.824,"Driver.Present.queue_present":0.584,"Vulkan.QueuePresent":0.583},"trace_dropped":false,"trace":"aps5-trace-6447ed1ed7fd-20276.json.gz"}
{"commit":"6447ed1ed7fd","dirty":true,"env":{"APS5_TRACE_SECONDS":"20:8"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","resolution":"1920x1080","window":{"spec":"seconds 20:8","first_present":57,"ms":8081.418},"presents":76,"frame_ms":{"p50":103.048,"p90":113.51,"p99":131.862,"max":131.862},"gpu_busy_ms_per_present":5.214,"worker_busy_pct":{"queue worker 0x0":3.193},"top_phases_ms_per_frame":{"Driver.Packet":3.34,"Driver.Packet.draw":2.727,"Driver.Draw":2.661,"Driver.Draw.shader_compile_and_link":1.57,"Driver.Present":0.862,"Shader.DrawStage":0.862,"Driver.Present.queue_present":0.612,"Vulkan.QueuePresent":0.61},"trace_dropped":false,"trace":"aps5-trace-6447ed1ed7fd-37108.json.gz"}

Raw trace names and SHA-256 values are recorded in the series evidence index. The common evidence link below contains those files.

Other homebrew checks

Workload Control FPS This topic FPS Scope
vkQuake 54.590 54.797 Moving demo; small differences need matched camera repeats
Syobon Action 30.276 30.277 Approximately 30-FPS cap
Middle Ages Ping Pong N/A N/A Runtime compatibility checked; no performance figure reported

UI Lab: the 21 default concepts were rendered and visually reviewed in a navigation cycle for this topic. Artwork was present; this covers default navigation, not all themes or every widget interaction.

Known baseline rendering issue: vkQuake still has intermittent flickering and an intermittently black floor on main and the tested performance branches. These changes do not fix it. Yamagi Quake II gameplay stops at unsupported last-provoking-vertex flat interpolation, and UZDoom at unsupported clip/cull-distance handling on the baseline; neither supplies a valid gameplay FPS comparison.

Dependencies, series and overlap

#6917 retains registry lease snapshots; #6951 memoizes run bounds per lease; #7261 reconciles resource-set proofs after registry changes. This topic checks the registered owner of an individual import before full reconciliation. They optimize related paths and are not claimed as new work here.

The project overlap scan compared the local topics against 785 open PRs and checked merges into main e5c2b3c325e485ba7fd417c47c46f48aa2c89115. This topic merges cleanly in that snapshot. Some other PRs already conflict with main, so the tool cannot compare all their shared-file hunks; the full report is retained with the common series evidence package. No exact duplicate was identified in the inspected implementations. This is not a certification that every conflicting foreign branch is composition-tested.

Conventions and whitespace checks passed for the tested topic range. The benchmark base remains pinned for comparability; this is not a fresh-current-main build/test claim. Measurements and focused tests refer to the pinned source revisions above; no full-suite CI run is claimed.

Combined series result

Same pinned main, machine, 1920x1080 SuperTuxKart tutorial/menu scene, warm caches, maximized window and muted audio. APS5_TRACE_SECONDS=20:8 only; no application-output redirection. FPS is presents divided by the recorded capture interval; frame quantiles are computed independently. Rows are sorted by increasing FPS. Each row is one capture.

Configuration FPS p50 ms p90 ms p99 ms
Pinned main 9.509 104.114 110.231 113.153
main + #6658 + item 01 14.248 68.284 78.652 95.172
main + #6658 15.493 63.782 68.742 78.478
Historical ten-topic stack + #6658, before item-10 import correction 26.124 37.622 41.458 44.996
Corrected ten-topic stack + #6658 + tested #6678 revision 32.323 30.874 32.059 33.862

The corrected combination is 3.40x the pinned-main throughput, with p50 reduced by 70.3%. This is a combined result, not the gain of each PR. The earlier 32.646-FPS combination is superseded because item 10 needed its resident-import correctness repair. Screen-counter peaks near 35 FPS are not an average.

The combination includes #6658 (local integration 6baa697b2f6d6154fe7f144a77eb0af1ce37f173) and #6678 at tested revision 5f822a50086fd880d6b4346709b70f8901431f43. #6658 is open. #6678 merged on 2026-10-18 with later head fd301c78a5d625d6eba8b8a32e5746a044fc235e; that newer revision and current main were not benchmarked here. Their implementations and gains are credited separately. Related earlier SuperTuxKart work #6718 and Windows tracking work #6701 are separate PRs and are not relabeled as items in this series.

Checklist

  • Based on pinned main 6447ed1ed7fd; clean merge checked against main e5c2b3c325e4; related overlaps and duplicate-review limits are listed above
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • 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: NVIDIA RTX 3070 Laptop, NVIDIA 617.42, Windows 11 Pro build 26300
  • AI-assisted: yes

The published head adds publication metadata only; its complete source tree is identical to the tested snapshot above.

Series index

These are the ten performance topics from the same profiling effort, followed by a separate UI Lab cache-preservation fix. Membership in the series does not imply a dependency.

Item Pull request Required dependency
01 #7464: perf(agc): keep unimported label stores on the CPU #6658
02 #7465: perf(agc): defer small host imports until first GPU use none
03 #7466: perf(agc): validate host imports through their registered owner none
04 #7467: perf(libc): avoid repeated Windows path component scans none
05 #7468: perf(libkernel): find direct-memory aliases through the physical index none
06 #7469: perf(libkernel): find free direct-memory ranges in allocation order none
07 #7470: perf(libc): release exact resident mappings without repeated queries none
08 #7471: perf(libc): collect resident writes directly into the output buffer none
09 #7472: perf(libc): reuse saved direct-memory buffers when unreferenced none
10 #7473: perf(libc): skip write-watch queries for proven clean resident ranges #7471
11 #7474: fix(agc): preserve pipeline caches on immediate guest exit none

Reproduction evidence

Series traces, summary lines, module hashes, focused-test logs and UI contact sheets. Game measurements use the pinned base and source revisions described above; assets contain no game binaries.

Complete the publication checklist and series cross-links for boykopovar#7466.
No source or test changes.
@github-actions

github-actions Bot commented Oct 18, 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 862 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1191 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1324 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 1368 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 2434 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 4449 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 5883 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6146 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6177 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6182 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6185 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6187 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6209 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6373 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6457 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6479 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6548 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6636 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6682 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6683 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6718 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6730 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6747 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6759 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6771 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6820 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6868 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6905 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6911 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6913 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6918 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/execution/HostImportWindows.cpp
PR 6946 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6951 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6971 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6973 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6987 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6989 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6995 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7002 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7048 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7082 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7154 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7233 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7258 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7261 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7292 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7371 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7427 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7446 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7457 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7505 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7514 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7533 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7604 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7618 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7629 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7647 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7717 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7803 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7844 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7849 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7919 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7961 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 7984 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 8016 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp

@github-actions github-actions Bot added agc libSceAgc* perf Performance change perf numbers missing perf pull request without a before and after summary line labels Oct 18, 2026
@github-actions

Copy link
Copy Markdown

This pull request is labeled perf, so it needs the summary line of a capture on main and one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste both aps5-summary.jsonl lines, attach the two traces and add the output of tools/trace_digest.py.

@savvaniss

Copy link
Copy Markdown
Contributor

Intel and AMD Windows data: with this PR the 56 tests built from tests/Recorder.cpp and HostImportWindows.cpp pass on an Intel UHD 770 and an AMD RX 9070 XT. Without it, 8 import-settle and host-import tests fail on both.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head 7cea858cf merged into main 07377573f. "Without" means this PR's test files on main 07377573f, with none of its other changes.

Tests, ×3 UHD 770 RX 9070 XT
This head: 56 tests 49 pass, 7 import-watch and import-settle tests skip (no other queue family to settle imports on) 56 of 56 pass
Without 8 fail with (9) a scan under a pending write was kept: the 6 import-settle tests, agc_driver_host_import_lifetime, agc_driver_host_import_mutation_race the same 8 fail with a signaled batch's read still refuses

This is a correctness check only; I measured no speed.

I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7432, #7426, #7413, #7480, #7465, #7464, #7449, #7489, #7673, #7560). Neither GPU showed a failure beyond main's own: the five image-table tests (#6647) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_driver_layered_volume_vertex_no_gpl (#4768) on the RX 9070 XT.

AI-assisted: yes (Claude Code)

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* needs rebase Conflicts with main, rebase needed perf numbers missing perf pull request without a before and after summary line perf Performance change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants