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 / ecosystem5 / CONTRACT.md

123 lines · 6906 bytes Raw Blame History Rendered
1# PACK5 v1: bounded public-example packing
2
3This implements one component of aien-train5 and train3: integer token packing,
4next-token labels, supervised-target masks and causal attention boundaries.
5It consumes existing native public-example admission, retaining those owners.
6No tokenizer, dataset reader, numerical tensor engine, model training loop,
7worker runtime, durable cursor or checkpoint format is implemented here.
8
9## Frozen dependencies and caller
10
11Compose these exact source files, in order, followed by a caller:
12
131. Omega L775 commit `84d03c5523f39ca1045d1c313c5f62597779462b`,
14 `src/learning/benchmark/core.om`, SHA256
15 `a5a2e74c815f9ca6a90dbdfbfc7ecc343f0362c824064f2058e9d1d7c119c40c`.
162. Omega L776 commit `d8d14c47647e49774f64b58e3c138335656f175d`,
17 `src/learning/curriculum/admit.om`, SHA256
18 `533638a9f128853d696644de2bbf7b1859797b170a7e32e54c112ab94c3dadb1`.
193. `native/ecosystem5/pack.om`.
20
21L776 published head is `1a14972c3b2d7494ba445df79967e7963359230e`.
22The native compiler SHA256 is
23`191b776ef98821597c3e30655da6d680a9b66edbc9ceaca3c39c61ea6df098e9`,
24independently rebuilt from omega-bridge
25`0fc7d8662cb799e7c206b17c18ea4c3ec2b8fea9` by the compiler qualification lane.
26The compilation target is static AArch64 Linux. No foreign runtime is linked.
27
28Callers first use existing `cbegin`, `csubmit` and `cfinish`. Only successful
29completed admission with `CState[2]=1` and `LS[18]=1` may be consumed. `CGood`
30is the accepted index list in submission order; `CFreeze` is its manifest
31snapshot. Quarantined records never enter a packed sequence. Live `LT` changes
32after admission cannot alter the consumed frozen split.
33
34These are trusted, single-thread, in-process arrays. The caller must preserve
35the owner modules' state and supply measured identities and tokenization.
36Public mutable arrays do not authenticate an attacker or prevent concurrent
37mutation. Checking a supplied digest does not prove its contents. Existing
38custody, tokenizer and execution owners retain those duties.
39
40## Inputs
41
42`DPCfg[4]` holds schema1, vocabulary size1..4294967296, split1(train) or2(dev),
43and padding token ID less than vocabulary size. Every accepted record must
44belong to the requested split. Mixed accepted train/dev batches are refused.
45Protected adaptive/final records are already refused by L775.
46
47`DPPin[16]` holds expected tokenizer SHA256 words0..3, observed tokenizer words4..7,
48expected template SHA256 words8..11 and observed template words12..15. Every
49identity has four big-endian u64 words representing all32 digest bytes. Both
50expected identities must be nonzero and must match all observed words. They
51may equal one another; no cryptographic independence is inferred. There is no
52identity measurement or hashing implementation in this module.
53
54For accepted task slot `t`, `DPLen[t]` is1..256 and `DPPrompt[t]` is0..DPLen[t].
55`DPToken[t*256+j]` is token ID `j`, strictly below vocabulary size. Token zero
56is legal. Prompt length counts prefix tokens excluded as prediction targets.
57All-prompt examples are valid and contribute no supervised targets. Records
58of length1 are valid and contribute no next-token targets. Empty records are
59refused. Length/prompt entries for all quarantined or absent slots must be0;
60unused token-array cells are ignored. Maximum64 admitted records and256 total
61packed token positions. Oversized batches are refused, never truncated.
62
63## Results and failures
64
65`dppack()->ulong` validates the entire input before changing payload arrays.
66It clears `DPState[ready,count,records]` at entry. Failure leaves every payload
67cell unchanged but invalid, and `dpattend` returns false until a later success.
68Do not consume payloads without `DPState[0]=1`.
69
70On success, accepted records are copied in `CGood` order. `DPOut[256]` contains
71token IDs; `DPTask[256]` holds original task slots; `DPPos[256]` holds positions
72within each record. `DPState[1]` is the actual packed count; `DPState[2]` counts
73records. An all-quarantined completed admission yields a valid empty batch.
74
75For position `p` within a record, `DPLabel[p]` is that record's next token when
76one exists. `DPMask[p]=1` exactly when the next token exists and its within-record
77index is at least the prompt length. Thus the last prompt token may predict
78the first completion token, and no final record token predicts the next record.
79Prompt-only labels may remain populated but must be ignored when mask0. This
80is an integer supervision mask, not a loss computation.
81
82Unused output positions contain the configured padding token in output and
83label, mask0, task sentinel18446744073709551615 and position0. Physical padding
84IDs inside a real record are ordinary tokens; only explicit record length
85defines padding. No special-token semantic is guessed.
86
87`dpattend(q,k)->bool` returns true only for valid packed positions in the same
88record with k<=q. Padding and out-of-range indices, including maximumu64,
89return false. Helpers `dpvalidate`, `dpinput` and `dpcopy` are internal and do
90not independently provide a safe publication API; call `dppack`.
91
92| Code | Meaning |
93| --- | --- |
94| 0 | Valid packed batch |
95| 70 | Admission incomplete, invalid or active |
96| 71 | Schema, vocabulary, partition or padding configuration invalid |
97| 72 | Zero or mismatched supplied tokenizer/template identity |
98| 73 | Invalid/duplicate accepted index, inconsistent membership, or tokens declared for nonaccepted slot |
99| 74 | Invalid record or prompt length |
100| 75 | Token ID outside the declared vocabulary |
101| 76 | Total packed capacity exceeded |
102| 77 | Accepted record belongs to another partition |
103
104## Qualification and remaining work
105
106The native author suite drives actual owner admission and passes282622 checks.
107Its independent coordinate oracle enumerates196 two-record layouts and their
108prompt boundaries, verifies targets and padding, and compares every attention
109pair with separately defined partition intervals and a lower triangle. Direct
110controls cover readiness, identities, malformed records, mixed partitions,
111quarantine, reverse submission order, full capacity and64 records. Three
112compiled mutants invert supervision, remove record attention isolation and
113bypass partition refusal; they fail checks5163,19 and263254 respectively.
114
115Independent final-source review of088258d passed84378 additional native checks,
116reproduced the original282622-check binary, and caught all three compiled
117mutants with a separate caller. The full report is preserved under
118`evidence/ECOSYSTEM5/independent-review/`. This slice
119does not establish tokenizer parity, actual data-source authentication,
120shuffling/resume, durable checkpoint recovery, model quality or physical GPU
121results. All these remain assigned to train3/5/6 and their existing owners.
122No prior first-party implementation or runtime dependency can be retired from
123this additive component alone. The complete replacement issues stay open.