test: banner purge + WHY-only comment sweep (rule 8)

Every section banner dies (103 -> 0) across test/lang, the observer
suites, the C carriers, and the five comment-heavy corpus fixtures;
banner provenance (#N cites, carrier numbers, repair-cluster labels)
folded into headers or adjacent WHY comments. Narration deleted; row
provenance, ref cites, divergence pins, and layout contracts kept
(fwd-ref decl-order guards and bootstrap-gate corpus rationale
restored where the sweep over-cut). Comment-only proven: all 3742
wwbuild workdir .s byte-identical before/after; test-commit and
test-byteid (161 lang + 1399 data, 0 pinned-divergent) green.
This commit is contained in:
2026-08-08 21:40:23 +09:00
parent aadc6618f0
commit 83f5956df2
120 changed files with 184 additions and 530 deletions

View File

@@ -1,15 +1,11 @@
/*
* 993_ww_ww — explicit bootstrap gate for the ww-side driver port.
*
* Diffs the C-built `ww` against the ww-built `ww_ww`. Both drivers
* Explicit bootstrap gate: the C-built `ww` and the ww-built `ww_ww`
* orchestrate the same w6c/w6a/w6l, so the resulting binaries must be
* byte-identical for every program in the corpus. The corpus mixes:
* - a tiny single-file program (no -I flags)
* - a multi-import build (selfhost/cmd/wwdump/main.ww), exercising
* `use` resolution + the -I search path + the libwwrt.a link.
*
* Each build runs from a per-driver scratch directory so the
* intermediate .s/.o files don't collide.
* byte-identical for every program in the corpus. The corpus includes
* a multi-import build (selfhost/cmd/wwdump/main.ww) exercising `use`
* resolution, the -I search path, and the libwwrt.a link. Each build
* runs from a per-driver scratch directory so the intermediate .s/.o
* files don't collide.
*/
#include <stdio.h>
#include <stdlib.h>
@@ -62,10 +58,8 @@ slurp_eq(const char *a, const char *b)
return rc;
}
/* Build `src` via the named driver, expecting output binary `out` in
* the build directory. `incs` may be a colon-separated list of include
* dirs (the ww driver accepts -I path1:path2:path3). Returns 0 on
* success. */
/* `incs` may be a colon-separated list of include dirs (the ww driver
* accepts -I path1:path2:path3). */
static int
build_via(const char *bin, const char *driver, const char *src,
const char *workdir, const char *incs, const char *out_basename)
@@ -129,10 +123,8 @@ cleanup:
return rc;
}
/* Stage a program whose main() returns `code`, build+exec it via the
* named driver's `run` subcommand, and return the propagated exit code
* (-1 on staging/spawn failure). #16: ww_ww must report the child's real
* exit code, not collapse every non-zero exit to 1. */
/* #16: `run` must report the child's real exit code, not collapse
* every non-zero exit to 1. Returns -1 on staging/spawn failure. */
static int
run_exit_code(const char *bin, const char *driver, int code)
{
@@ -160,11 +152,10 @@ run_exit_code(const char *bin, const char *driver, int code)
return rc;
}
/* Stage a program that fails to compile, run it via the named driver,
* and return the exit code. Pins the build-step caller contract: a
* failing build must still report failure (non-zero). The process mechanism's
* exact exit-code return must not regress this, since the
* w6c/w6a/w6l callers only test `!= 0`. */
/* Pins the build-step caller contract: a failing build must still
* report failure (non-zero). The process mechanism's exact exit-code
* return must not regress this, since the w6c/w6a/w6l callers only
* test `!= 0`. */
static int
run_build_fail(const char *bin, const char *driver)
{