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 / native / autodiff664 / CONTRACT.md

140 lines · 8103 bytes Raw Blame History Source

Native reverse-mode tape (bounded): native/autodiff664/tape.om

Status: IMPLEMENTED and EXERCISED on the host (aarch64 Linux, DGX Spark). Not QUALIFIED on hardware, not MERGED, not DEPLOYED. Tracks omega-mv #664 (native autograd) and builds on #663 / PR #674 (native/ecosystem663/metadata.om).

What it is

A handwritten seeded .om reverse-mode tape for rank-2 IEEE binary32 tensors. Values and gradients use native f32 words. It contains no FFI, no C fallback and no generated code. Build order: native/ecosystem663/metadata.om, native/autodiff664/tape.om, then the consumer.

wordmeaning
tpresetempty tape (node count, backward flag, arena offset to 0)
tpleaf r c rg → idleaf [r,c]; rg 1 requires grad
tpset n i v → 0write leaf/node value element i
tpadd a b, tpsub a b, tpmul a b → idelementwise, equal shapes
tpmm a b → id[m,k]·[k,n]
tprelu a → idx > 0 ? x : +0
tpbcast a rows → id[1,c] → [rows,c]
tpsum a axis → idaxis 0 → [1,c], axis 1 → [r,1] (keepdims)
tpback root → 0reverse pass, seed 1.0, once per tape
tpval n i, tpgrad n i, tphasg nread value / gradient / whether a gradient exists

Admission and limits

Each recorded node has an M20 metadata-v1 descriptor (TD) and an allocator snapshot (TS). Every operand passes emcheck from metadata.om before an op runs, so a stale or non-live operand is refused with the metadata error. The tests/autodiff664 tstale check exercises this path.

codecondition
−30capacity: 33rd node, >64 elements, reduced axis >32, arena full
−31tpback already run or failed, or any op after tpback
−32bad id, shape mismatch, bad layout, bad axis
−33tpback root not [1,1] or not requiring grad
−1..−8passed through from emcheck
exit 97tpval/tpgrad out of range or on a node without a gradient

A refusal records nothing (the node count is unchanged).

Numeric order (the contract the fixture oracle checks)

Evidence (host)

The recorded host suite used omega-mv seed/out/omc, SHA-256 be8c51301307555254fc59e351d281aae1aa096d91521777e33a41c8b446448a (main 9920aab1; the suite first passed with 62775d2a391cfef7cde64e387655caa9809a267093112910ec76bfa568f3712b). That pin is historical. The x86efi compiler from PR #1015 is b4f45121f6c6d5d8a6ed0f5c4f3934b7cc4bec369bfa89523699bd33928f9b55 (seed/omc/omc.om 16b4ca40a5bd7796ac08b55d1ceadac1260e52298ed123f45418e77b3221c749). On 2026-11-04 the tape suite passed against it natively (DGX Spark, Linux aarch64): TAPE_SUITE_PASS NATIVE_TAPE_PASS checks=302, all three compiled mutants failed with status 1. The compiler of PR #1022 (efi 14) is 3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194 (seed/omc/omc.om 0effe37afc4ddd0507151c9f2afa34b3e6774eae7006cbecd8c59f11bc386db7). On 2026-11-04 the tape suite passed against it the same way (DGX Spark, Linux aarch64, core 9): TAPE_SUITE_PASS NATIVE_TAPE_PASS checks=302, all three compiled mutants failed with status 1. On 2026-11-07, with the signed-zero padding checks and the fourth mutant added (DRA-14 follow-up), the suite passed against the reseeded compiler cfd96b48b0460ab5557853d6856f9c741b96ac8d0d624e06198defb4cbfa0d8a (main 6efc4572, DGX Spark, Linux aarch64, cores 10-11): TAPE_SUITE_PASS NATIVE_TAPE_PASS checks=351, all four compiled mutants failed with status 1. tape.om is unchanged (sha256 1b4ed431…8bde).

OMC=<pinned omc> OUT=<scratch> sh tests/autodiff664/run-tape.sh
# TAPE_SUITE_PASS NATIVE_TAPE_PASS checks=351

Not claimed

General autograd (rank >2, more than 32 nodes, DIV/SQRT/MEAN/TRANSPOSE), GPU launch from .om (#638 / CUDApp #35), performance, atomic checkpoint publication, or any hardware qualification.