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 / omegallm / wsplit / README.md
| 1 | # wsplit |
| 2 | |
| 3 | Seeded Omega replacement for `make_splits.py` and `make_d.py` in |
| 4 | `evidence/OMEGALLM/wsp-dra187-20261107/`. All generation, parsing, random draws, |
| 5 | JSON formatting, record framing, metadata and SHA-256 execute in Omega. |
| 6 | The program reads the original inputs below, never the committed split outputs: |
| 7 | |
| 8 | `/home/drakestapleton/handoffs/tool-omega-20261104` |
| 9 | |
| 10 | ## Build |
| 11 | |
| 12 | Linux AArch64. Pin `omega-mv` to |
| 13 | `e5b32567a7aff3ce594e3254a622a846a6cd190b`: |
| 14 | |
| 15 | - `seed/out/omc` SHA-256: |
| 16 | `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f` |
| 17 | - `om/sha256/sha256-om2.om` SHA-256: |
| 18 | `dbf002dd6aa36585632b9d01d98ac3f0bd2fa0f0475082940de53638847994bb` |
| 19 | |
| 20 | From the aien-train root, with `OUT` an existing private build directory and `wbuild` built as in |
| 21 | `tools/omegallm/wdrive/README.md`: |
| 22 | |
| 23 | ```sh |
| 24 | OMEGA_MV=../omega-mv |
| 25 | sha256sum "$OMEGA_MV/seed/out/omc" "$OMEGA_MV/om/sha256/sha256-om2.om" |
| 26 | OMC="$OMEGA_MV/seed/out/omc" CORE=0 wbuild "$OUT/wsplit" "$OMEGA_MV/om/sha256/sha256-om2.om" tools/omegallm/wsplit/wsplit.om |
| 27 | ``` |
| 28 | |
| 29 | wbuild writes every line starting `export fn ` as `fn `, because the output is a program, so SHA's |
| 30 | four `export fn` declarations become `fn`. It also moves the `om2` line and the `layout shactx` |
| 31 | block to the top of `$OUT/wsplit-all.om`. The layout, implementation and constants are unchanged. |
| 32 | wbuild checks omc's sha256, compiles with `taskset -c CORE nice -n 19`, and leaves no output from a |
| 33 | failed compile. On 2026-11-07 (MEASURED) the binary was byte for byte the one from the earlier |
| 34 | `sed 's/^export fn /fn /'` and `cat` route, sha256 `be6f7f0d...f19f`. There is no foreign runtime |
| 35 | dependency. |
| 36 | |
| 37 | ## Commands |
| 38 | |
| 39 | ```sh |
| 40 | mkdir -p /tmp/wsplit-output /tmp/wsplit-negative |
| 41 | taskset -c 0 nice -n 19 "$OUT/wsplit" splits /tmp/wsplit-output |
| 42 | taskset -c 0 nice -n 19 "$OUT/wsplit" d /tmp/wsplit-output |
| 43 | taskset -c 0 nice -n 19 "$OUT/wsplit" splits /tmp/wsplit-negative 1 |
| 44 | ``` |
| 45 | |
| 46 | `OUTDIR` must exist. Existing `S`, `H`, `G` or `D` output files are overwritten. |
| 47 | `splits` writes `S`, then `H`, then `G`, sharing the used-ID set as the Python |
| 48 | instrument does. `d` preserves the selected source rows' order. Each writes |
| 49 | `X.json`, `X.rec` and `X.meta`. Summary stdout matches the Python instrument: |
| 50 | template/form/exclusion counts for `splits`, then split name, row count, JSON |
| 51 | SHA-256 and record SHA-256. The optional unsigned seed offset (0 to 999999) |
| 52 | is accepted only for `splits`; offset 1 is the negative control, not a new split. |
| 53 | |
| 54 | Metadata is ASCII, one newline-terminated row per JSON row: |
| 55 | |
| 56 | ```text |
| 57 | idx role length kind |
| 58 | ``` |
| 59 | |
| 60 | There is no header. For example, `0 control 4 path`. Role is `target` for |
| 61 | length at least 6 and `control` otherwise. Kind is `word` for G and `path` |
| 62 | for S/H/D. The index is the post-shuffle JSON index. |
| 63 | |
| 64 | S/H/D records contain UTF-8 `prompt`, byte 31, UTF-8 `answer`, byte 0. |
| 65 | G records contain only UTF-8 `prompt`, byte 0, matching the original generator. |
| 66 | JSON has Python's one-space indentation, insertion-order keys, ASCII escapes, |
| 67 | lowercase Unicode escape hex and no final newline. |
| 68 | |
| 69 | ## Exactness and bounds |
| 70 | |
| 71 | MT19937 helpers are symbol-renamed copies of the verified `wprobe.om` helpers |
| 72 | at aien-train `72d3377`. Integer seeding uses `init_by_array` with a single |
| 73 | 32-bit key word, which covers every seed and offset accepted here. `_randbelow` |
| 74 | uses high-bit `getrandbits` rejection, including rejection for powers of two. |
| 75 | The small-pool `sample(range(1, 10), 2)`, choice, descending shuffle, range draws, |
| 76 | 200-attempt pattern fallback, discarded leading-zero draws and the extra loop |
| 77 | Goal draws preserve Python's call order. No float random API is needed. |
| 78 | |
| 79 | The tokenizer covers the supplied arrays of objects, their strings (JSON |
| 80 | escapes and UTF-8), integer lengths, and skipped primitive/nested values. Task |
| 81 | and Goal lines are extracted, deduplicated and sorted from inputs, not embedded |
| 82 | as a fixture. Goal digit runs become `{}` before sorted form selection. |
| 83 | Raw `item<digits>` and then `hello<digits>` scanning is over file bytes, not |
| 84 | parsed JSON. The frozen corpus uses ASCII digits; non-ASCII decimal digit |
| 85 | semantics of Python `re` are outside this input subset. Leading-zero strings |
| 86 | remain distinct through numeric value plus digit length. The scanner is |
| 87 | streaming, including matches crossing read boundaries. Hidden entries are |
| 88 | excluded as in Python glob. Source symlinks and unknown directory-entry types |
| 89 | are refused; the observed inputs have neither. |
| 90 | |
| 91 | Explicit capacities: each parsed JSON input is smaller than 524288 bytes, |
| 92 | output buffer 524288 bytes, string arena 4194304 bytes, 32767 stored strings, |
| 93 | 256 tasks and 256 forms, 1024 rows, 32768 excluded/generated IDs, 18 digits per |
| 94 | raw ID, directory depth 32. Raw scanned JSON files are filtered at the same |
| 95 | strictly-less-than 52428800-byte size limit as Python and are not loaded whole. |
| 96 | The program refuses exhaustion; it does not silently drop input. |
| 97 | |
| 98 | Exit codes: 0 success; 2 usage/unsupported seed; 61 capacity; 62 unsupported or |
| 99 | malformed input; 63 random rejection limit; 70 I/O failure. Omega's checked |
| 100 | runtime may also report its standard trap exit statuses. |
| 101 | |
| 102 | ## ORACLE and acceptance |
| 103 | |
| 104 | ORACLE: the existing, independent CPython instruments `make_splits.py` and |
| 105 | `make_d.py`, retained in historical evidence. They are verification references |
| 106 | only, never executed by wsplit or needed to build or run it. CPython's algorithms |
| 107 | are documented by [random.py](https://github.com/python/cpython/blob/v3.12.3/Lib/random.py) |
| 108 | and [_randommodule.c](https://github.com/python/cpython/blob/v3.12.3/Modules/_randommodule.c). |
| 109 | Byte comparison uses `cmp`; SHA-256 can also be checked with `sha256sum`. |
| 110 | |
| 111 | The input tree includes actively written evaluation results. A historical H |
| 112 | must not be regenerated or rewritten: its preregistered hashes remain frozen. |
| 113 | The accepted comparison, confirmed by the integrating lane, is current-input |
| 114 | Omega versus current-input Python for all four splits, plus committed S/G/D. |
| 115 | The frozen H discrepancy must be causally accounted for separately, not hidden |
| 116 | by excluding a particular ID in product code or by adding a snapshot mode. |
| 117 | |
| 118 | On 2026-11-07, current-input H differed from committed H at indices 31, 61 and |
| 119 | 248. The new raw output `src/item1199.om` in |
| 120 | `round41/c9/results/c9b-round40-fam-dev.json` excluded a previously fresh ID. |
| 121 | An ORACLE-only intervention deleting precisely `1199` from the exclusion set |
| 122 | restored both committed H files byte for byte. Product code has no such |
| 123 | intervention. The changed file is a round41 evaluation result, not round40 |
| 124 | training data. See the integrating lane's port receipt for timestamps, hashes, |
| 125 | commands, sizes, runtime, metadata checks and the seed-offset negative control. |
| 126 | |
| 127 | No compiler, language, host-word, gate or repository-ownership contract changed; |
| 128 | this tool-specific README is the affected guide. |
| 129 | |
| 130 | ## MT19937 attribution |
| 131 | |
| 132 | The MT19937 recurrence and initialization originate with Makoto Matsumoto and |
| 133 | Takuji Nishimura, as retained in CPython's `_randommodule.c`: |
| 134 | |
| 135 | Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, |
| 136 | All rights reserved. |
| 137 | |
| 138 | Redistribution and use in source and binary forms, with or without |
| 139 | modification, are permitted provided that the following conditions are met: |
| 140 | |
| 141 | 1. Redistributions of source code must retain the above copyright notice, |
| 142 | this list of conditions and the following disclaimer. |
| 143 | 2. Redistributions in binary form must reproduce the above copyright notice, |
| 144 | this list of conditions and the following disclaimer in the documentation |
| 145 | and/or other materials provided with the distribution. |
| 146 | 3. The names of its contributors may not be used to endorse or promote products |
| 147 | derived from this software without specific prior written permission. |
| 148 | |
| 149 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 150 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 151 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| 152 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
| 153 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| 154 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 155 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| 156 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 157 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 158 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |