interplane.Get Omega
Read in your language

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

tests: require complete SHA-256 freestanding mutant output

open 86ae3c61681212f9 #1037 · opened 2026-11-05 13:42 UTC

Imported from GitHub aien-dev/omega-mv#1037, by drakestapleton

Base 37fa50340345bbecd702e3ce49c95e9df24529d7 · Head 7a581c0b3fb740433e4e4800ddefa3d649a5d9e2

drakestapleton wrote on 2026-11-05 13:42 UTC

Evidence

Host-only checks on Linux x86-64, source tree e22f2d98de81da981bd4b7f3eb236ee43f35eb7c (head 7a581c0b3fb740433e4e4800ddefa3d649a5d9e2):

  • make PHYSICS_DIR=/nonexistent PHYSICS_LOCK_CHECK=0 test-sha256-freestanding-red-control: exit 0, PASS SHA256 red control: 10 broken controls refused, complete digest mismatch accepted (synthetic host-only).
  • make -f mk/omega-gpu-engine.mk test-sha256-freestanding-red-control: same result, without loading other make fragments.
  • Replacing only SHA256_FS_CHECK_RED with the original || true / differing-output predicate makes the same regression exit 2: FAIL SHA256 red control accepted failed-empty.
  • Independent read-only review reproduced that failure, additionally verified refusal of a missing executable, missing reference and invalid output destination, and reran the final regression. A formatting-only false-positive found during review was fixed before this draft.
  • Expanded recipe sh -n, git diff --check: exit 0.
  • Unmodified crumb tool at the repository's crumb.lock pin d0f0b95d344b4c6628c3d868346932fd247ce168: crumb verify . exits 0, 188 crumbs current. No checker or pin change.

Defect and repair

Follow-up to merged #966, claimed here. Its wrong-round-constant control suppressed the mutant executable's status and treated any output difference as success. A failed empty run, a successful empty run and a truncated run all passed the exact extracted recipe.

The existing Makefile control now requires the mutant to exit successfully, emit valid digest rows for the complete expected case sequence, and produce an actual digest-field difference. Formatting changes alone cannot count. A synthetic host-only regression exercises the same checker and is a prerequisite of the full freestanding parity target.

The real K[0] mutant, FIPS values, parity acceptance and length checks remain unchanged. This does not change Omega code, generated bindings, dependency/compiler pins, workflows or gate manifests. The separate OMEGA_UNITS override issue is outside this patch.

Limits

Full AArch64 test-sha256-freestanding-parity and test-codegen-freestanding execution is NOT_RUN locally. No Omega compiler, emulator, target caller or hardware experiment was run. These results establish checker behavior only, not native SHA-256 execution or hardware qualification. Existing hosted workflows do not run the full freestanding parity target.

Draft for maintainer review and an AArch64 host rerun. No merge or deployment.

Exact-head CI

At 7a581c0b3fb740433e4e4800ddefa3d649a5d9e2, all four reported workflows completed successfully:

These workflows do not run the new synthetic target or the full freestanding parity target. The synthetic regression was rerun locally after fetching the published exact head, and pinned crumb verification passed again. Full native parity and codegen still need the AArch64 host rerun; this draft is not a qualification result.

Apply it

git checkout -b patch-86ae3c61681212f9 37fa50340345bbecd702e3ce49c95e9df24529d7
curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/86ae3c61681212f9.patch | git am

Raw patch (mbox) · Diff

Provenance

This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record:

github-import 1
aien-dev/omega-mv
1037
7a581c0b3fb740433e4e4800ddefa3d649a5d9e2
{"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":1037,"url":"https://github.com/aien-dev/omega-mv/pull/1037","export_sha256":"7319147b350ad908bf0b731068ec3be7b8dee848041dc862f71455e8e4680140","imported_utc":"2026-11-18T16:35:40Z"}

Changes

diff --git a/.crumb b/.crumb
index 622707972..da615e3e2 100644
--- a/.crumb
+++ b/.crumb
@@ -59,7 +59,7 @@
           "purpose": "Directory doctrine. Purpose not yet described by a human."
         },
         {
-          "digest": "1d027cfb699f8ebe4ad85158dff7d7c3b1539b5eb2b53f39ec8fdd593017fb31",
+          "digest": "1b079afc06ebce6ba2768b2bdf05d372203cd47af8d73d0aac98de2c5ed53343",
           "last_commit": "e673cbb52",
           "name": "mk",
           "purpose": "Directory mk. Purpose not yet described by a human."
@@ -96,7 +96,7 @@
         },
         {
           "digest": "58f22402d9b0849093ddae0c364872f3623adca238d3a07362b3b2367970de72",
-          "last_commit": "e673cbb52",
+          "last_commit": "96693b8ec",
           "name": "tests",
           "purpose": "Directory tests. Purpose not yet described by a human."
         },
@@ -107,15 +107,15 @@
           "purpose": "Directory tools. Purpose not yet described by a human."
         }
       ],
-      "children_root": "sha256:aa8991b5ca6aab1084402a0675a7734db8ff47a5964a1957a806c83d450e8807",
-      "compiled_at": "2026-11-05T13:04:30Z",
+      "children_root": "sha256:8a49a3660bdacc2486d6e5a74a18ee1101da9799b0e19890b4e50174e3939612",
+      "compiled_at": "2026-11-05T13:40:33Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:aac0e0cc7eb6abbd6887a3471e6f3d5db5a4c7aa49d2d72410f60a034ccfea14",
+      "digest": "sha256:fa617f79bf9b2b3d367223142805e3b7ed3566dced9055d5f84167bda35254ad",
       "evidence_files": 15321,
       "evidence_root": "sha256:e4e83d089b086dd1dcab0cfd4babe338eab359310746dbddc14edd655012c33f",
       "files": 23689,
-      "generated_at_commit": "e673cbb52742e8a54ca64653faa61fffbd324fd7",
-      "source_tree": "sha256:3994895183f3ad2ca608b43366d6212ef0f27a939d3a0c1332a3e0dc6755c859"
+      "generated_at_commit": "37fa50340345bbecd702e3ce49c95e9df24529d7",
+      "source_tree": "sha256:d8be759126a7c3eb31951ab0a11b33ff7d0ead6fbe264025d9eb8864f6fb4210"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 05fc8203a..733c9b883 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -110,4 +110,5 @@ Update this table in the same commit as the work it credits.
 | Claude Opus 5.5 | Merged main dc0d06e9 (#948 branch displacement, #967 IR cast) into the #875 OM-2 `dit` 225 / `scrub` 226 branch: reseeded omc to 38626559 at 512 functions, moved every active pin, regenerated the pinned units, and reran the #948 gate set plus the s5 dit/scrub gate (18 cases, 7 omc.om mutants detected) with a main-omc negative control and a four-mode sweep of every tracked .om. |
 | Claude Opus 5.5 | R15 energy preflight test: the fake package counter (and the falling cpu_p counter of decr3) now ticks every 10 ms until the case finishes instead of on a fixed 0.05/0.15 s schedule, so a preflight that starts late under load still sees it advance; delayed-start repro, 30/30 quiet and 30/30 under pinned busy loops |
 | Codex | Corrected Neuralese historical compiler attribution and separated active reproduction pins from dated run evidence. |
+| Codex | Hardened the freestanding SHA-256 wrong-round-constant control to require a successful complete run before accepting a digest mismatch, with synthetic host-only refusal checks. |
 | Claude Opus 5.5 | Added `target x86efi` on current main: PE32+ output, UEFI entry/exit with callee-saved XMM and MXCSR, the target-scoped `efi` word with the general file operation `efi 12` and console `efi 13`, gate18 coverage of the scoped keyword, and `docs/X86-EFI.md`. Exercised under QEMU/OVMF only (float parity with x86linux and AArch64, efi 12 refusal codes, Read/Write-swap and MXCSR mutants); physical firmware NOT_RUN. |
diff --git a/mk/.crumb b/mk/.crumb
index 53de73d9a..dd832c543 100644
--- a/mk/.crumb
+++ b/mk/.crumb
@@ -7,14 +7,14 @@
     "generated": {
       "children": [],
       "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
-      "compiled_at": "2026-11-05T13:02:29Z",
+      "compiled_at": "2026-11-05T13:40:33Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:1d027cfb699f8ebe4ad85158dff7d7c3b1539b5eb2b53f39ec8fdd593017fb31",
+      "digest": "sha256:1b079afc06ebce6ba2768b2bdf05d372203cd47af8d73d0aac98de2c5ed53343",
       "evidence_files": 0,
       "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
       "files": 98,
-      "generated_at_commit": "c64349a46daf039a3c1a1205790325f31f840618",
-      "source_tree": "sha256:ffea04d1718cbfc2da75e9c63a02b68b755c643eb50ef81f7602ce0a567f644d"
+      "generated_at_commit": "37fa50340345bbecd702e3ce49c95e9df24529d7",
+      "source_tree": "sha256:b84f5c1d061fcea5c3145f13982774862d8d25c1664d4e374638bd3431c83918"
     },
     "owner_lane": "",
     "provenance": {
diff --git a/mk/omega-gpu-engine.mk b/mk/omega-gpu-engine.mk
index f3251cae7..3c4373c57 100644
--- a/mk/omega-gpu-engine.mk
+++ b/mk/omega-gpu-engine.mk
@@ -180,16 +180,58 @@ build/test_codegen_freestanding: $(CODEGEN_FS_TEST_DEPS) $(GPU_FS_LINK)
 # split), and the FIPS digests must be the published ones. Controls: the hosted codegen test hashes through the
 # Omega binding (omega2_sha256_*), and a copy of the freestanding binding whose machine code loads round constant
 # K[0] as 0x428a2f99 (movz x1,#0x2f98 -> #0x2f99) must FAIL the comparison.
-.PHONY: test-sha256-freestanding-parity
+.PHONY: test-sha256-freestanding-parity test-sha256-freestanding-red-control
 SHA256_FS_PARITY_DEPS = tests/test_sha256_freestanding_parity.c src/sha256.h src/omega_api_decl.h src/omega_native.h
 SHA256_FS_RED = build/sha256_parity_red
+# A killed digest mutant must finish normally and emit every expected case, in order. A crash,
+# empty/partial output or malformed digest is a broken control, not evidence of a digest mismatch.
+# Arguments: executable, mutant output, known-good output (already checked above).
+define SHA256_FS_CHECK_RED
+"$(1)" > "$(2)" || { echo "RED CHECK BROKEN: mutant did not complete"; exit 1; }; \
+awk 'NF != 3 || ($$1 != "fips" && $$1 != "len") || length($$3) != 64 || $$3 ~ /[^0-9a-f]/ { exit 1 }' "$(2)" \
+	|| { echo "RED CHECK BROKEN: malformed mutant output"; exit 1; }; \
+awk '{ print $$1, $$2 }' "$(2)" > "$(2).cases" && \
+awk '{ print $$1, $$2 }' "$(3)" > "$(2).expected-cases" && \
+cmp -s "$(2).cases" "$(2).expected-cases" \
+	|| { echo "RED CHECK BROKEN: mutant did not emit every expected case in order"; exit 1; }; \
+awk '{ print $$3 }' "$(2)" > "$(2).digests" && \
+awk '{ print $$3 }' "$(3)" > "$(2).expected-digests" \
+	|| { echo "RED CHECK BROKEN: could not read digests"; exit 1; }; \
+if cmp -s "$(2).digests" "$(2).expected-digests"; then echo "RED CHECK BROKEN: a wrong round constant passed"; exit 1; \
+else [ $$? = 1 ] || { echo "RED CHECK BROKEN: could not compare mutant output"; exit 1; }; \
+echo "red check: K[0] changed in the freestanding machine code FAILS the comparison after a complete run"; fi
+endef
+
+# Host-only checks of the same control, with synthetic executables and output. No Omega code runs.
+test-sha256-freestanding-red-control:
+	@set -eu; mkdir -p build; d=$$(mktemp -d build/sha256-red-control.XXXXXX); trap 'rm -rf "$$d"' EXIT; \
+	printf 'fips 0 %064d\nlen 0 %064d\n' 0 0 > "$$d/reference"; \
+	printf 'fips 0 %064d\nlen 0 %064d\n' 1 1 > "$$d/wrong"; \
+	printf '%s\n' '#!/bin/sh' 'case "$$CASE" in' \
+	  'failed-empty) exit 1 ;;' 'failed-full) cat "$$BAD"; exit 1 ;;' 'empty) exit 0 ;;' \
+	  'partial) head -n 1 "$$BAD" ;;' 'malformed) printf "fips 0 bad\nlen 0 bad\n" ;;' \
+	  'reordered) tail -n 1 "$$BAD"; head -n 1 "$$BAD" ;;' \
+	  'extra) cat "$$BAD"; head -n 1 "$$BAD" ;;' \
+	  'whitespace) sed "s/ /  /g" "$$REF" ;;' 'no-newline) printf "%s" "$$(cat "$$REF")" ;;' \
+	  'unchanged) cat "$$REF" ;;' 'wrong) cat "$$BAD" ;;' 'esac' > "$$d/runner"; \
+	chmod +x "$$d/runner"; REF="$$d/reference"; BAD="$$d/wrong"; export REF BAD CASE; \
+	for CASE in failed-empty failed-full empty partial malformed reordered extra unchanged whitespace no-newline; do \
+	  if ( $(call SHA256_FS_CHECK_RED,$$d/runner,$$d/red,$$d/reference) ) > "$$d/log" 2>&1; then \
+	    echo "FAIL SHA256 red control accepted $$CASE"; cat "$$d/log"; exit 1; \
+	  fi; \
+	done; \
+	CASE=wrong; ( $(call SHA256_FS_CHECK_RED,$$d/runner,$$d/red,$$d/reference) ) > "$$d/log" 2>&1 \
+	  || { echo "FAIL SHA256 red control rejected a complete digest mismatch"; cat "$$d/log"; exit 1; }; \
+	echo "PASS SHA256 red control: 10 broken controls refused, complete digest mismatch accepted (synthetic host-only)"
+
 build/test_sha256_parity_hosted: $(SHA256_FS_PARITY_DEPS) src/omega_om_units.c
 	@mkdir -p build
 	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -D_GNU_SOURCE -Isrc -o $@ tests/test_sha256_freestanding_parity.c src/omega_om_units.c -pthread
 build/test_sha256_parity_freestanding: $(SHA256_FS_PARITY_DEPS) $(GPU_FS_DIR)/omega_om_units_fs.o
 	@mkdir -p build
 	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -o $@ tests/test_sha256_freestanding_parity.c $(GPU_FS_DIR)/omega_om_units_fs.o
-test-sha256-freestanding-parity: build/test_sha256_parity_hosted build/test_sha256_parity_freestanding build/test_codegen_hosted
+test-sha256-freestanding-parity: build/test_sha256_parity_hosted build/test_sha256_parity_freestanding build/test_codegen_hosted \
+		test-sha256-freestanding-red-control
 	./build/test_sha256_parity_hosted > build/sha256_parity_hosted.txt
 	./build/test_sha256_parity_freestanding > build/sha256_parity_freestanding.txt
 	cmp build/sha256_parity_hosted.txt build/sha256_parity_freestanding.txt
@@ -210,9 +252,7 @@ test-sha256-freestanding-parity: build/test_sha256_parity_hosted build/test_sha2
 	gcc $(GPU_FS_CFLAGS) -c -o $(SHA256_FS_RED)/red.o $(SHA256_FS_RED)/red.c
 	gcc -std=gnu11 -O2 -Wall -Wextra -Werror -Isrc -o $(SHA256_FS_RED)/parity_red tests/test_sha256_freestanding_parity.c \
 		$(SHA256_FS_RED)/red.o
-	@./$(SHA256_FS_RED)/parity_red > $(SHA256_FS_RED)/red.txt || true; \
-	if cmp -s $(SHA256_FS_RED)/red.txt build/sha256_parity_hosted.txt; then echo "RED CHECK BROKEN: a wrong round constant passed"; exit 1; \
-	else echo "red check: K[0] changed in the freestanding machine code FAILS the comparison ($$(cmp $(SHA256_FS_RED)/red.txt build/sha256_parity_hosted.txt | head -1))"; fi
+	@$(call SHA256_FS_CHECK_RED,$(SHA256_FS_RED)/parity_red,$(SHA256_FS_RED)/red.txt,build/sha256_parity_hosted.txt)
 test-codegen-freestanding: build/test_codegen_hosted build/test_codegen_freestanding test-gpu-fs-allowlist-control \
 		test-sha256-freestanding-parity
 	./build/test_codegen_hosted --dump > build/codegen_dump_hosted.txt