perf(agc): skip unused retire registry snapshots without unit shadows #25963
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/25963"
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 malekaifa on 2026-11-23T01:26:03Z.
What
When unit shadows are disabled (
APS5_NO_UNIT_SHADOW=1, or write watching makesUnitShadowEnabled()false),WaitForLeasesAndImportsstill builds a whole-registryGuestAllocationsAcquireRegistered()snapshot before retiring an overlapping host import.RetireShadowimmediately returns in that configuration, so its coverage predicate never observes that lease.Pass an empty
GuestAllocations::Lease{}at the two pin-waiter retirement sites when unit shadows are off. The default unit-shadow-on path is unchanged, as are recorder waits, import retirement, and the broader whole-registry lease design.This addresses the measured registry-copy hot path reported in #6453 when unit shadows are disabled. It does not claim to fix the issue's default unit-shadow-on stall.
Tested
maind32e21402929:git diff --checkpassed andpy -3 tools/check_conventions.py --base origin/main --head HEADpassed.GuestBufferMemory.cppblob9eb0a5ef5f719817ab9ad97f4638f6538d107267, one file, +2/-2.APS5_NO_UNIT_SHADOW=1, in the Ratchet & Clank scene described there. Across two runs per arm, main-thread samples in_Rb_tree_increment/GuestAllocationsAcquireRegisteredfell from 14.3% / 4.3% and 14.4% / 4.0% to 0.5% / none and 0.4% / none. Presents in the first 60 s after the flash went from 34/35 to 51/46; in the first 100 s from 73/77 to 93/89. The longest frame stayed about 5.2-5.8 s, so this PR does not claim to remove the separate longest freeze.WaitForLeasesAndImports, but only its recorder finish/sync path; it does not touch or replace these two registry-snapshot acquisitions. #24510 and #19351 touch otherGuestBufferMemory/unit-shadow paths, not these lines.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-23T01:26:12Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-23T01:38:48Z.
Review: APPROVED
Reviewed — looks good
Nothing in the inspected changes blocks merging; the reported performance improvement still needs independent verification.
What I ran
Reviewed head
86765d3651680b86403a8ff577a6b5fdfbb850a8; basemain. No build or tests were run. I readdescription.md,commits.md,manifest.json,diff.patch, and the changed lines and relevant functions throughrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
GuestBufferMemory.cpp:4266andGuestBufferMemory.cpp:4332: the condition matches the documented intent. With unit shadows disabled, the lease is empty;RetireShadowimmediately returns in that configuration, and the registry snapshot is avoided. The default unit-shadow-enabled path still acquires the registered lease. Consider adding regression coverage for the disabled path and measuring the change on the PR head; the supplied measurements describe a matching local conditional, not this exact fork commit.Not verified
No build, automated tests, or independent performance reproduction was run. The full changed file was excluded from the review folder; I read its changed lines and relevant ranges via
repo_read.py.files.jsonwas not present in the review folder listing; the manifest marks the one changed file as excluded for size.To get this to a good state
Nothing is required. Optional: add coverage for the no-unit-shadow retirement path and verify the performance result on the PR head.