Repository navigation
build: the corpus registry — one declaration per corpus, one generic pipeline, build.w iterates - #1143
Conversation
…pipeline, build.w iterates Corpus identity was threaded by hand through 27 sites of build.w (the compat runtime's bundle args, stage and release embeddings, bootstrap empty slots, four stage links, two Linux and two Windows cross plans, the drift and root-check lanes) plus three exclusion lists, and each build/<corpus>.w copied the same fetch/stage/migrate/root/check/promote pipeline. Missing a site does not fail cleanly: it embeds a corpus as source, links a stage without its bundle, or leaves a cross target without it (docs/wo_bundles.md "The corpus registry"). build/corpus.w: the Corpus record (upstream pin, package, directory, harness, drift harness, module floor, defines, excludes, promote ordering, test lane) and its six hooks (prepare_reference, stage, migrate, finish_generated, verify_generated, lanes) with defaults; the shared helpers, migrate options, the reject/root/write functions. A Corpus is the upstream source and its oracle; WoBundle stays the compiled artifact, derived from it (corpus_bundle_plan), so one upstream may later back several bundles. build/corpora.w: the registry (corpus_count/corpus_at, indexed because a Corpus is ephemeral — its hooks take references — and the pinned seed's comptime evaluator iterates a Vec of ephemeral records as strings), the generic actions (prepare-reference, migrate, check- generated, promote, bundle-root, bundle-root-check), corpus_pipeline (download, extract, prepare, migrate, check, promote, root tools, drift lane, then the corpus's lanes), the exclusion and internal-module args, the wo-drift group and the :test deps. build.w derives corpus_plans from the registry and loops at every site; add_cross_rt_targets takes the plan list; the embedded-stdlib exclusion, build/runtime.w's (exclude= args) and build/compiler.w's inventory (internal-module= args) come from the same list. build/pcre2.w, zlib.w, c_algorithms.w and tommyds.w are declarations plus hooks and lanes; pcre2's hand-rolled fetch, zlib's HTTP helper and the dead synthetic- module checks are gone. Target names are unchanged except that every corpus now has <stem>-download, <stem>-prepare-reference and <stem>-bundle-root. Proof: with the same migrator, the old pipelines (in the Phase 2 tree) and the registry pipeline produce identical migrated trees for all four corpora; wo-drift rebuilds every stored bundle byte for byte; fixpoint holds. zlib's tarball is fetched over HTTPS (the generic downloader).
Only the header comment changes (`with build :<stem>-bundle-root`); the `use` lines are identical.
|
Battery at b42aa07a (the same tree, before the rebase onto main; the rebase changed no content), local: |
…byte loop Two CI-only failures of the registry (#1143, linux aarch64): the <stem>-bundle-root target produced lib/std/<corpus>/bundle.w, so every build ran it under the pinned seed to satisfy the root as an input of the bundle and check targets, and the seed's comptime evaluator (the aarch64 asset) rejects `<` on strings ("comparison requires comptime scalar values"). The tool now writes a stamp under out/.build-state and only runs when invoked; the root generator orders module names with a byte loop, as build/compiler.w's comp_str_compare always has.
The header-owner rule compares a Clang cursor location's file stem with the unit list's; on Windows the location spells the file with backslashes, so the basename was the whole path, no unit owned any header, and behav_migrate_header_inline_owner failed on both Windows lanes of #1143.
|
CI at f8e08b2: linux aarch64 failed in the new |
CI drives `build` and `:test` with the seed pinned in seed.lock, so every action body in build.w and build/*.w runs under that released compiler's evaluator. The local battery was driven by ~/.local/bin/with, which every battery replaced with the fresh compiler (`:update-seed`), so build-layer code only the fresh compiler accepts passed locally and broke CI (#1143: `<` on strings in an action). Rust and Go pin the compiler that runs the build system and refuse a newer one for that job; With now does the same. - src/main is always the seed.lock asset: `with build :seed` is idempotent on the lock's digest (a bump refetches, any other binary is replaced); `:update-seed` is gone. - `seed-driver` (build/retention.w) hashes the driving compiler (the graph's "seed" resolution: WITH, PATH, src/main) against seed.lock, walks the action's process ancestry on POSIX so `WITH=src/main with build` is refused too, and checks the workflow pins. First in :test, a dep of test-green and last-green; test-green records driver_sha256 and last-green requires it and the seed-input digest. - `seed-compat` (stage1 in a tree copy, never run in CI) is retired; its RSS-tripwire exemption goes with it. - nightly-release drives :fixpoint, :test and :last-green with src/main on every platform; only the release UAT runs the rebuilt binary. - CLAUDE.md/AGENTS.md, README, the release and bootstrap runbooks and tools/bump_seed_pins.w describe the seed-driven battery.
…e path boundary (#1151) * build: the pinned seed drives the battery CI drives `build` and `:test` with the seed pinned in seed.lock, so every action body in build.w and build/*.w runs under that released compiler's evaluator. The local battery was driven by ~/.local/bin/with, which every battery replaced with the fresh compiler (`:update-seed`), so build-layer code only the fresh compiler accepts passed locally and broke CI (#1143: `<` on strings in an action). Rust and Go pin the compiler that runs the build system and refuse a newer one for that job; With now does the same. - src/main is always the seed.lock asset: `with build :seed` is idempotent on the lock's digest (a bump refetches, any other binary is replaced); `:update-seed` is gone. - `seed-driver` (build/retention.w) hashes the driving compiler (the graph's "seed" resolution: WITH, PATH, src/main) against seed.lock, walks the action's process ancestry on POSIX so `WITH=src/main with build` is refused too, and checks the workflow pins. First in :test, a dep of test-green and last-green; test-green records driver_sha256 and last-green requires it and the seed-input digest. - `seed-compat` (stage1 in a tree copy, never run in CI) is retired; its RSS-tripwire exemption goes with it. - nightly-release drives :fixpoint, :test and :last-green with src/main on every platform; only the release UAT runs the rebuilt binary. - CLAUDE.md/AGENTS.md, README, the release and bootstrap runbooks and tools/bump_seed_pins.w describe the seed-driven battery. * rt: with_libc_* seams for the stdio streams, errno, fileno, isatty, rlimit, mkstemp, realpath std.libc will export C-standard functions and With functions over with_libc_* seams only (Eric, 2026-09-15): nothing POSIX-, Darwin- or glibc-spelled, so a corpus migrated on one host links on every target. This lands the runtime side first (Bootstrap Rules: new exports before their consumers): rt_core.w gains with_libc_stdin/stdout/stderr/errno/ fileno/isatty/getrlimit/setrlimit/mkstemp/realpath over one rt_* body per backend. Windows' stream accessors now return the UCRT streams (__acrt_iob_func) instead of null. The Darwin-spelled shims each backend still defines (__error, __std*p, getrlimit, mkstemp, realpath) go with the std.libc change that stops referencing them. * migrate: the Clang bridge is the one path boundary Every file path or location the bridge hands upward is spelled with `/`, whatever libclang or the host said: on Windows Clang spells locations with `\` and mixes separators within one path, and GetFullPathNameA answers realpath with `\`. buf_append_path/make_path_str rewrite at the five location builders, the inclusion collector, realpath and the cursor-in-file fallbacks, so basenames, stems, the header-owner pairing, module paths and diagnostics see one spelling on every host. The migrator normalizes its CLI paths (input, output, -I, forced includes) once at entry and no longer looks for `\` anywhere (138c5f8's either-separator basename is gone). behav_migrate_backslash_locations includes a header through a name carrying a literal backslash and migrates into a backslash output path: on POSIX the header is a file literally named eng\engine.h, on Windows a subdirectory, and either way the location's basename must pair the header's inline with its unit and nothing downstream may see a `\`. * migrate: FILE-class system records are c_void again; an anonymous union base reads plain Two #1142 regressions the corpora never showed because nothing re-migrates them (wo-drift compiles the checked-in output): - The bridge stopped treating a leading underscore as anonymity, so `FILE *` became `*mut __sFILE` (41 sites in pcre2test alone): a system record the migrator never emits, while std.libc's fopen returns `*mut c_void`. A reserved-spelled tag declared in a system header is now spelled c_void; a project's `_Tag` keeps its identity. - The field printer's borrow-through-type form met a struct's unnamed union member (zlib's `ct_data.fc`), whose type is c_void, and emitted `(*(&raw const x.fc as *const c_void)).freq`. An opaque base prints plain `base.field`. behav_migrate_system_record_pointer and behav_migrate_anon_union_field pin both. * std.libc: C-standard functions and with_libc_* seams only Eric's rule (2026-09-15): std.libc exports C-standard functions (the same name and meaning in libSystem, glibc and the UCRT) and With functions over with_libc_* runtime seams; nothing POSIX-, Darwin- or glibc-spelled, so a corpus migrated on one host links and behaves the same on every target. The Darwin stdio globals, glibc's stdin/stdout/stderr, __error, fileno, isatty, mkstemp, realpath and get/setrlimit leave the module; libc_stdin/stdout/stderr(), errno_ptr(), fileno, isatty, mkstemp, realpath, getrlimit and setrlimit are With functions over the seams that landed in fb2933d5. The Linux and Windows backends drop the Darwin-spelled shims they carried to fake those symbols, and FnAbi's preserved-name list shrinks with them. std.os stops c_importing isatty. The migrator lowers the stdio globals to the accessor calls (ci_libc_stream_accessor) and renames the host errno/fileno/isatty spellings to the std.libc names (ci_libc_portable_callee), so migrated output never names a host symbol. Gates: libc-surface-check (:test) scans lib/std/libc.w for the rule and cross-checks the migrator allowlist against the module and the preamble; corpus_reject_foreign_symbols (<stem>-check-generated and -promote) refuses any extern outside the migrator preamble, any extern variable and any retired host spelling, with Corpus.declared_externs for a prototype upstream declares but never defines (c-algorithms' rb_tree_subtree_height); tools/rt_decl_audit.w becomes the rt-decl-audit lane. The selfhost-linux-aarch64 lane's missing :test is #1149. * corpora: pcre2 and zlib re-promoted by the current migrator The stdio globals become libc_stdin/stdout/stderr() calls and __error() becomes errno_ptr() (std.libc's seams; zl/gzread and gzwrite no longer carry a Darwin-only symbol inside the bundle), and the output picks up the migrator's explicit argument and array-literal casts that landed since these corpora were last promoted. c_algorithms and tommyds re-promote byte-identical. * docs: handoff — the CI gates branch * docs: seed.lock names seed-driver; handoff cites subjects, not hashes --------- Co-authored-by: Eric Hartford <[email protected]>
The corpus registry (docs/wo_bundles.md "The corpus registry"), ruled 2026-09-14: a migrated C corpus is one declaration, the pipeline is generic, and
build.witerates the registry instead of naming corpora.Why now. At four corpora, corpus identity was threaded by hand through 27 sites of
build.w(the compat runtime's bundle args, the stage and release embeddings, the bootstrap empty slots, four stage links, two Linux and two Windows cross plans, the drift and root-check lanes) plus three exclusion lists, and eachbuild/<corpus>.wcopied the same fetch/stage/migrate/root/check/promote pipeline. Missing one site does not fail cleanly: it embeds a corpus as source, links a stage without its bundle, or leaves a cross target without it. STC (Phase 3) has a genuinely different staging shape and is the test of the abstraction.The model.
Corpus(build/corpus.w) is the upstream source, its migration and its oracle: the pinnedUpstream, package, directory, harness, drift harness, module floor, defines, excludes, promote ordering, test lane, and six explicit hooks (prepare_reference,stage,migrate,finish_generated,verify_generated,lanes) with strong defaults. No flags: PCRE2 generatesconfig.hinprepare_referenceand completes cross-module imports infinish_generated; zlib migrates its two test programs one at a time inmigrate; c-algorithms registers its ALLOC_TESTING test-program lanes inlanes.WoBundle(build/wo.w) stays the compiled artifact and is derived from aCorpus(corpus_bundle_plan), so one upstream may later back several bundles.build/corpora.w):corpus_count/corpus_at, the generic actions,corpus_pipeline(download, extract, prepare, migrate, check, promote,<stem>-bundle-root, root check, drift lane, then the corpus's lanes), theexclude=/internal-module=args, thewo-driftgroup and the:testdeps.build.wderivescorpus_plansand loops;build/runtime.wandbuild/compiler.wtake the corpus facts as args. Target names are unchanged except every corpus now has<stem>-download,<stem>-prepare-referenceand<stem>-bundle-root; pcre2's hand-rolled fetch, zlib's HTTP helper and the dead synthetic-module checks are gone (build layer: −1,300 lines net).Proof. With the same migrator, the old pipelines (run in the Phase 2 tree) and the registry pipeline produce identical migrated trees for pcre2, zlib, c-algorithms and TommyDS;
wo-driftrebuilds every stored bundle byte for byte; fixpoint holds. The only text change is the bundle roots' header comment, now written by the generic generator.Seed-evaluator notes (why the registry is indexed rather than a
Vec[Corpus]): a plain record cannot hold a fn field whose parameters are references (anephemeralone can), and the pinned seed's comptime evaluator iterates aVecof ephemeral records as strings. Every other shape is what the seed already evaluates forTarget.Battery: see the final comment.