perf(size): build release runtime archives without the GC/diagnostic instruments - #11629
Merged
Merged
Conversation
added 6 commits
September 28, 2026 09:31
…rebuilt links drop the rest Follow-up to the stdlib change. An installed perry links the prebuilt full-feature libperry_runtime.a, and always-live runtime code named optional subsystems directly: globalThis population (eval -> the interpreter and the parser, Intl members, Temporal), the generic operators and property / instanceof / construct paths (Temporal, Intl subclassing), the native-module member lookup (bun YAML/TOML/semver/JSONL), Date/Number/BigInt toLocale* with options (ICU), Date time-zone offsets (IANA db), the RegExp matchAll iterator (regex engine), URL host canonicalization and IDNA, and the interpreter's GC/exception integration. Each now goes through a feature_hooks::Hook slot filled by a js_runtime_install_<feature> entry point; an empty slot answers exactly what the #[cfg(not(feature))] branch answered, and always-live tables keep their shape (the savepoint field, prune entry and root scanner stay and forward). The generated installer object also registers a runtime installer, run by js_gc_init before user code: the program's runtime features on a prebuilt link, js_runtime_install_compiled otherwise. stdlib_installs.rs gains the runtime trigger table with drift tests; perry-stdlib reuses the runtime Hook. Installed-mode (release recipe): net+fetch+TLS backend 19.45 -> 15.05 MB, runtime-only fs program 13.72 -> 8.76 MB. Auto-optimized links unchanged. perry-runtime suite 4706/0/12 on base and branch.
…intl.rs under the size cap; wasm ABI table - gc_runtime_root_holders: a registered scanner that forwards through a feature Hook slot (SLOT.get() then a call) now seeds the SLOT.set(path) targets in the same file, so the interpreter scanner behind dyn_eval_hooks::scan_dyn_eval_roots_mut keeps covering the dyn_eval key caches; a planted self-test case covers it (and fails with the rule disabled). Coverage counts equal main exactly (693 reached, 446 classified). - PASS1_MARKED: re-audited the gc/mod.rs change (forwarder registration and the startup feature installer call; neither is in the mark-complete to sweep-entry window) and re-pinned. - intl.rs: the Intl namespace forwarder, its slot and the feature install move to intl/hooked.rs (2004 -> 1982 lines). - runtime_abi.tsv: the js_runtime_install_* / register symbols.
…instruments perry-runtime's `diagnostics`, `gc-instruments` and `hot-diag` features are default features, so the prebuilt `libperry_runtime.a` an installed perry links carried every census, verifier, trace and hot-path diagnostic into every program. Gate that code on build-script cfgs (perry_diagnostics, perry_gc_instruments, perry_hot_diag) that build.rs derives from the features unless PERRY_RELEASE_STRIP_INSTRUMENTS=1, and set that in the release-packages workflow (both Linux docker builds included). An env var rather than a feature change keeps one feature union across the shipped archives (#6303/#7358). Workspace builds, cargo test and auto-optimized instrument builds are unchanged. A stripped binary refuses an instrument knob at startup, as a build without the features always has; the compiler now also notes that a prebuilt link cannot honor an instrument request and names PERRY_WORKSPACE_ROOT. Installed-mode backend 15.05 -> 14.71 MB, fs-only 8.76 -> 8.39 MB.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (37)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
proggeramlug
force-pushed
the
size/runtime-link-features
branch
from
September 28, 2026 12:31
4005d17 to
5779c12
Compare
…rebuilt links drop the rest Follow-up to the stdlib change. An installed perry links the prebuilt full-feature libperry_runtime.a, and always-live runtime code named optional subsystems directly: globalThis population (eval -> the interpreter and the parser, Intl members, Temporal), the generic operators and property / instanceof / construct paths (Temporal, Intl subclassing), the native-module member lookup (bun YAML/TOML/semver/JSONL), Date/Number/BigInt toLocale* with options (ICU), Date time-zone offsets (IANA db), the RegExp matchAll iterator (regex engine), URL host canonicalization and IDNA, and the interpreter's GC/exception integration. Each now goes through a feature_hooks::Hook slot filled by a js_runtime_install_<feature> entry point; an empty slot answers exactly what the #[cfg(not(feature))] branch answered, and always-live tables keep their shape (the savepoint field, prune entry and root scanner stay and forward). The generated installer object also registers a runtime installer, run by js_gc_init before user code: the program's runtime features on a prebuilt link, js_runtime_install_compiled otherwise. stdlib_installs.rs gains the runtime trigger table with drift tests; perry-stdlib reuses the runtime Hook. Installed-mode (release recipe): net+fetch+TLS backend 19.45 -> 15.05 MB, runtime-only fs program 13.72 -> 8.76 MB. Auto-optimized links unchanged. perry-runtime suite 4706/0/12 on base and branch.
…intl.rs under the size cap; wasm ABI table - gc_runtime_root_holders: a registered scanner that forwards through a feature Hook slot (SLOT.get() then a call) now seeds the SLOT.set(path) targets in the same file, so the interpreter scanner behind dyn_eval_hooks::scan_dyn_eval_roots_mut keeps covering the dyn_eval key caches; a planted self-test case covers it (and fails with the rule disabled). Coverage counts equal main exactly (693 reached, 446 classified). - PASS1_MARKED: re-audited the gc/mod.rs change (forwarder registration and the startup feature installer call; neither is in the mark-complete to sweep-entry window) and re-pinned. - intl.rs: the Intl namespace forwarder, its slot and the feature install move to intl/hooked.rs (2004 -> 1982 lines). - runtime_abi.tsv: the js_runtime_install_* / register symbols.
…pers to their only targets
…d its own targets, regenerate all three tables The single combined seeds.txt rule `interp_(savepoint|restore) => interp_(savepoint|restore)` matched each side independently, so it delegated interp_savepoint's indirect call to EITHER dyn_eval::interp_savepoint OR dyn_eval::interp_restore instead of pairing them 1:1. dyn_eval::interp_restore genuinely reenters (roots_truncate drops interpreter-held Rc<InterpFn> values through an unresolved drop-glue indirect call on swc_ecma_ast::expr::Expr); on linux-x86_64 that drop glue is not inlined away, so the stray edge made js_try_push / js_eh_try_push classify Reenters -- UNSAFE drift against their committed Leaf (caught by gc-call-effects-linux in CI). macos-aarch64 and windows-x86_64 happened to devirtualize the same drop glue and stayed clean, which is why this didn't show up on either of those two platforms. Split into two rules, each naming only the one function its own slot can ever hold. js_try_push / js_eh_try_push / js_gc_init confirmed Leaf and perry_runtime_widget_init unchanged (Reenters on macos-aarch64 only, pre-existing and unrelated to this PR) across all three targets, verified by building perry-runtime-static/perry-stdlib-static locally for each target (native macOS, windows-x86_64 via cargo-xwin, linux-x86_64 via cargo-zigbuild) and running the checker against the real archives. Also regenerate all three committed tables: the nine js_runtime_install_* / js_runtime_register_feature_installer symbols this PR adds were never added to crates/perry-codegen/src/gc_effects/*.tsv at all (safe drift, all Leaf).
proggeramlug
force-pushed
the
size/runtime-link-features
branch
from
September 28, 2026 14:45
5779c12 to
ca25317
Compare
…629-main-refresh-recovery-20261001
…629-main-refresh-recovery-20261001
…605-main-refresh-recovery-20261001
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.
Current published refresh
39b3a1c25c6268d66fd82c8facd8c53d29fbf019merges the actual installer parent1732ca997d940ad6dea8afeca7466bfeb6c512f1and resolves the sole conflict in the PASS1_MARKED holder audit. Both parent and child audit explanations are retained. Every other holder entry and all five source pins are preserved; every Rust source, Cargo manifest and lockfile is byte-identical to precedingb6b42d7ac59972b6542b41619450114664ffe25f. The two changed paths are the holder JSON and a keyed changelog fragment.Source-pin and whitespace checks pass. This clears the stacked-parent source conflict; it does not establish new-head product or CI acceptance. A matching rebuilt compiler/static archives, current script lint and fresh successful whole shadow/native root jobs remain pending. #11605 must land before this stacked PR is retargeted to main and validated against main CI.
Earlier validation below is historical at its explicitly named heads and does not approve the refresh.
Shipping builds can set PERRY_RELEASE_STRIP_INSTRUMENTS=1 to omit diagnostic and GC-instrument machinery consistently across compiler, runtime, stdlib and provider archives. Normal workspace builds keep the existing instruments. Installed compiler/runtime startup refuses unavailable instrument requests instead of silently accepting inactive knobs. The release archive workflow forwards the same setting through the complete build graph.
This branch also contains the link-time optional-feature installation from #11605. The latest-main integration resolves the root-holder inventory conflict by preserving both contracts and current scanner registrations. It retains the collector/read-site fixes from #11738 and the current dependency lockfile.
Current-head validation at b6b42d7:
Prior validation at reviewed head 85e0fe1: matching default and stripped compiler/static/provider product builds passed; installed filesystem startup, compiler request diagnostics and GC_CENSUS acceptance/refusal behaved as expected. Default native TCP echo passed. The stripped TCP arm could not be executed under the previous sandbox. 1512 default-instrumented GC unit tests passed. Those older results do not validate this new head or stripped moving GC.
Fresh CI, both whole GC-root jobs and latest-head product/installed validation remain pending. Previous-head CI success is not approval for this update.