python3 tests/watch.py --label "mutant partition coverage" -- bash rocq/tests/partitions.sh
# Hand-written checked IR (rocq/tests) goes in as written: the check
# passes take pizlonate's output, never renew_hull or renew_if.
NANOFIL_CHECKS=reference NANOFIL_JOBS=$NIX_BUILD_CORES tests/par.sh rocq/agree.sh rocq/tests/*.ir
# Forty Fil-C modules of ten random functions (tests/gen.pl's filc
# mode), which trap often and reach every reuse form, join the
# matrix below.
mkdir gen
for seed in $(seq 1 40); do
(cd src && ../bin/nanofil --script ../tests/gen.pl $seed 10 filc </dev/null) > gen/gen-$seed.ir
done
# Lua 5.4.7's lctype.c, lobject.c and lstring.c, the source nix/lua.nix
# builds, with the run lines of rocq/tests/lua.c, join the outcome
# matrix; the validator judges their mutants once, below, since each
# is judged on the whole module.
mkdir luasrc
tar -xf
${pkgs.lua5_4.src} -C luasrc --strip-components=1
rocq/lua.sh luasrc/src >lua.ir
mark prepare
# Modes are independent, just as in the validator matrix below. Keep
# each mode's complete log and propagate any failing xargs child.
for opt in plain -O; do
for checks in reference reuse renew guard hoist schedule half forward combined hull getter extended; do
echo "$opt $checks"
done
done | xargs -P "$NIX_BUILD_CORES" -L 1 bash -c '
set -o pipefail
opt=$0; [ "$opt" = plain ] && opt=
t0=$(date +%s)
NANOFIL_OPT=$opt NANOFIL_CHECKS=$1 NANOFIL_JOBS=1 tests/par.sh rocq/agree.sh tests/filc/*.ir tests/c/*.c gen/*.ir lua.ir \
2>&1 | tee "$TMPDIR/agree-$0-$1.log" | grep --line-buffered "^@@nanofil-" \
|| { echo "### agree NANOFIL_OPT=$opt NANOFIL_CHECKS=$1"; cat "$TMPDIR/agree-$0-$1.log"; exit 1; }
echo "agree NANOFIL_OPT=$opt NANOFIL_CHECKS=$1: $(grep -c "^/" "$TMPDIR/agree-$0-$1.log") files agree ($(( $(date +%s) - t0 ))s)"'
mark outcomes
# The validator against ir:valid_module/1 on mutants of every checked
# module (rocq/valid.sh, rocq/mutants.pl), in every mode at once.
NANOFIL_CHECKS=reference NANOFIL_JOBS=$NIX_BUILD_CORES tests/par.sh rocq/valid.sh rocq/tests/*.ir
# (xargs drops empty words, so "plain" stands for no -O.)
for opt in plain -O; do
for checks in reference reuse renew guard hoist schedule half forward combined hull getter extended; do
echo "$opt $checks"
done
done | xargs -P "$NIX_BUILD_CORES" -L 1 bash -c '
set -o pipefail
opt=$0; [ "$opt" = plain ] && opt=
t0=$(date +%s)
NANOFIL_OPT=$opt NANOFIL_CHECKS=$1 NANOFIL_JOBS=1 tests/par.sh rocq/valid.sh tests/filc/*.ir tests/c/*.c gen/*.ir \
2>&1 | tee "$TMPDIR/valid-$0-$1.log" | grep --line-buffered "^@@nanofil-" \
|| { echo "### valid NANOFIL_OPT=$opt NANOFIL_CHECKS=$1"; cat "$TMPDIR/valid-$0-$1.log"; exit 1; }
echo "valid NANOFIL_OPT=$opt NANOFIL_CHECKS=$1: $(grep -c "^/" "$TMPDIR/valid-$0-$1.log") files agree ($(( $(date +%s) - t0 ))s)"'
mark validator-matrix
# The C programs of tests/c/prog that declare an alias, a weak
# symbol, thread-local data or a constructor, with the reference
# checks only: they bring the corpus's aliases and its kinds of data
# linkage. Not those with a "// cflags:" line, which compile as
# progtest.sh does and not as cc-ir does.
grep -lE 'alias *\(|weak|_Thread_local|__thread|thread_local|constructor|destructor' \
$(grep -L '^// cflags:' tests/c/prog/*.c) >prog.list
xargs -P "$NIX_BUILD_CORES" -n 1 bash -c '
set -o pipefail
NANOFIL_CHECKS=reference NANOFIL_JOBS=1 tests/par.sh rocq/valid.sh "$0" 2>&1 \
| tee "$TMPDIR/prog-$$.log" | grep --line-buffered "^@@nanofil-" \
|| { echo "### valid $0"; cat "$TMPDIR/prog-$$.log"; exit 1; }' <prog.list
# Lua's whole-module mutant generation alone takes minutes on one
# core. Once the other programs finish, share its independent item
# partitions across the available cores, without nested matrix fanout.
NANOFIL_CHECKS=reference NANOFIL_JOBS=1 NANOFIL_MUTANT_JOBS=$NIX_BUILD_CORES \
tests/par.sh rocq/valid.sh lua.ir | tee "$TMPDIR/prog-lua.log"
echo "valid tests/c/prog and lua.ir: $(($(wc -l <prog.list) + 1)) modules agree"
mark validator-programs
mkdir -p $out
cp "$TMPDIR"/agree-*.log "$TMPDIR"/valid-*.log "$TMPDIR"/prog-*.log $out/