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 / tensix

64d6db3 Repin consumers to aperture compiler on full queue object base Drake Stapleton committed 2026-11-13
..
README.md10754
a.hex576
b.hex576
boot-qemu.s21008
boot-tt.s21067
edges.expect787
edges.s21143
expect.hex576
gate-tensix.sh17898
irrv32.om6614
mix-expect.hex576
mix.expect238
mix.unit.om197
oracle.py7092
rv32im.tbl4554
vecadd.bin44
vecadd.expect158
vecadd.s21240
vecadd.unit.om125

README.md

seed/tensix: vecadd for the Tenstorrent Tensix RISC-V cores

Each Tensix tile on Tenstorrent Wormhole (n150, n300) and Blackhole (p100, p150) cards contains five small RISC-V cores: RISCV B, NC, T0, T1 and T2. This directory writes a 32-bit integer vector add for these cores, out[i] = a[i] + b[i] modulo 2^32, and checks the result with outside tools.

There are two producers of the kernel words, and the gate requires them to agree byte for byte.

  1. Seeded Omega (irrv32.om). seed/out/omc builds irrv32.om into an AArch64 program. That program reads the OSC IR v1 of a scalar unit (fn addu a uint b uint to uint, in vecadd.unit.om) and lifts it into the elementwise loop out[i] = f(a[i], b[i]). The words are built from instruction fields inside Omega.
  2. Rung 6, as in seed/sm121. The unchanged rung-2 assembler seed/rung2/asm2.bin reads a plain-text instruction table, rv32im.tbl (all 48 RV32I + M instructions), and hand-written listings.

No C, Rust or Python program produces any instruction word.

seed/out/omc < seed/tensix/irrv32.om > irrv32 && chmod +x irrv32
{ printf 'ir\n'; cat seed/tensix/vecadd.unit.om; } | seed/out/omc | ./irrv32 > vecadd.bin   # 44 bytes

irrv32 accepts exactly one function that takes two uint parameters and returns uint. The function must be a single block that uses only CONST (emitted as lui+addi), MOV (addi), BIN add/sub/mul/and/or/xor, and RET. It may use at most 7 vregs, which map to x5-x7 and then x14-x17. div, rem, shl and shr are refused, because Omega traps on a zero divisor or an out-of-range shift and this kernel has no trap path. Other types, control flow and calls are also refused. Every refusal sets a nonzero exit code (20-28) and writes no bytes.

FileWhat it is
rv32im.tblRV32IM encodings as asm2 table lines. Registers are written as numbers 0-31, because asm2's register parser uses ARM names.
irrv32.omSeeded Omega emitter: OSC IR v1 scalar uint unit → RV32IM elementwise kernel.
vecadd.unit.omThe scalar unit ret add a b. Its emitted kernel must equal vecadd.bin.
mix.unit.om, mix.expect, mix-expect.hexA second unit, ((a+b)*3000000000) xor a, which exercises CONST, MOV, mul and xor. It comes with its hand-written disassembly and 64 expected words.
vecadd.s2The kernel: 11 instructions, 44 bytes. a0 = a, a1 = b, a2 = out, a3 = n; it returns through ra.
vecadd.binThe committed kernel bytes. The gate rebuilds them twice and requires the same bytes both times.
boot-tt.s29 instructions placed at L1 0x0, where RISCV B starts after reset. It loads the arguments from 0x1000, calls vecadd, then writes the done mark 0x0600d000 to 0x1010 and spins.
boot-qemu.s2Linux user-mode start code for qemu. It calls vecadd, then makes the write(1, out, 4n) and exit(0) system calls.
edges.s2, edges.expectEvery table entry once, with fields at their edge values. edges.expect is the disassembly written by hand before any disassembler was run.
vecadd.expectThe expected disassembly of the kernel.
a.hex, b.hex, expect.hex64 little-endian words each. The first six are hand-picked edge cases; 61 of the 64 sums wrap.
oracle.pyThe oracle driver: interop oracle, not Omega-native, and it never generates kernels. It loads ttsim and talks to it over PCIe the way a host driver would, or wraps an image in an ELF file for qemu.
gate-tensix.shThe gate script.

Expected values were computed in Wolfram with this query: WolframLanguageEvaluator: a=Join[{0,2^32-1,2^31,2^31-1,2^32-1,16^^12345678}, Table[Mod[2654435761(i+1),2^32],{i,6,63}]]; b=Join[{0,1,2^31,1,2^32-1,16^^87654321}, Table[Mod[2^32-1-40503 i^2+977 i,2^32],{i,6,63}]]; Mod[a+b,2^32]. It reported 64 words, of which 61 have a+b ≥ 2^32. mix-expect.hex uses the same a and b with BitXor[Mod[Mod[a+b,2^32]*3000000000,2^32],a]. The CONST split for 3000000000 is lui 0xb2d06, addi -512, also from Wolfram.

Run

mkdir -p build/oracle/ttsim-v1.15.0 && cd build/oracle/ttsim-v1.15.0
for a in wh bh; do curl -LO https://github.com/tenstorrent/ttsim/releases/download/v1.15.0/libttsim_${a}_aarch64.so; done
sha256sum libttsim_*   # the gate refuses anything but the pinned sha256 values below
cd - && nice -n 19 sh seed/tensix/gate-tensix.sh   # 0 PASS, 1 FAIL, 3 NOT_RUN

The host must be AArch64 Linux, because asm2.bin is an AArch64 program. The gate also needs:

  • riscv64-unknown-elf-objdump and riscv64-unknown-elf-objcopy;
  • llvm-objdump (version 18);
  • qemu-riscv32;
  • python3.

If any of these, or a ttsim library, is missing, the gate prints NOT_RUN and exits with code 3.

What the gate checks

All of these checks are interop oracles, not Omega-native.

  1. Same bytes every build. Each image is assembled twice and both builds must match byte for byte. The kernel must also equal the committed vecadd.bin, and both start images must end with exactly those bytes. omc (pinned sha256) builds irrv32.om twice; both builds must be identical. irrv32 emits each unit twice. Its vecadd output must be byte-identical to asm2's vecadd.bin. GNU objdump must print exactly mix.expect for the mix kernel.
  2. Two independent disassemblers.
    • GNU objdump must print exactly vecadd.expect and edges.expect. These cover all 48 table names: 51 words in total.
    • LLVM objdump must agree with GNU on every mnemonic and register.
  3. Three runs that compare results. The kernel runs on:
    • ttsim Wormhole (Tensix tile (1,1));
    • ttsim Blackhole (Tensix tile (1,2));
    • qemu-riscv32.

    Each run must give all 64 sums equal to expect.hex. On ttsim, the output buffer is first filled with 0xee bytes, so a kernel that never ran cannot pass. The Omega-emitted vecadd and mix kernels then run on the same three oracles, behind the same start code, against expect.hex and mix-expect.hex.

  4. Negative controls. Every one of these must be caught:
    • C1: one bit flipped in the table (add becomes sub). Caught by GNU objdump and by ttsim.
    • C2: one wrong expected value.
    • C3: the wrong register in the listing. Caught by qemu.
    • C4: one wrong branch-offset bit. ttsim stops with "invalid pc".
    • C5: an out-of-range immediate. asm2 refuses it.
    • C6: the unit mutated from add to sub. The emitted bytes change, and ttsim's output differs.
    • C7: the emitter mutated (a0 stride 8). Caught by qemu.
    • C8: a div unit. irrv32 refuses it with exit 24 and emits 0 bytes.

What is established, and what is NOT

Established (EXERCISED on oracles, 2026-10-26):

  • The table encodes RV32IM the way two independent disassemblers read it.
  • The kernel computes the right sums on ttsim's models of Wormhole B0 and Blackhole A0 RISCV B, and on qemu.
  • Seeded Omega (irrv32.om) emits the same vecadd bytes from the scalar unit's OSC IR, and a second kernel (mix) that is correct on the same three oracles.

NOT established:

  • Nothing has run on a Tenstorrent card (NOT_RUN on hardware).
  • ttsim is Tenstorrent's software model, not silicon.
  • The fp32 SFPU path and the Tensix coprocessor (matrix unit) are not used.
  • irrv32.om covers straight-line u32 scalar bodies only. Signed types, traps, control flow, loops inside the body and Tensix coprocessor instructions are not lowered.
  • Only RISCV B is used, on a single tile.
  • There is no NoC traffic, no DRAM, and no tt-metal runtime.

What is open (sources read 2026-10-26)

  • tt-isa-documentation at be833101 (code Apache-2.0, images CC BY-ND 4.0; LICENSE_understanding.txt notes that patent rights may be needed). It documents:
    • the baby RISC-V cores. Wormhole is RV32IM. Blackhole adds Zicsr, Zaamo, Zba, Zbb, part of F/Zfh, and .ttinsn; T2 also has V.
    • L1, soft reset, the PCIe TLB windows and NoC coordinates;
    • about 120 Tensix coprocessor instructions, each with a bit-encoding diagram and a functional model (for example TensixCoprocessor/MVMUL.md).

    Coprocessor instructions are pushed by RISC-V sw (BabyRISCV/PushTensixInstruction.md). So the RISC-V level, the coprocessor instruction level, and the host-to-tile path are all documented well enough for Omega to emit code without closed tools.

  • ttsim (Apache-2.0), source at b3620244. Release v1.15.0 was published 2026-10-25. Pinned libraries:
    • libttsim_wh_aarch64.so: e2a56ffe04072a10d477db1ef85cdbd5d392d9fc52043bb949b90a4c01ff6b4f;
    • libttsim_bh_aarch64.so: 2367dccc964c0ce4a20b14520e5f7ac6191bb227fb20e87aca1e94bf7432ced2.
  • tt-metal, tt-umd, sfpi (GCC-based SFPU compiler) and tt-llk are Apache-2.0. tt-kmd (the kernel driver) is GPL-2.0. Licences were read from the GitHub API on 2026-10-26. None of these is used here.
  • RISC-V Unprivileged ISA 20191213, chapters 2, 7 and 24, for the instruction formats.

Before a hardware receipt

  1. A card. An n150 or p150 card, or Tenstorrent cloud access. I have neither.
  2. The kernel driver. tt-kmd (GPL-2.0) must be loaded to map BAR0. The same TLB and soft-reset sequence that oracle.py uses on ttsim then works on the card. tt-umd does this from C++.
  3. Firmware and tile choice. On real cards the ARC firmware and the tt-metal firmware own the tiles. A raw run must use a tile that nothing else is using and must restore soft reset afterwards. Harvested rows and columns change which NoC coordinates are Tensix tiles.
  4. Running beyond one tile. NoC reads and writes are needed for DRAM inputs and for using many tiles.
  5. What the receipt must contain.
    • the card model and serial;
    • the firmware version;
    • the tt-kmd version;
    • the image sha256;
    • the tile coordinates;
    • the output compared with expect.hex;
    • the same negative controls, run on the card.

Host dependencies (oracles only)

DependencyVersionRoleOmega replacement
GNU objdumpbinutils 2.42disassemblernone needed (read-only oracle)
LLVM objdump18.1.3second disassemblernone needed (read-only oracle)
ttsimv1.15.0Tensix simulatornone needed (vendor oracle)
qemu-riscv328.2.2RV32 executornone needed (read-only oracle)
Python3.12.3oracle.py byte transportan .om host loader (dlopen/FFI word plus ELF byte writer; proposal)