perf(agc): audit a cached template only after the host import set changed #14838
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14838"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-11-01T19:18:47Z.
What
Carries #9012 by @SP4C3B4R-8, with credit.
Carry the import-generation condition for periodic cached resource audits onto main
ac26e59d9a. Keep the interval, audit budget and override from the original change. Preserve current recent-import lookup helpers, insertion counters and compared-import coverage API.Successful insertions advance the audit generation; retirement, device replacement and reset advance it through the existing epoch changes. Joined creation uses the insertion path. The separate joined epoch invalidation stays intact. Add generation and stable repeated-lookup checks to the sampled lookup and joined heap fixtures.
Tested
ac26e59d9aplus this change; it also merges cleanly with maind8b60b46ed): the ctests that use the changed sources 17/17 passed, and the seven named focused tests passed 7/7 with none skipped:agc_driver_resource_cache_lookup_changed,agc_driver_sampled_cache_budget,agc_driver_resident_heap_mirror,agc_driver_host_import_at_map,agc_driver_host_import_proofs,agc_driver_host_import_teardown,agc_host_import_retire. Not run: Windows, macOS, any GPU/game qualification.Local checks: git diff --check and git bundle verify succeeded. Current recent-import helpers, HostImportFor and importJoined remain byte-identical to the base. These checks do not establish runtime correctness.
Run the focused tests on main and the carry with the validation layer and the same GPU/configuration. Include agc_driver_resource_cache_lookup_changed, agc_driver_sampled_cache_budget, agc_driver_resident_heap_mirror, agc_driver_host_import_at_map, agc_driver_host_import_proofs, agc_driver_host_import_teardown and agc_host_import_retire. Also run the changed lookup and joined fixtures with insertion-generation advancement removed as a negative control. Skipped Vulkan or sparse joined cases are missing coverage.
Earlier A/B records belong to the original head
19191f4ea2, not this carry: https://github.com/boykopovar/AnyPS5/pull/9012#issuecomment-6361833585 and https://github.com/boykopovar/AnyPS5/pull/9012#issuecomment-6363581990 . No new performance or game-gate result is claimed. Preserve current performance and game qualification requirements.Checklist
mainac26e59d9a; carries #9012 (the original, which conflicts with currentmain); no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T19:24:17Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The exact head has a concurrency race in its shared audit budget, and the required AGC performance evidence is missing for this carry.
What I ran
Reviewed head
645b7272a8c8099c775b19bba3f569252abaad2aagainst PR basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. The merge preview against currentmain(e0caf1360035286bd22b9f2a3030e97b880ffb28) is clean. Linux x86_64, Debian 12, Python 3.11.2, Git 2.39.5; no C++ build or compiler run.Commands and inspections performed:
Results
mainCommands and unedited output
git diff --check ...produced no output and exited successfully. The precheck report recorded:Hosted checks at review time:
Negative control
Not run. I did not mutate the implementation or disable generation advancement to test whether the added tests detect the budget race.
Findings
Blocking
The global 4 ms audit budget can be exceeded under contention. In
ImportAuditAdmitted, one thread can successfully publish the newslotand pause before resettingadmitted. Other threads then see that new slot and increment the previous slot's count; the first thread's reset erases those reservations, allowing more than the configured budget in the same time slice. This violates the intended shared cap. Make slot rollover and reservation atomic as one state transition (or serialize rollover/reservation), and add a deterministic concurrent rollover test.Required AGC validation evidence is missing for this head. The PR is labeled
perf, but it has no matched main/change summary lines or attached traces for this carry. It also reports no GPU testing, while the repository requires the same focused validation-layer tests onmainand the change using the same machine and GPU for AGC changes. The linked measurements belong to the older #9012 head and do not validate this SHA. Add the required matched records, traces and digest, plus the specified focused GPU results; otherwise remove theperfclaim/title and provide the required AGC validation before merge.Non-blocking
main; clarify whether this carry supersedes it and the intended landing order.Sources
Not verified
No local build, C++ tests, GPU test, game qualification, Windows or macOS run was performed. Hosted Windows was pending; Linux and specialized jobs were skipped. The precheck's ABI and test-quality helpers were unavailable in the isolated PR snapshot. The author-reported Linux tests were read from the PR description and were not rerun here.
To get this to a good state
Fix the shared-budget rollover race and add a concurrent regression test. Attach the matched performance and AGC validation evidence required above. On the new head, I will rerun the precheck, diff check, stack check, and review the updated implementation and test; hosted checks and GPU evidence should be refreshed for that SHA.