fix(agc): keep nonbinding import probes from pinning buffers #7061

Merged
Azaluz merged 1 commit from upstream-pr/7061 into main 2026-10-17 21:05:04 +00:00
Azaluz commented 2026-10-17 09:35:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Azaluz on 2026-10-17T09:35:16Z.


What

Prevent nonbinding host-import probes from changing the use stamps that protect actual buffer pointers from eviction.

  • Split the covering lookup into a const peekImport and a stamping findImport.
  • Use the observational lookup for HostImportCovers, joined-span endpoint expansion, sparse join-base metadata, and profiling-only import classification.
  • Keep stamping actual pointer acquisitions and binding prepasses.
  • Add budget-pressure regressions for coverage hints and refused joins, including a genuine-acquisition control, descriptor/serial checks, copied bytes, hot-import retention, and guest-data integrity.

With a two-import budget, a coverage hint or a refused join currently refreshes an otherwise unused import. A later disjoint descriptor then copies because the unused import appears held. The regressions show that the descriptor can instead acquire its complete import while genuinely acquired buffers remain protected.

Related: #6097 fixes the stale covering lookup in importAllocation. This change addresses other nonbinding callsites and uses the same observational helper split. No stale-import qualification or allocation changes from #6097 are included.

Merge order: #5372 changes joined-span policy at the same two endpoint expressions. The overlap check reports that textual conflict, so it is listed as a merge-order dependency below. After #5372 lands, its != nullptr endpoint predicates should be retained while using peekImport for both lookups. This PR is independently built and tested on main.

Tested

Windows 11 build 26300, MinGW GCC 15.2, Release, publication base ef674f5af3e4d0fe44fda10e46d36ead2c262c0e, after preserving the original frozen experiment on adb0e7a8cb68232f457c788afa90e53648c0f15f.

  • Both new scenarios fail independently with unchanged production code: a coverage hint prevented eviction of an unused import; a failed join endpoint probe prevented eviction of an unused import. The genuine-acquisition control passes on that baseline.
  • Candidate agc_driver_graphics_tests: passed, natural exit, 15.640 s after the publication rebase (5.954 s on the original frozen experiment), including existing joined-import and sparse-heap coverage.
  • Native Vulkan gates with ANYPS5_REQUIRE_VULKAN=1 APS5_PROFILE_DRAW=1 ANYPS5_NO_SHADER_CACHE=1: agc_driver_host_import_windows_tests, agc_driver_host_import_at_map_tests, agc_driver_bda_device_tests, and agc_driver_host_import_teardown_tests all passed without skips.
  • Full graphics mocks do not implement vkCreateQueryPool when profiling is enabled; the same preparation failure occurs on baseline and candidate. Native profile-enabled gates above passed.
  • python tools/check_conventions.py --base origin/main: passed.
  • Overlap review: 762 open PRs; 46 shared-file patches reviewed, including 16 branches that could not be automatically compared because they conflict with main. No duplicate of this bookkeeping fix found. #5372 has the declared textual overlap; composing this patch and #6097 in either order produces the same clean tree.
  • GPU tests ran with mining stopped. No frame-rate, title-unblocking, or current-main gameplay claim.

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
  • 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: #5372
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 617.42, Windows 11 build 26300
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4898992065 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7061). Originally posted by [Azaluz](https://github.com/Azaluz) on 2026-10-17T09:35:16Z. --- ### What Prevent nonbinding host-import probes from changing the use stamps that protect actual buffer pointers from eviction. - Split the covering lookup into a const `peekImport` and a stamping `findImport`. - Use the observational lookup for `HostImportCovers`, joined-span endpoint expansion, sparse join-base metadata, and profiling-only import classification. - Keep stamping actual pointer acquisitions and binding prepasses. - Add budget-pressure regressions for coverage hints and refused joins, including a genuine-acquisition control, descriptor/serial checks, copied bytes, hot-import retention, and guest-data integrity. With a two-import budget, a coverage hint or a refused join currently refreshes an otherwise unused import. A later disjoint descriptor then copies because the unused import appears held. The regressions show that the descriptor can instead acquire its complete import while genuinely acquired buffers remain protected. Related: #6097 fixes the stale covering lookup in `importAllocation`. This change addresses other nonbinding callsites and uses the same observational helper split. No stale-import qualification or allocation changes from #6097 are included. Merge order: #5372 changes joined-span policy at the same two endpoint expressions. The overlap check reports that textual conflict, so it is listed as a merge-order dependency below. After #5372 lands, its `!= nullptr` endpoint predicates should be retained while using `peekImport` for both lookups. This PR is independently built and tested on main. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 build 26300, MinGW GCC 15.2, Release, publication base `ef674f5af3e4d0fe44fda10e46d36ead2c262c0e`, after preserving the original frozen experiment on `adb0e7a8cb68232f457c788afa90e53648c0f15f`. - Both new scenarios fail independently with unchanged production code: `a coverage hint prevented eviction of an unused import`; `a failed join endpoint probe prevented eviction of an unused import`. The genuine-acquisition control passes on that baseline. - Candidate `agc_driver_graphics_tests`: passed, natural exit, 15.640 s after the publication rebase (5.954 s on the original frozen experiment), including existing joined-import and sparse-heap coverage. - Native Vulkan gates with `ANYPS5_REQUIRE_VULKAN=1 APS5_PROFILE_DRAW=1 ANYPS5_NO_SHADER_CACHE=1`: `agc_driver_host_import_windows_tests`, `agc_driver_host_import_at_map_tests`, `agc_driver_bda_device_tests`, and `agc_driver_host_import_teardown_tests` all passed without skips. - Full graphics mocks do not implement `vkCreateQueryPool` when profiling is enabled; the same preparation failure occurs on baseline and candidate. Native profile-enabled gates above passed. - `python tools/check_conventions.py --base origin/main`: passed. - Overlap review: 762 open PRs; 46 shared-file patches reviewed, including 16 branches that could not be automatically compared because they conflict with main. No duplicate of this bookkeeping fix found. #5372 has the declared textual overlap; composing this patch and #6097 in either order produces the same clean tree. - GPU tests ran with mining stopped. No frame-rate, title-unblocking, or current-main gameplay claim. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #5372 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: NVIDIA GeForce RTX 4080 SUPER, driver 617.42, Windows 11 build 26300 <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no -->
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!7061
No description provided.