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

branch main Branches Tags History

omega-mv / mk / physics0.mk

61 lines · 4596 bytes Raw Blame History
1# PD-0 hidden-equation benchmark substrate (Physics-0 Discovery Engine,
2# spec aien-dev/physics docs/PD0_HIDDEN_EQUATION_BENCHMARK.md @ 5bd2b04, revision 3).
3# Files under src/physics0/ and tests/physics0/. Picked up by `-include mk/*.mk`;
4# not part of `all` or `test`. Direction 2 lane only: wire records, world
5# process (generators), STAND_IN recorder and range guard, oracle + reference
6# sparse solver (test-only), G0/G1 gates, Omega-language helpers. No ladder
7# checker, scorer, controls or learner here (other lanes).
8#
9# physics0-test G0 self-test (plain + ASan/UBSan), G5 isolation, G1 oracle
10# calibration (V1 + V3 per level), mutant check, OSC differential
11# physics0-evidence copy the G0/G1 receipts into evidence/physics0/ (new names per cut, never overwritten)
12# pd0-world build/physics0/pd0-world <level|null> <seed>: the world process
13ifndef PHYSICS0_MK
14PHYSICS0_MK := 1
15.PHONY: physics0-test physics0-evidence pd0-world
16P0_DIR = $(OUT_DIR)/physics0
17P0_OMC ?= seed/out/omc
18# learner-side pure OM-2 (no generator, no world, no file I/O): G5 isolation runs on these units
19P0_OM_LEARNER = src/physics0/pd0_types.om src/physics0/pd0_rng.om src/physics0/pd0_chan.om src/physics0/pd0_wire.om src/physics0/pd0_relation.om
20# world-side pure OM-2
21P0_OM_WORLD = $(P0_OM_LEARNER) src/physics0/pd0_world.om
22
23$(P0_DIR)/pd0-world: $(P0_OM_WORLD) src/physics0/pd0_world_main.om $(P0_OMC)
24 @mkdir -p $(P0_DIR)
25 { echo "om2"; cat $(P0_OM_WORLD) src/physics0/pd0_world_main.om; } | $(P0_OMC) > $@ && chmod +x $@
26
27pd0-world: $(P0_DIR)/pd0-world
28
29$(P0_DIR)/test_pd0_world: $(P0_OM_WORLD) tests/physics0/test_pd0_world.om $(P0_OMC)
30 @mkdir -p $(P0_DIR)
31 { echo "om2"; cat $(P0_OM_WORLD) tests/physics0/test_pd0_world.om; } | $(P0_OMC) > $@ && chmod +x $@
32
33$(P0_DIR)/pd0-oracle: $(P0_OM_WORLD) tests/physics0/pd0_oracle.om $(P0_OMC)
34 @mkdir -p $(P0_DIR)
35 { echo "om2"; cat $(P0_OM_WORLD) tests/physics0/pd0_oracle.om; } | $(P0_OMC) > $@ && chmod +x $@
36
37$(P0_DIR)/test_pd0_osc: $(P0_OM_LEARNER) tests/physics0/test_pd0_osc.om $(P0_OMC)
38 @mkdir -p $(P0_DIR)
39 { echo "om2"; cat $(P0_OM_LEARNER) tests/physics0/test_pd0_osc.om; } | $(P0_OMC) > $@ && chmod +x $@
40
41physics0-test: $(P0_DIR)/test_pd0_world $(P0_DIR)/pd0-oracle $(P0_DIR)/test_pd0_osc $(P0_DIR)/pd0-world
42 @mkdir -p $(P0_DIR)/receipts
43 ./$(P0_DIR)/test_pd0_world > $(P0_DIR)/g0.out; tail -1 $(P0_DIR)/g0.out; grep -q '^PHYSICS0_G0: PASS$$' $(P0_DIR)/g0.out
44 PD0_GEN_OM=src/physics0/pd0_world.om sh tests/physics0/isolation.sh $(P0_OM_LEARNER) | tee $(P0_DIR)/isolation.out | tail -1; grep -q '^PHYSICS0_ISOLATION: PASS' $(P0_DIR)/isolation.out
45 ./$(P0_DIR)/pd0-oracle all $(P0_DIR)/receipts > $(P0_DIR)/g1.out; cat $(P0_DIR)/g1.out; grep -q '^PHYSICS0_ORACLE: PASS$$' $(P0_DIR)/g1.out
46 -./$(P0_DIR)/pd0-oracle 1 $(P0_DIR) -mutant > $(P0_DIR)/mutant.out
47 @grep -q '^PHYSICS0_G1_V1_L1-mutant: FAIL' $(P0_DIR)/mutant.out && echo "PHYSICS0_MUTANT_SIGN: PASS (wrong generator sign is caught by the oracle check)" || { echo "PHYSICS0_MUTANT_SIGN: FAIL"; exit 1; }
48 -./$(P0_DIR)/pd0-oracle 6 $(P0_DIR) -mutlat > $(P0_DIR)/mutant_latent.out
49 @grep -q "^PHYSICS0_G1_V1_L6-mutlat: FAIL (oracle_exact FAIL, oracle_fit FAIL)" $(P0_DIR)/mutant_latent.out && echo "PHYSICS0_MUTANT_LATENT_SIGN: PASS (wrong latent sign makes oracle_fit FAIL)" || { echo "PHYSICS0_MUTANT_LATENT_SIGN: FAIL"; exit 1; }
50 ./$(P0_DIR)/test_pd0_osc > $(P0_DIR)/osc.out; tail -2 $(P0_DIR)/osc.out; grep -q '^PHYSICS0_OSC_DIFF: PASS$$' $(P0_DIR)/osc.out
51 @echo "physics0-test: PASS (G0, G5 isolation, G1 V1 oracle all levels, V3 breach rates recorded, mutant caught, OSC differential; pure OM-2 substrate)"
52
53# Receipts are immutable: existing evidence files are never rewritten (cp -n); each cut adds new files.
54physics0-evidence: physics0-test
55 mkdir -p evidence/physics0
56 for f in $(P0_DIR)/receipts/pd0-oracle-*.json; do b=$$(basename "$$f" .json); cp -n "$$f" "evidence/physics0/$$b-rev3b.json"; done
57 { echo "receipt: PD0_G0"; echo "spec: aien-dev/physics docs/PD0_HIDDEN_EQUATION_BENCHMARK.md @ 5bd2b04 (rev 3, PD0DESC2)"; echo "recorder: STAND_IN"; echo "range_guard: STAND_IN"; \
58 echo "commit: $$(git rev-parse HEAD)"; echo "date_utc: $$(date -u +%Y-%m-%dT%H:%M:%SZ)"; echo "--- test_pd0_world"; cat $(P0_DIR)/g0.out; \
59 echo "--- isolation"; cat $(P0_DIR)/isolation.out; echo "--- G1 oracle"; cat $(P0_DIR)/g1.out; echo "--- osc differential"; cat $(P0_DIR)/osc.out; \
60 echo "--- mutant"; cat $(P0_DIR)/mutant.out; echo "--- mutant latent sign"; cat $(P0_DIR)/mutant_latent.out; } > evidence/physics0/pd0-g0-receipt-cut3b.txt
61endif