Golden-token merge gate for the own Omega LLM (DRA-52, Core #853)
A fixed prompt set is decoded greedily on the GB10 by the candidate's own kernels and compared token
by token with a committed reference decoded by an independent path: the same tree's f64 CPU forward
(model.om), not the f32 GB10 kernels (gpu/gk.om, gpu/gr.om, gpu/gg.om, gpu/gb.om) the gate
checks. The model is the own Omega LLM (aien-train native/omegallm). The 35B and every outside model
are retired and are not used here (Linear P-DRA-7, DRA-162).
Every judgment and every sequencing step is .om compiled by a pinned seeded omc: gate.om judges,
drive.om builds, records and runs the gate. No shell script carries logic; host programs (git, tar,
env, sh and the tools aien-train's own tests/omegallm/build.sh calls) are exec'd by absolute path
with an empty environment.
| File | Role |
|---|---|
gdec.om | Greedy decoders, appended to an aien-train tree's gb10 composition: gtcpu (CPU, f64) and gtgpu (GB10, f32, all prompts in one batch, one ggfwd per step). Prints one T k s id top1_e9 margin_e9 line per token. |
gate.om | rec makes the reference record from a gtcpu run; cmp judges a gtgpu run against it. Hashes the checkpoint, merges and prompt file itself (om/vendor/sha256.om). |
drive.om | The driver (omc omega-mv bf54b19f, built with om/golden/build.sh; run from the repository root). build OMC TRAIN REV OUT [NEG] resolves REV to one commit in a private repository OUT/src.git, snapshots that commit with git archive there (never TRAIN's working tree, replace refs, grafts or info/attributes), builds it with the snapshot's own tests/omegallm/build.sh (TARGET=gb10, omc omega-mv e5b32567, sha256 2c824805…), appends gdec.om and prints BUILD_OK <binary sha256> <path> source_sha256 <sha> commit <sha>. record builds and records a reference; gate is the merge gate (REV frozen once; candidate and negative control, gtgpu, gate cmp); core is the Core gate step; check runs the host arms. |
negctl/softmax-log2e.neg | The negative control: one GB10 kernel constant (the causal-softmax log2(e) immediate in gpu/gr.om grsoftf, x 5/4). Lines want N, block LINE, from LINE, to LINE; the build refuses unless exactly want lines change. |
ref/ | The committed prompt set and reference record. |
aien-train.lock | The aien-train commit the Core gate step (tests/gates/run.sh gb10-golden-tokens) checks. |
fixtures/ | Hand-written SYNTHETIC files (not a model, not a decoder run) for drive check. |
Decoding contract
Context of prompt k: token 0, then the prompt's BPE encoding (its bytes when V = 256), exactly as
ollm sample builds it. Each step takes the argmax of the logits at the last context position
(lowest index on ties). A generated id 0 ends the prompt. 1 + |prompt| + N <= T, so the window never
slides and both decoders use positions 0 onward.
gtgpu reads the CE kernel's row output (gpu/gr.om id 21: L <- (e/sum - [c = y]) sc, with target
y = 0 and sc = 1/(T B)), so the decision passes through every forward kernel including the CE
kernel: p_c = L_c / sc, p_0 = L_0 / sc + 1. top1 is the kernel's row max of the logits and the
margin is log(p1/p2). gtcpu reads the f64 logits directly.
Record aien-golden-ollm/1
aien-golden-ollm/1
label REAL|FAKE|SYNTHETIC
ckpt_sha256 <64 hex> merges_sha256 <64 hex> prompts_sha256 <64 hex> (one per line)
prompts K
max_tokens N
margin_floor_e9 F (2^-7 logit = 7812500)
drift_bound_e9 D (2^-9 logit = 1953125)
ref_decoder gtcpu
ref_engine_sha256 <sha256 of the reference decoder binary>
ref_source aien-dev/aien-train@<commit>
host_id <id>
utc <YYYY-MM-DDTHH:MM:SSZ>
P k n id0 .. id(n-1) kept reference ids of prompt k
L k n top1_0 .. top1_(n-1) reference top-1 logits (10^-9 units)
M k n m0 .. m(n-1) reference top-1 margins (10^-9 units)
end
drive record passes fixed constants to rec: N = 48, F = 7812500, D = 1953125 (drive.om texts
tmx, tfl, tdr). The former MAXTOK, FLOOR_E9 and DRIFT_E9 environment
overrides of record.sh are gone; changing a bound is a source change. rec refuses (exit 4) a
decoder run with more than N steps for a prompt, or fewer than N without an end, so cmp refuses
exactly what rec cannot write.
rec keeps the leading steps of each prompt whose reference top-1 margin is at least F: those are
the steps where a correct f32 forward cannot legitimately pick another token, so any divergence there
is a defect. The first step below F and all later steps are dropped. A prompt that keeps fewer than 4
steps is refused (exit 5), so the prompt set has to be chosen to decide.
cmp exits 3 (NOTCOMPARABLE) when the checkpoint, merges or prompt file does not hash to the record
or the prompt count differs. For each kept step the candidate id must equal the reference id
(DIVERGE k index=s ref=X cand=Y, cand=end when the candidate stopped) and its top-1 logit must be
within D of the reference's (DRIFT k index=s ref=.. cand=..). Exit 0 all match, 1 any DIVERGE or
DRIFT, 4 a malformed record or decoder run. The summary's maxdrift_e9 is over the matching prompts.
Run
# build the driver once (omc omega-mv bf54b19f)
OMC=<omc bf54b19f> bash om/golden/build.sh /tmp/golden-drive om/golden/ollm/drive.om
# reference (host CPU; once per checkpoint or prompt-set change)
OMC_TRAIN=<omc e5b32567> OMC_GATE=<omc bf54b19f> \
/tmp/golden-drive record <aien-train> <rev> CK MERGES om/golden/ollm/ref/prompts.txt OUTDIR
# the gate (GB10: inside an exclusive window)
spark-window open golden --lease 20 --gb10 exclusive --quiet none --wait
spark-window run env OMC_TRAIN=... OMC_GATE=... /tmp/golden-drive gate \
<candidate aien-train> <rev> om/golden/ollm/ref/r10-ck60000.ref CK MERGES om/golden/ollm/ref/prompts.txt OUTDIR
spark-window close
# host arms
OMC_GATE=<omc bf54b19f> OMC_TRAIN=<omc e5b32567> TRAIN=<aien-train> /tmp/golden-drive check
drive gate prints GOLDEN-GATE PASS (exit 0) only when the candidate matches and the negative
control, the candidate with one kernel constant changed, is blocked; FAIL (1) blocks the merge;
NOT_RUN (3) without a GB10 hold, a pinned compiler or a comparable record; BROKEN (4) when a build
fails or the negative control is not blocked, which voids the verdict. The decoder is built from the
commit REV resolves to, so uncommitted, skip-worktree or untracked edits in TRAIN cannot reach it.
REV resolves in a private bare repository OUT/src.git (no templates), fetched from TRAIN's HEAD,
heads, tags and remotes through an upload-pack that ignores grafts and replace refs, and git archive
runs there; every git child runs with the system and global config, attributes and graft files
disabled and --no-replace-objects. TRAIN's refs/replace, info/grafts, info/attributes and
config therefore cannot select the commit or shape the snapshot; the commit's own .gitattributes
is part of the commit and does apply. gate resolves REV once, pins OUT/src.git HEAD to that commit
id, builds candidate and negative control from it, and returns BROKEN unless both builds report
that commit, so a branch moved between the two builds cannot split them.
cmp also refuses (exit 4) a record whose header or rows break what rec writes: max_tokens in
1..4096, nonzero floor and drift bound up to 10^12, every row RMIN..max_tokens long and every kept
margin at least the floor.
Checkpoint and merges for the Core gate step are found by content: $AIEN_GOLDEN_DIR/<sha256>
(default $AIEN_MODELS_DIR/omega-llm-golden, else $HOME/models/omega-llm-golden), with the sha256
taken from the record and checked again by gate.om.
Evidence
First GB10 run, 2026-11-07 (evidence/dra52-golden-20261107/, EXERCISED on one GB10): aien-train
main 0518c915 PASS (343/343 kept tokens, max drift 2.49e-5 logit) with its negative control blocked;
a tree whose only change is the RMS-norm epsilon in gpu/gr.om (1e-5 -> 1e-4) FAIL (blocked by
DRIFT; it moved no greedy token, so a token-only comparison would have passed it).
Scope and limits
- Gated paths: the Omega LLM's forward on the GB10 (aien-train
native/omegallm/model.om,gpu/, including the vendored CUDAppcontext.om,vector.om,launch.om) and its build composition.crates/aien-serve-httpin Core serves no own-model path today (the 35B is retired), so a Core serving PR is not exercised by this gate; that arm waits for the Omega LLM serving cutover (DRA-125).ollm serve(aien-trainserve.om) is CPU only and is not exercised bygtgpu. - The reference is recorded on the same Spark host by an independent implementation (CPU f64 vs GB10 f32). A reference from a second machine is NOT_RUN.
- Making
aien/golden-tokensa required status check on GitHub is repository administration, not part of this directory.