Repository navigation
The compiler's modules are a bundle: a test that imports one links it (internals-tests 260 s -> 16 s) (#3351) - #3393
Merged
Merged
Conversation
added 14 commits
November 17, 2026 00:47
…le initializer the linking program runs, every declaration in the interface
…Drop types; omits what has no spelling
…ce prints constants
This was referenced Nov 17, 2026
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.
Eric said go on #3351 (2026-11-16): the compiler's own modules become a bundle, so a test that imports one stops checking, lowering and generating the whole compiler.
Measured (darwin-aarch64, release compiler)
comptime_value_share_test.w(31 lines,use ComptimeValue): Semainternals-tests(123 files)internals-compiler-tests(3 files)compiler-bundle(new, once per tree)All 126 files of the two lanes pass against the bundle.
What it is
A tree bundle:
--bundle-corpus tree:<dir>[,<dir>], the modules of one checkout's directories compiled once for that checkout's tests.build/compiler_bundle.wbuilds the compiler's (src/,out/gen/) intoout/compiler-bundle/compiler.{o,wi,manifest}; the two internals lanes runwith test --link-bundle out/compiler-bundle/compiler. It is a build artifact, never stored, embedded, published or chosen on demand, and read only by the compiler that wrote it.wo_bundles.mdhas the section ("Tree bundles").What a tree bundle carries that a stored
.wodoes not:HashMap.new()): the object defines<prefix>bundle_init, the manifest names it, the linking program's main wrapper calls it before its own initializers;pubor not (its importers are tests of the same package, D100);@[callconv],mutparameters, ephemeral types, types withDrop, every import of a module;The interface is checked like every bundle's: the
.wipass must reproduce the source pass's fingerprint or the target fails. That check found two real defects on the way, both fixed here:mutparameters were printed without their mode (a calling-convention difference), and an interface function that a second interface module also declares was dropped rather than module-qualified when an interface is read whole.For Eric
std.tls's trace memo) is not the importing test's copy.src/Parse.wandsrc/tools/generate_embedded_stdlib.w. Nothing imports either, and neither compiles any more (the build has its own generator).pub varglobals in CImport/CiMigrate are plainvar(apubglobal's writes are a declared contract; nothing outside the package reads them);extend Codegenin Codegen.w isimpl Codegen; the legacyfn Span.len(self: &Self)functions ofcompiler.foundation.Span/Sourceare methods.$m$<hash>owner identity (the module prefix is the identity). No stored bundle has such a name (40 store objects scanned), so no.wois re-keyed;FnAbi.wis untouched.Evidence
:release-checksgreen (fixpoint, Sema invariance, corpora tests, wo-drift).src/main build :internals-testsand:internals-compiler-testsunder the pinned seed: 123 and 3 files ok..wipass).Not measured: the bundle build's memory on a small runner. Its peak here was 4.8 GB when it ran beside stage builds; the four test compiles it replaces each loaded the whole compiler. If the Windows nightly shows it, that is #3364's lane.
Part of #3351 (the issue's remaining item, user-program package bundles, is a separate design).