Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/issues/05d4c644b4ec26ab # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers # [OM-AUTHOR A2] Enforce representation invariants, initialization and external layouts Open · #746 · open 2026-10-25 15:35 UTC Imported from GitHub aien-dev/omega-mv#746, by drakestapleton drakestapleton wrote on 2026-10-25 15:35 UTC ## Scope Extend existing struct/field/sizeof/offsetof implementation, #625 semantics and #623 verification. Structs already exist; no competing type system. - Define a bounded abstract-type mechanism with restricted constructors and preserving operations; first consumer dup32(x)=(u64(x)<<32)|u64(x), invariant high32==low32. Reject implicit raw-integer construction. External bytes need validation; unsupported proof obligations remain UNKNOWN/refused. - Definite-assignment checks across branches/loops/calls, including partial external scratch initialization. Distinguish initialized storage from initialized logical range; prove reads follow writes or use explicit checked contract. - Qualify named record layouts for SHA's 104-byte external context, endianness/alignment/field widths. Existing 8-byte-cell structs cannot be assumed C-layout-compatible. Define separate explicit layout contract when needed. - Negative controls: unduplicated store, constructor bypass, branch-only write, aliased write, partially initialized schedule, wrong offsets/endianness, stale type/profile identity. - Erase redundant runtime checks only when justified by verified preservation; report retained checks and unknown obligations. ## Delivery contract Approved bounded language evolution under #599, not a replacement master plan. Baseline inspected: omega main `acb3f15cdc691b1b046b48b0dad0f9255a12ba4b`, seed/omc/omc.om and om/sha256/sha256.om. Reconcile latest source, issue comments, active branches/PRs and file owners before editing. Read plan authority/current execution plan, doctrine, applicable ADRs, AGENTS.md and .crumb. Existing compiler/IR/checker/ABI owners retain authority; one writer per shared file. Final first-party logic/tests/automation use seeded handwritten .om, no parallel compiler or retained legacy fallback. Qualify then cut over consumers and delete retired active implementations, preserving history. Pin compiler/source/target/config/fixtures and raw evidence; independent review and negative controls required. Host/simulator/device results remain distinct; unrun is NOT_RUN. Preserve live 27B/35B service and reserved hardware coordination; no deployment or driver changes authorized by this issue. did:key:`z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd` wrote on 2026-11-18 17:21 UTC Recovered GitHub comment. Original comment `6404127017` ## #746 implemented and qualified on a draft branch (L834/L835) `om2/compiler-s3` @ `ad220c05` (PR #754), carried forward in `om2/compiler-s4` @ `f6a6492fd` (PR #764). - External layouts. `layout NAME SIZE` + `field F T [COUNT] at OFF little|big` + `end`, at top level before the first `fn`. Fields past `SIZE`, overlapping bytes, `SIZE` outside 1..4096 → error 29 at the offending line (`obligation=layout`). Field access only through a `view`/`edit NAME` parameter, with width and byte order applied (signed fields sign-extended); a field name shadows a local in that position (E15). Observed: `field f uint at 6 little` in an 8-byte layout → exit 29 at line 3. The SHA-256 context is the reference case: `layout shactx 104`'s emitted image equals the gcc 13.3.0 `offsetof` image built from `src/sha256.h` (`cmp` exit 0). - Initialization. `fresh` scratch arrays with a definite-write analysis: an element (or all N for a non-number index) read before a definite write → error 27 (`obligation=init`) at the get line; passing a fresh array to a non-inline call, `read`/`write` or `part` → error 27 there. Observed: `ret get s 2` in a `fresh` array with nothing written → exit 27 at line 3. Conservative across an `if`-without-`else`, `while` and rolled `for`; keeps the intersection at an `if/else` join (E15). - Restricted invariants. `abstract NAME T [ops W...]` + `holds NAME dup32`, seals confined to the `NAME`+`mk` constructor, `open` to the base type, listed operations only, `dup32`'s run-time check erased only for the exact body `ret seal NAME or shl ulong x 32 ulong x` — `om2 diag` reports `kept`/`erased` so nobody has to assume it. Qualified: C2 5,876/5,876; §5 layout 20/20, fresh 13/14 (the one FAIL needs `part`, delivered in S4), abstract 22/22; 15→17 S3 mutants killed, including union-at-join, rolled-loop writes, call/run-time get checks and every `abstract` check; the 6,876-case C2 manifest unchanged at every commit. Evidence: #752 `candidates/s3/RESULTS.txt`, `evidence/phaseB/s3-head//`. Sign in to comment