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 / docs / runtime / API.md

577 lines · 40065 bytes Raw Blame History Source

Omega Runtime API v0

Omega Runtime API version: 0.1

Status: first written version, 2026-10-19 (slice R1, omega-mv#594, tracking #593). Source of truth is the C headers in src/. This file describes them; docs/runtime/omega_runtime_api.manifest lists them; make test-runtime-api checks the list against the headers (a host check, no GPU). Review state: the first version was reviewed by Opus 5.5 on 2026-10-22 (L386). The sections changed for main 62d1d0d6 (head 2908f13a) were reviewed again by a separate review lane (ApiReview594); its findings F1-F7 and N1-N5 are fixed in this version. Those fixes were reviewed at head 7be2c6f7 (Rev955), and its six findings are fixed too; docs/runtime/API-REVIEW.md records both reviews. The fixes of the second review have not been reviewed again. The check proves the list and every quoted C signature match the headers; prose is checked by review.

The version number lives in one header, src/omega_runtime_api.h (OMEGA_RUNTIME_API_VERSION_MAJOR, _MINOR).

1. What this is

Omega is a GPU compute runtime that does not use CUDA. This file is the written contract for the part a program calls directly: find and open the GPU, get memory, copy data in and out, run a kernel, run many kernels in one submission, run a packaged job, and read errors. It covers what exists on the main branch today, on one machine type (GB10, the DGX Spark), through the Linux open-driver backend. Nothing here claims more than that.

How to read an entry:

TierMeaning
STABLEUsed by other code in the project, covered by chip results, and kept compatible under the rule in section 2. Has its own #### section below.
EXPERIMENTALWorks and is listed, but may change in any minor version, because the design is still moving or only one use of it exists. Listed in tables with the reason.
INTERNALExists in a header for the project's own libraries or tests. Not part of the API; not in the manifest; may change or disappear any time. Every one declared in a manifest header is named in section 10, so nobody builds on it by accident (the check enforces that list).

Every C signature in this file is copied from the header it names. tools/runtime_api_check.sh re-checks every quoted signature against the headers on every run.

2. Version and compatibility rule

The version is MAJOR.MINOR, currently 0.1. It is a property of the list of entries and their behaviour, not of the library build.

A MINOR bump (0.1 to 0.2) is allowed to:

It needs a MAJOR bump (0.x to 1.0, then 1.x to 2.0) to:

MAJOR 0 means "the first written version", not "anything goes": the rule above already binds STABLE entries in 0.x. What 0 adds is a warning: the project may promote entries to STABLE freely until 1.0 (moving a STABLE entry down still needs a MAJOR bump, as above), and the first 1.0 will be cut only when section 8 (what v0 does not have) has been looked at again.

How it is enforced: a header change that moves any listed entry fails make test-runtime-api until the manifest line is edited on purpose (tools/runtime_api_check.sh --bless refreshes the numbers; the diff is reviewed). A reviewer then decides MINOR or MAJOR using the rule above and edits the version macros and the Omega Runtime API version: line in this file; the check fails if the three disagree. The check cannot tell whether the bump was the right size. That is a review duty.

The platform contract has its own number (OMEGA_GPU_PLATFORM_ABI_MAJOR 1, OMEGA_GPU_PLATFORM_ABI_MINOR 2, set in src/omega_gpu_platform.h). A platform minor bump needs at least a runtime MINOR bump; a platform major bump needs a runtime MAJOR bump.

3. How the pieces fit (plain English)

Device and platform. Omega talks to the GPU through a small "platform" layer: a table of services (a clock, a lock, device-visible memory, a submission queue, a way to poll for completion). Today one platform exists, the Linux reference (src/omega_gpu_platform_linux.c), which uses NVIDIA's open kernel driver. The contract is written so a second backend (WSL2 on Windows, or Aienux with no Linux driver) can fill the same table. A program normally never touches the platform: the first call that needs the GPU installs the Linux reference by itself. There is one device, one channel per process. There is no call to ask the device its name, SM count or memory size yet (section 8).

Memory. You ask the session for a buffer and get an OmegaGpuMem: a handle, a CPU pointer, a GPU address and a size. Every ordinary buffer is GPU-uncached, because the CPU writes inputs the chip reads and polls markers the chip writes. You make CPU writes visible to the GPU with omega_gpu_session_sync_to_gpu and GPU writes visible to the CPU with omega_gpu_session_sync_to_cpu. Code (the machine code of a kernel) lives in a separate kind of buffer (omega_gpu_session_alloc_code): the CPU writes it once, the GPU only executes it. Handles carry a generation number, so a handle from a closed device or an already freed buffer is refused instead of silently reused. A buffer you mean to reuse and grow, such as staging space, can be an OmegaGpuScratch. For read-only weights there is a GPU-cached allocation (omega_gpu_session_alloc_cached, EXPERIMENTAL). There is no async copy and no unified memory in v0.

Launch. One kernel launch is an OmegaGpuLaunch: where the code is, how many registers, the block and grid size, the argument words, shared memory, and a timeout. omega_gpu_session_launch submits it and waits for the chip to finish (it is synchronous). The wait is by polling a completion word, never by an interrupt.

Command lists. omega_gpu_cmdlist_* records many launches and submits them as one unit with one completion wait. By default each launch is preceded by a barrier so dependent launches cannot overlap; a launch can be marked independent. EXPERIMENTAL: streams, events and dependency-ordered execution are being built on top of it (omega-mv#580), so its options and statistics will grow.

Job engine. omega_gpu_execute runs one already-built job (today only a 1-D vector job: two inputs, one output) through named states and returns success or exactly one named failure. EXPERIMENTAL.

Errors, the latch and parked buffers.

Threads. One process-wide lock (the platform LOCK service, lock id OMEGA_GPU_SESSION_LOCK_ID, which is 0). A call sequence that touches the device (open, alloc, launch, readback) is done between omega_gpu_session_lock() and omega_gpu_session_unlock(). Threads therefore take turns on the one channel. The Linux reference lock is a plain (non-recursive) pthread mutex (locks[id], src/omega_gpu_platform_linux.c:45 and :141), so taking it twice from one thread deadlocks. These take the lock themselves and must be called without it: omega_gpu_session_close, omega_gpu_session_recover, omega_gpu_cmdlist_create, omega_gpu_cmdlist_free, and the section 9.5 calls that touch the device or a library cache (the compute and upload calls, omega_gpu_tensor_free, omega_gpu_matmul_cache_clear, omega_gpu_matmul_set_cta_budget, omega_gpu_matmul_prepare, omega_gpu_attention_pool_alloc, omega_gpu_attention_pool_free, the serving reserve, seal and release calls, and omega_gpu_device_close through omega_gpu_session_close). The section 9.5 accessors do not take the lock: omega_gpu_matmul_cta_budget, omega_gpu_tensor_shape, omega_gpu_matmul_rc_name, omega_gpu_matmul_last_error, omega_gpu_elementwise_rc_name, omega_gpu_attention_rc_name, omega_gpu_attention_last_error and omega_gpu_matmul_is_blocked (an atomic read); neither does the INTERNAL omega_gpu_elementwise_last_error (section 10). omega_gpu_matmul_cta_budget reads without the lock the value that omega_gpu_matmul_set_cta_budget writes under it (src/omega_gpu_matmul_api.c:146-153), so calling the two from different threads at once is a data race. omega_gpu_session_cancel may be called from any thread without the lock (header). omega_gpu_session_is_blocked reads the latch with an atomic load (src/omega_gpu_session.c:173), so it is safe without the lock too. omega_gpu_session_last_error returns a pointer into one process-wide text buffer: read it under the lock, before the next call.

3.1 A minimal sequence (sketch)

omega_gpu_session_lock();
OmegaGpuSession *s = omega_gpu_session_open();         /* NULL: see omega_gpu_session_last_error() */
OmegaGpuMem in, code;
omega_gpu_session_alloc(bytes, &in);                   /* GPU-uncached data buffer */
omega_gpu_session_alloc_code(code_size, &code);        /* write the machine code to code.cpu */
omega_gpu_session_sync_to_gpu(&in);
OmegaGpuLaunch L = { .code_va = code.va, .timeout_ms = 1000, /* gpr_count, threads_*, grid_*, args, n_args ... */ };
uint64_t elapsed_ns = 0; uint32_t marker = 0;     /* launch adds to elapsed_ns: start it at 0 */
int rc = omega_gpu_session_launch(&L, &elapsed_ns, &marker);
omega_gpu_session_sync_to_cpu(&in);
omega_gpu_session_free(&in);
omega_gpu_session_unlock();

This is a shape sketch, not a worked example (the worked example is slice R2).

4. Session: device, lock and state

omega_gpu_session_lock

STABLE: used by every library API and chip-proven; the lock model is the documented one.

void omega_gpu_session_lock(void);

Takes the process-wide session lock (platform LOCK service, id OMEGA_GPU_SESSION_LOCK_ID). Does not touch the device. In the hosted build the first call installs the Linux reference platform (pthread_once, src/omega_gpu_session.c:109-115), so it takes a real mutex. Freestanding build only: with no platform installed it does nothing, and the open that follows refuses.

omega_gpu_session_unlock

STABLE: pairs with the lock.

void omega_gpu_session_unlock(void);

omega_gpu_session_open

STABLE: used by every library API and chip-proven. Treat the returned pointer as "the device is open"; the fields of OmegaGpuSession are EXPERIMENTAL (the session's own launch buffers) and a caller needs none of them.

OmegaGpuSession *omega_gpu_session_open(void);

Caller holds the lock. Opens the device on first use. Returns NULL when the process is latched, no platform is installed or the open failed; the stage is in omega_gpu_session_last_error().

omega_gpu_session_is_open

STABLE: simple state query.

bool omega_gpu_session_is_open(void);

omega_gpu_session_is_blocked

STABLE: the latch query that every caller needs.

int omega_gpu_session_is_blocked(void);

Returns 1 once an uncertain completion has latched this process, else 0. Any thread.

omega_gpu_session_close

STABLE: the only way to close the device; its refusal after a latch is part of the error model.

void omega_gpu_session_close(void);

Closes the device and frees every session buffer. Takes the lock itself. Refused (a no-op) after an uncertain completion. The next open reopens; every handle of the closed device is stale from then on.

omega_gpu_session_open_count

STABLE: diagnostic with a fixed meaning.

uint32_t omega_gpu_session_open_count(void);

Device opens so far in this process (a persistent session shows 1).

omega_gpu_session_set_spin_us

STABLE: used by sovereign-core's binding; fixed meaning and limit.

int omega_gpu_session_set_spin_us(uint32_t us);

Process-wide marker-poll spin window, used by every launch whose own spin_us is 0. 0 (the default) keeps the platform's sleep-poll. Returns 0 on success, -1 above OMEGA_GPU_SESSION_MAX_SPIN_US (setting unchanged).

omega_gpu_session_spin_us

STABLE: reads the setting above.

uint32_t omega_gpu_session_spin_us(void);

5. Session: memory

All allocation calls need the caller to hold the lock with the device open.

OmegaGpuMem

STABLE: the buffer type every API passes around. A device buffer: a typed handle, its kind, the CPU view, the GPU virtual address and the size. A cpu of NULL means there is no CPU view.

FieldMeaning (from src/omega_gpu_session.h)
handleOmegaGpuBufferHandle: index and generation
kindOMEGA_GPU_HANDLE_BUF_DATA, _BUF_CODE or _BUF_QUEUE
cpuCPU view
vaGPU virtual address
sizebytes of both views

OmegaGpuBufferHandle

STABLE: a field of OmegaGpuMem, so its layout is part of it. { uint32_t index; uint32_t generation; }. Generation 0 is never issued, so a zeroed handle means "none". A handle is valid only while its slot generation matches; a closed handle is refused.

OmegaGpuDeviceHandle

STABLE: same shape and rule as the buffer handle; named in the platform contract. { uint32_t index; uint32_t generation; }.

OmegaGpuQueueHandle

STABLE: same shape and rule as the buffer handle; named in the platform contract. { uint32_t index; uint32_t generation; }.

omega_gpu_session_alloc

STABLE: the ordinary buffer call, used by every library.

int omega_gpu_session_alloc(size_t bytes, OmegaGpuMem *out);

A GPU-uncached DATA buffer, CPU and GPU read/write, rounded up to a page. Returns 0 on success; non-zero with the stage named on failure (the driver can refuse, for example with no memory; the refusal is counted in OmegaGpuAllocStats.alloc_failures).

omega_gpu_session_alloc_code

STABLE: the only way to place kernel code; chip-proven.

int omega_gpu_session_alloc_code(size_t code_size, OmegaGpuMem *out);

A CODE buffer (CPU writes, GPU executes, GPU never writes) for code_size bytes plus the 2 KB instruction-prefetch tail (src/omega_gpu_code_alloc.h), the tail zero-filled. The caller writes the code to out->cpu. A size of 0 still gets one page (omega_gpu_code_alloc_bytes rounds up to at least one page).

omega_gpu_session_free

STABLE: the release call; its latch behaviour is part of the error model.

void omega_gpu_session_free(OmegaGpuMem *m);

Releases m to the platform and zeroes *m. Latched: m is parked instead (never released). A stale handle (from a closed device) or a closed session is refused: nothing is released, the refusal is counted (OmegaGpuAllocStats.stale_refusals) and *m is zeroed.

omega_gpu_session_sync_to_gpu

STABLE: the visibility rule for CPU writes.

int omega_gpu_session_sync_to_gpu(const OmegaGpuMem *m);

Makes CPU writes to the whole buffer visible to the device (platform SYNC). Returns 0, also for a buffer with no CPU view; -1 with the stage named when refused or when there is no device.

omega_gpu_session_sync_to_cpu

STABLE: the visibility rule for GPU writes.

int omega_gpu_session_sync_to_cpu(const OmegaGpuMem *m);

Makes device writes to the whole buffer visible to the CPU. Same return values as sync_to_gpu.

OmegaGpuScratch

STABLE: the staging-buffer type the library APIs use. A caller-owned staging buffer that grows to its high-water mark: mem (an OmegaGpuMem), cap (usable bytes), high_water (largest request so far) and reserved (a serving reservation is active, see omega_gpu_session_scratch_reserve). Zero-initialise it before first use. This is required: omega_gpu_session_scratch reads reserved, cap, mem.cpu and high_water before it writes them (src/omega_gpu_session.c:315-321).

omega_gpu_session_scratch

STABLE: used by every library API.

int omega_gpu_session_scratch(OmegaGpuScratch *s, size_t bytes);

Makes s->mem at least bytes long (reallocated when it grows; contents are not kept). Returns 0 or -1; with a reservation active, a request past the reserved size returns OMEGA_GPU_SESSION_SCRATCH_RESERVED (-2) and allocates nothing.

omega_gpu_session_scratch_free

STABLE: the matching release.

void omega_gpu_session_scratch_free(OmegaGpuScratch *s);

OmegaGpuAllocStats

STABLE: used by sovereign-core's binding to show that serving asks the driver for nothing. Counters of driver allocations made through omega_gpu_session_alloc since the process started: allocs, alloc_bytes (page-rounded), alloc_failures, frees, stale_refusals. Covers the session layer only.

omega_gpu_session_alloc_stats

STABLE: reads the counters above.

void omega_gpu_session_alloc_stats(OmegaGpuAllocStats *out);

6. Session: launch

OmegaGpuLaunch

STABLE: the launch descriptor; chip-proven by every library. One launch: a kernel already resident at code_va, argument words for constant bank 0 at 0x380 (buffer addresses, then parameters), and the grid.

Argument layout and the checks omega_gpu_session_launch makes (src/omega_gpu_session.c:525-537):

FieldMeaning (from src/omega_gpu_session.h)
code_vaGPU address of the kernel code
gpr_countregisters the QMD (the launch descriptor the hardware reads) declares; multiple of 8, at least 64 in practice
threads_x, threads_yblock size
grid_x, grid_ygrid size
num_elementsQMD config num_elements (kept per API for identical words)
args, n_argsn_args words written at constant bank + 0x380; n_args at most OMEGA_GPU_SESSION_MAX_ARGS (32)
timeout_mscompletion poll limit, applied to each of the launch's two markers in turn (so a launch can wait up to twice this); past it the completion is uncertain and the process latches. Do not pass 0: the marker is then polled once (after the spin window, if any) and the launch latches unless the grid had already finished
shared_bytesshared memory per block; 0 = the default (1024)
spin_usspin-poll window before the platform's sleep-poll; 0 = the process-wide setting; at most OMEGA_GPU_SESSION_MAX_SPIN_US

omega_gpu_session_launch

STABLE: the single-kernel launch; chip-proven.

int omega_gpu_session_launch(const OmegaGpuLaunch *L, uint64_t *elapsed_ns, uint32_t *marker_out);

Caller holds the lock, device open, not latched. Submits one launch and polls for both completion markers, so it returns when the chip is done. 0 on success; -1 with the stage named on failure; OMEGA_GPU_SESSION_CANCELLED (-3) when a cancel request was seen. A marker timeout latches the process. elapsed_ns (submit to second marker) is added to when the pointer is given; marker_out receives the first marker word observed.

7. Session: errors, the latch, parked buffers

omega_gpu_session_last_error

STABLE: the error-model entry point.

const char *omega_gpu_session_last_error(void);

The stage of the most recent failure, "" if none. Shared by every API. Points into one process-wide buffer: read it under the lock, before the next call.

OmegaGpuParkStats

STABLE: the parked-buffer report. buffers (parked, listed plus untracked), untracked (parked past the listed OMEGA_GPU_SESSION_PARK_MAX = 512) and bytes.

omega_gpu_session_parked

STABLE: how a caller sees what the latch kept.

void omega_gpu_session_parked(OmegaGpuParkStats *out);

Buffers parked after an uncertain completion: kept allocated, never returned to the platform. The session's own launch buffers (ring, constant bank, marker, QMD page) are parked at the latch and every later free parks too.

omega_gpu_session_is_parked

STABLE: per-handle form of the above.

int omega_gpu_session_is_parked(OmegaGpuBufferHandle h);

1 if this handle is parked and listed.

8. Not in v0 (so nobody assumes it)

Each line is a gap named in docs/runtime/ROADMAP.md section 1 (on branch runtime/roadmap, not yet merged); the gaps themselves are not in the manifest.

9. EXPERIMENTAL entries

Listed in the manifest, may change in any minor version. Signatures are in the manifest and the headers; the names are checked there. The reason is why each is not STABLE yet.

9.1 Session extras (src/omega_gpu_session.h, src/omega_gpu_mem_cached.h)

EntryReason it is EXPERIMENTAL
omega_gpu_session_alloc_cachedGPU-cached memory is correct only for write-once, never-polled, GPU-read-only weights; the API cannot enforce that (the caller must).
omega_gpu_session_scratch_reserve, omega_gpu_session_scratch_unreserveServing-daemon feature (no driver call after warm-up); one user.
omega_gpu_session_cancelA cancel after submit cannot stop the chip: it latches the process. Semantics may tighten as recovery matures.
omega_gpu_session_recover, omega_gpu_session_recoveriesC5 recovery after a latch (evidence/C5-ISOLATION/): new on main after this API was first drafted; its device-close path is one backend's (Linux RM client close) behaviour and has no chip run yet (section 3). recover returns 0 when the latch is lifted, -1 with the reason named when nothing was latched (neither the process nor the command lists), no device is open, or the close was refused (then the process stays latched).
omega_gpu_session_extra_queueQueues 1..3 past the session queue, each with its own 64 KB ring; granted only when the device was opened with AIEN_OMEGA_GPU_CHANNELS > i. Work on different queues is not ordered. One backend, one user (the command-list pair).
omega_gpu_session_set_platform, omega_gpu_session_platform, omega_gpu_session_submit_prefix_words, omega_gpu_session_completion_mode, omega_gpu_session_now_nsTied to the platform contract, which has one real backend.
omega_gpu_host_alloc, omega_gpu_host_calloc, omega_gpu_host_freeCPU-only memory from the platform HOST_MEM service; the freestanding build needs them, hosted code can use malloc.
OmegaGpuSessionThe session's own launch buffers; a caller needs none of its fields.

9.2 Platform contract (src/omega_gpu_platform.h, ABI 1.2)

Types: OmegaGpuPlatform (the service table), OmegaGpuPlatformCaps, OmegaGpuBufferDesc, OmegaCpuView, OmegaGpuVa, OmegaGpuBusAddr, OmegaGpuHandleTable. Functions: omega_gpu_platform_refusal_name, omega_gpu_platform_negotiate, omega_gpu_platform_check, omega_gpu_platform_check_for, omega_gpu_platform_check_buffer, omega_gpu_handles_init, omega_gpu_handles_open, omega_gpu_handles_check, omega_gpu_handles_close. Enums and constants: the handle kinds, rights (OMEGA_GPU_RIGHT_*), cache policy, services (OMEGA_GPU_SVC_*) and refusal names (OMEGA_GPU_PLAT_*).

Reason: the contract is written for three backends but only the Linux reference has run; the second backend (rig/gb20x) and the native one will likely force changes. What it already promises (from the header): resources are typed handles with a generation; every byte range carries a length and rights; anything the CPU polls is OMEGA_GPU_RIGHT_HOST_POLLED and must be GPU-uncached; polling a word is never claimed as interrupt support; a missing service is refused, never emulated.

9.3 Command lists (src/omega_gpu_cmdlist.h)

Types: OmegaGpuCmdListOpts, OmegaGpuCmdListStats, the opaque OmegaGpuCmdList. Functions: omega_gpu_cmdlist_create (takes the lock itself), omega_gpu_cmdlist_free, omega_gpu_cmdlist_reset, omega_gpu_cmdlist_count, omega_gpu_cmdlist_add, omega_gpu_cmdlist_mark_independent, omega_gpu_cmdlist_submit, omega_gpu_cmdlist_is_latched, omega_gpu_cmdlist_stamps, omega_gpu_cmdlist_barrier_name, omega_gpu_cmdlist_submit_pair (list a on the session queue and list b on extra queue 1, both submitted before either is waited; caller holds the lock), omega_gpu_cmdlist_wait_for (C4 event: the next launch added waits on the chip for a launch of the other list of the pair). Up to OMEGA_GPU_CMDLIST_MAX_LAUNCHES (4096) launches per list. A list made before omega_gpu_session_recover is refused after it.

Reason: omega-mv#580 is building pipelined and dependency-ordered execution on this module, so the options, statistics and barrier modes will grow. The measured extra cost of each launch in a list is about 30 us with a wait-for-idle barrier (evidence/OWN30B-LAUNCH-COST-20261014T0120Z/r1/receipt.json, verdict FAIL on 4 of 11 checks). A timeout latches the list; the session latches as well only if the 1 ms check launch queued behind the list also times out (src/omega_gpu_cmdlist.c:233-240, section 3). The OMEGA_GPU_CMDLIST_BARRIER_NONE mode and skip_launch option are test-only. OmegaGpuCmdListOpts.first_barrier_none (C4 streams) drops the WAIT_FOR_IDLE and the shader-cache invalidate before launch 0 of a list. The caller must make sure the code, constant banks and QMDs that launch 0 reads are not in a stale cache line (fresh slots or unchanged contents), or launch 0 may read old bytes (src/omega_gpu_cmdlist.h:85-87). 0 keeps the barrier.

9.4 Job engine (src/omega_gpu_engine.h)

Types: OmegaGpuJob, OmegaGpuResult, OmegaGpuTimeouts, OmegaGpuBackend, OmegaGpuBackendDiag. Functions: omega_gpu_execute, omega_gpu_engine_set_backend, omega_gpu_engine_is_blocked, omega_gpu_engine_set_clock, omega_gpu_engine_failure_name, omega_gpu_engine_state_name, omega_gpu_engine_wait_name, omega_gpu_engine_step_name. One failure name per run (OMEGA_GPU_ENGINE_*), states INITIAL to SUCCESS, the failed step recorded, and an uncertain completion blocks every later omega_gpu_execute in the process with UNCERTAIN_COMPLETION_BLOCKED.

Reason: accepts one job shape (OMEGA_GPU_LAYOUT_VECTOR_1D); #580 widens it; the chip receipt for the vector-add job is on an unmerged branch (hive/DEEP2-A3-gpu-engine-impl). Note: the status paragraph at the top of omega_gpu_engine.h says only a fake backend exists; src/omega_blackwell_engine.c is on main and src/omega_blackwell_submit.c installs it, so that paragraph is out of date (whether it is chip-qualified on main is UNVERIFIED here).

9.5 Libraries (matmul, elementwise, attention, serving)

The entries carried over from aien-sovereign-core's manifest: src/omega_gpu_matmul_api.h, omega_gpu_elementwise_api.h, omega_gpu_attention_api.h, omega_gpu_serving.h (the functions and structs after the libraries comment in the manifest). Reason: shapes and formats follow one model (Qwen3-30B); there is no general any-shape GEMM yet (docs/runtime/ROADMAP.md 1.3, branch runtime/roadmap). They are the surface sovereign-core's Rust binding uses today. They are not described entry by entry in v0; their headers are the description. One value differs from sovereign-core's pinned copy: OMEGA_GPU_MATMUL_MAX_CTAS is 1024 in the header (changed by omega #473, commit 98cecadc), 64 in their manifest. Omega's manifest is canonical; R12 brings theirs level.

9.6 Library entries (manifest spelling)

Types are the manifest's Rust spelling (*const, *mut, u32, ...); the headers hold the C. Every entry here is EXPERIMENTAL.

EntrySignature
OmegaGpuMatmulInfostruct, 160 bytes (fields in the manifest)
OmegaGpuServingBoundsstruct, 44 bytes (fields in the manifest)
OmegaGpuEwInfostruct, 120 bytes (fields in the manifest)
OmegaGpuAttnInfostruct, 176 bytes (fields in the manifest)
OmegaGpuKvLayoutstruct, 64 bytes (fields in the manifest)
omega_gpu_matmul_bf16fn(u32, u32, u32, *const u16, *const u16, *mut f32, *mut OmegaGpuMatmulInfo) -> i32
omega_gpu_matmul_f32fn(u32, u32, u32, *const f32, *const f32, *mut f32, *mut OmegaGpuMatmulInfo) -> i32
omega_gpu_matmul_rc_namefn(i32) -> *const c_char
omega_gpu_matmul_cache_clearfn() -> ()
omega_gpu_tensor_upload_bf16fn(u32, u32, *const u16, *mut *mut OmegaGpuTensor) -> i32
omega_gpu_tensor_upload_f32fn(u32, u32, *const f32, *mut *mut OmegaGpuTensor) -> i32
omega_gpu_tensor_freefn(*mut OmegaGpuTensor) -> ()
omega_gpu_tensor_shapefn(*const OmegaGpuTensor, *mut u32, *mut u32) -> ()
omega_gpu_matmul_resident_bf16fn(u32, *const u16, *const OmegaGpuTensor, *mut f32, *mut OmegaGpuMatmulInfo) -> i32
omega_gpu_matmul_resident_f32fn(u32, *const f32, *const OmegaGpuTensor, *mut f32, *mut OmegaGpuMatmulInfo) -> i32
omega_gpu_matmul_last_errorfn() -> *const c_char
omega_gpu_matmul_is_blockedfn() -> i32
omega_gpu_device_closefn() -> ()
omega_gpu_matmul_set_cta_budgetfn(u32) -> ()
omega_gpu_matmul_cta_budgetfn() -> u32
omega_gpu_reserve_servingfn(*const OmegaGpuServingBounds) -> i32
omega_gpu_serving_releasefn() -> ()
omega_gpu_matmul_preparefn(u32, u32, u32) -> i32
omega_gpu_serving_sealfn() -> ()
omega_gpu_rmsnorm_f32fn(u32, u32, *const f32, *const f32, f32, *mut f32, *mut OmegaGpuEwInfo) -> i32
omega_gpu_rope_f32fn(u32, u32, *const f32, *const f32, *const f32, *mut f32, *mut OmegaGpuEwInfo) -> i32
omega_gpu_swiglu_f32fn(u32, *const f32, *const f32, *mut f32, *mut OmegaGpuEwInfo) -> i32
omega_gpu_elementwise_rc_namefn(i32) -> *const c_char
omega_gpu_gqa_attention_f32fn(*const f32, *const f32, *const f32, u32, u32, u32, u32, *mut f32, *mut OmegaGpuAttnInfo) -> i32
omega_gpu_gqa_attention_rows_f32fn(*const f32, *const f32, *const f32, u32, u32, u32, u32, u32, *mut f32, *mut OmegaGpuAttnInfo) -> i32
omega_gpu_attention_pool_allocfn(usize, *mut *mut c_void) -> i32
omega_gpu_attention_pool_freefn() -> ()
omega_gpu_paged_attention_bf16fn(*const f32, *const c_void, *const OmegaGpuKvLayout, *const u32, u32, u32, u32, u32, u32, u32, *mut f32, *mut OmegaGpuAttnInfo) -> i32
omega_gpu_paged_attention_batch_bf16fn(*const f32, *const c_void, *const OmegaGpuKvLayout, *const i32, *const i32, u32, u32, u32, u32, u32, u32, *mut f32, *mut OmegaGpuAttnInfo) -> i32
omega_gpu_attention_rc_namefn(i32) -> *const c_char
omega_gpu_attention_last_errorfn() -> *const c_char

10. INTERNAL (not part of the API)

Not in the manifest; may change or vanish without notice. Every external function a manifest header declares is either a manifest fn or named below as one of the leading names of a bullet (the names before any other text; names in the prose after them do not count); make test-runtime-api fails on any other, and on a name that is both (section 11).

Session (src/omega_gpu_session.h):

Job engine (src/omega_gpu_engine.h):

Matmul (src/omega_gpu_matmul_api.h):

Elementwise (src/omega_gpu_elementwise_api.h):

Attention (src/omega_gpu_attention_api.h):

Everything else under src/omega_gpu_* and src/omega_blackwell_* in headers the manifest does not list (kernel builder, encoder, per-model APIs, launch helpers).

11. Checking this file

make test-runtime-api runs tools/runtime_api_check.sh on the real headers and then tools/runtime_api_negative.sh, which breaks a copy of the headers, the manifest or this file in sixteen ways and requires the check to fail each time: a removed function (twice: a STABLE one and the EXPERIMENTAL omega_gpu_session_recover), a missing version macro, a changed function signature, a changed struct, a changed constant, a version line in this file that disagrees with the macro, a quoted signature in this file that no header has, a quoted signature that only appears inside a longer one (int32_t inside uint32_t), a STABLE entry with no section here, a removed struct field the manifest lists (OmegaGpuCmdListOpts.first_barrier_none), a new function in a manifest header with no manifest line, the same for a function that returns a function pointer, an INTERNAL function dropped from section 10, a manifest fn dropped from the manifest while section 10's prose still mentions it (omega_gpu_serving_seal), and a manifest fn also listed as INTERNAL. It needs no GPU and no physics checkout. It checks: every manifest function against its header with exact types; sizes, offsets and constants against a compiled probe; the version macros against the manifest and this file; that every STABLE entry has a #### section here and every EXPERIMENTAL one is named here; that every C signature quoted in this file appears verbatim in a header; and, with gcc's -aux-info, that every external function a manifest header declares is either a manifest fn or a leading name of a section-10 bullet, never both, and every such name is still declared (another compiler fails the check with "needs a compiler with -aux-info"). It does not check that the prose is true. Not seen: a new struct or constant (nothing to compare it with), a field added inside padding that the manifest does not list, a field that changes type but keeps its size, and a constant value quoted in prose.

Where it runs: the gate OMEGA-RUNTIME-API (tests/gates/omega-runtime-api.gate, requires portable) runs make test-runtime-api through tests/gates/run.sh runtime-api. The Spark judge runs it on a pull request that touches its inputs. The hosted AIEN Checks job runs the portable gates it finds on main (.github/workflows/aien-verification.yml), so it runs there from the first pull request after the gate file is on main. It needs gcc (for -aux-info), make, perl, sed and a POSIX awk.