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 / numeric / E1_DIVSQRT_GB10.md

203 lines · 10941 bytes Raw Blame History Source

E1 row 7: correctly rounded FP32 DIV and SQRT on the GB10

Status: see "Result" at the end. This page covers gap-table row 7 in E1_GAP_TABLE.md.

What this closes

The GB10 (Blackwell, sm_121) now has its own FP32 divide and square root kernels. Each one gives the same bits as the CPU semantic omega_math_div / omega_math_sqrt, which is the IEEE 754 result: round to nearest even, subnormal inputs and outputs kept (no flush to zero), and every NaN result returned as the canonical quiet NaN 0x7fc00000. The comparison on the chip is against the AArch64 FDIV / FSQRT instructions and against omega_math_*. Both must match, with zero mismatches.

How the kernels work

Neither kernel uses the hardware's approximate reciprocal or square root units (MUFU), and neither uses floating-point multiply-add. Each one does the whole operation with exact integer arithmetic, the same way the CPU semantic does, so the rounding is exact by construction:

Every shift amount on a path that affects the result stays inside [0, 31].

Kernel layout

PartWords
Prologuethe 17 vecadd words, unchanged: thread index, bounds check, addresses, LDG a into R2, LDG b into R5
Body13 instruction forms, all PT-guarded, control word 0x010fde00
Epiloguevecadd STG [R6.64], R9, EXIT, BRA
PaddingNOPs up to a multiple of 8

About the body control word 0x010fde00: it means stall 15, no barrier set, and wait on scoreboard SB4. SB4 is the write barrier both vecadd LDGs set. Every body instruction is fixed-latency, so stall 15 is the conservative ptxas -O0 pattern for this class.

The QMD allocates 48 registers. The hardware reserves the top two of the allocation: a 32-register QMD faulted (Xid 13, "Out Of Range Register") on the LOG2, SIGMOID and TANH bodies, which use R30 and R31 (receipt 1dc85ef2, kept as NOT_RUN). DIV and SQRT write R8 through R27 and R9; the transcendental bodies use up to R31. No body touches R1, R6, R7 or the uniform registers.

Provenance (no invented encodings)

Pre-submission checks

Each check in src/omega_numeric_divsqrt_gb10.c is one line that ends in a CHECK: marker. tools/divsqrt_check_sweep.sh deletes each check in turn and shows that the host tier then fails.

CheckWhat it guards
ds_opthe op is known
ds_lenthe kernel length is valid
ds_prologuethe prologue is identical to the vecadd prologue
ds_epiloguethe kernel ends with STG, EXIT, BRA
ds_padthe padding is NOPs only
ds_bodythe body is not empty and not oversize
ds_guardno body instruction is predicated
ds_ctrlevery body control word is the fixed control word
ds_formsevery body word decodes and re-encodes to the same bits (a recorded form)
ds_def_useno register is read before it is written
ds_pred_def_useno predicate is read before it is written
ds_reservedthe body never writes R1, R6 or R7
ds_gprevery register fits inside the QMD allocation, below the two registers the hardware reserves at its top
ds_resultthe last body instruction writes R9
ds_digestthe kernel digest equals the recorded nvdisasm-verified digest
ds_args_op, ds_buffers, ds_countarguments
ds_qmd, ds_qmd_gpr, ds_qmd_codethe QMD

Verification

TierCoverage
Host (make test-divsqrt-host)encoder round trips; one refusal per check; a host model of the exact body (register-level interpreter) against FDIV/FSQRT and omega_math_* on the hard corpus from tests/test_omega_numeric.c, the edge set and 200k random samples
Host, long--host-sqrt-all runs all 2^32 SQRT inputs through the host model; --host-div N runs N random DIV pairs
Chip (tools/run_divsqrt_gate.sh)SQRT: all 2^32 inputs. DIV: 7 batches of 2^24 pairs (117,440,512), with batch 0 starting with the corpus and the edge set

The DIV edge set covers:

The DIV random pairs are stratified across five shapes:

The receipt is ~/workspace/evidence-out/E1-DIVSQRT/<sha256>.json (mode 0444). It records:

The script refuses to run on a dirty tree.

Result

Three chip runs, all receipts kept (none overwritten), all under ~/workspace/evidence-out/E1-DIVSQRT/, physics pinned at e95e3ed:

RunOmega commitVerdictReceipt (sha256)What it showed
1f2a6a19FAIL88930d2f03f98ba50e09a3a3e53ae17278e0f6b0c72a1b535e20ae74857e55c2DIV correct. 49,359,680 SQRT outputs still held the 0x55555555 fill: the host read results after the completion marker but before the stores were visible. Fix: wait for the QMD release semaphore (value 6) and a barrier before reading.
29bd4de2PASSdaa1d6235373f2e7cae97c410094d4d0aeb43dbe680baafe5aa2ffd70227fed5Same numbers as run 3 below.
39b5756ePASSde7b2dd6a930ae94529773cf4e31aa08aac7065602b1d771e13e6ed2784a9074Rerun after the Codex review fixes (gate exit status, commit binding, sweep crash handling, QMD high address bits, thread checks). Kernel words unchanged. This is the receipt of record.

Run 3 numbers:

Review: Codex (gpt-6-astra, read-only sandbox) found no arithmetic blocker and four MAJOR plus one MINOR integrity issues in the gate tooling; all five were fixed in 9b5756e before run 3.

Not done here: the kernels are not yet called from omega_numeric_gb10.c (owned by another lane), so omega_numeric still refuses DIV/SQRT on GB10 until that wiring lands.

Row 10: natural EXP and LOG

The same frame and encoder carry two more whole-program kernels: the E1 OP_TABLE ops EXP and LOG, bit-identical to omega_math_exp / omega_math_log of src/omega_numeric.c (built with -ffp-contract=off, so every C operator is one unfused binary32 operation). The bodies are body_exp / body_log in src/omega_numeric_divsqrt_gb10.c.

OpWordsKernel sha256Float ops (all unfused, in C order)
EXP88b0214f4b0c8416411fdd897d640b45b27da16b92e117f57b02c6abb2f1350cb613 FMUL, 9 FADD (FSUB as FADD with a negated operand), 1 I2FP
LOG312be4f782381c34169670e45e500fd1f0afa0cc7bcfcec9f8e6aca8a41b0029a9e9 FMUL, 6 FADD, 3 I2FP; z = (m-1)/(m+1) is the row 7 DIV sequence (integer, correctly rounded)

Neither kernel contains MUFU or FFMA. EXP truncates prod +/- 0.5 toward zero from the float bits (integer shift, exact for every input that reaches it), converts k with I2FP (exact for |k| <= 150), and builds 2^k, 2^127, 2^(k+100) and 2^-100 by writing exponent fields, then selects the branch the C takes. LOG splits exponent and mantissa as the C does (subnormals scaled by 2^23 first) and calls the DIV core for z.

Host evidence (not hardware): the host model of the emitted bodies against omega_math_exp / omega_math_log over all 2^32 inputs, 0 mismatches each (build/test_omega_numeric_transc_gb10_cpu --host-all EXP / LOG). Full-domain output digests (tree of tests/test_omega_transc.c): EXP 413c342928951fb078a3f6ecdc56221f26a2a6b19a1b7e099227bf38c1c2829c, LOG 05e94f63d078b9d460bc94305389a874216c6cb50d2d462b8d4bd0943c86f51e. make test-numeric-transc-gb10-mutants builds EXP with c2 one ulp up and LOG with c1 one ulp up; each must fail a host-model check. nvdisasm 13.0.85 and sm121dis decode all 88 + 312 words to the encoder's text (tools/divsqrt_nvdisasm_check.sh). Chip run: tools/run_numeric_transc_gate.sh (default op list includes EXP and LOG). Chip PASS on the GB10, 2026-10-27, omega cb6d201, physics 048e5f5: EXP and LOG each over all 2^32 inputs, 0 mismatches, 0 unwritten, output digests equal to the host-model digests above (receipt evidence/E1-TRANSC-GB10/b2f4afe91148931db0f10f40edec9b8cce4533db99ec8e7d9733492794fa2b0e.json, chip log blobs/ea7a32198c71b30b6682f53a556bf01d02d1a765e32c632e970f51330d6c92ef.log).