Repository navigation
perf(agc): release a heap mirror once a host import serves its range - #1410
Merged
oneandonlydean merged 1 commit intoOct 9, 2026
Merged
Conversation
9 tasks done
Contributor
|
Tested on AMD under Linux, since this PR wasn't: RX 9070 XT (RDNA4, GFX1201), RADV / Mesa 26.2.4, Linux 7.2.9 (CachyOS), GCC Release build.
AI-assisted: the runs and this write-up were done by Claude (Claude Code) on my machine. |
An address-based build maps every readable registered range: through a host import when one can be made, else through a heap mirror, a host-visible copy of the range. A range mirrored while the import budget was full kept its mirror after a later pass imported it, until the guest freed the range. The pass then read the range through the import, and the mirror only held host-visible memory and a second copy of the bytes. The pass now releases the heap mirror of every range it serves through an import. Recorded work that bound the mirror keeps it until it completes. If the import goes away while the range stays registered, the next pass makes a new mirror from the guest bytes. The [buffers] image mirrors profile line counts the released mirrors.
Celegans12
force-pushed
the
perf/agc-imported-heap-mirrors
branch
from
October 9, 2026 13:48
c468258 to
3f00dc7
Compare
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An address-based build maps each readable registered range through a host import, else through a heap mirror, a host-visible copy kept current by write tracking. A range mirrored while
APS5_HOST_IMPORT_MIBwas full kept its mirror after a later pass imported it (budget freed by an unmap). Until the guest freed the range, the mirror held host-visible memory and bytes no build read.AcquireRegisterednow releases the heap mirror of each range its pass serves through an import. Recorded work that bound it keeps it until it completes, as for a swept mirror. Image mirrors are unchanged.[buffers] image mirrorsline (APS5_PROFILE_DRAW) counts the released mirrors.mainwith our open PRs and feat(agc): host import windows, least-recent eviction under the budget #290), heap mirrors held 10.6 GiB in 37k ranges while host imports swung between 0.7 and 3.7 GiB with the mirror count flat.importAllocationand its call in this pass (it conflicts withmainalready; this change adds no conflict). Its eviction drops imports of ranges that stay registered; the next pass then mirrors such a range anew from the guest bytes. fix(agc): throw instead of aborting when a heap mirror cannot be made #1085 (ours,acquireMirrorand the same tests), fix(agc): release the current address space with the image mirrors #1071 (ClearImageMirrors) and fix(agc): retry failed host imports after range replacement #1357, fix(agc): order direct reads after copied writes #1359 and perf(agc): reuse import decisions across mapping changes #1361 (the importentryin the sameAcquireRegisteredloop) merge cleanly.Tested
maindf16c4c: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 403/403 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_graphics(mock device, new case next to the heap mirror tests): a mirrored range that a later build imports loses its mirror, an imported range is not mirrored again, and a build without the import mirrors the current guest bytes anew. Fails onmain.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)