test: retarget Pattern-A combined-feed gates to sep .sepwork layout (M4 E3, #94)

94a of the C-mig2 split (rob rule-11): 13 Pattern-A gates that fed a
.combined.ww to w6c/w6c_ww now drive two --sep builds (ww / ww_ww) and
byte-diff the concatenated per-package .sepwork/*.s, mirroring #93's
convention. Lands pre-flip while combined.ww still exists as the
reversible safety net. Test-only; all 5 binary pins HOLD.

989_enumcap_run deferred to 94b (its decisive assertion is a combined.ww
content diff, not a .s diff).
This commit is contained in:
2026-06-18 16:44:41 +09:00
parent 7b6f24adea
commit bbd2ad390a
14 changed files with 377 additions and 391 deletions

View File

@@ -120,26 +120,35 @@ static int
byteid(const char *bin)
{
int pid = getpid();
char stem[256], comb[256], cs[256], ws[256], cmd[4096];
snprintf(stem, sizeof stem, "/tmp/at911_bid_%d", pid);
snprintf(comb, sizeof comb, "%s.combined.ww", stem);
snprintf(cs, sizeof cs, "/tmp/at911_bid_c_%d.s", pid);
snprintf(ws, sizeof ws, "/tmp/at911_bid_w_%d.s", pid);
char stemc[256], stemw[256], cs[256], ws[256], cmd[4096];
snprintf(stemc, sizeof stemc, "/tmp/at911_bid_c_%d", pid);
snprintf(stemw, sizeof stemw, "/tmp/at911_bid_w_%d", pid);
snprintf(cs, sizeof cs, "/tmp/at911_bid_cs_%d.s", pid);
snprintf(ws, sizeof ws, "/tmp/at911_bid_ws_%d.s", pid);
/* `ww test -c -o <stem>` (compile-only) writes a lib/test-inclusive
* combined beside -o without running the harness. */
/* #94 sep layout: `ww test -c --sep -o <stem>` carries -T to the root
* so w6c synthesizes the test table + fork loop, and emits per-package
* asm to <stem>.sepwork/ (compile-only, no harness run; WW_PKGCACHE
* pinned to /tmp). The cstage build (w6c) and wwstage build (w6c_ww)
* must produce byte-identical asm across all packages. */
snprintf(cmd, sizeof cmd,
"%s/ww test -c -o %s test/wcc/data/attest_record.ww > /dev/null 2>&1",
bin, stem);
runwait(cmd);
if (access(comb, 0) != 0) {
fprintf(stderr, "911 FAIL: ww test -c produced no %s\n", comb);
"WW_PKGCACHE=/tmp/at911_pkgc_c_%d %s/ww test -c --sep -o %s "
"test/wcc/data/attest_record.ww > /dev/null 2>&1", pid, bin, stemc);
if (runwait(cmd) != 0) {
fprintf(stderr, "911 FAIL: cstage ww test -c --sep\n");
return 1;
}
snprintf(cmd, sizeof cmd, "%s/w6c -T %s -o %s 2>/dev/null", bin, comb, cs);
if (runwait(cmd) != 0) { fprintf(stderr, "911 FAIL: w6c -T (byteid)\n"); return 1; }
snprintf(cmd, sizeof cmd, "%s/w6c_ww -T %s -o %s 2>/dev/null", bin, comb, ws);
if (runwait(cmd) != 0) { fprintf(stderr, "911 FAIL: w6c_ww -T (byteid)\n"); return 1; }
snprintf(cmd, sizeof cmd,
"WW_PKGCACHE=/tmp/at911_pkgc_w_%d %s/ww_ww test -c --sep -o %s "
"test/wcc/data/attest_record.ww > /dev/null 2>&1", pid, bin, stemw);
if (runwait(cmd) != 0) {
fprintf(stderr, "911 FAIL: wwstage ww_ww test -c --sep\n");
return 1;
}
snprintf(cmd, sizeof cmd, "cat %s.sepwork/*.s > %s 2>/dev/null", stemc, cs);
if (system(cmd)) {}
snprintf(cmd, sizeof cmd, "cat %s.sepwork/*.s > %s 2>/dev/null", stemw, ws);
if (system(cmd)) {}
char bc[262144], bw[262144];
int rc = 0;
@@ -150,10 +159,11 @@ byteid(const char *bin)
fprintf(stderr, "911 FAIL: -T asm differs between stages\n");
rc = 1;
}
unlink(comb); unlink(cs); unlink(ws);
snprintf(cmd, sizeof cmd, "%s.s", stem); unlink(cmd);
snprintf(cmd, sizeof cmd, "%s.o", stem); unlink(cmd);
unlink(stem);
unlink(cs); unlink(ws);
snprintf(cmd, sizeof cmd, "rm -rf %s.sepwork %s.sepwork %s %s "
"/tmp/at911_pkgc_c_%d /tmp/at911_pkgc_w_%d",
stemc, stemw, stemc, stemw, pid, pid);
if (system(cmd)) {}
return rc;
}