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 / OMC-EFF-1 / baseline / RESULT.md

193 lines · 13175 bytes Raw Blame History Source

OMC-EFF-1 baseline: seeded omc at 3364a1dfd against gcc C twins

Protocol: bench/omc_efficiency/PROTOCOL.md, sha256 ae1d1b2ace22bd30993f2ac14965d0e5ec62d9d66ae4b4e9521a417e5c74033a, frozen in commit 951de2ebbeb4c1859b00fd34b230844a5448c6a2 (pushed as perf/omc-efficiency-baseline before the run). Subject: omc sha256 befb8199db8c4bca188a494dfaac2a6f0ee5c36fcea11188c75666c55fce8a1d (omega-mv 3364a1dfd0ca50c1b82bf19ba34932d8bc10a7a9). Oracle: gcc 13.3.0, -O2 -static; reference -O0 -static. Counters: perf 7.0.14. Host: DGX Spark GB10, Linux 7.0.0-1019-nvidia aarch64, pinned to CPU 19 (Cortex-X925, 3.9 GHz max), nice -n 19. Run 2026-10-26T15:44:03Z, one declared run, no rerun. Load average 8.69 at start, 12.84 at end (shared machine, not quiesced). Evidence level: MEASURED on the host. No GPU, no hardware qualification.

Validity (PROTOCOL section 5): VALID

  1. Build mode S rows=231 ok=231 fail=0, exit 0: every compile reproduced its reference bytes.
  2. Run mode S rows=1176 ok=1008 fail=0 ctl_detected=168 ctl_missed=0, exit 0: every real run printed exactly the Wolfram-computed want/ bytes with status 0, and all 168 mutant runs were rejected.
  3. instructions:u max/min per (case, arm): 1.000000 everywhere (omc counts are exact; C counts vary by at most 6 instructions out of 10^8..10^9).
  4. selftest.log: 8/8 PASS (wrong expected output, a matching control and a wrong build reference are each rejected with exit 1; usage errors exit 2).

Programs: omc / cO2 (21 paired rounds; median, 95% interval x(6)..x(16), coverage 0.9734)

Wall time, ns (fork to waitpid; includes process start for every arm):

caseomc median (min..max)cO2 median (min..max)cO0 medianomc/cO2 [95%]cO0/cO2
arith120,363,347 (120,128,019..131,565,960)35,852,097 (35,555,230..86,354,432)94,693,4393.360 [3.330, 3.378]2.641
branch146,681,886 (146,221,258..156,999,736)73,802,818 (73,447,792..80,432,100)323,109,1601.990 [1.982, 1.995]4.380
fib136,641,182 (136,264,684..144,773,307)34,252,340 (33,986,147..40,070,096)127,913,8363.994 [3.977, 4.006]3.744
leafcall53,621,560 (53,315,126..57,753,015)15,994,361 (15,839,353..17,105,794)74,065,7313.356 [3.337, 3.375]4.619
sieve247,316,647 (245,635,791..270,673,536)117,503,563 (113,403,103..167,831,344)812,642,7592.106 [2.091, 2.124]6.942
isort78,189,234 (77,843,169..90,237,389)39,867,615 (39,209,643..61,337,954)206,951,5151.969 [1.642, 1.984]5.181
matmul18,708,718 (17,968,137..23,529,955)11,049,684 (10,777,170..15,572,646)54,098,3631.649 [1.631, 1.679]4.867
geometric mean2.5014.458

cycles:u:

caseomc median (min..max)cO2 median (min..max)cO0 medianomc/cO2 [95%]cO0/cO2
arith466,359,514 (466,352,624..466,366,074)137,155,005 (136,296,806..137,825,193)366,588,5973.400 [3.397, 3.404]2.669
branch568,927,996 (568,018,955..571,182,142)284,832,276 (283,429,655..285,060,372)1,254,539,8151.998 [1.994, 2.001]4.404
fib529,388,142 (528,460,166..529,601,480)131,049,850 (130,844,037..131,539,402)495,489,9314.039 [4.035, 4.041]3.782
leafcall206,421,156 (206,280,480..206,676,054)60,159,623 (60,104,451..60,628,561)285,165,0203.431 [3.427, 3.433]4.741
sieve955,533,448 (950,618,663..957,973,873)447,702,787 (439,154,071..453,280,552)3,155,639,0652.133 [2.119, 2.139]6.993
isort301,626,421 (301,569,474..301,814,221)151,062,954 (150,952,156..193,948,563)797,423,3641.997 [1.944, 1.998]5.261
matmul67,395,948 (67,169,838..68,539,499)39,089,179 (38,825,474..39,942,959)205,095,9511.723 [1.720, 1.729]5.253
geometric mean2.5454.556

instructions:u (deterministic):

caseomccO2cO0omc/cO2cO0/cO2
arith680,000,770560,095,6591,520,095,5681.2142.714
branch2,029,124,699929,136,3741,951,393,2442.1842.100
fib2,340,101,671994,852,2301,834,228,3152.3521.844
leafcall870,000,917360,095,751930,095,6672.4162.583
sieve7,139,388,4691,376,344,6416,084,501,5055.1874.421
isort2,707,063,875802,211,0602,506,926,3663.3753.125
matmul600,130,654164,893,584630,920,6783.6403.826
geometric mean2.6672.825

All statistics: WolframLanguageEvaluator over the raw rows in wl-data.m (wolfram-wall.txt, wolfram-cyc.txt, wolfram-ins.txt). Plainly: omc's programs take 2.5x the time of gcc -O2 across the suite (1.65x to 3.99x per case). Against gcc -O0 the median paired wall ratio omc/cO0 per case is arith 1.273, branch 0.454, fib 1.067, leafcall 0.725, sieve 0.305, isort 0.378, matmul 0.342; geometric mean 0.562, i.e. omc is 1.78x faster than -O0 overall but slower than -O0 on arith and fib (wolfram-prose-checks.txt).

Compile time (10 rounds) and code size

caseomc median nscO2 median nscO0 median nsomc/cO2
arith511,64435,498,735.532,269,4460.0146
branch489,62036,202,78832,404,015.50.0135
fib489,98045,761,781.531,654,7540.0105
leafcall504,31636,416,254.532,256,278.50.0138
sieve532,46839,186,435.532,505,4080.0134
isort532,32439,581,00633,418,6950.0132
matmul517,82041,386,17233,052,6930.0121

Geometric mean omc/cO2 compile time 0.0130 (gcc time includes cc1, as and the static link; both include fork and exec). Code size: omc ELF bytes (whole program: 176-byte header, putnum, trap stubs, entry) against all .text* bytes of gcc -c of the twin:

caseomc filecO2 .text*cO0 .text*omc/cO2omc/cO0
arith7281642444.442.98
branch7921482645.353.00
fib78010641560.735.00
leafcall7761322205.883.53
sieve10802884523.752.39
isort13723606283.812.18
matmul12444567922.731.57

Geometric means 3.27 (omc/cO2) and 2.78 (omc/cO0). Deviation, stated: the protocol named the .text section; at -O2 gcc places main in .text.startup, so the declared column (sizes.txt) reads 0 for arith, branch, isort and matmul. The table above sums every .text* section of the same objects (size -A), a correction made after the run; both columns are kept. The omc figure also counts the ELF header and runtime stubs, which the C objects do not; it is not a like-for-like kernel size.

Where omc's instructions go (PROTOCOL section 7, MODELED, reconciled)

Every instruction of every omc hot path was classified (attribution-labels.tsv) and multiplied by trip counts computed with Wolfram (attribution-blocks.tsv, wolfram-attribution-queries.txt, results wolfram-attribution.txt). Every case reconciles with the MEASURED instruction total to better than 1.1e-6 (the residual is the putnum calls and the 5-word entry, left out of the model). Classes: CONST = mov/movk of an immediate (loop limits, array lengths for bounds checks, global base addresses, the while-guard limit 1000000, operands); BOUNDS = the run-time index check (cmp, b.hs trap 3); GUARD = the while pass counter (cmp, b.hs trap 4, add); CALLSAVE = stack check, str/ldr of registers around calls, sp adjust; CALL = bl/ret; CTRL = loop and condition compares and branches; WORK = the rest.

classinstructions (suite)share of omc instructionsshare of excess over cO2
CONST5,039,477,59930.8%45.1%
CTRL3,351,060,36820.5%30.0%
WORK3,062,412,05818.7%27.4%
CALLSAVE1,907,904,38811.7%17.1%
GUARD1,347,302,2718.2%12.1%
BOUNDS1,344,666,8548.2%12.0%
CALL312,984,0721.9%2.8%

(omc total 16,365,811,055; cO2 total 5,187,629,299; excess 11,178,181,756; shares of excess add to more than 100% because cO2 also executes control and work instructions.)

Per case (CONST as a share of that case's excess; IPC = instructions per cycle, from the medians):

caseexcess instructionsCONST / excessexcess cyclesomc IPCcO2 IPClargest omc class
arith119,905,1111.668329,204,5091.464.08WORK 52.9% (udiv + msub for rem t 1000003)
branch1,099,988,3250.402284,095,7203.573.26CTRL 37.1%, CONST 21.8%, GUARD 19.4%
fib1,345,249,4410.000398,338,2924.427.59CALLSAVE 64.9%
leafcall509,905,1660.235146,261,5334.215.99CALLSAVE 44.8%
sieve5,763,043,8280.565507,830,6617.473.07CONST 45.6%
isort1,904,852,8150.421150,563,4678.975.31CONST 29.6%
matmul435,237,0700.50128,306,7698.904.22CONST 36.4%

Hotspot facts for the compiler owner

  1. Loop-invariant immediates are re-materialized on every pass (MEASURED count, MODELED split). omc emits mov/movk for the same constant at each use inside the loop: the loop limit at every head (for with a number count above 4095, every while guard limit 1000000), the array length before each bounds check, the global base address before each load or store, and operand constants (mul h 31, rem t 1000003, mix i 2654435761). Example, matmul inner loop (disasm/matmul.omc.s 0x2e0..0x334): 22 instructions per pass, 8 of them mov/movk of 90000 (twice), the base of ma and the base of mb. gcc -O2: 6 per pass (ldr, add, ldr post-index, madd, cmp, b.ne). This class is 45.1% of the suite's excess instructions, the largest single class. Caveat: X925 issues wide; where omc's IPC is 7.5..9 (sieve, isort, matmul) these extra instructions cost few cycles, so the cycle gain from removing them is smaller than their instruction share. [INFERENCE until measured]
  2. Call save/restore stores every in-use register, live or dead, and reloads through the stack (MEASURED count). fib (disasm/fib.omc.s 0x204..0x274): 24 save/restore/stack-check instructions per non-leaf invocation of fib, which makes two calls (WolframLanguageEvaluator: (1517903654-14)/(Fibonacci[39]-1) -> 24; 14 are main's), including stores of x1 before it is written, of the argument temporary x2/x3, and a reload of x0 after the last use of n; the argument is reloaded from its save slot instead of moved. CALLSAVE is 64.9% of fib's and 44.8% of leafcall's instructions; fib has the largest cycle ratio in the suite (4.04x) and the largest wall ratio (3.99x). In leafcall the 2-instruction constant argument 2654435761 is also re-materialized each call.
  3. Division and remainder by a constant use udiv (MEASURED cycles, mechanism [INFERENCE]). arith: omc executes only 1.21x gcc's instructions but 3.40x its cycles; omc IPC 1.46 against 4.08. gcc replaces t % 1000003 with umulh/shift/msub (disasm/arith.cO2.s); omc emits udiv + msub (disasm/arith.omc.s 0x228..0x234). The same pattern sits in matmul's fill (rem .. 13, rem .. 11), isort's generator (rem .. 2147483648, a power of two, and rem .. 100000) and in every putnum (rem x 10, div x 10).
  4. Loop shape: every loop tests at the top and jumps back unconditionally (CTRL, 20.5% of omc instructions); gcc tests at the bottom. The while guard (GUARD, 8.2%) and bounds checks (BOUNDS, 8.2%) are mandatory Omega semantics, not removable without a proof; their limit constants are counted under CONST.
  5. Register pressure refusal: the direct matmul inner expression add s mul get ma add mul i 300 k get mb add mul k 300 j is refused with error 12 (more than 16 registers); the kernel names the row and column walk instead (PROTOCOL section 2).

Ranking by excess cycles (MEASURED): sieve 507.8M, fib 398.3M, arith 329.2M, branch 284.1M, isort 150.6M, leafcall 146.3M, matmul 28.3M (total 1,844,600,951). Which compiler change converts the most of that into time is not measured here: it needs the section 8 A/B on a candidate compiler.

What was not run

Files

run.raw, build.raw (conductor rows), provenance.txt, inputs.sha256 (protocol, conductor, run.sh, kernels, want), arms.sha256 (every binary run), sizes.txt (declared size column), selftest.log, wl-data.m (the rows as Wolfram data), wolfram-*.txt (every statistic), attribution-*.tsv, wolfram-attribution*.txt, disasm/ (omc and gcc -O2 disassembly).

Replay: git checkout 951de2eb && sh bench/omc_efficiency/run.sh seed/out/omc OUTDIR 19, then the queries in wolfram-*.txt on the new rows.