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 / TRANSLATOR.md

160 lines · 13504 bytes Raw Blame History Source

Omegese #45 translator (en2goal, goal2en, rep2en)

Issue: aien-dev/aien-train#45. The translator is the only place English exists in the product path. It is deterministic, rule-based .om. It loads no model and no checkpoint, and it is built and tested separately from the core (tests/omegese45/translator/run-translator.sh builds only the units listed below).

Status: IMPLEMENTED and EXERCISED on the GB10 Spark Grace CPU, cores 10-14, nice 19. Receipt: evidence/OMEGESE45/translator/.

Build units (concatenation, pinned omc bf54b19f, sha256 62775d2a…3712b)

BinaryUnits, in order
en2goaltranslate/otio.om translate/en2goal.om translate/otfrag.om translate/main-en2goal.om
goal2entranslate/otio.om vocab.om msg.om translate/otmsg.om translate/goal2en.om translate/otfrag.om translate/main-goal2en.om
rep2entranslate/otio.om vocab.om msg.om translate/otmsg.om translate/rep2en.om translate/otfrag.om translate/main-rep2en.om

All paths are under native/omegese45/. goal2en and rep2en validate every G and P line with the contract lane's ocsetgl and ocvline (vocab.om, msg.om, contract commit fa57fdf). The translator does not re-implement the R45 grammar. All translator names start with ot.

Exit codes

CodeToolMeaningstdout
0allsuccessthe G line or the English sentence
2allusage, or a stdin read or stdout write errorusage line
20 EN_UNSUPPORTEDen2goalno rule matches, empty or blank input, over 512 bytes, or a byte outside TAB and 0x20..0x7eEN_UNSUPPORTED
21 EN_RANGEen2goala dim above 4095, a seed above 65535, or a malformed number (interface v1.2 §4; dim 0 is accepted)EN_RANGE
22 EN_SHAPEen2goalthe inner dims differ (k of the left matrix ≠ rows of the right)EN_SHAPE
23 EN_AMBIGen2goalmore than one readingEN_AMBIG
30 G2E_CONTRADICTrep2enP contradicts G or the runtime facts; no success is printedG2E_CONTRADICT <what>
31 G2E_INVALIDgoal2en, rep2enan input is invalidG2E_INVALID <what>

Dims 0 and 257..4095 pass through en2goal: D can encode 0x000..0xfff, and the core refuses those dims (code bound), not the translator (interface v1.2 §4, review finding T3).

en2goal grammar

Normalization (otnorm):

Numbers: a word that starts with a digit, or with +/- followed by a digit, fills a number slot. The word must be 1..9 decimal digits; anything else is malformed and gives 21. Leading zeros are accepted.

Rules: this is the text otrules table in en2goal.om, verbatim. A rule must match the whole word sequence. a/b lists literal alternatives, and ? marks the word as optional. #m #k are the left matrix dims, #j #n the right matrix dims, #s the seed and #t the second seed.

m ?please multiply a/an #m by #k matrix by/with/times a/an #j by #n matrix with seed #s
m ?please ?run/do/compute/submit ?a/an/one matmul/matmul_u32 ?job ?of ?size #m x #k x #n ?with seed #s
m goal for review one matmul_u32 job multiplying a/an #m by #k matrix by a/an #j by #n matrix with seed #s
p ?please ?run/do/compute/submit two matmuls/matmul/matmul_u32s/matmul_u32 ?jobs ?of ?size #m x #k x #n ?with seeds #s and #t
p matmuls #m x #k x #n ?with seeds #s ?and #t
p ?please multiply a/an #m by #k matrix by/with/times a/an #j by #n matrix twice with seeds #s and #t
p goal for review two matmul_u32 jobs each multiplying a/an #m by #k matrix by a/an #j by #n matrix with seeds #s and #t in that order
x ?please ?run/do/compute/submit ?a/an/one matmul/matmul_u32 ?job ?of ?size #m x #k x #n ?with seeds #s ?and #t
x ?please ?run/do/compute/submit two matmuls/matmul/matmul_u32s/matmul_u32 ?jobs ?of ?size #m x #k x #n ?with seed #s
x ?please multiply a/an #m by #k matrix by/with/times a/an #j by #n matrix with seeds #s and #t
x ?please ?run/do/compute/submit ?a/an/one matmul/matmul_u32 ?job ?of ?size #m x #k x #n ?with seed #s and/or ?seed #t
x ?please ?run/do/compute/submit ?a/an/one matmul/matmul_u32 ?job ?of ?size #m x #k x #n ?with seed #s seed #t

Decision:

  1. If any x rule matches, or two m/p rules give different readings, the result is 23.
  2. If no rule matches, the result is 20.
  3. Otherwise a range or malformed-number failure gives 21.
  4. Otherwise j ≠ k gives 22.
  5. Otherwise the G line is printed: goal mm ushort 0xMMM ushort 0xKKK ushort 0xNNN ulong 0xSSSS end or goal pair … ulong 0xSSSS ulong 0xTTTT end, in lowercase hex.

goal2en templates (fixed)

The article is always a. Every value is decimal. Both sentences are in the en2goal grammar, and the suite checks that re-parsing them gives the same G.

rep2en

CLI: rep2en FACTS_TSV. stdin carries the G line, then the P line.

Facts format (interface v1.2 §5): facts.tsv has 13 TAB-separated columns: job attempt m k n seed exit class code dag_id mjr1_sha256 mjr1_outcome verifier.

Validity: any of the following gives G2E_INVALID facts with exit 31:

Templates (fixed; values come only from G and facts.tsv):

CaseSentence
ok mmCompleted and verified: one matmul_u32 job multiplying a {m} by {k} matrix by a {k} by {n} matrix with seed {s}; job 1 dag_id {dag1} mjr1_sha256 {sha1}.
ok pairCompleted and verified: two matmul_u32 jobs, each multiplying a {m} by {k} matrix by a {k} by {n} matrix, with seeds {s1} and {s2}; job 1 dag_id {dag1} mjr1_sha256 {sha1}; job 2 dag_id {dag2} mjr1_sha256 {sha2}.
refused boundNot completed: refused before dispatch (code bound): the goal asks for a {m} by {k} by {n} matmul and a dimension is outside the admitted range 1 to 256; nothing was dispatched.
refused CNot completed: job {j} was refused (code {C}): {plain}.
fail CNot completed: job {j} failed (code {C}): {plain}.

{dag}/{sha} are the dag_id/mjr1_sha256 of that job's last facts row; {j} is the job of the last facts row.

Plain words:

CodePlain words
replaythe worker refused a replay of an already executed job
budgetthe job was refused for budget or fuel
workerthe worker refused the job
transportthe connection to the worker failed
receiptthe verifier refused the worker receipt
recompthe verifier recompute failed
verdictthe recomputed result did not match the worker result
ioa local input or output error occurred

Checks, in order:

  1. An invalid G gives G2E_INVALID goal <reason>, an invalid P G2E_INVALID report <reason>, malformed stdin G2E_INVALID input and an invalid facts file (every rule under Validity, header and history included) G2E_INVALID facts, all with exit 31.
  2. P ok whose kind or operands differ from G gives G2E_CONTRADICT operands.
  3. Every facts row:
    • a job outside 1..(1 or 2) gives G2E_CONTRADICT jobs;
    • m/k/n differing from G, or a seed differing from G's seed for that job, gives G2E_CONTRADICT operands.
  4. P ok:
    • every job of G needs a last row with class ok (hence exit 0), otherwise jobs (missing) or class;
    • if the check passes, the success template is printed.
  5. P refused bound: facts must have no rows (bound otherwise) and a G dim must be outside 1..256 (bound otherwise).
  6. P refused/fail C:
    • facts must have rows (dispatch otherwise);
    • the last row must have the same class (class otherwise) and the same code (code otherwise).

A retried job (an attempt-1 fail transport row, then an attempt-2 row for the same job) is decided by its attempt-2 row.

Measured accuracy and cost (receipt: evidence/OMEGESE45/translator/suite.txt)

Not covered (NOT_RUN or out of scope)