Skip to content

perf(agc): retry hot heap mirrors as host imports behind a switch - #22438

Merged
oneandonlydean merged 7 commits into
boykopovar:mainfrom
oneandonlydean:perf/agc-heap-mirror-retry
Nov 20, 2026
Merged

oneandonlydean merged 7 commits into
boykopovar:mainfrom
oneandonlydean:perf/agc-heap-mirror-retry

Conversation

@oneandonlydean

Copy link
Copy Markdown
Collaborator

What

An experiment for #22339, behind APS5_HEAP_MIRROR_RETRY=1. Without the variable nothing changes.

Background: a registered heap that was refused as a host import once (budget full) is heap mirrored. While it stays write-watched, a cached address space keeps the mirror and never asks for the import again; only a rebuild of the space does. Since #15919 an import change patches the space instead of rebuilding it, and since #16751 nothing is evicted while recorded work is active, because the retired bytes stay pinned until that work is released. On PPSA06866 this leaves a hot heap mirrored for the whole run: it is refreshed on every address-based build and each refresh writes pending images back.

With the switch:

  • Every 64 address-based builds served by the cached space, a heap mirror that was refilled in at least 32 of them is tried as a host import again, with eviction of idle imports allowed.
  • When recorded work is active and the idle imports would make room, they are retired ahead and the heap is owed its import. Until then other requesters (access windows, joins, color targets) cannot take the owed room. The space is rebuilt once the retired bytes are released, and that build imports the heap. An owed heap expires after 64 builds, so a heap that never fits costs one round of idle imports per 64 builds at most.
  • A cached space that holds heap mirrors is rebuilt after an import change instead of patched, as before perf(agc): patch the cached address space after an import change instead of rebuilding it #15919.

The [address] profile line gains heap mirror retries N (imported N, owed N).

Tested

Linux, built on e7988a85b0. agc_driver_graphics passes with the new heapMirrorRetryTests, which runs both arms on a write-watched block: without recorded work the retried heap replaces an idle import at once; with a recorder active the idle import is retired ahead, the heap stays mirrored while the bytes are held, and the first build after their release rebuilds the space and imports the heap. Without the switch 140 builds leave the mirror and the idle import alone. The test body is not built on Windows.

Not tested: no title was run. PPSA06866 is not available on my machine, so there are no performance numbers. The run that would settle it is the scene of #22339 (phoenix-31) with APS5_PROFILE_DRAW=1, three arms on this branch: default, APS5_HEAP_MIRROR_RETRY=1, and APS5_HEAP_MIRROR_RETRY=1 with APS5_NO_SPACE_PATCH=1. The [address] and [buffers] image mirrors lines of each arm show whether the heap leaves the mirror (retries, imported, owed, heap MiB) and what it does to the frame time.

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
  • Unimplemented paths throw; silent stubs are listed under Silent stubs in their library's technical debt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none (see perf: PPSA06866 title screen at half speed since #15919 and #16751 (storage write-backs on memory access) #22339)
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 610.57.04, Linux
  • AI-assisted: yes

With APS5_HEAP_MIRROR_RETRY=1 a write-watched heap mirror that is refilled
on most address-based builds is tried as a host import again every 64
builds. Under recorded work the idle imports are retired ahead, the heap
is owed their room and the address space is rebuilt when the bytes are
released. A cached space that holds heap mirrors is rebuilt after an
import change instead of patched. Default behaviour is unchanged.
@github-actions github-actions Bot added docs agc libSceAgc* perf Performance change perf numbers missing perf pull request without a before and after summary line labels Nov 17, 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.

@domx4q

domx4q commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Ran agc_driver_graphics and the heap mirror and BDA tests with the Khronos validation layer on Linux and an NVIDIA GPU, with and without APS5_HEAP_MIRROR_RETRY.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada, subgroup 32), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head 5cdce5612a merged onto main 1adc0e2f4b with --no-ff, clean merge. Main baseline is a Release build of 1adc0e2f4b on the same machine.

export ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer
ctest --test-dir build -R '^agc_driver_graphics$' -V
ctest --test-dir build -R '^(agc_driver_resident_heap_mirror|agc_.*heap_mirror.*|agc_driver_bda_.*|agc_address_space_unwatched_mirror_import)$' -V
APS5_HEAP_MIRROR_RETRY=1 ctest --test-dir build -R '<same pattern>' -V

agc_driver_graphics creates no Vulkan device, so the second pattern adds the GPU tests that go through GuestBufferMemory.

main 1adc0e2f4b this PR
Result, agc_driver_graphics 1 of 1 passed 1 of 1 passed
Result, heap mirror and BDA 17 passed, 2 skipped of 19 17 passed, 2 skipped of 19
Result, heap mirror and BDA, APS5_HEAP_MIRROR_RETRY=1 17 passed, 2 skipped of 19 17 passed, 2 skipped of 19
Insert instance layer "VK_LAYER_KHRONOS_validation" 0 + 8 + 8 0 + 8 + 8
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

heapMirrorRetryTests runs inside agc_driver_graphics here: its "heap mirror retries not tested" line is absent, and the test passes. agc_driver_bda_reads_shadowed_results and _per_build skip on both sides ("the device reports watched host memory written when it imports or reads it"), as on main. Every device selection picked the RTX 4090.

No new VUID- errors; all focused tests pass on Ada, with the two device skips of main.

AI-assisted: yes (Claude Code)

@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 15295 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp L180

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 1896 docs/dev/ENVIRONMENT.md
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 4472 docs/dev/ENVIRONMENT.md
PR 5372 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6412 core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 6924 docs/dev/ENVIRONMENT.md
PR 7275 docs/dev/ENVIRONMENT.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 7643 docs/dev/ENVIRONMENT.md
PR 8246 docs/dev/ENVIRONMENT.md
PR 9345 docs/dev/ENVIRONMENT.md
PR 9356 docs/dev/ENVIRONMENT.md
PR 9387 docs/dev/ENVIRONMENT.md
PR 9508 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 9712 docs/dev/ENVIRONMENT.md
PR 9852 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 10193 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 10442 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 10443 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 11435 docs/dev/ENVIRONMENT.md
PR 11436 docs/dev/ENVIRONMENT.md
PR 12157 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 12324 docs/dev/ENVIRONMENT.md
PR 12746 docs/dev/ENVIRONMENT.md
PR 12840 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 12849 docs/dev/ENVIRONMENT.md
PR 12944 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13148 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 13809 docs/dev/ENVIRONMENT.md
PR 13863 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 13920 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 13928 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 13929 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 15296 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 15529 docs/dev/ENVIRONMENT.md
PR 15548 docs/dev/ENVIRONMENT.md
PR 15570 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 15621 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 16753 docs/dev/ENVIRONMENT.md
PR 16793 docs/dev/ENVIRONMENT.md
PR 16831 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 17347 docs/dev/ENVIRONMENT.md
PR 17611 docs/dev/ENVIRONMENT.md
PR 17719 docs/dev/ENVIRONMENT.md
PR 17729 docs/dev/ENVIRONMENT.md
PR 17943 docs/dev/ENVIRONMENT.md
PR 18029 docs/dev/ENVIRONMENT.md
PR 18173 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 18226 docs/dev/ENVIRONMENT.md
PR 18293 docs/dev/ENVIRONMENT.md
PR 18369 docs/dev/ENVIRONMENT.md
PR 19054 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
core/libs/prx/libSceAgcDriver/tests/BdaResources.cpp
docs/dev/ENVIRONMENT.md
PR 19130 docs/dev/ENVIRONMENT.md
PR 19445 docs/dev/ENVIRONMENT.md
PR 19697 docs/dev/ENVIRONMENT.md
PR 20041 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 20172 docs/dev/ENVIRONMENT.md
PR 20187 docs/dev/ENVIRONMENT.md
PR 20315 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 20519 docs/dev/ENVIRONMENT.md
PR 21238 docs/dev/ENVIRONMENT.md
PR 21708 docs/dev/ENVIRONMENT.md
PR 22025 docs/dev/ENVIRONMENT.md
PR 22190 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 22424 docs/dev/ENVIRONMENT.md
PR 22434 docs/dev/ENVIRONMENT.md
PR 22546 docs/dev/ENVIRONMENT.md
PR 22647 core/libs/prx/libSceAgcDriver/Graphics/include/GuestBufferMemory.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 22697 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 22944 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 22957 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
docs/dev/ENVIRONMENT.md
PR 23229 docs/dev/ENVIRONMENT.md
PR 23234 core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp
PR 23243 docs/dev/ENVIRONMENT.md
PR 23244 docs/dev/ENVIRONMENT.md
PR 23248 docs/dev/ENVIRONMENT.md

A draw that reuses its cached resources retakes the address space without an address-based build, so on a screen served by reuse the retry count never advanced and the trial never ran. With APS5_HEAP_MIRROR_RETRY a retake of a space with heap mirrors now counts as a build and is refused when the trial or an owed import is due, which sends that draw through a build where the existing trial runs. The image mirrors profile line is also printed from retakes.
@Scramblrrrr

Scramblrrrr commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Updated clean Windows coverage on your latest canonical e179f36c12f0ac2c023ba53e973438c48c8dcb57 is complete, including importRetireCreditTests. The test-only child is codex/windows-retire-credit-tests-verified-nov18, head f581df36d3ca9b702a682f209233117c4c18c709.

Three commits: 48c3958ca0 ports the existing retry fixture, 6b351313bd resets its mapping before release, and f581df36d3 ports the new retire-credit fixture. One file, 37 insertions / 8 deletions relative to e179; original assertions and Linux mmap paths remain. Windows uses the existing write-watched GuestArena. Please cherry-pick the test commits if useful; no duplicate upstream PR.

Same final 19-case fixture, three rounds per arm Retry unset Retry enabled
Canonical e179 graphics provider 57/57 57/57
Test-only child f581 graphics provider 57/57 57/57

The exact final fixture binaries and support-library hashes are identical between providers; only libSceAgcDriver.prx changes. Both completion markers appear in every round, including the credit-disabled refusal, credit-enabled admission during recorded work, quarter-budget limit, and released-bytes assertions. Thus a Windows early return cannot masquerade as coverage. These transition checks use the fixture's simulated device. Eight separate cases per round create actual RTX 5070 Ti devices with Khronos insertion; zero skips, missing-layer messages or VUID/SYNC identifiers. This is native regression coverage, not a forced hardware credit/retry or game-performance result.

Windows 11 26200, RTX 5070 Ti / NVIDIA 617.42, GCC 15.2 r7 Release, validation 1.4.363. Diff/conventions checks pass against current origin/main. The first local compilation caught an incorrect cleanup-call argument list; it was corrected before freezing any tested binaries, and the successful rebuild and all four gates use f581.

007 remains separate: our existing #9508 integration predominantly takes the per-resource sparse-mirror path outside the cached-address-space retry path, and its observed retry/import/owed counters remain zero. No e179 production change has been staged into the game runtime and no loading or FPS benefit is claimed. Raw title data remains local. AI-assisted.

While recorded work is active a new host import gets no credit for the imports it replaces and may evict nothing, because the retired bytes stay pinned until the work completes. At a full budget nothing new is admitted, so a heap that fell back to a mirror stays one. With APS5_IMPORT_RETIRE_CREDIT an import may replace and evict under recorded work while the retired bytes still pinned stay within a quarter of the budget, which bounds what is pinned at the budget plus a quarter. The shutdown report counts the imports admitted this way.
The credited counter rose with the switch off, on any replacing import and on imports that later failed. Count it after the import is made, only when the credit let it in over the budget, and check the counter in the switch-off test.

@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

The targeted inspection found no verified blocking defect in the retry and retire-credit paths at head e01b313b65eac44edeeba8be5003614ac9678af3; executable checks were not run.

What I ran

  • Read the prepared description, commit list, manifest, and diff; inspected the changed import-budget and address-space retry logic at the pinned head.
  • No build or tests run. No repository changes made.

Results

Check Result Note
Diff and changed code passed Key retry and credit paths inspected
Build and tests not run No executable checks performed

Findings

Blocking

None verified in the inspected code.

Non-blocking

  • The description reports Linux coverage and explicitly notes that no title or performance run was available. The intended PPSA06866 comparison remains unverified; it would establish the experiment’s practical impact.

Not verified

  • GuestBufferMemory.cpp was read only in targeted ranges because its full text was excluded as too large. Thus this is not a complete review of that file or every changed hunk.
  • BdaResources.cpp and docs/dev/ENVIRONMENT.md are listed as included in the manifest but their full texts were not inspected; the test implementation was read from the diff only.
  • No build, tests, title run, Windows run, or performance measurements were performed by this reviewer. Author-reported Linux test results were not independently verified.
  • review/files.json could not be read through the available reader; the manifest shows GuestBufferMemory.cpp excluded for size and the other two changed files included.

To get this to a good state

Nothing is required. Optional: run the documented PPSA06866 three-arm comparison and report the profile and frame-time results.

…re credit admitted the import

With both switches off the retire after an import is created reads the pinned total again, the same expression as before the retire credit. Only an import admitted on the credit uses live bytes there. The environment table states the bound as a quarter of the budget plus at most one import.

@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 — changes requested

Changes are required before merge: fix the host import retry path so a retry can admit the heap after retiring idle imports, and keep the retry guard active through the import attempt.

What I ran

Reviewed head e179f36c12f0ac2c023ba53e973438c48c8dcb57. No commands or tests were run; the prepared reader was used to inspect the diff and source.

Results

Check Result Note
Source review failed Two retry-path defects verified
Build and tests not run Author reports Linux tests; not independently run
Windows and title behavior not run No Windows build or title run confirmed

Findings

Blocking

  • core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp:2450: When an owed heap retry finds enough idle imports, evictable is capped to the retire-credit allowance. With retire credit disabled, or when retired + replaced exceeds the allowance, this cap is zero. The subsequent test at lines 2451–2460 uses the uncapped idle amount to retire imports and record the heap as owed, but then returns without importing it. On the next build the owed bytes are cleared because the range is not yet imported; the heap can therefore remain mirrored despite available idle imports. The retry path should allow retiring the idle imports needed for the heap attempt, while preserving the recorded-work pinning rules.
  • core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp:5416: The retry flag is cleared immediately after importsNow, before the import allocation path runs. The special idle-import retirement branch at line 2452 checks this flag, so a retry that reaches importRunAt cannot activate the branch. Keep the retry context active through the complete attempt, including allocation, and clear it reliably afterward.

Non-blocking

None.

Not verified

The full source file GuestBufferMemory.cpp was excluded from the prepared files because it was too large; relevant functions and call sites were read through repo_read.py. The included files GuestBufferMemory.hpp, BdaResources.cpp, and docs/dev/ENVIRONMENT.md were read. No other changed files were listed in the manifest. Build, tests, Windows behavior, and title/performance behavior were not verified.

To get this to a good state

Correct both retry-path issues, then rerun the reported agc_driver_graphics coverage on the updated head, including heap retry with recorded work and with enough idle imports.

@oneandonlydean

Copy link
Copy Markdown
Collaborator Author

@MarcZX10 I checked both findings against e179f36 and I do not think either is a defect. Line numbers are in GuestBufferMemory.cpp.

  1. The owed heap. Returning without the import at 2452 to 2460 is intended. Under recorded work a retired import's bytes stay pinned until that work completes, so the heap cannot be admitted in the same build without passing the budget. The retry retires the idle imports and records the range as owed. The owed bytes are not cleared on the next build: line 5397 clears them only when the retry switch is off, when 64 builds have passed, or when peekImport finds the range imported. While they stand, other requesters see them as reserved (2446), and once the retired bytes are released line 5404 rebuilds the address space, which imports the heap. With APS5_IMPORT_RETIRE_CREDIT the same case is admitted at once within the quarter-budget allowance.

  2. The retry flag. importsNow (3753) calls importAllocation directly, which reaches importRunAt and the branch at 2452 before it returns, all under the imports mutex taken at 5394. So the flag set at 5416 covers the whole attempt, and 5418 clears it after the allocation path has run.

heapMirrorRetryTests in BdaResources.cpp (3564 to 3576) runs this sequence under an active recorder: the retry is counted as owed (possible only through the branch at 2452, so the flag was set there), the idle import is retired, the next build keeps the owed range and its room, and the build after the release rebuilds the address space for it. agc_driver_graphics passes with it on this head.

If you see a path where the owed range is dropped before the release, point me at it and I will add a test arm for it.

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Nov 19, 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 — looks good

Nothing blocks merging based on the code inspected; the experiment’s behavior is gated by environment switches, and I found no verified blocking defect.

What I ran

Reviewed head 9986d0ec58a95d2a28e114ef3744cb40ff8b7034 using the prepared diff and repo_read.py for targeted source ranges. No build or tests were run. The description reports Linux build and test results; these were not independently verified.

Results

Check Result Note
Diff and targeted source review passed Retry and retire-credit paths inspected
Build and tests not run Author reports Linux results
Runtime performance not run No title run or performance captures reported

Findings

Blocking

None.

Non-blocking

  • The retry behavior is an experiment without title-level performance measurements. The description identifies the Phoenix scene and profile counters needed to assess whether it improves frame time; sharing those captures would help establish the change’s value.

Not verified

  • GuestBufferMemory.cpp was read through targeted ranges with repo_read.py; its full 8,409-line text was not read. BdaResources.cpp was read over the changed test range. The prepared diff and manifest were read. GuestBufferMemory.hpp and ENVIRONMENT.md were not fully read; their changed lines were reviewed in the diff and the documentation range was checked. No other files were listed in the manifest.
  • Build, tests, Windows behavior, console behavior, and performance were not independently verified.

To get this to a good state

Nothing is required. Optional: report the Phoenix scene profile captures described in the PR description.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Nov 19, 2026
@Colewiz7

Copy link
Copy Markdown
Contributor

Head 9986d0ec58 merged onto main 50d85e27bc as da10ee6105, no conflict. Linux 7.3.4, GCC 16.2.1 Release, Mesa 26.2.6 RADV, RX 7900 XT (gfx1100) and 7800X3D iGPU (gfx1036).

No new failures and no new validation messages on either GPU.

RX 7900 XT iGPU
tests run (6333 on the 7900 XT, the 2033 GPU ones on the iGPU), new failures vs main none none
-R '^agc' ( tests) with the layer, new failures vs main none none
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Layer runs used VK_LAYER_KHRONOS_validation 1.4.363.1 with VK_LOADER_DEBUG=layer and ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; the loader inserted the layer in every run, and the set of distinct validation messages matches main.

AI-assisted: yes

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

Labels

agc libSceAgc* docs 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.

5 participants