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 / physics0 / OMEGA-MIGRATION.md

40 lines · 4202 bytes Raw Blame History Source

PD-0 substrate: what is in the Omega language today, what moves later

Status at this commit (OSC-3 slice of the Omega Systems Core compiler; docs/osc/OSC-1-SELF-HOST-STATEMENT.md and docs/osc/OSC-3-DESIGN.md for what the language can express: integer scalars u8..u64, i8..i64, bool, fixed arrays of at most 64 cells, structs (OSC-2), bounded loops, no recursion, no bytes or strings, no I/O, no 128-bit integers).

In Omega now

tests/physics0/osc/pd0_helpers.osc (same header format as the OSC golden corpus in tests/compiler/progs/): 10 functions, 62 lines.

FunctionSpec itemC twin
mul(a, b)2.1 product rescale (a*b)/1e6, truncatingpd0_mul (src/physics0/pd0_rng.c)
const_draw(lo, hi, u)3 constant drawpd0_const
noise_map(u1..u4, sigma)3 Irwin-Hall noise from four uniformspd0_noise
l0_s0, l0_s14.1 L0 kinematics tickpd0_gen_step case L0
l1_s0, l1_s14.1 L1 spring tickpd0_gen_step case L1
l2_s14.1 L2 damped spring velocity tickpd0_gen_step case L2
cube(s0)the L4 monomial s0*s0*s0pd0_monomial with exponent 3
description_bits(...)6.2 description length rulepd0_relation_description_bits

Differential test tests/physics0/test_pd0_osc.c (gate PHYSICS0_OSC_DIFF): the file is compiled by the OSC front end, every function runs through the reference interpreter and through the native AArch64 code (osc_cg + osc_native), and both results are compared with the C twin on 20 000 seeded input sets per function (200 000 runs, 0 mismatches at this commit, plain and ASan/UBSan). Inputs stay inside the world box (|v| <= 10.0 units, constants <= 9.0, u <= 2.0).

Line count at this commit (wc -l, comments included): Omega 62 lines (one .osc file) versus C 1 334 lines under src/physics0/ and 925 lines of test-only C and shell under tests/physics0/. The Omega share of the substrate is the pure integer arithmetic of the spec; everything that touches bytes, hashes, processes or files is C.

Why the rest is not in Omega yet, item by item

PieceBlocker in the language todayMoves when
pd0_mul with 128-bit intermediateno i128; a*b traps OVERFLOW fora*b
pd0_gen_step as one function over a state arrayarrays of i64 are expressible, but the step needs the level selector and constants as parameters (at most 6 scalar parameters, OSC_MAX_PARAMS) and no struct parametersstruct or array parameters beyond 6 scalars, or a module with globals
pd0_relation_step (sum over terms of coef * monomial)the relation is a struct of arrays of structs; OSC-2 structs cannot hold arrays of structs and there are no array parameters across functions with bounds checks over 64 cellsnested aggregates or byte slices
SplitMix64 and FNV-1au64 wrapping arithmetic exists; the stream needs the tag as bytes (fnv1a64("const"))bytes / strings
PD0REC1 / PDLAW1 encode and decode, SHA-256 chainbytes, slices, a SHA-256 in Omegabytes plus a verified Omega SHA-256
world server (pipe), pd0-world binaryno I/O, no processescapabilities / effects (OSC-0 decision 5 says never inside the language core; an Omega runtime seam is needed)
least squares and NRMSE in the calibration codefloating point; the calibration is test-only anywaystays C (or integer rational arithmetic if a future owner wants it bit-reproducible)

Rules kept