interplane.Get Omega
Read in your language

aien-train

AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.

Brought by drakestapleton

branch main Branches Tags History

aien-train / docs / omegese45 / DEMO.md

265 lines · 17949 bytes Raw Blame History Rendered
1# OE45 demo: English request to a verified Aienet-0 microjob and back (aien-train #45)
2
3Demo lane of issue #45. One bounded episode, end to end:
4
5```
6English request
7 -> en2goal (translator lane) validated Omegese goal G (or EN_* refusal, nothing dispatched)
8 -> hive (this lane) asks the core for A core: oe45core decode CKPT G|U (pipeline lane)
9 -> validator + binding check (msg.om) invalid A: one guided re-decode (mode G); bind refusal: exit 62
10 -> journal A, lower A, aienet0-run/serve the EXISTING merged Aienet-0 microjob path, loopback
11 -> journal R, ask the core for the next A or the final report P
12 -> facts.tsv from runtime artifacts only (interface §5)
13 -> rep2en (translator lane) English response, refused if P contradicts G (G2E_CONTRADICT)
14 -> check-demo (eval lane) independent check: signatures, recompute, policy, English
15```
16
17Status: IMPLEMENTED and EXERCISED (GB10 Spark Grace CPU, cores 10-14, nice 19) for the
18reference CONTROL core: all eleven cases PASS (nine end-to-end cases and two v1.3 shape
19guards). The published supervised-trained checkpoint has also been EXERCISED: eight of
20the nine end-to-end cases PASS; happy-pair is REJECTED-BY-VERIFIER because its final report
21copies seed 2 twice. Both shape guards PASS. The harness correctly exits 67 for that
22unmet happy-pair acceptance criterion; it is not an all-case model PASS.
23
24The only admitted job is `matmul_u32` with m, k, n in 1..256 and a u64 seed (interface §5).
25Worker, verifier and driver run on the same Spark over 127.0.0.1, CPU only. No GPU.
26
27## Files
28
29| Path | Role |
30|---|---|
31| `native/omegese45/hive/hive.om` | the driver (journal, decode, repair, binding, dispatch, reconcile, facts) |
32| `tests/omegese45/demo/setup-runtime.sh` | builds the pinned Aienet-0 runtime (open-humanity 53c39bf2, aien-protocols e705fdc9) |
33| `tests/omegese45/demo/baseline.sh` | one direct aienet0-run/serve round trip, the runtime baseline |
34| `tests/omegese45/demo/run-demo.sh` | the nine cases plus two v1.3 episode-shape guard controls |
35| `tests/omegese45/demo/recheck-evidence.sh` | re-runs the unchanged `check-demo` over the committed current receipts; no runtime or private key needed |
36| `evidence/OMEGESE45/demo/` | current receipts `run-reference-v13/`, `run-trained-v13/`; historical runs and prefix regression evidence retained separately |
37
38Build of the driver, with omc at omega-mv bf54b19f (sha256 `62775d2a391cfef7cde64e387655caa9809a267093112910ec76bfa568f3712b`):
39
40```
41cat native/omegese45/vocab.om native/omegese45/msg.om native/omegese45/mjr1.om \
42 native/omegese45/hive/hive.om | /tmp/om-main/seed/out/omc > hive
43```
44
45## Commands
46
47```
48# runtime (once): builds aienet0-run, aienet0-serve and the matmul_u32 recompute binary
49sh tests/omegese45/demo/setup-runtime.sh /tmp/oe45-demo-rt
50
51# reference CONTROL core: exercises every non-model step
52OE45_CORE=reference sh tests/omegese45/demo/run-demo.sh /tmp/oe45-demo-rt /tmp/oe45-demo-ref
53
54# model core: the pipeline oe45core with a checkpoint directory
55OE45_CORE=model CKPT=/path/to/ck sh tests/omegese45/demo/run-demo.sh /tmp/oe45-demo-rt /tmp/oe45-demo-model
56
57# fresh clone, no runtime: re-verify the committed receipts (OE45_RECHECK_PASS, exit 0)
58sh tests/omegese45/demo/recheck-evidence.sh
59```
60
61`check-demo` pins the runtime identity as constants (`EVAL-CONTRACT.md` §10). The pin is a
62provenance pin: the demo passes only with the runtime whose public keys are those constants
63(`/tmp/oe45-demo-rt` on the Spark, created 2026-10-29), and its private keys are not committed.
64A fresh clone verifies the committed current receipts with `recheck-evidence.sh`: the checker's
65output and exit code must equal the committed `check.out` and `check.rc` for all 20 checked case
66directories of `run-reference-v13` and `run-trained-v13`, and two negative controls (a flipped MJR1
67byte, an edited `check.out`) must be detected. `setup-runtime.sh` on a new RT generates new random
68identities. A live run with them is EXERCISED (unpinned), never PASS: a case whose only failing
69check is `keys.trust_root` prints `CASE <name> UNPINNED`, and if no case fails otherwise the run
70ends `OE45_DEMO_UNPINNED ... identity=coordinator.ed25519:<hex>` with exit 70. The tampered case
71requires the targeted check (`row1.mjr1.signature`, `english.seeds`) in the FAIL list, so it stays
72meaningful when every case also fails `keys.trust_root`. History: observed 2026-10-31 at
73`c6caed3b` (before exit 70 existed), a new RT gave 8 FAIL and 3 PASS with the reference core and
74a copy of `/tmp/oe45-demo-rt` gave `OE45_DEMO_PASS` 11/11.
75
76Environment: `MODE=G|U` (first decode, default G), `PORTBASE` (first loopback port, default
7714340, never 14323), `OMC` and `OMEGA` (default `/tmp/om-main`). Heavy steps run under
78`taskset -c ${AIEN_TEST_CPUS:-0-9,15-19} nice -n 19 ionice -c3`; `AIEN_TEST_CPUS` keeps them off cores 10-14,
79which the shared Spark reserves for its live service. OUT must not exist.
80
81Output: `PIN` lines (compiler, commits, runtime binaries), `BIN` lines (sha256 of every built
82binary), one `CASE <name> PASS|UNPINNED|FAIL <facts>` line per case, then `OE45_DEMO_PASS` (exit 0),
83`OE45_DEMO_UNPINNED core=… identity=… unpinned: <cases>` (exit 70) or
84`OE45_DEMO_FAIL core=… failed: <cases>` (exit 67). Per-case receipts are in
85`OUT/cases/<case>/`: `request.en`, `en2goal.*`, `goal.oe45`, `goal.review.en`, `hive.*`,
86`episode.oe45`, `dispatch.log`, `facts.tsv`, `rep2en.*`, `response.en`, `check.out`,
87`check.rc`, `artifacts/`, `keys/`, `pins/`, `runtime.env`, `worker/`, `logs/`.
88
89## The nine cases (interface §9), plus two v1.3 guard controls
90
91| Case | Request | What it proves | Pass condition |
92|---|---|---|---|
93| happy-mm | "please multiply a 16 by 32 matrix by a 32 by 8 matrix with seed 7" | full path for one job | hive 0, check FAITHFUL, P `rep ok mm …0x0007` |
94| happy-pair | "run two matmuls of size 4 x 4 x 4 with seeds 1 and 2" | two jobs in one episode | hive 0, FAITHFUL, P `rep ok pair …` |
95| bound | "run a matmul of size 300 x 8 x 8 with seed 5" | core refusal: nothing dispatched, worker state unchanged | P `rep refused bound end`, header-only facts, sha256 of worker `seen` equal before and after |
96| translator | "make me a sandwich" | translator refusal: no goal, nothing dispatched | en2goal 20 EN_UNSUPPORTED, hive not run, FAITHFUL on header-only facts |
97| transport | "run a matmul of size 8 x 8 x 8 with seed 11" | worker down once, retry, recovery | facts `1 1 10 fail transport` then `1 2 0 ok`, `intent 1 2 --retry=1` in dispatch.log, FAITHFUL |
98| replay | same request as happy-mm, with happy-mm's signed document planted | replay is refused, no second execution | P `rep refused replay end`, worker `executing dag_id=<dag>` count stays 1, one `done <dag>` line in `seen` |
99| repair | "run a matmul of size 12 x 6 x 3 with seed 21" | injected invalid A rejected by the validator, guided re-decode, executed | `hive: repair` logged once, hive 0, FAITHFUL |
100| restart | "run a matmul of size 32 x 16 x 8 with seed 33" | kill -9 after dispatch, restart from the journal, no duplicate execution | kill rc 0 and driver wait rc 137; journal ends in `act job`; `hive: reconcile 1 1`; worker executions 1; FAITHFUL |
101| tampered | copies of happy-mm | negative controls for the independent check | receipt byte 200 flipped: UNFAITHFUL (signature); `seed 7` changed to `seed 8` in response.en: UNFAITHFUL (english.seeds) |
102| refuse-then-job | in-bound 2 x 2 x 2, seed 9; injected core emits refuse then job | a syntactically valid A cannot follow a refuse | hive 64 before dispatch; zero facts rows, zero worker executions, worker `seen` unchanged |
103| direct-report | same goal; injected core emits P directly after G | a final report needs a preceding A | hive 64 before journaling P; zero facts rows, zero worker executions, worker `seen` unchanged |
104
105Fault injection is harness glue only (`OUT/work/wrap/`): `serve-down` keeps the worker down
106once (flag file), `core-bad` strips the final ` end` of one core answer (flag file),
107`run-hang` lets one real aienet0-run finish, records its rc, then sleeps until killed.
108`core-refuse-job` and `core-direct-p` inject complete messages in an invalid causal order.
109The shared `ohorder` guard runs both before a decoded message is journaled/dispatched and
110while `ohline` replays the journal: refuse only directly after G, no A after refuse, no P
111directly after G, and the P after refuse must be `rep refused bound end`. These controls
112do not call check-demo on deliberately incomplete episodes; their oracle is exit 64 with
113no dispatch log, zero facts rows (no facts file), zero worker executions and unchanged seen.
114
115### Restart and replay behaviour, as observed
116
117The journal `episode.oe45` is append-only. An A job line is synced before dispatch and its R
118line after it. On restart, hive rescans the journal; an A job without its R is reconciled
119(`hive: reconcile <job> <attempt>`) by sending the same signed document again with `--retry`.
120The worker keeps its state in `WSTATE/seen` and returns the cached receipt for a document it
121has already executed, so the restart case shows one `executing` line in the worker logs, one
122`done` line in `seen`, and a VERIFIED outcome
123([dispatch.log](../../evidence/OMEGESE45/demo/run-reference-v13/cases/restart/dispatch.log),
124[worker-state.txt](../../evidence/OMEGESE45/demo/run-reference-v13/cases/restart/worker-state.txt),
125[kill.txt](../../evidence/OMEGESE45/demo/run-reference-v13/cases/restart/kill.txt)).
126A new episode that submits an already executed document gets `REFUSED WORKER AN0_REPLAY`
127from aienet0-run exit 11 (the worker's refusal frame), which hive maps to
128`res refused replay end`
129([replay facts](../../evidence/OMEGESE45/demo/run-reference-v13/cases/replay/facts.tsv)).
130
131## Driver interface
132
133`hive CONF`, run in the case directory. CONF has 15 lines, one value each: RUN, SERVE, KEYS,
134PINS, WKEYS, WPINS, WSTATE, RECOMP, RECSHA, ADDR, CORE, CKPT, MODE (U|G), VERIFIER (hex P-256
135compressed key), ACCEPT (seconds). Inputs: `goal.oe45`. Outputs: `episode.oe45`,
136`dispatch.log`, `hive.log`, `facts.tsv` (interface §5, v1.2 rules), `disp/`, `out/`, `logs/`.
137
138| Exit | Meaning | Owner |
139|---|---|---|
140| 0 | episode complete: P journaled, facts.tsv written | hive |
141| 61 | usage or config | hive |
142| 62 | binding refused before dispatch (msg.om 41/42) | hive |
143| 63 | decode failed after one guided repair, or checkpoint refused (core 51/52) | hive |
144| 64 | journal, goal or policy guard | hive |
145| 65 | driver I/O or spawn failure | hive |
146| 66 | unmapped aienet0-run exit, or VERIFIED/MJR1 inconsistent | hive |
147| 69 | bundle payload differs from the lowered A | hive |
148| 60 | setup or build failed | run-demo.sh |
149| 67 | at least one case missed its expectation | run-demo.sh |
150| 68 | the eval checker is not runnable | run-demo.sh |
151| 70 | every expectation met, but some checked case failed only `keys.trust_root` (unpinned RT): `OE45_DEMO_UNPINNED`, never a PASS | run-demo.sh |
152
153aienet0-run exits map to R exactly as interface §5: 0 `res ok`, 10 `fail transport`,
15411 `refused replay|budget|worker` (from the `REFUSED WORKER <tag>` line), 12 `fail receipt`,
15513 `fail recomp`, 14 `fail verdict`, 15 `fail io`.
156
157## Results
158
159### Reference CONTROL core: OE45_DEMO_PASS
160
161`OE45_CORE=reference` replaces the model with the eval lane's deterministic reference policy
162(`eval/omegese45/oe45lib.py policy_next`). It is a CONTROL: it proves the translator, driver,
163journal, binding, Aienet-0 dispatch, restart, replay, rep2en and the independent check, and
164says nothing about the model. Current run: fresh clone of clean `feat/45-demo` at
16515d48825da1d7bdd687a65d02fb7424a361e2a37, contract 71b9abd, translator 96f8aaf,
166pipeline a3ee223 and eval E5 code 3c6e165. EXERCISED (GB10 Spark Grace CPU, cores 10-14,
167nice 19): all eleven cases PASS, rc 0, `OE45_DEMO_PASS core=reference mode=G ckpt=-`
168([command](../../evidence/OMEGESE45/demo/run-reference-v13/cmd.txt),
169[output](../../evidence/OMEGESE45/demo/run-reference-v13/run-demo.txt)).
170
171| Reference CONTROL check | Interpretation |
172|---|---|
173| `episode.reference_policy` | Tautological: the injected core and checker both use `oe45lib.policy_next`; this is not independent model-policy evidence. |
174| Runtime artifact signatures, recompute and English facts | Checked separately from the policy function. The receipt and English tampering cases must be rejected. |
175
176### Current trained-model run: one report rejected, not all-case acceptance
177
178The same fresh clone ran the trained checkpoint with `PORTBASE=14440`, rc 67:
179`OE45_DEMO_FAIL core=model mode=G ckpt=/tmp/op45w/final/ck failed: happy-pair`.
180The original nine cases have **8 PASS, 1 REJECTED-BY-VERIFIER**. The two v1.3 shape
181guards both PASS, so the full harness has ten PASS lines and one FAIL line. No goal,
182seed or model output was changed to make it pass. happy-pair's A/R jobs used seeds
1831 and 2 correctly; its P claimed seeds 2 and 2. rep2en refused with exit 30
184`G2E_CONTRADICT operands`, and check-demo returned UNFAITHFUL
185([case receipts](../../evidence/OMEGESE45/demo/run-trained-v13/cases/happy-pair/),
186[command](../../evidence/OMEGESE45/demo/run-trained-v13/cmd.txt),
187[output](../../evidence/OMEGESE45/demo/run-trained-v13/run-demo.txt)).
188The strict happy-pair English-response acceptance criterion remains unmet. This is
189evidence that contradictory model reports are rejected, not that the learned policy is exact.
190
191The clean integration branch starts at main 5aaeb65 and imports only this lane's owned
192paths from source snapshot b672cdb; it does not inherit PR #42. The requested ancestry
193check returned 1 and its changed-path intersection with PR #42 is empty
194([proof](../../evidence/OMEGESE45/demo/clean-branch.txt)).
195
196### Model core, pipeline tuning checkpoint t-s7: OE45_DEMO_FAIL (6 of 9)
197
198`CKPT=/tmp/op45w/t-s7/ck` is a pipeline tuning checkpoint (step 40000, lr 2^-7, info line in
199[run-demo.txt](../../evidence/OMEGESE45/demo/run-model-ts7/run-demo.txt)), not a published
200trained checkpoint. Same fresh clone, same host. PASS: happy-mm, bound, translator, replay,
201restart, tampered. FAIL: happy-pair, transport, repair. In all three the model emitted
202`act refuse bound end` for an in-bound goal. Nothing was dispatched, rep2en refused to render
203the report (rc 30 `G2E_CONTRADICT bound`) and check-demo returned UNFAITHFUL
204`episode.reference_policy` ([happy-pair check](../../evidence/OMEGESE45/demo/run-model-ts7/cases/happy-pair/check.out)).
205The safety layers held; the model is not good enough.
206
207### Published trained checkpoint and step-0 control
208
209From a fresh clone at c8a4e28 (before the v1.3 review fixes):
210
211```
212OE45_CORE=model CKPT=/tmp/op45w/final/ck PORTBASE=14360 \
213 sh tests/omegese45/demo/run-demo.sh /tmp/oe45-demo-rt /tmp/oe45-demo-final
214OE45_CORE=model CKPT=/tmp/op45w/final/ck0 PORTBASE=14390 \
215 sh tests/omegese45/demo/run-demo.sh /tmp/oe45-demo-rt /tmp/oe45-demo-ck0
216```
217
218Both commands returned 67, `OE45_DEMO_FAIL` (GB10 Spark Grace CPU, cores 10-14, nice 19).
219The trained `ck.a` digest is
220`2ebb99de9a0aa04dfba95e0f008e392b99c3f4c4c3836086e24cf7b3a8204058`
221(generation 21, step 400000). Eight cases pass; happy-pair has correct A/R jobs for seeds
2221 and 2, but P copies seeds 2 and 2. rep2en rejects the operand contradiction and check-demo
223returns UNFAITHFUL. This is a model error, not successful English reporting
224([trained run](../../evidence/OMEGESE45/demo/run-trained-pre-review/run-demo.txt)).
225
226The step-0 `ck.a` digest is
227`02d85006cd96c9c450c66147538a286b07954964fa14552fb40501fcf77225f2`.
228Only translator passes; the random model fails the other eight cases. Downstream replay
229and tampering fixtures cannot be prepared because the initial job has no signed bundle;
230their FAIL lines are not successful refusal evidence. Restart does not reach its kill
231point and fails as expected
232([step-0 run](../../evidence/OMEGESE45/demo/run-step0-pre-review/run-demo.txt)).
233
234### Core fix found by this demo
235
236The first model run showed that `oe45core` rejected any prefix holding `act refuse` (rc 40),
237so the core could never decode the report after a refusal. Fixed on
238`fix/45-core-refuse-prefix` (00d66c37, on pipeline 0e908203): a prefix may end in G followed
239by `act refuse C end`; a refuse after an R, or any message after the refuse, stays rc 40.
240`tests/omegese45/core/run-core.sh` carries the regression and three negatives; the suite
241passed with the fix and the old binary returns 40 on the same prefix
242([core-refuse-prefix/](../../evidence/OMEGESE45/demo/core-refuse-prefix/)).
243
244## Pins
245
246| Item | Value |
247|---|---|
248| omc | omega-mv bf54b19f, sha256 `62775d2a391cfef7cde64e387655caa9809a267093112910ec76bfa568f3712b` |
249| hive (15d4882) | `3b99f1f890c2ac3c30c3618404e3ba9bcca869d2b6bbeb91ea01126a3a2810a3` |
250| en2goal | `90a93182bdf628a26d4cee6a3a98370e25b445ae1197dabee76b1f3c93925045` |
251| goal2en | `7e1d6fd5743414ee51b92884c3491f8d97e0a3a294dc742b2c01b3b6de316290` |
252| rep2en | `4b57fa73c96f59b036fd02184f2a64e54f31bf80a37ab5cb2a1f3fad48c8212a` ([current binaries.sha256](../../evidence/OMEGESE45/demo/run-reference-v13/binaries.sha256)) |
253| aienet0-run | `b8685830e175105b254d707d395257cc531532107da1618959f6f309c1e6a08d` (open-humanity 53c39bf2) |
254| aienet0-serve | `a56de94baeb56dad79392f5480fb85e9d7bb71bf4b884285c1f24944b458a2de` |
255| matmul_u32 recompute | `d2cd7382e0dc64e49498ae3b1ceffc73f1ddcbd3ddcf93e6d607498ccd58ea12` (aien-protocols e705fdc9, SHA unit omega-mv 55845e70) |
256
257## NOT_RUN
258
259- GPU or Spark-window training and inference (interface §10).
260- The transformer model: softmax needs `exp`, `.om` has none (interface §6, §10).
261- Hive multi-agent configurations, peer handoff, cancellation, stale dependencies (§10).
262- A scientific Turing score, energy measurement, tokenizer comparison (§10; R45 is a fixed
263 lexical vocabulary).
264- Multi-host dispatch: worker and verifier run on one Spark over 127.0.0.1.
265- Jobs other than `matmul_u32` with dims 1..256.