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 / translation-validate.mk

49 lines · 3706 bytes Raw Blame History
1# #623 independent G1 translation validation (spec/universal/translation-v1.md). Host AArch64 only.
2# Needs: the pinned omc (OMEGA_NATIVE_OMC, sha256 734f0a39...6b61), an omega-bridge clone holding
3# 012860dbf26ee62a9838594b9dfd1e3e94a540a9 (OMEGA_BRIDGE_REPO), the C importer build (build/L589, from
4# mk/c-u64-import.mk) and the public tools/adapters/lower and tools/adapters/c-export commands.
5# A missing tool or pin gives NOT_RUN and exit 3, never PASS.
6.PHONY: translation-validate-bridge test-translation-validate test-translation-compose test-source-aware-v2-reference \
7 test-translation-compose-v2
8T623_BUILD := build/T623
9# OMEGA_BRIDGE_REPO (an aien-dev/omega-bridge clone, absolute path) comes from the caller; no host default.
10T623_BRIDGE_COMMIT := 012860dbf26ee62a9838594b9dfd1e3e94a540a9
11T623_SA := $(wildcard build/L574/sa)
12
13# The bridge generator, compiled by the pinned omc from native.om at the pinned commit.
14translation-validate-bridge:
15 @test -n "$(OMEGA_NATIVE_OMC)" || { echo 'NOT_RUN set OMEGA_NATIVE_OMC to the pinned seed omc'; exit 3; }
16 @test -n "$(OMEGA_BRIDGE_REPO)" || { echo 'NOT_RUN set OMEGA_BRIDGE_REPO to an omega-bridge clone'; exit 3; }
17 @mkdir -p $(T623_BUILD)
18 git -C "$(OMEGA_BRIDGE_REPO)" show $(T623_BRIDGE_COMMIT):src/native.om > $(T623_BUILD)/native.om
19 "$(OMEGA_NATIVE_OMC)" < $(T623_BUILD)/native.om > $(T623_BUILD)/bridge-native.tmp
20 chmod 700 $(T623_BUILD)/bridge-native.tmp && mv $(T623_BUILD)/bridge-native.tmp $(T623_BUILD)/bridge-native
21
22test-translation-validate: translation-validate-bridge
23 python3 tests/universal/translation/validate_g1.py --lower tools/adapters/lower --export tools/adapters/c-export \
24 --importer build/L589/c-import --omc "$(OMEGA_NATIVE_OMC)" --bridge-native $(T623_BUILD)/bridge-native \
25 --bridge-repo "$(OMEGA_BRIDGE_REPO)" $(if $(T623_SA),--sa $(T623_SA)) \
26 --out $(T623_BUILD)/validate-$$(python3 -c 'import uuid; print(uuid.uuid4().hex)')
27
28# G2 (spec/universal/translation-compose-v1.md): the six directed C/Rust/Python compositions and the
29# same-language round trips. Needs, in addition, the Rust and Python adapter builds (mk/rust-u64.mk,
30# mk/python-u64.mk), build/L574/sa, rustc and python3.
31test-translation-compose: translation-validate-bridge
32 python3 tests/universal/translation/validate_compose.py --omc "$(OMEGA_NATIVE_OMC)" \
33 --bridge-native $(T623_BUILD)/bridge-native --bridge-repo "$(OMEGA_BRIDGE_REPO)" --sa build/L574/sa \
34 --out $(T623_BUILD)/compose-$$(python3 -c 'import uuid; print(uuid.uuid4().hex)')
35
36# G3 (spec/universal/source-aware-v2.md, translation-compose-v2.md). The independent v2 reference decoder
37# against the v2 codec build/L832/sa (tools/source-aware/build-v2), and the 30 directed compositions of
38# C/Rust/Python/C++/Zig/Go. Needs, in addition, the C++/Zig/Go adapter builds, tools/adapters/retarget,
39# g++, rustc and python3 on PATH, ZIG (0.17.0), GO (1.27.3) and GOFMT given by the caller or found on PATH;
40# a missing oracle is NOT_RUN (exit 3), never a host default.
41test-source-aware-v2-reference:
42 python3 tests/universal/source-aware/v2_reference.py --sa build/L832/sa $(if $(T623_SA),--sa-v1 $(T623_SA)) \
43 --out $(T623_BUILD)/v2-reference-$$(python3 -c 'import uuid; print(uuid.uuid4().hex)')
44
45test-translation-compose-v2: translation-validate-bridge test-source-aware-v2-reference
46 python3 tests/universal/translation/validate_compose_v2.py --omc "$(OMEGA_NATIVE_OMC)" \
47 --bridge-native $(T623_BUILD)/bridge-native --bridge-repo "$(OMEGA_BRIDGE_REPO)" --sa2 build/L832/sa \
48 $(if $(ZIG),--zig "$(ZIG)") $(if $(GO),--go "$(GO)") $(if $(GOFMT),--gofmt "$(GOFMT)") \
49 --out $(T623_BUILD)/compose-v2-$$(python3 -c 'import uuid; print(uuid.uuid4().hex)')