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 / om / evidence / README.md

108 lines · 8537 bytes Raw Blame History Source

om/evidence: seeded Omega port of omega_vector.c and omega_evidence.c

evidence.om ports the computing parts of src/omega_vector.c (113 lines) and src/omega_evidence.c (195 lines) to seeded Omega (aien-dev/omega-mv#726, aien-dev/aien-architecture-mv#300/#316). The part above the line note ==== parity harness is the library: 13 functions with array parameters and integer results, bindable through the omega-bridge native call ABI v1. The part below it is a program-mode parity harness. The harness also performs the C's process and file effects, because Omega allows host words only in program mode.

Reproduce from a fresh clone:

OMEGA_OMC=/path/to/seed/out/omc [OMEGA_BRIDGE=/path/to/omega-bridge@012860db] sh om/evidence/parity/run.sh

run.sh compares the .om output with C oracle hashes recorded in parity/expected.txt. The C oracle driver is not in the tree. It takes about 6 s on the Spark. The pathtree and digtree listings omit directory sizes, which depend on the filesystem under TMPDIR (ext4 and tmpfs differ), so any TMPDIR works.

What the C files contain, and what is ported

The task spec described "vector construction/hashing" over vectors of 0..4096 elements and "evidence record formatting" with random fields. The C does not match that description. This port follows the C:

C functionportnotes
omega_vector_spec_initvecspecname strncpy 63, SHA-256 of "OMEGA_VECADD_U32" ‖ width u16 LE ‖ count u32 LE ‖ overflow u8; the four fixed fields come back in fld
omega_vector_oracle_u32vecadd
omega_vector_verify_oraclevecveridx is written only on a mismatch
omega_vector_generate_deterministicvecgen
omega_vector_build_spec_graphnot portedbuilds an OmegaGraph through omega_core.c/omega_canonical.c (omega_build_*, omega_compute_semantic_id). It is a port of the graph core, not of this file; it has 1 caller (callsites.txt)
trim_line + popen_read_line length rule, omega_evidence_physics_commitlnaccoperates on the 256-byte buffer fgets filled
omega_evidence_run_commitcmtacc
omega_evidence_run_idrunidgmtime_r (civil-from-days) + strftime("%Y%m%dT%H%M%SZ") + "-" + sha or "unknown"
omega_evidence_pathevpaththe string and both length limits; mkdir_p_for_file stays with the caller (harness: mkdirp)
omega_evidence_write_digestdigrel + shainit/shaupd/shafinthe content name; the O_EXCL 0444 create and write loop stay with the caller (harness: excl)
omega_evidence_hardware_from_nvrmhwhexcompute_class/sm_version are copies and alias is the literal "sm_121", so both stay with the caller
omega_evidence_tree_dirtycaller"any line from popen, or popen failed" has no computation to port; the harness reproduces it
omega_evidence_self_binarynot portedreadlink(/proc/self/exe) + getenv("OUT_DIR") + access, which are effects only. It is not in the corpus: its result depends on the running binary

omega_evidence.h also declares omega_run_m4_gates .. omega_get_m19_gate_snapshot. These are defined in tools/omegatool.c, not in omega_evidence.c, and are out of scope.

SHA-256 is adapted from tools/zero-legacy/sha256.om (arch-316-closure), with the state moved into parameters. There is no import, so the code is copied. om/sha256/sha256.om (bound as omega_omsha, already used by src/sha256.c) is the other existing Omega SHA-256. A cutover can call it instead of shainit/shaupd/shafin.

Oracle

The C at omega-mv acb3f15cd: omega_vector.c 77057d59…7ed1, omega_vector.h b50a9218…9f43, omega_evidence.c 7d533625…fa94, omega_evidence.h 57b3e231…94c0, sha256.c ea8ae1c8…1ed15 (which itself calls om/sha256 through src/omega_om_units.inc). nvrm.h comes from physics 048e5f5e (physics.lock). Compiler: gcc 13.3.0 -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2, the Makefile CFLAGS, aarch64. .text sha256: omega_vector 124ee068…d23d, omega_evidence dc7725ea…adb. The objects are unchanged. The driver interposes popen/pclose/time at link time: popen returns the record's bytes through fmemopen, so fgets is the real libc one. run_id runs in a forked child per record, because it is cached in a static. physics_commit reads a real physics.lock file. path and write_digest run for real in an empty directory, and the tree they leave is compared as well (names, types, modes, sizes and file sha256). In program mode the harness does the same effects with the same flags (O_WRONLY|O_CREAT|O_EXCL|O_CLOEXEC, mode 0444, directories 0755, umask 022).

omc sha256 3ad9f10f…3194 (the previous pins b4f45121…9b55, be8c5130…448a, 24caacf4…abb7, 90c8884c…3983, 469532a5…79bc, 1578b357…dbe1 and 62775d2a…712b emit the same bytes). evidence.om compiles to a 35,032-byte program.

streamfunction(s)recordsresult
vspecvecspec300: NULL name, n 0, n 1/2/4096/2^31/2^32-1, NUL inside the name, 60..67-byte names around the 63 cut, random 0..100-byte names300/300
vaddvecadd vecver500 vectors, n 0..4096 (0, 1, 2, 4095, 4096), wrap-heavy inputs, exact, 1-bit flip, all poison, last element, two mismatches500/500 (c bytes, rc, first index)
vgenvecgen40 lengths 0..409640/40 (a, b, c)
linecmtacc lnacc324: run_commit with popen ok/NULL, physics.lock present/absent (n 0..300, trimmed length n-2..n), tree_dirty; empty, \n only, CR/space trims, 39/41 chars, NUL inside, >255 bytes, two lines324/324
runidrunid200: years 1 and 9999, the epoch, -1, 2^31 edges, random; good, bad and failing sha lines200/200
hwhwhex100: NULL rm, zero and random uuids100/100
pathevpath300: NULL rel, n 0, path length 1022..1025 around the 1024 limit, n = len-1/len/len+1, random300/300 + tree (7,676 lines)
digestdigrel sha*200: NULL stem/ext/buf (len 0 accepted, len 5 refused), rel length around 768, buffer 0..20000 with 55/56/63/64/4096/4097/8192 edges, exact repeats (rc 1)200/200 + tree (1,880 lines)

Sixteen small mutants are part of the verdict. Each must change its stream's hash. All are killed, for example the overflow byte in the spec digest (280 lines), a 64-byte name cut (98), trim_line without CR (14), >= → > in the length rule (8), non-floor division for negative times (42), the leap month (14), uppercase hex (94), the 1024 limit (300), directory mode (pathtree), the EEXIST return (12), SHA padding at 55 bytes (17) and file mode (digtree). See parity/run.sh.

Limits

NOT_RUN