LATX, fix: Release AOT merge and invalidated segment resources - #473
Open
LaurenIsACoder wants to merge 1 commit into
Open
LATX, fix: Release AOT merge and invalidated segment resources#473LaurenIsACoder wants to merge 1 commit into
LaurenIsACoder wants to merge 1 commit into
Conversation
AOT merging retains input buffers and index allocations after completion or failure. Mapping invalidation only releases the first overlapping segment, leaving other segment-owned cache mappings alive. Release merge inputs and their vector on all exit paths, destroy borrowed indexes before their input buffers, and free owned TB-index values on replacement and destruction. Clean up failed directory scans and invalidate every overlapping segment after successful unmap, remap or replacement. Keep the existing reusable ELF cache policy and cache format unchanged. Add TU/non-TU merge ownership tests and a segment-unmap test using real host mappings. The unfixed production paths fail the ownership checks; the fixed isolated branch passed 27 lat-pr-fast tests. The merge tests stub generated code publication, and unavailable guest integration tests were skipped. Signed-off-by: Hanlu Li <heuleehanlu@gmail.com>
LaurenIsACoder
force-pushed
the
latx-aot-memory-ownership
branch
from
September 8, 2026 03:51
9bd53a7 to
b282c15
Compare
This was referenced Sep 8, 2026
LaurenIsACoder
force-pushed
the
latx-aot-memory-ownership
branch
from
September 8, 2026 07:07
b282c15 to
325f9bf
Compare
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.
Scope
Based on current upstream
bfe17ae7c1. Fix AOT resources whose owning operation has finished:This does not duplicate upstream's AOT reader fix (
17b479de7877) or change the cache format/capacity. Thread ownership changes in #472 are separate; this PR does not depend on them.Author self-review and combined validation
The actual published diffs were reviewed individually and checked against the local candidates. Follow-up corrections were folded into their existing commits; author/sign-off metadata updates preserved the per-PR source trees. The series remains six commits across #472, #473, #474, #475 and #476.
All five branches merge without conflicts on
bfe17ae7c1. The combined source tree80aaaaf13688387640f528d1c0bccb6a800f8d6ebuilds and passes 33/33 lat-pr-fast tests. On that combined binary, the 500-cycle KZT unload and retained-handle checks, 520-cycle SMC/fork checks, and 512 successful TSYNC operations alongside thread creation also complete successfully. A tests-disabled configuration registers no tests.The integration suite still reports 27 skips, including after selecting the available guest sysroot with
LATX_X86_64_SYSROOT: 25 require clang and two require the x86 cross compiler. These are not passes. This author self-review does not substitute for the upstream CI matrix, maintainer review or real-application acceptance.Validation
LoongArch64, GCC 15.3, x86_64-linux-user, LAT O1, KZT compiled in, release build:
target_munmapwith real host mappings: a single range removes three segment/cache owners while preserving both neighbors;mincoreverifies the released mappings. Invalid and repeated unmap are covered.No installed runtime changes or claim of full application memory acceptance.