Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/tests/test_c4_requal_mutants_conversion_equiv.sh # omega-mv Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance. Brought by drakestapleton Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / tests / test_c4_requal_mutants_conversion_equiv.sh` 127 lines ยท 8453 bytes Raw Blame History 1 #!/bin/sh 2 # SPDX-License-Identifier: Apache-2.0 3 # Copyright 2026 Drake Stapleton (AIEN / aien-dev) 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 17 # Conversion proof: tools/c4_requal_mutants.sh (now an adapter over 18 # tools/mutation_runner.sh) must behave exactly like the pinned old script 19 # (commit `e6298806f1c7ccd874d123350d639ad8bba6edc7`, omega#216, the newest main 20 # commit that still holds the unconverted script with M03 retired and the 21 # rewritten M13). Host only, CPU only. PREREQUISITE: build/aienos-authority 22 # must exist (run 'make test-c4-requal' first); both sweeps build 15 mutants 23 # (M01 to M16 minus the retired M03), so this is slow. Env ONLY="M01 M05" 24 # narrows both sweeps to the same ids. 25 # 26 # Compared: stdout, exit code, the JSON receipt (byte for byte), and the 27 # per-mutant verdict list (id + KILLED/SURVIVED*/ERROR from the stderr lines). 28 # Normalised (volatile only): the receipt path in the stdout summary line 29 # (each sweep writes to its own file) and /tmp/c4mut.* or /tmp/mutrun.* scratch 30 # directory names. 31 # 32 # ONE more field is masked, the failing-case COUNT: the N in a KILLED note 33 # "N failing case(s), first: ..." becomes in BOTH old and new, in the stderr 34 # lines and the JSON receipt, and only when N is an integer >= 1. Evidence that 35 # the count is not stable even for the OLD script alone: the C4 harness has 24 36 # SIGKILL cases (tests/runtime/rx_c4_requal.c:645 kill_sweep(24); the kill delay 37 # and nanosleep/kill are at :305-308) whose outcome depends on timing. Forge 38 # diagnostic log test-queue-logs/DEEP6-conv-c4-diag-light-072723.log lines 39 # 21-36: raw harness fail counts per run were 9 10 10 9 9 (old-style dir) and 40 # 10 10 9 12 12 (runner-style dir), old script M06 gave 10 and 10 while the 41 # converted one gave 11 and 8, and the sorted non-kill FAIL lines were identical 42 # in all 10 runs. The count is descriptive: KILLED is decided by the exit code 43 # and nf>0 (tools/mutation_runner.sh lines 150-155), never by the value of N. 44 # A 0 count, a missing count, a non-number and a changed first failing case stay 45 # visible differences; so does every other field (status, id, file, checks text, 46 # order, row count, exit code, summary line). The negatives below prove it. 47 set -u 48 root=$(cd "$(dirname "$0")/.." && pwd) 49 cd "$root" || exit 2 50 old=tools/_c4_requal_mutants_old.$$.sh 51 tmp=$(mktemp -d "${TMPDIR:-/tmp}/c4equiv.XXXXXX") || exit 2 52 trap 'rm -rf "$tmp" "$root/$old"' EXIT INT TERM 53 git show `e6298806f1c7ccd874d123350d639ad8bba6edc7`:tools/c4_requal_mutants.sh > "$old" || { echo "FAIL cannot extract pinned old script"; exit 2; } 54 chmod +x "$old" 55 56 norm() { # file -> normalised on stdout 57 sed -e "s#$tmp/[A-Za-z0-9_.]*json#OUT.json#g" -e 's#/tmp/c4mut\.[A-Za-z0-9]*#TMP#g' \ 58 -e 's#/tmp/mutrun\.[A-Za-z0-9]*#TMP#g' "$1" 59 } 60 # stdin -> stdout: the one masked field. The count must follow ( or " or a space 61 # (stderr "(9 failing case(s), first: " and JSON "note": "9 failing case(s), first: "), 62 # start with 1-9 (so 0, an empty count and a non-number are not masked) and be 63 # followed by ", first: " (the KILLED-with-FAIL-lines note shape). 64 mask() { 65 sed -e 's/\([(" ]\)[1-9][0-9]* failing case(s), first: /\1 failing case(s), first: /' 66 } 67 verdicts() { # stderr file -> "id STATUS" per mutant 68 sed -n 's/^\(M[0-9][0-9]*\) \(KILLED\|SURVIVED_REDUNDANT\|SURVIVED_GAP\|SURVIVED\|ERROR\) .*/\1 \2/p' "$1" 69 } 70 # same