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 / numeric / E1_SCALAR_CONTRACT.md

97 lines · 6996 bytes Raw Blame History Source

E1 scalar contract (WP-A)

What each E1 scalar op must return, and where it runs today. Closes rows 1, 3 and 4 of E1_GAP_TABLE.md for the CPU tier only.

Rules for every op

The ops

OpResultCompared as
FSETP_<P>_SELP(a, b) ? a : b, the chosen word moved unchanged (NaN payload and the sign of zero kept)INT_EXACT
F2I_FLOOR / F2I_CEIL / F2I_RNIint32 of a rounded down / up / to nearest even; NaN gives 0; out of range saturates to INT32_MIN / INT32_MAXINT_EXACT
F2Uuint32 of a toward zero; NaN and every negative give 0; above range gives 0xffffffffINT_EXACT
I2FP_U32the bits of a read as uint32, converted to FP32 (RNE)BIT_EXACT
F32_TO_F16binary16 of a in bits [15:0], bits [31:16] zero; RNE; 65520 and above round to infF16_BITS
F32_TO_BF16bfloat16 of a in bits [15:0], bits [31:16] zero; RNE; overflow rounds to infBF16_BITS
F16_TO_F32 / BF16_TO_F32exact FP32 of the 16-bit value in bits [15:0] of a; bits [31:16] ignoredBIT_EXACT
FFMA_Va * b + c with one rounding, c read per element; exact zero sums are +0 unless both terms are -0BIT_EXACT

The 13 predicates P, with U meaning "also true when a or b is NaN" (-0 equals +0 in all of them):

PLTLEGTEQNENUMNANLTULEUGTUGEUEQUNEU
a < b1100110110001
a == b0101010010110
a > b0010110001101
unordered0000001111111

F16_BITS / BF16_BITS: both words must have bits [31:16] zero; a 16-bit NaN equals any 16-bit NaN; everything else must match bit for bit (omega_numeric_compare_equal).

Status

OpCPU tierIndependent of the reference?GB10
13 FSETP_*_SELfcmp + fcsel (NE, EQU: two fcsel)yesencoded: FSETP.<P>.AND P0 + FSEL R9, R2, R5, P0
F2I_FLOOR / CEIL / RNIfcvtms / fcvtps / fcvtnsyesencoded: F2I.FLOOR.NTZ / F2I.CEIL.NTZ / F2I.NTZ (variable latency, STG waits on its scoreboard)
F2Ufcvtzuyesencoded: F2I.U32.TRUNC.NTZ (variable latency)
I2FP_U32ucvtfyesencoded: I2FP.F32.U32 (fixed latency)
F32_TO_F16 / F16_TO_F32fcvt between s and h registersyesencoded: F2F.F16.F32 (variable latency, stored unmasked: the hardware must write bits [31:16] = 0, which F16_BITS parity checks on every element) / HADD2.F32 R9, -RZ, R2.H0_H0 (the ptxas form of cvt.f32.f16)
F32_TO_BF16bfcvt (refused at run time if the CPU lacks BF16)yesencoded: F2F.BF16.F32 (variable latency, stored unmasked; BF16_BITS parity checks bits [31:16] = 0)
BF16_TO_F3216-bit shiftno: AArch64 has no scalar BF16 widening instruction, so the CPU tier is the same shift the definition is; the oracle is the separate checkencoded: SHF.L.U32 R9, R2, 0x10, RZ, the ptxas form of cvt.f32.bf16. Not an independent hardware conversion: it is the same 16-bit shift as the definition
FFMA_Vfmadd with per-element cyes (the reference is a 128-bit integer fma)encoded: LDC.64 R10, c[0x0][0x3a0] (the c pointer, kernel argument words 8..9), IMAD.WIDE.U32 R10, R9, 0x4, R10, LDG.E R11, FFMA R9, R2, R5, R11

GB10 encodings were added by E1 WP-C. Every instruction word decodes under nvdisasm 13.0.88 -b SM121 to the intended instruction (provenance table in src/omega_numeric_provenance.c); control words follow ptxas 13.0.88 sm_121 output. The structural checker (omega_numeric_check_patch) refuses a patch whose compare code, conversion mode or latency class does not match the op, whose first instruction does not wait on the a/b loads, whose multi-instruction form does not end with the STG + EXIT pair, or whose FFMA_V c path is not LDC.64 R10 / IMAD.WIDE.U32 / LDG.E R11 (both scoreboarded) / FFMA R9, R2, R5, R11, or in which an instruction that sets a scoreboard stalls fewer than 2 cycles before its waiter. That last rule comes from the chip: the first Gate 5 run (2026-10-01, FAIL receipt evidence/OMEGA-NUMERIC-0/d40f37f9f653e631b4c5e4b8c69dc8951b5bb0e74d4f102cb711441e718f111a.json, run on omega b0c7b9c, added to the repository on 2026-10-01 as a new file; its name is its internal receipt_digest, the file itself hashes to ef5db55e...) had the c load stall 1 cycle, the FFMA did not see the barrier and read the stale address word (2349 of 4096 mismatches); with stall 4 a chip diagnostic gave 4096 of 4096 correct. Gate 5 then PASSED on omega 7211b59 + physics e95e3ed (receipt f4f6d362..., in evidence/OMEGA-NUMERIC-0/): all 23 E1 scalar ops zero mismatches at n=4096. Fixed-latency instructions must also stall at least 5 cycles (the chip-proven ptxas value) and the FFMA_V LDG and IMAD words are checked in full. The checker is structural only: it cannot show that a word computes the right value. "Encoded" is not "correct on the chip": GB10 parity for each op is one Gate 5 parity line at n=4096 with zero mismatches under the manifest compare mode (tests/run_numeric_gates.sh, now 38 ops), recorded in the chip receipt.

How it is checked

Three derivations per element: the integer reference (src/omega_numeric.c), the CPU tier (AArch64 instructions, same file) and a second integer oracle written differently (tests/numeric_oracle.h).