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
| 1 | # M22 OMEGA_OPTIMIZER substrate + E5 training provenance (Lane 21, pure seeded OM-2). |
| 2 | # Transactional generation store over plain byte buffers (src/train/tg_store.om), |
| 3 | # SGD as the first updater (src/train/tg_sgd.om). No tensor/autodiff dependency. |
| 4 | # Picked up by `-include mk/*.mk`; not part of `all` or `test`. Host only, |
| 5 | # single core, no GPU, no quiet flag. |
| 6 | # |
| 7 | # test-train purity check, then the pure OM-2 exit tests run twice; |
| 8 | # both runs must print the same replay digest |
| 9 | # train-purity src/train contains only pure .om sources (0 C/H files) |
| 10 | # train-receipt digest-named receipt under evidence/M22/receipts (clean tree only) |
| 11 | # |
| 12 | # The receipt says M22 NOT QUALIFIED: this is the substrate + SGD path only. |
| 13 | ifndef TRAIN_MK |
| 14 | TRAIN_MK := 1 |
| 15 | .PHONY: test-train train-purity train-receipt |
| 16 | TRAIN_OMC ?= seed/out/omc |
| 17 | TRAIN_DIR = $(OUT_DIR)/train |
| 18 | TRAIN_OM_SRCS = src/train/generation.om src/train/sgd_update.om src/train/tg_sha256.om \ |
| 19 | src/train/tg_store.om src/train/tg_sgd.om |
| 20 | |
| 21 | $(TRAIN_DIR)/test_train: tests/train/test_train.om $(TRAIN_OM_SRCS) $(TRAIN_OMC) |
| 22 | @mkdir -p $(TRAIN_DIR) |
| 23 | (printf 'om2\n'; sed -e '/^om2$$/d' -e 's/^export fn /fn /' $(TRAIN_OM_SRCS) tests/train/test_train.om) | $(TRAIN_OMC) > $@ && chmod +x $@ |
| 24 | |
| 25 | train-purity: |
| 26 | @bad=$$(find src/train -maxdepth 1 \( -name '*.c' -o -name '*.h' \) 2>/dev/null); \ |
| 27 | if [ -n "$$bad" ]; then echo "train-purity: FAIL, unexpected C/H files:"; echo "$$bad"; exit 1; fi; \ |
| 28 | echo "train-purity: src/train is 100% pure seeded OM-2 (0 C/H files)" |
| 29 | |
| 30 | test-train: train-purity $(TRAIN_DIR)/test_train |
| 31 | @rm -rf $(TRAIN_DIR)/scratch $(TRAIN_DIR)/scratch-2 |
| 32 | ./$(TRAIN_DIR)/test_train $(TRAIN_DIR)/scratch > $(TRAIN_DIR)/run1.log 2>&1; rc=$$?; \ |
| 33 | cat $(TRAIN_DIR)/run1.log; [ $$rc -eq 0 ] |
| 34 | ./$(TRAIN_DIR)/test_train $(TRAIN_DIR)/scratch-2 > $(TRAIN_DIR)/run2.log 2>&1; rc=$$?; \ |
| 35 | cat $(TRAIN_DIR)/run2.log; [ $$rc -eq 0 ] |
| 36 | @a=$$(awk '$$1=="replay_digest"{print $$2}' $(TRAIN_DIR)/run1.log); \ |
| 37 | b=$$(awk '$$1=="replay_digest"{print $$2}' $(TRAIN_DIR)/run2.log); \ |
| 38 | if [ -z "$$a" ] || [ "$$a" != "$$b" ]; then echo "test-train: replay digest differs between runs"; exit 1; fi; \ |
| 39 | echo "test-train: pure OM-2 PASS, replay digest equal across runs ($$a)" |
| 40 | |
| 41 | train-receipt: |
| 42 | bash tests/train/train_receipt.sh |
| 43 | endif |