Repository navigation
D30 R3 step 1: the runtime as an embedded bundle, built at compiler build time, byte-identical across stages - #2486
Merged
Merged
Conversation
added 5 commits
October 20, 2026 02:13
…d runtime, the rt slot joins lane links The runtime bundle is a `.wo` in shape and none of its store (docs/proposals/d30-implementation-plan.md §10, ruling 2026-10-20): - `--bundle-corpus rt` names the embedded runtime tree `<embedded-rt>/rt` (`bundle_corpus_base`), and `use rt.<module>` resolves there in Resolve and the Frontend, as `use std.x` resolves to the embedded stdlib; the bundle root is one `use` per runtime module. - A module's own foreign seam — `extern var` and `c facade` — is the object's, not interface material: the emitter omits it instead of refusing the module. - The interface declares with_sysinfo_os/arch bodiless; comptime keeps answering them from the build's target (D91), as it did the extern. - Link: an embedded bundle named `rt` joins the link only under the lane and only when the embedded runtime is this compiler's generation (D132, #761); its symbols are the flat with_*/rt_* names, so the module-prefix predicate does not apply. test/internals/bundle_corpus_rt_test.w fails on main (the corpus is not known) and passes here.
…unit; rt-bundle-fixpoint proves stage1 == stage2 byte for byte
build/rt_bundle.w: `rt-bundle-root` writes out/gen/rt_bundle.w (one `use
rt.<module>` per module of this host's runtime), and the two bundle
targets compile it under WITH_RT_IN_UNIT=1 with --emit-obj
--bundle-corpus rt into out/bootstrap/lib (stage1) and out/lib (stage2),
check the emitted interface against the source fingerprint, and the
stage compilers embed the blobs (`wo_rt_{o,wi,manifest}`, slot `rt`).
`rt-bundle-fixpoint` (in :fixpoint) compares the two bundles' sha256.
Two things made the bytes differ before they agreed: the root's path
enters the debug info, so there is one generated root and the compile
runs under WITH_FILE_PREFIX_MAP (D50); and stage1's .wo slots are empty,
so without the stage compiles' --link-bundle pairs the prelude's
std.regex compiled pcre2 into the unit — its functions were pruned, the
string-literal counter was not, and the objects differed in nothing but
`l_str.N` (and the build took 15.9 s instead of 3.6 s).
Hello world under the lane with the release: 0.20 s (0.19 s in the object
world); it was 1.52 s compiling the runtime in-unit per program.
The bundle is the whole runtime, fiber core included, and its own call to the assembly with_fiber_switch is not among the program's undefined symbols: a --prelude=core program (test/behavior/prelude_core_mode.w) linked the bundle and the link refused with_fiber_switch as undefined. behav_d30_rt_in_unit_prelude_core.w fails on the previous commit.
…ht, what the step leaves
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.
D30 R3, step 1 of the order in docs/proposals/d30-implementation-plan.md §10 (rulings 2026-10-20). Still behind
WITH_RT_IN_UNIT.--bundle-corpus rtnames the embedded runtime tree;use rt.<module>resolves there; a module's own foreign seam (extern var,c facade) is omitted from an interface, not refused; comptime keeps answeringwith_sysinfo_os/archfrom the build's target (D91) when the interface declares them bodiless; an embedded bundle namedrtjoins the link only under the lane and only when the embedded runtime is this compiler's generation (D132, D30 implementation: retire the internal runtime ABI — runtime compiles in-unit; rt objects only a keyed cache; boundaries speak C #761), andfiber_asm.ojoins with it.build/rt_bundle.w—rt-bundle-rootgenerates the root,stage1-rt-bundle/rt-bundlecompile it as its own full unit under the lane intoout/bootstrap/lib/out/lib, check the emitted interface against the source fingerprint, and the stage compilers embed the blobs;rt-bundle-fixpoint(in:fixpoint) proves stage1's bundle is byte for byte stage2's.--link-bundlepairs forwarded to the bundle builds (stage1's empty.woslots otherwise compile pcre2 into the unit and renumber everyl_str.N).Evidence (seed-driven, worktree ~/.local/with-staging/d30-rt-unit at 918457f):
src/main build :gategreen; lane sweeps on the releaseWITH_RT_IN_UNIT=1: plain behavior 1702/1702, compile_errors 1790/1790, spec+internals 283/283;with run tools/battery.w→ GREEN (287 s). The docs commit on top is excluded from the green key (D49).