perf(aot): reduce preflight latency with cached full-coverage artifacts - #1392
Merged
Conversation
Train dynamic roots across the complete preflight workload and persist ABI-keyed native artifacts with checksum validation and atomic replacement. Track fallback reasons and recover safely through dynamic control flow and guarded memory accesses.
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.
Problem
Preflight AOT coverage was derived from a bounded execution sample and a fixed set of hot roots. Late control-flow targets could therefore remain uncompiled, while each process repeated training and native compilation even when the program and AOT ABI were unchanged.
Design Rationale
A lightweight coverage tracer now follows the complete training workload and records only control-flow roots. This provides whole-workload basic-block coverage without constructing full preflight RAM and shard state during training.
Compiled artifacts are persisted because complete coverage and native compilation are cold-start costs. Cache identity includes the program digest, AOT ABI, trace style, architecture, and operating system. Metadata and artifact digests reject stale or corrupt entries, and temporary-file replacement prevents partial artifacts from becoming visible.
Coverage is not treated as a correctness assumption. Unseen indirect targets, memory guards, ecalls, and exceptional paths continue in the interpreter. Fallback reasons remain active until execution reaches a compiled block leader, preserving recovery semantics and producing actionable diagnostics.
Change Highlights
Benchmark / Performance Impact
Operation
Layer
Benchmark command(s):
Environment: benchmark-dispatch runner and identical block input; branch-specific artifacts are linked below.
Raw data:
Testing
Risks and Rollout
Follow-ups (optional)
Copilot Reviewer Directive (keep this section)
When Copilot reviews this PR, apply
.github/copilot-instructions.mdstrictly.