Skip fresh auto optimized archive rebuilds#4928
Open
andrewtdiz wants to merge 1 commit into
Open
Conversation
806aad8 to
a0630c1
Compare
Contributor
|
Heads-up after rebasing this onto current main: |
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.
Summary
Investigation
The remaining small native source-change latency was not object-cache churn. In the dep-wide-100k shape, a one-module edit should invalidate one generated TS module, reuse the other native objects, and relink. The expensive extra work was in
build_optimized_libs: every build-cache miss still spawnedcargo build --release -p perry-runtime -p perry-stdlib ...for the hash-keyed auto runtime/stdlib target, even when the static archives were already present and source inputs were unchanged.This PR keeps the first run conservative. After a successful auto build writes
.perry-auto-build.stamp, the next build-cache-miss source edit can reuse fresh archives without spawning Cargo. The freshness check requires:Verification
cargo fmt --all -- --checkpassedcargo test -p perry build_optimized_libs_reuses_fresh_auto_archives_without_cargo -- --nocapturepassed: 1 passed, 0 failedcargo test -p perry optimized_libs -- --nocapturepassed: 12 passed, 0 failedcargo test -p perry object_cache_tests -- --nocapturepassed: 27 passed, 0 failedcargo build -p perry --releasepassed: finished release profile in 2m 03starget/release/perry --version->perry 0.5.1154Scaled native proof
After the real host auto archives existed, the first patched compile stamped them. Then I changed one source module and reran compile with
PATH=/usr/bin:/bin:/usr/sbin:/sbin, wherecargois unavailable butcc/link tools are still available. The second build succeeded, which proves the production path did not spawn Cargo.Command shape:
/usr/bin/time -lp target/release/perry compile --format json work/scaled-native/src/main.ts -o work/scaled-native/app # edit gen_0.ts PATH=/usr/bin:/bin:/usr/sbin:/sbin /usr/bin/time -lp target/release/perry compile --format json work/scaled-native/src/main.ts -o work/scaled-native/appResults:
42, checksum084c799cd551dd1d8d5c5f9a5d593b2e931f5e36122ee5c793c1d08a19839cc043, checksum0e55092af0746630c98d1b2e0d960617c33f8ea7b55739fd18cb7cd5342a28canative_modules=3,build_cache.hit=false(miss_reason=envfrom the deliberate PATH change),codegen_cache.hits=2,misses=1,stores=1,object_cache_paths_reused=2,object_cache_paths_stored=1,link_cache.linked=true,object_fingerprints_used=3,object_files_hashed=0,external_inputs_hashed=1target/perry-auto-8981e03852ab7578/.perry-auto-build.stampwithkey=crypto|true|host|wasm=falseandfeatures=perry-runtime/full,perry-stdlib/crypto100k benchmark status
Baseline from the latest report:
dep-wide-100k native small_changeRust 2.26s vs Perry 2.98s median; no-op already fixed at Rust 0.36s vs Perry 0.12s.I generated the dep-wide-100k repro and attempted the full native small-change run, but the run was initially consumed by first-time auto runtime/stdlib archive seeding in
target/perry-auto-8981e03852ab7578. Per the lane supervisor guidance, I stopped waiting on that path and switched to the focused scaled proof above. The full dep-wide-100k after wall-clock should be rerun from a seeded archive state.