Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/blob/main/evidence/OMC-EFF-1/baseline/RESULT.md # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `omega-mv / evidence / OMC-EFF-1 / baseline / RESULT.md` 193 lines ยท 13175 bytes Raw Blame History Rendered 1 # OMC-EFF-1 baseline: seeded omc at `3364a1dfd` against gcc C twins 2 3 Protocol: `bench/omc_efficiency/PROTOCOL.md`, sha256 4 ``ae1d1b2ace22bd30993f2ac14965d0e5ec62d9d66ae4b4e9521a417e5c74033a``, frozen in commit 5 ``951de2ebbeb4c1859b00fd34b230844a5448c6a2`` (pushed as `perf/omc-efficiency-baseline` before the run). 6 Subject: omc sha256 ``befb8199db8c4bca188a494dfaac2a6f0ee5c36fcea11188c75666c55fce8a1d`` (omega-mv 7 ``3364a1dfd0ca50c1b82bf19ba34932d8bc10a7a9``). Oracle: gcc 13.3.0, `-O2 -static`; reference `-O0 -static`. 8 Counters: perf 7.0.14. Host: DGX Spark GB10, Linux 7.0.0-1019-nvidia aarch64, pinned to CPU 19 9 (Cortex-X925, 3.9 GHz max), `nice -n 19`. Run 2026-10-26T15:44:03Z, one declared run, no rerun. 10 Load average 8.69 at start, 12.84 at end (shared machine, not quiesced). Evidence level: MEASURED on the 11 host. No GPU, no hardware qualification. 12 13 ## Validity (PROTOCOL section 5): VALID 14 15 1. Build mode `S rows=231 ok=231 fail=0`, exit 0: every compile reproduced its reference bytes. 16 2. Run mode `S rows=1176 ok=1008 fail=0 ctl_detected=168 ctl_missed=0`, exit 0: every real run printed 17 exactly the Wolfram-computed `want/` bytes with status 0, and all 168 mutant runs were rejected. 18 3. `instructions:u` max/min per (case, arm): 1.000000 everywhere (omc counts are exact; C counts vary 19 by at most 6 instructions out of 10^8..10^9). 20 4. `selftest.log`: 8/8 PASS (wrong expected output, a matching control and a wrong build reference 21 are each rejected with exit 1; usage errors exit 2). 22 23 ## Programs: omc / cO2 (21 paired rounds; median, 95% interval x(6)..x(16), coverage 0.9734) 24 25 Wall time, ns (fork to waitpid; includes process start for every arm): 26 27 | case | omc median (min..max) | cO2 median (min..max) | cO0 median | omc/cO2 [95%] | cO0/cO2 | 28 |---|---|---|---|---|---| 29 | arith | 120,363,347 (120,128,019..131,565,960) | 35,852,097 (35,555,230..86,354,432) | 94,693,439 | 3.360 [3.330, 3.378] | 2.641 | 30 | branch | 146,681,886 (146,221,258..156,999,736) | 73,802,818 (73,447,792..80,432,100) | 323,109,160 | 1.990 [1.982, 1.995] | 4.380 | 31 | fib | 136,641,182 (136,264,684..144,773,307) | 34,252,340 (33,986,147..40,070,096) | 127,913,836 | 3.994 [3.977, 4.006] | 3.744 | 32 | leafcall | 53,621,560 (53,315,126..57,753,015) | 15,994,361 (15,839,353..17,105,794) | 74,065,731 | 3.356 [3.337, 3.375] | 4.619 | 33 | sieve | 247,316,647 (245,635,791..270,673,536) | 117,503,563 (113,403,103..167,831,344) | 812,642,759 | 2.106 [2.091, 2.124] | 6.942 | 34 | isort | 78,189,234 (77,843,169..90,237,389) | 39,867,615 (39,209,643..61,337,954) | 206,951,515 | 1.969 [1.642, 1.984] | 5.181 | 35 | matmul | 18,708,718 (17,968,137..23,529,955) | 11,049,684 (10,777,170..15,572,646) | 54,098,363 | 1.649 [1.631, 1.679] | 4.867 | 36 | geometric mean | | | | 2.501 | 4.458 | 37 38 `cycles:u`: 39 40 | case | omc median (min..max) | cO2 median (min..max) | cO0 median | omc/cO2 [95%] | cO0/cO2 | 41 |---|---|---|---|---|---| 42 | arith | 466,359,514 (466,352,624..466,366,074) | 137,155,005 (136,296,806..137,825,193) | 366,588,597 | 3.400 [3.397, 3.404] | 2.669 | 43 | branch | 568,927,996 (568,018,955..571,182,142) | 284,832,276 (283,429,655..285,060,372) | 1,254,539,815 | 1.998 [1.994, 2.001] | 4.404 | 44 | fib | 529,388,142 (528,460,166..529,601,480) | 131,049,850 (130,844,037..131,539,402) | 495,489,931 | 4.039 [4.035, 4.041] | 3.782 | 45 | leafcall | 206,421,156 (206,280,480..206,676,054) | 60,159,623 (60,104,451..60,628,561) | 285,165,020 | 3.431 [3.427, 3.433] | 4.741 | 46 | sieve | 955,533,448 (950,618,663..957,973,873) | 447,702,787 (439,154,071..453,280,552) | 3,155,639,065 | 2.133 [2.119, 2.139] | 6.993 | 47 | isort | 301,626,421 (301,569,474..301,814,221) | 151,062,954 (150,952,156..193,948,563) | 797,423,364 | 1.997 [1.944, 1.998] | 5.261 | 48 | matmul | 67,395,948 (67,169,838..68,539,499) | 39,089,179 (38,825,474..39,942,959) | 205,095,951 | 1.723 [1.720, 1.729] | 5.253 | 49 | geometric mean | | | | 2.545 | 4.556 | 50 51 `instructions:u` (deterministic): 52 53 | case | omc | cO2 | cO0 | omc/cO2 | cO0/cO2 | 54 |---|---|---|---|---|---| 55 | arith | 680,000,770 | 560,095,659 | 1,520,095,568 | 1.214 | 2.714 | 56 | branch | 2,029,124,699 | 929,136,374 | 1,951,393,244 | 2.184 | 2.100 | 57 | fib | 2,340,101,671 | 994,852,230 | 1,834,228,315 | 2.352 | 1.844 | 58 | leafcall | 870,000,917 | 360,095,751 | 930,095,667 | 2.416 | 2.583 | 59 | sieve | 7,139,388,469 | 1,376,344,641 | 6,084,501,505 | 5.187 | 4.421 | 60 | isort | 2,707,063,875 | 802,211,060 | 2,506,926,366 | 3.375 | 3.125 | 61 | matmul | 600,130,654 | 164,893,584 | 630,920,678 | 3.640 | 3.826 | 62 | geometric mean | | | | 2.667 | 2.825 | 63 64 All statistics: WolframLanguageEvaluator over the raw rows in `wl-data.m` (`wolfram-wall.txt`, 65 `wolfram-cyc.txt`, `wolfram-ins.txt`). Plainly: omc's programs take 2.5x the time of gcc -O2 across the 66 suite (1.65x to 3.99x per case). Against gcc -O0 the median paired wall ratio omc/cO0 per case is 67 arith 1.273, branch 0.454, fib 1.067, leafcall 0.725, sieve 0.305, isort 0.378, matmul 0.342; geometric 68 mean 0.562, i.e. omc is 1.78x faster than -O0 overall but slower than -O0 on arith and fib 69 (`wolfram-prose-checks.txt`). 70 71 ## Compile time (10 rounds) and code size 72 73 | case | omc median ns | cO2 median ns | cO0 median ns | omc/cO2 | 74 |---|---|---|---|---| 75 | arith | 511,644 | 35,498,735.5 | 32,269,446 | 0.0146 | 76 | branch | 489,620 | 36,202,788 | 32,404,015.5 | 0.0135 | 77 | fib | 489,980 | 45,761,781.5 | 31,654,754 | 0.0105 | 78 | leafcall | 504,316 | 36,416,254.5 | 32,256,278.5 | 0.0138 | 79 | sieve | 532,468 | 39,186,435.5 | 32,505,408 | 0.0134 | 80 | isort | 532,324 | 39,581,006 | 33,418,695 | 0.0132 | 81 | matmul | 517,820 | 41,386,172 | 33,052,693 | 0.0121 | 82 83 Geometric mean omc/cO2 compile time 0.0130 (gcc time includes cc1, as and the static link; both 84 include fork and exec). Code size: omc ELF bytes (whole program: 176-byte header, putnum, trap stubs, 85 entry) against all `.text*` bytes of `gcc -c` of the twin: 86 87 | case | omc file | cO2 `.text*` | cO0 `.text*` | omc/cO2 | omc/cO0 | 88 |---|---|---|---|---|---| 89 | arith | 728 | 164 | 244 | 4.44 | 2.98 | 90 | branch | 792 | 148 | 264 | 5.35 | 3.00 | 91 | fib | 780 | 1064 | 156 | 0.73 | 5.00 | 92 | leafcall | 776 | 132 | 220 | 5.88 | 3.53 | 93 | sieve | 1080 | 288 | 452 | 3.75 | 2.39 | 94 | isort | 1372 | 360 | 628 | 3.81 | 2.18 | 95 | matmul | 1244 | 456 | 792 | 2.73 | 1.57 | 96 97 Geometric means 3.27 (omc/cO2) and 2.78 (omc/cO0). Deviation, stated: the protocol named the `.text` 98 section; at -O2 gcc places `main` in `.text.startup`, so the declared column (`sizes.txt`) reads 0 for 99 arith, branch, isort and matmul. The table above sums every `.text*` section of the same objects 100 (`size -A`), a correction made after the run; both columns are kept. The omc figure also counts the 101 ELF header and runtime stubs, which the C objects do not; it is not a like-for-like kernel size. 102 103 ## Where omc's instructions go (PROTOCOL section 7, MODELED, reconciled) 104 105 Every instruction of every omc hot path was classified (`attribution-labels.tsv`) and multiplied by 106 trip counts computed with Wolfram (`attribution-blocks.tsv`, `wolfram-attribution-queries.txt`, 107 results `wolfram-attribution.txt`). Every case reconciles with the MEASURED instruction total to 108 better than 1.1e-6 (the residual is the putnum calls and the 5-word entry, left out of the model). 109 Classes: CONST = `mov`/`movk` of an immediate (loop limits, array lengths for bounds checks, global 110 base addresses, the while-guard limit `1000000`, operands); BOUNDS = the run-time index check 111 (`cmp`, `b.hs` trap 3); GUARD = the while pass counter (`cmp`, `b.hs` trap 4, `add`); CALLSAVE = 112 stack check, `str`/`ldr` of registers around calls, `sp` adjust; CALL = `bl`/`ret`; CTRL = loop and 113 condition compares and branches; WORK = the rest. 114 115 | class | instructions (suite) | share of omc instructions | share of excess over cO2 | 116 |---|---|---|---| 117 | CONST | 5,039,477,599 | 30.8% | 45.1% | 118 | CTRL | 3,351,060,368 | 20.5% | 30.0% | 119 | WORK | 3,062,412,058 | 18.7% | 27.4% | 120 | CALLSAVE | 1,907,904,388 | 11.7% | 17.1% | 121 | GUARD | 1,347,302,271 | 8.2% | 12.1% | 122 | BOUNDS | 1,344,666,854 | 8.2% | 12.0% | 123 | CALL | 312,984,072 | 1.9% | 2.8% | 124 125 (omc total 16,365,811,055; cO2 total 5,187,629,299; excess 11,178,181,756; shares of excess add to more 126 than 100% because cO2 also executes control and work instructions.) 127 128 Per case (CONST as a share of that case's excess; IPC = instructions per cycle, from the medians): 129 130 | case | excess instructions | CONST / excess | excess cycles | omc IPC | cO2 IPC | largest omc class | 131 |---|---|---|---|---|---|---| 132 | arith | 119,905,111 | 1.668 | 329,204,509 | 1.46 | 4.08 | WORK 52.9% (udiv + msub for `rem t `1000003``) | 133 | branch | 1,099,988,325 | 0.402 | 284,095,720 | 3.57 | 3.26 | CTRL 37.1%, CONST 21.8%, GUARD 19.4% | 134 | fib | 1,345,249,441 | 0.000 | 398,338,292 | 4.42 | 7.59 | CALLSAVE 64.9% | 135 | leafcall | 509,905,166 | 0.235 | 146,261,533 | 4.21 | 5.99 | CALLSAVE 44.8% | 136 | sieve | 5,763,043,828 | 0.565 | 507,830,661 | 7.47 | 3.07 | CONST 45.6% | 137 | isort | 1,904,852,815 | 0.421 | 150,563,467 | 8.97 | 5.31 | CONST 29.6% | 138 | matmul | 435,237,070 | 0.501 | 28,306,769 | 8.90 | 4.22 | CONST 36.4% | 139 140 ## Hotspot facts for the compiler owner 141 142 1. **Loop-invariant immediates are re-materialized on every pass** (MEASURED count, MODELED split). 143 omc emits `mov`/`movk` for the same constant at each use inside the loop: the loop limit at every 144 head (`for` with a number count above 4095, every `while` guard limit `1000000`), the array length 145 before each bounds check, the global base address before each load or store, and operand constants 146 (`mul h 31`, `rem t `1000003``, `mix i `2654435761``). Example, matmul inner loop (`disasm/matmul.omc.s` 147 0x2e0..0x334): 22 instructions per pass, 8 of them `mov`/`movk` of 90000 (twice), the base of `ma` 148 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 149 instructions, the largest single class. Caveat: X925 issues wide; where omc's IPC is 7.5..9 150 (sieve, isort, matmul) these extra instructions cost few cycles, so the cycle gain from removing 151 them is smaller than their instruction share. [INFERENCE until measured] 152 2. **Call save/restore stores every in-use register, live or dead, and reloads through the stack** 153 (MEASURED count). fib (`disasm/fib.omc.s` 0x204..0x274): 24 save/restore/stack-check instructions 154 per non-leaf invocation of fib, which makes two calls (WolframLanguageEvaluator: 155 `(`1517903654`-14)/(Fibonacci[39]-1)` -> `24`; 14 are main's), including stores of x1 before it is written, of the argument temporary x2/x3, 156 and a reload of x0 after the last use of `n`; the argument is reloaded from its save slot instead 157 of moved. CALLSAVE is 64.9% of fib's and 44.8% of leafcall's instructions; fib has the largest 158 cycle ratio in the suite (4.04x) and the largest wall ratio (3.99x). In leafcall the 2-instruction 159 constant argument ``2654435761`` is also re-materialized each call. 160 3. **Division and remainder by a constant use `udiv`** (MEASURED cycles, mechanism [INFERENCE]). 161 arith: omc executes only 1.21x gcc's instructions but 3.40x its cycles; omc IPC 1.46 against 4.08. 162 gcc replaces `t % `1000003`` with `umulh`/shift/`msub` (`disasm/arith.cO2.s`); omc emits `udiv` + 163 `msub` (`disasm/arith.omc.s` 0x228..0x234). The same pattern sits in matmul's fill (`rem .. 13`, 164 `rem .. 11`), isort's generator (`rem .. `2147483648``, a power of two, and `rem .. 100000`) and in 165 every putnum (`rem x 10`, `div x 10`). 166 4. **Loop shape**: every loop tests at the top and jumps back unconditionally (CTRL, 20.5% of omc 167 instructions); gcc tests at the bottom. The `while` guard (GUARD, 8.2%) and bounds checks (BOUNDS, 168 8.2%) are mandatory Omega semantics, not removable without a proof; their limit constants are 169 counted under CONST. 170 5. **Register pressure refusal**: the direct matmul inner expression 171 `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 172 registers); the kernel names the row and column walk instead (PROTOCOL section 2). 173 174 Ranking by excess cycles (MEASURED): sieve 507.8M, fib 398.3M, arith 329.2M, branch 284.1M, isort 175 150.6M, leafcall 146.3M, matmul 28.3M (total 1,844,600,951). Which compiler change converts the most 176 of that into time is not measured here: it needs the section 8 A/B on a candidate compiler. 177 178 ## What was not run 179 180 - No candidate compiler and no A/B (PROTOCOL section 8 is declared, not exercised). 181 - No `perf record` or other per-instruction cycle attribution; the cycle mechanisms in facts 1..3 are 182 [INFERENCE] from instruction counts, IPC and disassembly. 183 - No GPU, no hardware qualification, no quiesced machine. 184 185 ## Files 186 187 `run.raw`, `build.raw` (conductor rows), `provenance.txt`, `inputs.sha256` (protocol, conductor, 188 run.sh, kernels, want), `arms.sha256` (every binary run), `sizes.txt` (declared size column), 189 `selftest.log`, `wl-data.m` (the rows as Wolfram data), `wolfram-*.txt` (every statistic), 190 `attribution-*.tsv`, `wolfram-attribution*.txt`, `disasm/` (omc and gcc -O2 disassembly). 191 192 Replay: `git checkout `951de2eb` && sh bench/omc_efficiency/run.sh seed/out/omc OUTDIR 19`, then the 193 queries in `wolfram-*.txt` on the new rows.