grammar: the header table follows the corpus, not the other way round #224
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/224-grammar-the-header-table-follows-the-corpus-no"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
grammar: the header table follows the corpus, not the other way round
Along the way:
Touches 10 files:
CLAUDE.md,cpu_broken.md,plan.md,scripts/lib/rotate-cpus.sh,scripts/test-capability.sh,scripts/test-corpus-test-run.shand 4 more.A clear improvement. The change in
src/rust/crates/ck_driver/tests/corpus_run.rsis the part I would have argued for.@ -377,0 +514,4 @@/// optional `--stdlib <path>` (used only for a directory), and `--opt/// <none|speed>`. A second positional, an unknown flag, an unknown `--opt`/// value, or a missing path is an error.fn parse_build_args(args: &[String]) -> Result<BuildArgs, String> {parse_build_argsreads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?@ -157,0 +218,4 @@let linked = matches!(self.built, Built::Linked);let (exit, stdout, stderr) = match &self.built {Built::NotAttempted => return Some(format!("`{app}`: nothing was attempted")),Built::Refused { rendered } => (1, String::new(), rendered.clone()),Builtis cloned on what looks like a hot path. Is the ownership forced here, or can this borrow?It can borrow. The clone of
Builtwas left over from before the lifetime was threaded throughsrc/rust/crates/ck_driver/tests/corpus_run.rs, and it is gone.Split. The decision in
parse_build_argsis a pure function now, with its own tests insrc/rust/crates/ck_driver/src/lib.rs.`cargo test --workspace` was the gate, and three costs were hiding in it: 57 integration binaries each statically linking the whole compiler, the same 106 corpus apps compiled twice by two of them, and 440 capability cells taking 440 container round-trips. None of it was visible, because no leg could be named or run on its own. Three leg scripts now exist, and `scripts/test.sh` only sequences them: test-unit-tests.sh 1352 unit tests + doctests 1.8s test-corpus-test-run.sh 106 apps, one container, one exec 3.9s test-capability.sh 440 cells, no container 4.7s Every leg runs even when an earlier one is red, for the reason the old file already gave about `--no-fail-fast`: a gate that stops at the first red reports one failure when the truth is three, and which one you see depends on the order they were listed in. Two compiler verbs, because a shell oracle may compare exit codes and bytes of machine-readable output and nothing else — if it needs a regex over a rendered diagnostic, the CLI is missing a verb: * `ckc build <path> -o <out>` — compile + link, no container run. `run` did all three as one act, so a harness wanting N binaries in a mount could not ask for them. It is `disassemble` minus the objdump. * `ckc outcome <dir>...` — the compiler states how far it got, in the `# capability` vocabulary, rendered by `ck_cktest::CapabilityCell`'s own Display so the printed line and the declared block cannot become two spellings. Matched on the error VARIANT, never on prose. A stage with no form is an error, not a guess. The verbs are what make these oracles outlive Rust. `capability.rs` matches on `ck_lower::LowerError` in-process, so the matrix can only ever judge the compiler it is compiled into — and Law 5 says that compiler is replaced. The same 440 cells now go through the CLI, so `ckc.ck` can be held to the identical files. Cross-validated against the Rust harness: 437 agreements and the same 3 disagreements plan.md §1 already records (`const_generic_fn_call` forward, `impl_method_signature_size_param` at a stage with no form, `money_unknown_currency_tag_is_accepted` regressed). The gate is RED on those three, which is the honest state of the tree. Each leg's own findings, since a green that has never gone red proves nothing: every gate was deliberately broken and observed to fail — a wrong `exit:`, a wrong `stderr_contains:`, a flipped `// STATUS: BROKEN` (the ratchet fired), a failing `#[test]`. `rotate-exec.sh` and `test-rotate.sh` are DELETED. Each leg computes the shared rotating mask itself and refuses if the degraded core is back online, so a wrapper you must remember to invoke is a gate you can run without. CLAUDE.md §4/§5, cpu_broken.md, plan.md §5 and the lib's own header are corrected in this commit: a contract naming a deleted script is the Law 3 defect. One gap is now recorded rather than created — `--serial`'s narrow mask, the mitigation for the single-core thermal concentration, has no caller today. The gate PRINTS what it does not cover, on every run. The legs are replacing 57 binaries one at a time; until the last lands, a green here is a green over part of the tree, and `conformance.rs`, `corpus.rs`, `sizes_pin.rs`, `frame_reconcile.rs` and the rest are named individually, because "and some others" is how a coverage hole becomes permanent.