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
aien-train / tools / verified_examples / README.md
| 1 | # Verified program examples (DRA-122) |
| 2 | |
| 3 | Seeded Omega admission, deterministic JSONL provenance, and an optional continuation-text export. |
| 4 | There is one admission rule: **the actual program must verify again now**. An old verified flag is |
| 5 | never evidence. No model is called, no model is trained, no GPU is opened, and nothing is published |
| 6 | by this tool. |
| 7 | |
| 8 | ## Dependencies and build |
| 9 | |
| 10 | Use the approved kernel-memory-capped omega-mv referee revision, `15760b5009f00485ce51669c84d0126ed19fa479`. |
| 11 | Its `seed/out/omc`, SHA-256 `a5613368f427aacd73ebeee16d46f8b3203405711d4de5b860d0cbee11ce4533`, |
| 12 | compiles this tool. The admitted compiler and benchmark task-set pins are the `vxsha` and `vxtasks` |
| 13 | texts in `examples.om`; a different run pin is refused. Changing a pin is a source change requiring |
| 14 | the full gate, not a command-line override. |
| 15 | |
| 16 | `OMEGA` below is a fresh checkout of that revision. Run the driver's self-test once to build its |
| 17 | `chat` edge and create fixtures. All fake-model output is **TEST DATA**, never release data. |
| 18 | The tool also recognizes `model_requested fake`, a `TEST` metadata line, and a `TEST_DATA` marker. |
| 19 | |
| 20 | ```sh |
| 21 | OMC="$OMEGA/seed/out/omc" |
| 22 | sh "$OMEGA/bench/inference_cost/driver.sh" --self-test |
| 23 | mkdir -p build/verified_examples |
| 24 | { |
| 25 | printf 'om2\n' |
| 26 | cat "$OMEGA/om/tls/sha2.om" "$OMEGA/seed/json/json.om" |
| 27 | sed 's/^fn main to int$/fn vxmodelmain to int/' tools/verified_examples/examples.om |
| 28 | cat tools/verified_examples/sources.om |
| 29 | } > build/verified_examples/all.om |
| 30 | "$OMC" < build/verified_examples/all.om > build/verified_examples/examples |
| 31 | chmod +x build/verified_examples/examples |
| 32 | ``` |
| 33 | |
| 34 | The SHA-2 implementation and UTF-8 state machine are reused from the pinned Omega source. Candidate |
| 35 | extraction reuses its `chat resp`, including the exact fenced-code rule. Admission calls its existing |
| 36 | `driver.sh --verify-candidate` interface: the same assembly, hidden inputs, byte comparison, mandatory |
| 37 | bubblewrap isolation, readiness checks and deadlines as the scoreboard. Compiler failures are never |
| 38 | run. The driver is an existing **shell migration dependency**, not Omega. Its namespace/mount, |
| 39 | process-tree and descriptor-supervisor Omega successor is not yet written. We do not duplicate it. |
| 40 | The small `sh -c` extraction invocation only binds stdin and fd 3 for the existing chat executable; |
| 41 | it makes no admission or serialization decisions. |
| 42 | |
| 43 | The driver documents the exercised host dependencies: bubblewrap 0.9.0, coreutils timeout 9.4, |
| 44 | Bash 5.2.21 and the selected C/Python/Rust compiler/runtime oracles. Omega passes through PATH and |
| 45 | binds OMC explicitly to the compiler whose bytes it hashed; no other environment is inherited. |
| 46 | Read-only Git archive/diff is used only for the harness source snapshot. Existing host build scripts |
| 47 | remain migration debt; no new shell implementation is introduced here. |
| 48 | |
| 49 | ## Build a real dataset (one command) |
| 50 | |
| 51 | Set RUN to one directory announced in the scoreboard's RUNS.txt, OUT to a **new absent** directory, |
| 52 | and OMEGA to the pinned checkout. All paths must be absolute. |
| 53 | |
| 54 | ```sh |
| 55 | build/verified_examples/examples prep "$RUN" "$OMEGA/bench/inference_cost" \ |
| 56 | "$OMC" "$OMEGA/build/inference_cost/bin/chat" "$OUT" release |
| 57 | ``` |
| 58 | |
| 59 | Without `prep`, use the same command with that word removed to omit `stories.txt`. Use final argument |
| 60 | `test` only for **TEST DATA**. A marked directory is refused in release mode, even if every program |
| 61 | would pass. A failed invocation has no valid manifest; never publish partial files. Output is local, |
| 62 | mode 0700/0600, not an external publication. |
| 63 | |
| 64 | Input is the driver's `attempts.txt` **wire version 2** and its per-attempt request.wire, response.json |
| 65 | and candidate.LANG. Every listed attempt is reconsidered, including ones formerly marked failed. |
| 66 | No decision depends on compiled_rc or verified_flag. The program re-extracted from response.json must |
| 67 | hash-identically to candidate.LANG; changing the candidate after the run is a refusal, even if the |
| 68 | replacement is correct. Verification executes the private extracted snapshot, not the mutable input. |
| 69 | An unverified program is omitted and counted as rejected. The run's compiler and task-set digests |
| 70 | must equal the tool pins; the current benchmark contents are independently checked with the driver's |
| 71 | single `--task-set-sha256` implementation before admission. |
| 72 | |
| 73 | Records preserve input attempt order, use fixed field order, JSON-escape UTF-8 and have no timestamps, |
| 74 | absolute paths, timing fields or nondeterministic compiler diagnostics. Program bytes and each sent |
| 75 | message are retained. Fields are task, language, arm, attempt, source, messages, program, |
| 76 | omc_sha256, task_set_sha256, referee_output_sha256 and test_data. The referee digest hashes the newly |
| 77 | observed hidden-input stdout, not the old eval directory or its verdict. `examples.jsonl` is the only |
| 78 | JSONL output; `manifest.json` has record/rejection counts, counts per language, JSONL SHA-256, pins, |
| 79 | TEST DATA status and the licence position. Referee artifacts live beside these files for replay. |
| 80 | |
| 81 | For model runs the licence position is: **model-written code, verified, from Drake's own runs**. |
| 82 | Verification establishes tested behavior, not authorship, copyright ownership or rights in copied |
| 83 | third-party material. The tool does not relicense code or publish the dataset automatically. |
| 84 | |
| 85 | ### Existing trainer connection: continuation text, not instruction training |
| 86 | |
| 87 | The trainer's existing `native/omegallm/data.om` `cmdprep` reads UTF-8 documents separated by |
| 88 | `<|endoftext|>`, not JSONL. Reuse research found no attempt-to-dataset converter in aien-train, |
| 89 | omega-mv, spark-rsi-mv or the handoffs search. `prep` exports exactly this existing format: |
| 90 | |
| 91 | ```text |
| 92 | Task: |
| 93 | <the pinned task statement> |
| 94 | |
| 95 | Program: |
| 96 | <the verified program, unchanged> |
| 97 | <|endoftext|> |
| 98 | ``` |
| 99 | |
| 100 | There is one document per admitted record, in the same order. A program containing the reserved |
| 101 | separator is refused for this export rather than silently creating extra documents. The manifest |
| 102 | also names the stories SHA-256. The JSONL is provenance; stories.txt is **plain continuation text** |
| 103 | for the current trainer. Instruction-format training waits on **DRA-123**. |
| 104 | |
| 105 | ```sh |
| 106 | ollm prep "$OUT/stories.txt" train.bin held.bin |
| 107 | ``` |
| 108 | |
| 109 | This only prepares existing token files. It is not a training command and needs no GPU. |
| 110 | |
| 111 | ## Second sources |
| 112 | |
| 113 | ```sh |
| 114 | build/verified_examples/examples references "$OMEGA/bench/inference_cost" \ |
| 115 | "$OMC" "$OMEGA/build/inference_cost/bin/chat" "$OUT" release |
| 116 | build/verified_examples/examples harness "$HARNESS" "$HARNESS_OMC" \ |
| 117 | "$OMEGA/build/inference_cost/bin/chat" "$OUT" release |
| 118 | ``` |
| 119 | |
| 120 | References: all four languages in the pinned benchmark's 20 task directories, each passed through |
| 121 | the same current referee. Source is `reference-solutions`; the task statement is `referee_contract`. |
| 122 | No invented sent conversation is supplied (`messages` is empty). |
| 123 | |
| 124 | Harness: a clean checkout of omega-harness `958d7f2e4efa5f476ec9c3953cf6d65122636054` and its own PIN's |
| 125 | compiler. The whole existing examples/gate.sh must pass first. Only its compile-success, actually |
| 126 | executed examples are imported, including expected traps with their explicit .expect contract; |
| 127 | compile-refusal examples are not training programs. The source is `harness-examples`. The task-set |
| 128 | digest is SHA-256 of `git archive --format=tar HEAD`; the referee digest binds the fresh complete gate |
| 129 | transcript. Source licences are retained, not replaced by a model-code claim. These are separately |
| 130 | named datasets, not model output, TEST DATA, or evidence of learned capability. |
| 131 | |
| 132 | ## Acceptance gate |
| 133 | |
| 134 | The gate is Omega too. It builds nine broken tool variants: stale verdict trusted, candidate binding |
| 135 | removed, compiler-pin mismatch admitted, task-set mismatch admitted, TEST DATA admitted to release, |
| 136 | trainer delimiter refusal removed, and an artificial 32-bit attempt-number cap restored, decimal overflow admission, and an unapproved referee artifact admitted. Every variant must fail its corresponding admission test. |
| 137 | It also replays the full positive TEST DATA workload twice, compares JSONL/manifest/stories hashes, |
| 138 | requires 80 positive records, runs the existing ollm prep unchanged, verifies a stale program is absent |
| 139 | from both JSONL and stories, and exercises both second sources. |
| 140 | |
| 141 | Supply a CPU-only ollm built by its existing tests/omegallm/build.sh with its own pinned compiler. |
| 142 | Neither this tool's new compiler pin nor the harness pin overrides the trainer's old pin. |
| 143 | |
| 144 | ```sh |
| 145 | { |
| 146 | sed 's/^fn main to int$/fn vssourcemain to int/' build/verified_examples/all.om |
| 147 | cat tools/verified_examples/gate.om |
| 148 | } > build/verified_examples/gate-all.om |
| 149 | "$OMC" < build/verified_examples/gate-all.om > build/verified_examples/gate |
| 150 | chmod +x build/verified_examples/gate |
| 151 | build/verified_examples/gate "$PWD/build/verified_examples/examples" "$OMEGA" \ |
| 152 | "$HARNESS" "$HARNESS_OMC" "$TRAINER" "$OMEGA/build/inference_cost/selftest" \ |
| 153 | "$PWD/build/verified_examples/all.om" "$ABSENT_GATE_WORK" |
| 154 | ``` |
| 155 | |
| 156 | Success ends `EXAMPLES-GATE PASS mutants=9 records=80`. Use a fresh clone and new work/output paths. |
| 157 | The protocol's existing fixed-width argument packet and Linux PATH_MAX remain real boundaries; |
| 158 | record payloads, hashing and output stream without a new dataset-size cap. The reused chat JSON |
| 159 | parser retains its documented per-response bound; an over-bound response is refused, never truncated. |
| 160 | |
| 161 | Private Cortex requests are **inventory only**, never inputs to this tool. Do not export their text. |
| 162 | Only aggregate kinds/check requirements belong in the private lane report; recall cannot establish |
| 163 | a total count when it supplies no count/filter interface. Before any external publication, scan added |
| 164 | source lines and dataset bytes for secrets, home paths, usernames and private-repository names. |
| 165 | |
| 166 | Numeric guard oracle (Wolfram Language, exact, unitless integers): |
| 167 | `{2^64-1, Quotient[2^64-1,10], Mod[2^64-1,10], 2^32, 2^32-1}` returned |
| 168 | `{18446744073709551615,1844674407370955161,5,4294967296,4294967295}`. The gate |
| 169 | admits the full uint64 maximum and rejects a decimal value that would otherwise wrap to a valid |
| 170 | attempt identity; its overflow-removal mutant must fail. |
| 171 | |
| 172 | ## Kernel memory-ceiling admission |
| 173 | |
| 174 | Before invoking even the referee digest mode, the converter hashes driver.sh itself and compares |
| 175 | it with the compiled `vxdriverpin`. A driver without the approved kernel-enforced process-tree |
| 176 | ceiling, or any other unapproved driver bytes, is refused with **exit 20**. Matching task data and |
| 177 | compiler pins alone are not enough. There is no command-line override or uncapped fallback. The |
| 178 | new guard's removal mutant uses a harmless comment-mutated copy of the **capped** driver, its |
| 179 | unchanged task files and the same pinned compiler; it never runs an old unbounded driver. |
| 180 | |
| 181 | The exercised host dependency is systemd-run from systemd 255 (255.4-1ubuntu8.17), using cgroup v2 |
| 182 | (`cgroup2fs`). This is an explicit containment dependency, not an Omega implementation. Its Omega |
| 183 | successor is the not-yet-written namespace/mount, process-tree, descriptor and cgroup supervisor. |
| 184 | |
| 185 | The capped referee requires its cgroup scope to read back the requested MemoryMax and zero swap |
| 186 | before any candidate. Failure to apply it is NOT_RUN (driver exit 3, converter exit 16). A candidate |
| 187 | killed within the ceiling is unverified and excluded. Kernel telemetry added beside the sandbox |
| 188 | readiness records does not change the stdout comparison or the deterministic dataset bytes. |