Skip to content

The engine corpora live under std.engines (D146) - #2557

Merged
ehartford merged 4 commits into
mainfrom
engines-namespace
Oct 22, 2026
Merged

ehartford merged 4 commits into
mainfrom
engines-namespace

Conversation

@ehartford

@ehartford ehartford commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

The engine corpora move under std.engines (D146, delegated)

Eric on #2556: the facades are named for their function, not their provenance; the engine corpora are one tier and belong under one namespace; and there is no 1:1 mapping between an engine and a facade.

So the migrated libraries (with migrate output, pinned and bundled: D37, D112) now live under std.engines.<library>, named for the library each one is:

was is
std.c_algorithms (lib/std/c_algorithms) std.engines.c_algorithms
std.tommyds std.engines.tommyds
std.re (lib/std/re) std.engines.pcre2
std.zl (lib/std/zl) std.engines.zlib
std.stc std.engines.stc
std.calg_testing, std.stc_testing (test corpora, assembled at test time) std.engines.c_algorithms_testing, std.engines.stc_testing

pcre2 and zlib drop the re/zl abbreviations, which read as facade names. The facades keep their functional names (std.regex, std.zlib, std.collections.*) and compose from whichever engines they need; no facade name implies an engine.

The change is the registry (package, corpus_rel, corpus_dir in build/*.w), the directory moves, and a mechanical rewrite of every importer: the facades, the tests, the tools, the build layer (which the pinned seed still evaluates: it reads std.engines.zlib.deflate from the tree), the compiler's one path rule (the pcre2 exemptions in Sema keep their scope: they are pcre2's, not every engine's), the specs and CLAUDE.md. The .wo bundle names and the corpus pins are unchanged. The generated corpora were rewritten the same way and then re-promoted through their pipeline targets, which regenerated them byte-identical (the proof that the text is the migrator's).

Decision log: D146 (delegated under D98; a veto is a revert).

Evidence

Release build, every corpus re-promoted (the only drift beyond the rename undoes the earlier identifier-wide str parameter rename), src/main build :gate green on b783b18, the seed-driven battery GREEN on 16909d9 (with run tools/battery.w, wall 406 s).

A link-stage defect the move exposed

The link stage extracts every embedded bundle object to one shared path, <artifact-root>/tmp/with_runtime/wo_<bundle>.o, with nothing of the bundle's identity in the name; the runtime objects likewise. The drop audit runs the pinned seed beside the candidate, and the two generations now hash the corpus modules differently (std/engines/… against std/…), so a cell could link the other generation's object and fail on undefined __with_mod_… symbols (five cells, varying per run; every cell links by hand). On one layout the module hashes agreed and a swapped object still linked, which is how it hid: #761's mixed-generation class. The extracted bundle object is now named by its interface sha and the runtime objects by the compiler generation.

Eric Hartford added 4 commits October 22, 2026 07:30
The type-declaration rename (#2552) reached the builtin-mapped and the
anonymous-record typedef paths but not the general one, so STC's
`typedef ptrdiff_t isize` came back as `pub type isize` on a fresh
migration (the promoted corpus still carried the earlier identifier-wide
rename). The opaque forward typedef and the general typedef escape the
name as a type now.
Eric on #2556: facades are named for their function, not their provenance;
the engine corpora are one tier and belong under one namespace; and there is
no 1:1 mapping between an engine and a facade. So the migrated libraries
move to std.engines.<library>, named for the library each one is:
std.engines.c_algorithms, std.engines.tommyds, std.engines.pcre2 (was
std.re), std.engines.zlib (was std.zl), std.engines.stc, with the test
corpora beside them (std.engines.c_algorithms_testing, std.engines.stc_testing).
The facades keep their functional names and compose from whichever engines
they need.

The change is the registry (package, corpus_rel, corpus_dir in build/*.w),
the directory moves, and a mechanical rewrite of every importer: the
facades, the tests, the tools, the build layer (the pinned seed still
evaluates it, reading std.engines.zlib.deflate from the tree), the
compiler's one path rule (the pcre2 exemptions in Sema keep their scope),
the specs, CLAUDE.md and the source-sdk cache key. The .wo bundle names and
the corpus pins are unchanged. The generated corpora were rewritten the same
way and then re-promoted through their pipeline targets, which regenerated
them (the rewrite and the migrator agree; the re-promotion also undoes the
earlier identifier-wide rename of parameters named str in tommyds and pcre2).
docs/with-abi.sha256 is re-recorded for a comment's path in TypeLayout.w;
the convention is unchanged.
…ime object by its generation

The link stage extracted every embedded bundle object to one shared path,
<artifact-root>/tmp/with_runtime/wo_<bundle>.o, with nothing of the bundle's
identity in the name, and the runtime objects likewise. Every compiler
process shares that directory, two generations included: the drop audit
runs the pinned seed beside the candidate, and once the engine corpora moved
(D146) the two generations hashed the modules differently, so a cell could
link the other generation's object and fail on undefined __with_mod_
symbols (five cells, varying per run; every cell links by hand). On one
layout the module hashes agreed and a swapped object still linked, which is
how it hid: #761's mixed-generation class.

The bundle object is now named by its interface sha and the runtime objects
by the compiler generation; the extraction stays idempotent per identity.
The runtime bundle's extracted object is wo_rt_<interface sha>.o now; the
predicate that adds fiber_asm.o beside it still tested for wo_rt.o, so a
program whose runtime needed the fiber switch linked without it (three
behavior fixtures).
@ehartford
ehartford marked this pull request as ready for review October 22, 2026 12:08
@ehartford
ehartford merged commit d8de481 into main Oct 22, 2026
@ehartford
ehartford deleted the engines-namespace branch October 22, 2026 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant