From caacc73b03c8176beb617c9e8f8e36611e8e7045 Mon Sep 17 00:00:00 2001 From: Drake Stapleton Date: Thu, 1 Oct 2026 22:15:06 -0500 Subject: [PATCH 1/3] tools: c4 mutation sweep runs on the shared runner Rows keep the same ids, edits and guards; known-equivalent classes move to a data column. Adds a conversion equivalence proof. Ported onto omega#216 (e6298806f1c7ccd874d123350d639ad8bba6edc7): mutant M03 is retired (row deleted, comment line kept as on main) and M13 is replaced by main's rewritten row byte for byte, so the table holds 15 rows. Apart from the class column format the rows equal main's old script. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01DsjWa6csUe4NxndCTmugHu --- ...test_c4_requal_mutants_conversion_equiv.sh | 63 ++++++++++++++ tools/c4_requal_mutants.sh | 86 ++++++------------- 2 files changed, 88 insertions(+), 61 deletions(-) create mode 100755 tests/test_c4_requal_mutants_conversion_equiv.sh diff --git a/tests/test_c4_requal_mutants_conversion_equiv.sh b/tests/test_c4_requal_mutants_conversion_equiv.sh new file mode 100755 index 000000000..1f00e4467 --- /dev/null +++ b/tests/test_c4_requal_mutants_conversion_equiv.sh @@ -0,0 +1,63 @@ +#!/bin/sh +# Conversion proof: tools/c4_requal_mutants.sh (now an adapter over +# tools/mutation_runner.sh) must behave exactly like the pinned old script +# (commit 2dc9dd8). Host only, CPU only. PREREQUISITE: build/aienos-authority +# must exist (run 'make test-c4-requal' first); both sweeps build 16 mutants, +# so this is slow. Env ONLY="M01 M05" narrows both sweeps to the same ids. +# +# Compared: stdout, exit code, the JSON receipt (byte for byte), and the +# per-mutant verdict list (id + KILLED/SURVIVED*/ERROR from the stderr lines). +# Normalised (volatile only): the receipt path in the stdout summary line +# (each sweep writes to its own file) and /tmp/c4mut.* or /tmp/mutrun.* scratch +# directory names. Nothing else is rewritten. +set -u +root=$(cd "$(dirname "$0")/.." && pwd) +cd "$root" || exit 2 +old=tools/_c4_requal_mutants_old.$$.sh +tmp=$(mktemp -d "${TMPDIR:-/tmp}/c4equiv.XXXXXX") || exit 2 +trap 'rm -rf "$tmp" "$root/$old"' EXIT INT TERM +git show 2dc9dd8:tools/c4_requal_mutants.sh > "$old" || { echo "FAIL cannot extract pinned old script"; exit 2; } +chmod +x "$old" + +norm() { # file -> normalised on stdout + sed -e "s#$tmp/[A-Za-z0-9_.]*json#OUT.json#g" -e 's#/tmp/c4mut\.[A-Za-z0-9]*#TMP#g' \ + -e 's#/tmp/mutrun\.[A-Za-z0-9]*#TMP#g' "$1" +} +verdicts() { # stderr file -> "id STATUS" per mutant + sed -n 's/^\(M[0-9][0-9]*\) \(KILLED\|SURVIVED_REDUNDANT\|SURVIVED_GAP\|SURVIVED\|ERROR\) .*/\1 \2/p' "$1" +} +# same