Skip to content

perf(size): build release runtime archives without the GC/diagnostic instruments - #11629

Merged
proggeramlug merged 25 commits into
mainfrom
size/release-runtime-no-instruments
Oct 3, 2026
Merged

proggeramlug merged 25 commits into
mainfrom
size/release-runtime-no-instruments

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Current published refresh 39b3a1c25c6268d66fd82c8facd8c53d29fbf019 merges the actual installer parent 1732ca997d940ad6dea8afeca7466bfeb6c512f1 and 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 preceding b6b42d7ac59972b6542b41619450114664ffe25f. 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:

  • Same four packages (perry, runtime-static, stdlib-static, ext-net), locked release checks pass with the strip flag unset and set to 1, LLVM 22.1.4.
  • All 111 local script-lint steps executed: 110 pass; only Public benchmark evidence freshness fails. Compile tier and two CI-only steps are explicitly skipped.
  • Root-holder inventory: 1521 declarations, 155 scanners; source/whitespace checks pass. Entry-wise conflict repair preserves both reviewed histories and current collector pins.

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.

Ralph Küpper 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.
@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f7894a9b-87b6-4eec-8b72-9a329912306a
📥 Commits

Reviewing files that changed from the base of the PR and between f50ee2b and bfcb7dd.

📒 Files selected for processing (37)
  • .github/workflows/release-packages.yml
  • changelog.d/11629-release-runtime-no-instruments.md
  • changelog.d/11629-stack-parent-refresh.md
  • crates/perry-runtime/build.rs
  • crates/perry-runtime/src/arena/alloc_sample.rs
  • crates/perry-runtime/src/arena/mod.rs
  • crates/perry-runtime/src/arena/quarantine.rs
  • crates/perry-runtime/src/arena/walk.rs
  • crates/perry-runtime/src/bun_compat/cli_utils.rs
  • crates/perry-runtime/src/error_stack_frames.rs
  • crates/perry-runtime/src/gc/barrier_arming.rs
  • crates/perry-runtime/src/gc/census.rs
  • crates/perry-runtime/src/gc/cycle.rs
  • crates/perry-runtime/src/gc/forwarding.rs
  • crates/perry-runtime/src/gc/fromspace_scan.rs
  • crates/perry-runtime/src/gc/instruments.rs
  • crates/perry-runtime/src/gc/malloc.rs
  • crates/perry-runtime/src/gc/mod.rs
  • crates/perry-runtime/src/gc/oldgen.rs
  • crates/perry-runtime/src/gc/pin.rs
  • crates/perry-runtime/src/gc/policy.rs
  • crates/perry-runtime/src/gc/roots/scan_mode.rs
  • crates/perry-runtime/src/gc/schedule.rs
  • crates/perry-runtime/src/gc/telemetry.rs
  • crates/perry-runtime/src/gc/trace.rs
  • crates/perry-runtime/src/gc/types.rs
  • crates/perry-runtime/src/hot_diag.rs
  • crates/perry-runtime/src/hot_diag/receiver_repr.rs
  • crates/perry-runtime/src/node_v8.rs
  • crates/perry-runtime/src/object/field_rep_store.rs
  • crates/perry-runtime/src/object/gc_slots.rs
  • crates/perry-runtime/src/object/method_site.rs
  • crates/perry-runtime/src/process/report.rs
  • crates/perry-runtime/src/typed_feedback.rs
  • crates/perry-runtime/src/typed_feedback/trace.rs
  • crates/perry/src/commands/compile/optimized_libs/driver.rs
  • scripts/gc_runtime_root_holders.json
 _______________________________________
< r/CodeReview: Where I'm the top post. >
 ---------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug force-pushed the size/runtime-link-features branch from 4005d17 to 5779c12 Compare September 28, 2026 12:31
Ralph Küpper and others added 6 commits September 28, 2026 16:43
…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.
…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
proggeramlug force-pushed the size/runtime-link-features branch from 5779c12 to ca25317 Compare September 28, 2026 14:45
@proggeramlug proggeramlug added the run-extended-tests Opt PR into compile-smoke/parity/doc-tests/drizzle-mysql-smoke label Oct 1, 2026
Base automatically changed from size/runtime-link-features to main October 3, 2026 13:12
@proggeramlug
proggeramlug merged commit 34acf64 into main Oct 3, 2026
6 of 26 checks passed
@proggeramlug
proggeramlug deleted the size/release-runtime-no-instruments branch October 3, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-extended-tests Opt PR into compile-smoke/parity/doc-tests/drizzle-mysql-smoke

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant