interplane.Get Omega
Read in your language

omega-kernel-template

aien-dev/omega-kernel-template

Brought by drakestapleton

branch main Branches Tags History

omega-kernel-template / README.md

114 lines · 6525 bytes Raw Blame History Source

omega-kernel-template

Write a small kernel in Omega, push, and get a receipt: the same kernel.om compiled by the pinned Omega compiler, run natively on AArch64 and as SPIR-V on PoCL's CPU OpenCL device, and checked case by case against a Python reference. It runs on GitHub's ubuntu-24.04-arm runners (free for public repositories), in about half a minute. No GPU, no CUDA toolkit, no local install.

Quickstart

  1. Click Use this template → Create a new repository (or: gh repo create my-kernel --template aien-dev/omega-kernel-template --public --clone).
  2. Edit kernel.om, and give each fn its expected answer in reference.py (optional: pin your own inputs in cases.tsv).
  3. Commit and push.
  4. Open the run under Actions: the summary says PASS or FAIL per case, and the omega-kernel-receipt artifact holds receipt.json, kernel.spv, the AArch64 disassembly and SHA256SUMS.

What one run does

steptoolwhere it runs
kernel.om → OSC IRomc, the Omega compiler, fetched from aien-dev/omega-mv at a pinned commit and sha256runner CPU
IR → SPIR-V 1.0 OpenCL kernelirspirv.om, the Omega SPIR-V translator, compiled by that same omcrunner CPU
validatespirv-val --target-env opencl2.1; the translator must also be byte-for-byte deterministicrunner CPU
run SPIR-VPoCL 7.2 CPU device (one work-item per case)runner CPU
run nativeomc compiles each case to an AArch64 Linux programrunner CPU
expected valuesreference.py in CPythonrunner CPU

A case passes when the AArch64 result equals reference.py and the SPIR-V result equals the AArch64 result bit for bit (a trap must be the same trap on both). The check runs your cases.tsv lines plus edge values and 32 seeded random inputs per fn, so the same commit always checks the same cases. A wrong kernel fails: the branch demo/wrong-kernel uses the textbook (a + b) / 2, which overflows uint, and its run is red (20 of 138 cases differ) while main passes all 138.

Honest scope

Files you edit

Run it on your own AArch64 Linux machine

Ubuntu 24.04 on arm64, from a clean checkout:

sudo apt-get install -y --no-install-recommends clang-18 libllvm18 libllvmspirvlib18.1 \
  ocl-icd-libopencl1 ocl-icd-opencl-dev spirv-tools curl
sh tools/fetch.sh
sh tools/check.sh

check.sh exits 0 for PASS, 1 for FAIL and 3 for NOT_RUN (wrong platform or missing tool), and writes build/summary.md and build/receipt/. On x86-64 it reports NOT_RUN: the native half needs AArch64.

Pins and receipts

toolchain.lock pins the omega-mv commit, the sha256 of omc, irspirv.om, opencl-host.c and parity.py, and the sha256 of the PoCL release asset. tools/fetch.sh refuses any file whose hash differs. The PoCL asset is built from source on the same runner image by .github/workflows/toolchain.yml and self-tested with the demo kernel before it is published. receipt.json (schema omega-kernel-receipt/1) records the verdict, run URL, commit, pins, hashes of the built translator, host, kernel.ir and kernel.spv, the Ubuntu package versions, the OpenCL device PoCL reported, and every differing case.

What is interim

The kernel compiler and the SPIR-V translator are Omega. The glue around them is not yet:

Connected repos

License

Apache-2.0; see LICENSE and NOTICE.

Human-Directed Agentic Engineering

Development follows Human-Directed Agentic Engineering (HDAE): humans define goals, architecture, constraints, acceptance criteria, and stopping points; agents implement, execute checks, diagnose failures, and revise within those boundaries. Human review retains responsibility for claims, acceptance, and release decisions. Generated receipts remain evidence of the checks they record, not a substitute for human acceptance.

For the documented method and a systems-software case study, see Gregory M. Kurtzer, [*Ginux: Building an Independent Kernel That Runs Linux Userspace through Human-Directed Agentic Engineering* (2026)](https://doi.org/10.5281/zenodo.23682548).