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 / docs / ecosystem663 / metadata-v1.md

135 lines · 6582 bytes Raw Blame History Source

M20 metadata-v1 native boundary

This component implements the integer metadata and storage-lifetime checks needed by Omega #663. It preserves the bounded M20 tensor contract at cd5897e3f92f72a015892c67b17f096e433b54f7, specifically src/tensor/omega_tensor.h and src/tensor/omega_tensor.c. src/autodiff/omega_autodiff.c is a dependent legacy consumer, not a native gradient implementation supplied by this change.

Owner: ecosystem303 tensor lane, ledger L787, parent L786. Exclusive paths: native/ecosystem663, tests/ecosystem663, docs/ecosystem663, and evidence/ECOSYSTEM663. L408 retains compiler ownership, L418 retains the existing migration, and L491 retains training/schedule work. No existing compiler, tensor, autograd or trainer source is changed.

Scope

native/ecosystem663/metadata.om validates a tensor descriptor against the allocator's current storage record. It detects shape/product overflow, out-of-bounds views, incorrect dtypes and stale storage generations. It also implements the storage record's release transition. These checks execute as seeded native AArch64 code using integer metadata.

This component does not allocate memory, store tensor values, execute tensor arithmetic, compute derivatives, authenticate an allocator record or make records safe for concurrent use. ES must be populated by the trusted existing allocator owner, under that owner's synchronization. Caller-controlled claims about storage do not establish that storage exists. Changing ES is an ordinary in-process operation, not a protected capability boundary.

An eventual native tensor allocator must call this single boundary; it must not copy a second implementation of its validation rules. Consumer integration must pin this source and test its actual allocation and release operations. The distributed #7 consumer may use this module to validate each local operand record, but metadata agreement alone does not execute a collective.

Frozen subset and input records

Schema version is 1. Dtype 1 is F32; 2 is F16; 3 is BF16. These are storage metadata tags here. No integer or complex tensor dtype is added. Rank is 0..8; rank 0 has one element. Every active dimension is at least 1, with product at most 1073741824. Empty tensors remain explicitly refused under inherited M20 semantics; supporting them requires a separately versioned extension.

Strides and offsets are unsigned element counts. Zero strides admit read-only broadcast views. Negative strides are not representable. Inactive dimensions and strides are ignored. Physical overlap is allowed for immutable views; this does not authorize overlapping writes. A huge stride on a size-one dimension does not access any extra element and is accepted.

ED is a 24-element ulong array:

IndexValue
0schema, exactly 1
1dtype, 1..3
2rank, 0..8
3declared element count, equal to shape product
4storage offset in elements
5storage slot, 0..4294967295
6storage generation, nonzero u64
7reserved, exactly zero
8..15dimensions
16..23element strides

ES is an 8-element ulong array containing the trusted storage snapshot:

IndexValue
0live, exactly 1 for admission
1retired, exactly 0 for admission
2storage slot
3current generation
4dtype
5allocation's element capacity, 1..1073741824
6..7reserved, zero

The slot may be zero; the generation may not. Descriptor slot, generation and dtype must equal the storage snapshot. Storage capacity does not require the view to cover all storage. Each logical element must lie within the capacity. The implementation checks remaining extent before multiplying, so untrusted large sizes/strides refuse instead of overflowing.

Calls and errors

emshape and embounds are internal helpers, not independently admitted entry points. embounds requires shape validation first.

StatusMeaning
0metadata admitted
-1unsupported schema or reserved field
-2rank above 8
-3zero dimension or inconsistent element count
-4unsupported or mismatched dtype
-5stale/retired/dead/invalid storage handle
-6view reaches outside storage
-8element-count or storage-capacity limit

These negative values retain M20 status meanings. The new descriptor envelope has its own schema version; it is not the C struct ABI or a shared transport wire format. emcheck refusal precedence is envelope, dtype, shape/count, handle, storage dtype, then extent. No mutation/version counter is invented: the inherited M20 tensors are immutable. Saved tensor storage references become stale after release; full autodiff node/tape lifetime is still #664.

Acceptance and remaining gates

The native test includes analytic boundary cases, scalar and rank-eight descriptors, both storage-only dtypes, maximum counts and generations, stale references, release/reuse/retirement, and 14400 tiny views compared against an independent element-enumeration algorithm. Compiled controls must detect missing offset accounting, generation comparison and retirement.

Build by concatenating this module and tests/ecosystem663/metadata-test.om, then feed the bytes to pinned compiler SHA256 191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9 and execute the resulting ELF on Linux AArch64. Existing development cat, redirection, chmod and quiet-build remain disclosed host orchestration. No new shell harness is delivered. Native import/process orchestration is separate owner work; this source uses no foreign runtime or dynamic library.

FP arithmetic remains blocked on the compiler/numeric owners and their exact qualified interfaces. Native forward/backward/update, actual allocator and trainer integration, CUDA-free model execution, physical cross-vendor results, checkpoint/resume and retirement are NOT_RUN. No legacy source is deleted because no existing production consumer has switched. All parent issues stay open. Independent final-source review and existing desk review are required.