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 / spec / universal / upper-lower-v1.md

92 lines · 4952 bytes Raw Blame History Source

Upper S1 lowering v1 (#624 G1, compiler/core lane)

Implements translation-v1.md section 5 (contract sha256 063f1d63…de86e, branch universal/624-translation-g0 @ 82cd7692f). It adds no format and changes no existing one.

Tool

tools/adapters/lower [NAME] < envelope > unit.om. The wrapper is transparent host dispatch: it checks build/L831/build.json (compiler sha, the sha of each closure source, the binary sha) and refuses 78 LOWER_STALE_OR_MISSING_BUILD when anything has drifted. It then execs the native binary with the same arguments. All validation, hashing and text generation run in seeded Omega.

Build (make -f mk/lower.mk lower, tools/adapters/build-lower.py):

Behaviour

  1. The tool reads stdin to EOF, up to 8192 bytes. A 8193rd byte means 65.
  2. The core's decode validates the whole envelope as source-aware v1, sidecar included. It is linked in-process, one envelope per process; its fixed globals are not reentrant, so harnesses must run separate processes, one at a time.
  3. The unit must also be S1: language 1, profile 1, runtime 0, ABI 1, and every op of type 1 with effects 0 and alias 0, with exactly these fields:
    opmeaningattributeobligations
    9input01
    1constant10
    2, 3, 4add, sub, mul11

    Input slots must form the permutation 0..n-1. The core guarantees uniqueness and slot ≤ 5, and this tool checks slot < n. The core already checks operand index < own index.

  4. The output is the section-5 unit, byte-deterministic, one LF after every line including end.
    • The note's hex is the unit's semantic identity, `SHA256("omega.source.semantic.v1" || semantic bytes), the same digest as sa identity`.
    • Constants are printed in unsigned decimal, from 0 to 18446744073709551615.
  5. Output is fully buffered and written only after acceptance. A refusal writes nothing to stdout and one named line to stderr.
statusstderrcause
64LOWER_BAD_COMMANDmore than one argument, or a bad NAME
65LOWER_MALFORMEDinput over 8192 bytes, or any core decode failure other than 68 (65/66/67/69..78)
68LOWER_PROFILE_MISMATCHcore decode 68, or a valid v1 unit that is not S1 (for example op 5, profile 2, a slot gap)
77LOWER_IOan OS read or write failure, not a semantic status

When NAME is absent the tool uses calc. NAME must match [A-Za-z_][A-Za-z0-9_]{0,62}, and it must not be "reserved". For this grammar, reserved means the 150 identifier keywords of omc 734f0a39 (for example get, u64, argcnt) plus v, i0..i5 and main. The reason, measured with omc 734f:

The coordinator approved this meaning of "reserved" on 2026-10-25.

Native realization

  1. The pinned omc compiles the unit in function mode.
  2. omega-bridge src/native.om at 012860db (source sha256 2c2c53f6…3940) binds it as uint32_t omega_<NAME>(uint64_t *result, uint64_t i0, ...).

A 64-result unit (new ulong 64) with six inputs compiles and runs. No register or size limit was hit.

Self-test

make -f mk/lower.mk test-lower builds lower and the unchanged importer, then runs tests/universal/translation/lower_selftest.py. It requires OMEGA_NATIVE_OMC and SA_SEED_REPO (a clone holding the pinned bridge seed commit); OMEGA_BRIDGE_REPO (a clone holding omega-bridge 012860db) defaults to SA_SEED_REPO. None of them has a $HOME default. It covers:

What it checks:

Evidence class: TESTED by this lane, DIFFERENTIAL + REFERENCE, NATIVE. It is not qualification.