diff --git a/test/run b/test/run index 3dd97a73..186d79b0 100755 --- a/test/run +++ b/test/run @@ -46,12 +46,12 @@ trap 'rm -rf "$RESULTS"' EXIT JOBS=${JOBS:-$(nproc 2>/dev/null || echo 4)} -# Phase 2 runs the wwstage byte-id gates (990-997) + 950_selfcheck -# sequentially. ww_ww writes intermediates next to every traversed source -# (task #15), so 991/992/994's reads of selfhost/cmd//main.{s,o, -# combined.ww} race against any concurrent driver-using test that emits -# a sibling .combined.ww (task #16). Phase 1 stays parallel for unit -# coverage; phase 2 sequential keeps the byte-id gates honest. +# Phase 2 runs the wwstage byte-id gates (990-997) + 950_selfcheck. +# ww_ww writes intermediates next to every traversed source (task #15), +# so 991/992/994's reads of selfhost/cmd//main.{s,o,combined.ww} +# race against any concurrent driver-using test that emits a sibling +# .combined.ww (task #16). Phase 1 stays parallel for unit coverage; the +# wwstage-driver tests stay out of phase 1 to keep those reads honest. for t in test/wcc/*.c; do [ -f "$t" ] || continue case ${t##*/} in @@ -65,9 +65,27 @@ done | xargs -0 -n2 -P "$JOBS" "$0" --one || true # byte-id gates (990-997) and 950_selfcheck entirely. Pre-push uses # `make test` for the full suite. if [ "${UNIT:-0}" != "1" ]; then - for t in test/wcc/950_*.c test/wcc/990_*.c test/wcc/991_*.c \ - test/wcc/992_*.c test/wcc/993_*.c test/wcc/994_*.c \ - test/wcc/995_*.c test/wcc/996_*.c test/wcc/997_*.c; do + # Phase 2 is partitioned (#3): the pure-reader byte-id gates run in + # parallel; the source-tree writers run in a serial tail afterward. + # + # PARALLEL GROUP — 990/991/992/994/996/997. Each reads only committed + # or make-all-produced files and writes only /tmp or a disjoint tracked + # stem (990→out smoke.*, 996→examples/mandelbrot/*, 997→/tmp fixture + # copy). No group member writes a stem another member reads (per-gate FS + # footprint audited race-free, #3), so they fan out via the same + # xargs -P "$JOBS" machinery as phase 1. + for t in test/wcc/990_*.c test/wcc/991_*.c test/wcc/992_*.c \ + test/wcc/994_*.c test/wcc/996_*.c test/wcc/997_*.c; do + [ -f "$t" ] || continue + name=${t##*/}; name=${name%.c} + printf '%s/%s\0%s\0' "$RESULTS" "$name" "$t" + done | xargs -0 -n2 -P "$JOBS" "$0" --one || true + + # SERIAL TAIL — 993/995/950, the only source-tree writers. 993 & 995 + # both write cmd/wwdump/main.* (995 writes all 5 cmd/*/main.*), so they + # run sequentially w.r.t. each other AND after the parallel group, so + # the group's readers see stable make-all output, never a torn write. + for t in test/wcc/993_*.c test/wcc/995_*.c test/wcc/950_*.c; do [ -f "$t" ] || continue name=${t##*/}; name=${name%.c} "$0" --one "$RESULTS/$name" "$t" || true