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 / seed / ng / bench / PREREG-payoff.md

132 lines · 8598 bytes Raw Blame History Source

PREREG: the M3 payoff map, hand-edited pass arms (lane ng-bench)

Committed and posted on the BOARD before any timing row of this round. Task: omp-queen-ng 2026-11-07T11:31:44Z ("for each of the 13 kernels, read omc's disassembly vs gcc -O2 and attribute the gap to causes, with a measured estimate where a hand-edited binary can test it"). Base: Radicle main da8b7e66. The harness, metric, interval and clean-block rule are the ones of PREREG.md and PREREG-contamination.md, unchanged.

What is measured

For 9 kernels, omc's own binary is edited by hand into a ladder of arms, each rung adding one compiler pass (or one bundle, named below) to the rung before it. Each rung is what that pass would emit on this code; the edit touches only the hot function or loop, everything else is omc's bytes. A rung's step factor is the time of the rung over the time of the rung below it, on the same block. The arms are models of passes, built by hand; they are not NG output.

kernelladder (rung = previous + pass)pass names used in the ranking
bcopyomc, ngL, ngB, ngVLICM+ROT, BCE, VEC
arithomc, ngL, ngMLICM+ROT, DIV
branchomc, ngL, ngCLICM+ROT, IFC
isortomc, ngL, ngBLICM+ROT, BCE
sortomc, ngL, ngBLICM+ROT, BCE
matmulomc, ngL, ngBLICM+ROT, BCE
sieveomc, ngL, ngBLICM+ROT, BCE
linearomc, ngL, ngB, ngFLICM+ROT, BCE, ISEL
leafcallomc, ngR, ngICALL, INL

Pass meanings (the spec files in hand/ state, per kernel, exactly what each rung changes and why it is legal):

Control arm ngA on every kernel: a byte-identical copy of omc's binary (A/A control, judged like gccO2aa in PREREG.md rule 2: its interval against omc contains 1 or its median lies in [0.99, 1.01]). Context arm gccO2: the baseline gcc -O2 binary.

Arms and binaries

Built by seed/ng/bench/hand.om (this commit; compiled by seed/out/omc sha256 cfd96b48…0d8a to hand sha256 f352309bee8789f37cb494f604042ba20dc695174cd9dfef2c742aa6de41a9d3) from three inputs per arm:

  1. hand/K-V.spec: the edit (directives @old check omc's original words, @at, @word, @nop), one instruction per case line with the expected disassembly after |.
  2. hand/K-V.words: the instruction words, encoded by the ng-a64 lane's encoder ng a64-enc (omega-mv ng/a64-m2 9c1bc18c2ed270010ac687cda9182436e66f192d, seed/ng/src/{ir,a64,main}.om, built by omc cfd96b48 to ng sha256 7221cc0d4a622db74975418bf5cace5789995516259cf77768c7b186e578a510). Words the encoder has no form for (the 6 SIMD words of bcopy-V) are literal @word lines.
  3. omc's binary of the kernel (seed/out/omc cfd96b48 and the baseline's 5f90edea emit identical bytes for all 9 kernels).

hand splice SPEC WORDS IN OUT writes the arm; `objdump -D -b binary -m aarch64 --adjust-vma=0x400000 OUT | hand check SPEC` must pass (every written word's disassembly equals the spec's text; objdump is the referee); the arm's stdout must have the kernel's kernels/want/K.sha256. All 20 arms pass all three (smoke on core 1, not a timing). The 47 binaries of the round, with their sha256, are hand/payoff-manifest.sha256.

Round

Fixture DIR /tmp/ngb/payrun: bin/ARM/CASE as in the manifest, want/ copied from kernels/want/. One invocation per core, ngbench v2 (binary sha256 ba6351527ef844836776dbaff44b782c5957225f35a172205ae4d77904ff0200):

ngbench run 31 3 DIR omc ngA ngL ngB ngV ngM ngC ngR ngI ngF gccO2 -- bcopy arith branch isort sort leafcall matmul sieve linear

roundcoreprefix
X9259flock -x -w 3600 ~/handoffs/hive/queen/pool-8-9.lock taskset -c 9 nice -n 10
A72511flock -x -w 3600 ~/handoffs/hive/queen/pool-10-11.lock taskset -c 11 nice -n 10

Absent arm/case pairs are skipped by ngbench. Start/end records as in PREREG.md. Rows go to evidence/<ts>-payoff/{x925,a725}/rows.txt, unedited.

Metric and statistics (fixed now)

Per block b, case c: r(X/Y, b) = (sum of X's two walls) / (sum of Y's two walls). Reported: median and the distribution-free 95% interval [r(k), r(n+1-k)] (PREREG.md; n = 31 gives k = 10), on all measured blocks and on the clean blocks (PREREG-contamination.md; the verdict uses the clean blocks when at least 21 remain).

Per case and core: every rung against omc, every rung against the rung below it (the step factor), every rung against gccO2, ngA/omc.

Ranking, per core type: for pass P, the measured step factors s(P, k) on the kernels where P has a rung; for every other of the 13 baseline kernels the factor is 1. Expected geomean gain of P = 1 / (product over the 13 kernels of s(P, k))^(1/13). Passes are ranked by it. Step factors depend on the ladder order (BCE is measured after LICM+ROT); that order is part of the result.

Kernels without a hand ladder in this round

Decision rules

Expectations, stated before the round

From the instruction counts per loop pass (omc vs each rung), every rung is expected to be faster than the rung below on both cores, with two exceptions where no difference is plausible: matmul (2400-byte column stride, expected to be memory-bound) and linear ngF (the loop is bound by the FADD latency chain). The core-1 smoke runs of bcopy were seen while building (omc 964 ms, ngL 720, ngB 272, ngV 42, gccO2 31 ms on a shared core); they are not evidence.

Known limits