Skip fresh auto optimized archive rebuilds#4928
Conversation
806aad8 to
a0630c1
Compare
|
Heads-up after rebasing this onto current main: |
a0630c1 to
bcc873b
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughIntroduces a stamp-and-mtime freshness cache for ChangesOptimized Libs Freshness Cache
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
bcc873b to
4c58a91
Compare
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.Summary by CodeRabbit