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 / evidence / NG-A64-VEC / README.md

70 lines · 9286 bytes Raw Blame History Source

NG-A64-VEC: ARMv9.2-A 128-Bit Packed Float Vector Lowering in seed/ng

Evidence Level: HOST_TESTED (Linux AArch64 host CPU, Cortex-X925 + Cortex-A725; gate.om + rgate.om + ngbuild/gate.om + Lean 4 host check + Wolfram MCP; native x86, GPU, and target-device qualification NOT_RUN)

1. Seed Lineage (MEASURED)

2. ARMv9.2-A Advanced SIMD Lowering and Safety Invariants

seed/ng/src/a64.om and the differential reference interpreter seed/ng/ngrun.om support 16-byte packed IEEE-754 float vectors vec f32 4 (i_tk=1, i_t1=13, i_t2=4) and vec f64 2 (i_tk=1, i_t1=14, i_t2=2):

  1. Memory (58 vload, 59 vstore): LDR Qt, [Xn, #imm12*16] / STR Qt, [Xn, #imm12*16] (0x3dc00000 / 0x3d800000) for constant 16B-aligned offsets in [0, 65520], and ADD x15, XZR, idx, LSL #sz + LDR/STR Qt, [base, x15] (0x3ce06800 / 0x3c806800) for dynamic or unaligned element indices across REF and SLICE.
  2. Broadcast and Lane Extraction (100 vsplat, 101 vextract): DUP Vd.4S, Vn.S[0] (0x4e040400), DUP Vd.2D, Vn.D[0] (0x4e080400), DUP Sd, Vn.S[imm] (0x5e040400 | (imm << 19)), and DUP Dd, Vn.D[imm] (0x5e080400 | (imm << 20)).
  3. Packed IEEE-754 Arithmetic (10 add, 11 sub, 12 mul, 46 fma): FADD, FSUB, FMUL, and single-rounding FMLA on .4S (sz=0) and .2D (sz=1). Because FMLA Vd, Va, Vb computes Vd + Va * Vb, a6_vfma emits FMLA in place when Vd == Vc, routes through scratch v31 when Vd aliases Va or Vb, and copies Vc to Vd via ORR Vd.16B, Vc.16B, Vc.16B otherwise.
  4. AAPCS64 BL Clobber Safety, 16B Stack Slots, and Disjoint Parallel-Move Scratches: AAPCS64 preserves only the low 64 bits (d8..d15) of v8..v15 across subroutine calls; a6_alloc spills every 128-bit VEC (a_vf[w] == 2) live across a BL to a 16-byte even-aligned frame slot (a6_slot). Allocated 128-bit V registers occupy 600..628 (v0..v28), a6_mvbrk reserves 631 (v31) exclusively as the parallel-move cycle breaker, and a6_mvq uses disjoint scratch v30 for 16B slot-to-slot copies (700..955) so 2-slot backedge swaps across BL preserve both 128-bit vectors; 16B stack ABI arguments past v0..v7 use 3000 + ks.

3. Lean 4 Formal Verification (MODELED, Host-Checked)

4. Wolfram MCP Verification (MODELED + MEASURED Ratio Check)

5. Cortex-X925 Host CPU Speedup (HOST_TESTED / MEASURED)

Pinned to a dedicated ARMv9.2-A Cortex-X925 core (3.900 GHz, taskset -c 19 nice -n 10 under exclusive pool lock), 200 warmup sweeps followed by 5 timed trials of 40,960,000 element FMAs (81,920,000 FLOPs) per trial (48 KiB working set in L1D), measured with monons (CLOCK_MONOTONIC), zero manual loop unrolling:

KernelCompilerTrials (ns)Median (ns)Min (ns)Throughput (GFLOP/s, median)Cycles / elem-FMA (3.9 GHz)Median SpeedupOutput Bit Checksum
bench-f32-omc.om (N=4096 x 10000)seed/out/omc (scalar FMADD S)23870052, 23794820, 23299439, 23338512, 2330140723,338,51223,299,4393.510082.222531.00000x13209710276162606135
bench-v4f32.oir (N=4096 x 10000)@ng opt + @ng a64 (FMLA V.4S)7585465, 6914418, 6797249, 6932482, 68068336,914,4186,797,24911.84770.6583553.37534x (3.42777x min)13209710276162606135
bench-f64-omc.om (N=2048 x 20000)seed/out/omc (scalar FMADD D)23833604, 22990748, 22971068, 23003500, 2291892322,990,74822,918,9233.563172.189411.00000x2097136
bench-v2f64.oir (N=2048 x 20000)@ng opt + @ng a64 (FMLA V.2D)14088439, 13636195, 13673235, 13655539, 1363289913,655,53913,632,8995.999031.300211.68362x (1.68115x min)2097136

No new compiled binaries are committed (benchmark and gate ELFs were built in scratch; bench-v4f32 and bench-v2f64 ELF SHA-256s are unchanged under the v2 ng.units pin); exact source/compiler/binary/stdout SHA-256 digests are recorded in evidence/NG-A64-VEC/receipt.tsv.

6. Gate Verdicts (HOST_TESTED / MEASURED)