diff --git a/.trinity/seals/hf_hf_model_card_hslm.json b/.trinity/seals/hf_hf_model_card_hslm.json new file mode 100644 index 0000000000..16d030b141 --- /dev/null +++ b/.trinity/seals/hf_hf_model_card_hslm.json @@ -0,0 +1,28 @@ +{ + "built_by": "t27c-bootstrap@0.5.2+fd332dfd5", + "closure": [], + "config": "gen=c,rust,verilog,zig;tests=zig", + "gen_hash_c": "sha256:5dd18763618fd8bb20f04469fa7fda1d58af17b4a88de090938ab4f260f048c8", + "gen_hash_rust": "sha256:6c7cd38aaa31e129190ba1a0f1d50d719466c30baf9aa3bc909ef00c93bec3db", + "gen_hash_verilog": "sha256:934e0bd8f85e55b9bb51e0b59148747ff7bf52eee7a2b5d81bf55ca14e3aaf3c", + "gen_hash_zig": "sha256:3886b16d9287cb00cd91eb39953607484bac95ab4f41948ea1db2bc4a63feaf8", + "module": "hf_model_card_hslm", + "ring": 12, + "seal_schema": 2, + "sealed_at": "2026-10-19T04:08:17Z", + "sealed_by": "t27c-bootstrap@0.5.2", + "spec_hash": "sha256:0b8452aadc5d1280fb651ef8c249776774c6286d0d683df42fe7f78434cc1d8e", + "spec_path": "specs/hf/model_card_hslm.t27", + "tests": { + "failed": 0, + "failing": [], + "forced": false, + "passed": 14, + "total": 14, + "vacuous": 0 + }, + "toolchain": { + "test_runner": "sha256:8512b80da533b79289110fca4a65f3336abd7a059ca4b72ea595d5e33ff8ad10", + "zig": "0.16.0" + } +} \ No newline at end of file diff --git a/.trinity/seals/igla_own_model.json b/.trinity/seals/igla_own_model.json index 40d354c5f9..6921cbdfac 100644 --- a/.trinity/seals/igla_own_model.json +++ b/.trinity/seals/igla_own_model.json @@ -1,5 +1,5 @@ { - "built_by": "t27c-bootstrap@0.5.2+9e8ff7af6", + "built_by": "t27c-bootstrap@0.5.2+78e57be99", "closure": [ { "spec": "specs/t27f/reel.t27", @@ -15,16 +15,16 @@ } ], "config": "gen=c,rust,verilog,zig;tests=zig", - "gen_hash_c": "sha256:5c6365f8b63c2904bb3b13278b99d66c84ade2025cf6ee084cb4cf19598c4c38", - "gen_hash_rust": "sha256:313643b2f632168a470d4d77396ca4da7bd110a32a0b51f2c3a96cb6030fbf06", - "gen_hash_verilog": "sha256:d2ac3cfcc384a8d8f14d55346b2d193670f4ad1424173ff7a5f524b5ecd69c5f", - "gen_hash_zig": "sha256:034324eec283aebddf41d64127dac4b6cdd871ce0ff1cb1c91ab17b58d8ffc69", + "gen_hash_c": "sha256:b873f8520e4df899149f445c461301bf1b49386f2b4811100f489c9932a300c3", + "gen_hash_rust": "sha256:a05f10d67d5d4fb39b8a11ae22cc6b6913221bb9af0e3e21d2ec59c171f146a1", + "gen_hash_verilog": "sha256:8032a8e3eaf5eb5dadcf0f770b6a95cee174ab29e3012ec483b1a9345173a61b", + "gen_hash_zig": "sha256:177198184dd4d70d87a62bfb58848652c49d1b4fed0f22977868534b0a7f438f", "module": "own_model", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-18T22:16:17Z", + "sealed_at": "2026-10-19T07:07:05Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:5a3d744947dc65b8c13d02a3ad58aa6c97f694f5459634110823788381a5ff80", + "spec_hash": "sha256:e0f4c553c36eb759edf2fa6b93d42eb383754652e0d317552047c2b2d308f46b", "spec_path": "specs/igla/own_model.t27", "tests": { "failed": 0, diff --git a/.trinity/seals/igla_own_model_board.json b/.trinity/seals/igla_own_model_board.json index ac1609d402..78c4c409b1 100644 --- a/.trinity/seals/igla_own_model_board.json +++ b/.trinity/seals/igla_own_model_board.json @@ -1,9 +1,9 @@ { - "built_by": "t27c-bootstrap@0.5.2+9e8ff7af6", + "built_by": "t27c-bootstrap@0.5.2+fd332dfd5", "closure": [ { "spec": "specs/igla/own_model.t27", - "spec_hash": "sha256:5a3d744947dc65b8c13d02a3ad58aa6c97f694f5459634110823788381a5ff80" + "spec_hash": "sha256:8efc8a9423a6d7b18ddd759008ae0137242ed1e03dea09b41e3869a778519fd3" }, { "spec": "specs/t27f/reel.t27", @@ -19,16 +19,16 @@ } ], "config": "gen=c,rust,verilog,zig;tests=zig", - "gen_hash_c": "sha256:e4afa57dd33fdae88c9bc8bcbad343ceadac9bb8ef19a775415b1d4582778f03", - "gen_hash_rust": "sha256:382521e2dadd256ffb9713a2fad1fc39f4fdd07fa18443c080cb186512b8aa65", - "gen_hash_verilog": "sha256:4e773a0e4aa1439990eeacc896f6b4d0ca8a43df1a92db6ffa69bb4d84d98655", - "gen_hash_zig": "sha256:270159ce45d856052de63181768a5f8f3af5f69180fa2ad917c5b5beff4ffa75", + "gen_hash_c": "sha256:a14cf110820c0e7bdcbf44240a9be49d62300a664954730cf26410d71eaaec1a", + "gen_hash_rust": "sha256:dceaed38810aff55353acff2d459583b8e64e7f247367c84e4e8c7dea6d89590", + "gen_hash_verilog": "sha256:50e26152e1e64b1b78fbd0c4f5d3ff38721da846715536f31d31d3d3779aeb4b", + "gen_hash_zig": "sha256:54459eecfeaea8e89e3ebda66b1d56c444fcad56b811870bd204276ea0337f06", "module": "own_model_board", "ring": 12, "seal_schema": 2, - "sealed_at": "2026-10-18T22:16:20Z", + "sealed_at": "2026-10-19T04:08:14Z", "sealed_by": "t27c-bootstrap@0.5.2", - "spec_hash": "sha256:dabe2457877296de9097c66834d3a29ad66aa1862cc86fc8242ae9ab1acd39e5", + "spec_hash": "sha256:ee1523acf392e509995b6ee8a782d60bea56cf3a00fb1bd6b30647f59fd67b71", "spec_path": "specs/igla/own_model_board.t27", "tests": { "failed": 0, diff --git a/docs/reports/t27b_expectations.json b/docs/reports/t27b_expectations.json index c65d3ed1de..58ba30b982 100644 --- a/docs/reports/t27b_expectations.json +++ b/docs/reports/t27b_expectations.json @@ -444,6 +444,7 @@ {"path": "specs/functions/webhook-generation-validate.t27", "t27b": "pass"}, {"path": "specs/functions/welcome-avatar-generate.t27", "t27b": "pass"}, {"path": "specs/github/auth.t27", "t27b": "pass"}, + {"path": "specs/hf/model_card_hslm.t27", "t27b": "pass"}, {"path": "specs/hosting/credit.t27", "t27b": "pass"}, {"path": "specs/hosting/feed.t27", "t27b": "pass"}, {"path": "specs/hosting/host.t27", "t27b": "pass"}, diff --git a/gen/json/igla/own_model_board.json b/gen/json/igla/own_model_board.json index 40616ee7af..944579c4d3 100644 --- a/gen/json/igla/own_model_board.json +++ b/gen/json/igla/own_model_board.json @@ -1 +1 @@ -{"job":"own_model","stage":"own_model","msg":"4 published, 23 verified, 0 drafts, 0 gaps; 62%","progress":0.62,"metrics":{"lens_pct":[68,70,48],"cells":[{"status":4,"pct":60},{"status":4,"pct":70},{"status":4,"pct":80},{"status":4,"pct":80},{"status":4,"pct":60},{"status":4,"pct":100},{"status":5,"pct":50},{"status":5,"pct":90},{"status":5,"pct":30},{"status":4,"pct":100},{"status":4,"pct":100},{"status":4,"pct":20},{"status":4,"pct":80},{"status":4,"pct":65},{"status":4,"pct":95},{"status":4,"pct":75},{"status":4,"pct":55},{"status":4,"pct":40},{"status":4,"pct":70},{"status":4,"pct":15},{"status":5,"pct":60},{"status":4,"pct":40},{"status":4,"pct":100},{"status":4,"pct":60},{"status":4,"pct":30},{"status":4,"pct":15},{"status":4,"pct":50}]}} +{"job":"own_model","stage":"own_model","msg":"5 published, 22 verified, 0 drafts, 0 gaps; 66%","progress":0.66,"metrics":{"lens_pct":[68,77,53],"cells":[{"status":4,"pct":60},{"status":4,"pct":70},{"status":4,"pct":80},{"status":4,"pct":80},{"status":4,"pct":60},{"status":4,"pct":100},{"status":5,"pct":50},{"status":5,"pct":90},{"status":5,"pct":30},{"status":4,"pct":100},{"status":4,"pct":100},{"status":4,"pct":20},{"status":4,"pct":80},{"status":4,"pct":65},{"status":4,"pct":95},{"status":4,"pct":75},{"status":4,"pct":85},{"status":4,"pct":80},{"status":4,"pct":70},{"status":4,"pct":15},{"status":5,"pct":60},{"status":4,"pct":40},{"status":4,"pct":100},{"status":4,"pct":60},{"status":5,"pct":70},{"status":4,"pct":15},{"status":4,"pct":50}]}} diff --git a/specs/hf/model_card_hslm.t27 b/specs/hf/model_card_hslm.t27 new file mode 100644 index 0000000000..d8733b4c7b --- /dev/null +++ b/specs/hf/model_card_hslm.t27 @@ -0,0 +1,364 @@ +// SPDX-License-Identifier: Apache-2.0 +// specs/hf/model_card_hslm.t27 -- source of truth for the Hugging Face model +// card of HSLM (playra/hslm-t27-2m), the 2.13M-parameter ternary language model +// trained end to end by a t27 program. Issue: gHashTag/t27#10372 (epic #10024, +// own_model cell 25). +// +// Every number below is read from /tmp/hslm/run.log of run 2 (train_hslm, +// 8000 steps, Railway lab), from eval_8000_w19683.txt (eval_hslm, 19683 +// held-out windows), from ngram.txt (ngram_hslm, the count baselines on the same +// tokens and windows), from sha256sum and wc -c of the released files on the +// lab, derived from the shapes by the tests, or is the string "not measured". +// Zero is never used to mean unknown. Same structure as the IGLA-Coder cards +// (gHashTag/igla-coder-gpu specs/hf/model_card_500m.t27). ASCII only (L3), +// English only (LANG-EN). +// phi^2 + 1/phi^2 = 3 | TRINITY + +module hf_model_card_hslm; + +pub const KIND : str = "hf-model-card"; +pub const ID : str = "hf/hslm_t27_2m"; +pub const NAME : str = "hslm_t27_2m"; +pub const TAGLINE : str = "A 2.13M-parameter ternary transformer whose architecture, training, checkpoint format and evaluation are all t27 programs. On held-out TinyStories it beats a bigram count model and loses to a trigram one."; +pub const LICENSE : str = "apache-2.0"; +pub const MODEL_URL : str = "https://huggingface.co/playra/hslm-t27-2m"; +pub const SOURCE_URL : str = "https://github.com/gHashTag/t27"; +pub const STATUS : str = "published"; + +// -- Architecture ------------------------------------------------------------ +// source: specs/ml/train_hslm.t27 header (THE MODEL) and specs/nn/hslm.t27. +// Every size is a power of three. +pub const SRC_ARCH : str = "specs/ml/train_hslm.t27 THE MODEL; specs/nn/hslm.t27"; +pub const CTX : u64 = 27; +pub const VOCAB : u64 = 729; +pub const EMBED : u64 = 243; +pub const FF : u64 = 729; +pub const N_BLOCK : u64 = 3; +pub const N_HEAD : u64 = 3; +pub const HEAD_DIM : u64 = 81; +pub const ARCH : str = "Decoder-only transformer, 3 blocks: RMSNorm, causal multi-head attention (3 heads of 81), RMSNorm, feed-forward 243 -> 729 -> 243 with biases; final RMSNorm without gain, ternary output head with a float bias. Token embedding 729 x 243 in floats."; +pub const TERNARY_NOTE : str = "Q, K, V, O, up and down in each block and the output head are ternary: each has an f64 shadow, requantized after every update with TWN (delta = 0.7 mean |w|, alpha = mean |w| over the kept entries, one alpha per matrix; nn/ternary_ste quantize_twn). The embedding, RMSNorm gains and biases are trained directly in floats."; + +// -- Parameters -------------------------------------------------------------- +// source: train_hslm NPARAM 2130138 (the run.log header prints nparam 2130138); +// the tests re-derive it from the shapes. +pub const SRC_PARAMS : str = "run.log header nparam 2130138; re-derived by tests"; +pub const PARAMS_TOTAL : u64 = 2130138; +pub const PARAMS_TERNARY : u64 = 1948617; +pub const PARAMS_EMBED : u64 = 177147; +pub const BLOCK_FLOAT_PARAMS : u64 = 1215; +pub const OUT_BIAS : u64 = 729; +pub const TERNARY_MATRICES : u64 = 19; +pub const SEGMENTS : u64 = 30; + +// -- Tokenizer --------------------------------------------------------------- +pub const SRC_TOKENIZER : str = "specs/nn/hslm_tokenizer.t27 (merges from trinity-training @ 3e9648c1817a97c5f9b8c727b0f8e2291928eead)"; +pub const TOK_SPECIALS : u64 = 4; +pub const TOK_BYTES : u64 = 256; +pub const TOK_MERGES : u64 = 469; +pub const TOK_NOTE : str = "Byte-level BPE: ids 0..3 are PAD, BOS, EOS, UNK; id = byte + 4 for the 256 bytes; 469 merges fill the vocabulary to 729."; + +// -- Data -------------------------------------------------------------------- +// source: wc -c and sha256sum on the lab; HTOK headers (12 bytes + 2 per token). +pub const SRC_DATA : str = "roneneldan/TinyStories on Hugging Face: TinyStoriesV2-GPT4-train.txt (first 25,000,000 bytes, cut at the last story marker) and TinyStoriesV2-GPT4-valid.txt; tokenized by specs/ml/hslm_corpus.t27"; +pub const DATA_LICENSE : str = "CDLA-Sharing-1.0"; +pub const TRAIN_RAW_BYTES : u64 = 25000000; +pub const TRAIN_TXT_BYTES : u64 = 24999431; +pub const TRAIN_STORIES : u64 = 30496; +pub const VALID_TXT_BYTES : u64 = 22502601; +pub const VALID_STORIES : u64 = 27630; +pub const TRAIN_TOKENS : u64 = 8557893; +pub const VALID_TOKENS : u64 = 7689354; +pub const TRAIN_TOK_BYTES : u64 = 17115798; +pub const VALID_TOK_BYTES : u64 = 15378720; +pub const TRAIN_TXT_SHA256 : str = "11dd493e85414802061dbf9d94840839c9fbc8e7c71e8833a4c82713a4093e24"; +pub const TRAIN_RAW_SHA256 : str = "4f58be27e7c321948886b8d10bbfe270df428609a847569ecb6ce8ea7f472caa"; +pub const VALID_TXT_SHA256 : str = "6874bae9a4c1a4e7edcf0e53b86c17817e9cf881fc75ff2368da457b80c0585d"; +pub const TRAIN_TOK_SHA256 : str = "9631d31544f1733e752a7d7c92f67467fa5781cc4d917628d9641987521127d5"; +pub const VALID_TOK_SHA256 : str = "d076d9e8fd8a4fd6ab1ee67d0d57cf770fb0597bdf0ccee87c69a21e0c284d91"; +pub const DATA_NOTE : str = "The token files are not in this repository; rebuild them from the two TinyStories files with specs/ml/hslm_corpus.t27 and check them against the pinned sha256."; + +// -- Training (run 2) -------------------------------------------------------- +// source: run.log header and done line; train_hslm THE STEP. +pub const SRC_TRAIN : str = "run.log (sha256 below): header, step lines every 500 steps, done line"; +pub const TRAIN_BATCH : u64 = 66; +pub const TRAIN_STEPS : u64 = 8000; +pub const TRAIN_TOTAL : u64 = 8000; +pub const DEFAULT_STEPS : u64 = 32000; +pub const TRAIN_WARMUP : u64 = 2000; +pub const TRAIN_SEED : u64 = 1729; +pub const LOSS_POSITIONS : u64 = 27; +pub const TRAIN_TOKENS_SEEN : u64 = 14256000; +pub const TRAIN_RECIPE : str = "LAMB (beta1 0.9, beta2 0.999, eps 1e-6, weight decay 0.01 on matrices and embedding), gradients averaged over 66 windows of 27 tokens and clipped to L2 norm 1.0; learning rate 1e-3 after 2000 linear warmup steps, cosine to 1e-6 at step 8000; loss = mean cross-entropy over all 27 positions."; +pub const TRAIN_NOTE : str = "The schedule ran to its end (lr 1e-6 at step 8000), but 8000 is a quarter of the trainer's default 32000 steps, and the model saw 14,256,000 tokens, 1.67 passes over the 8.56M-token train cut. It is undertrained, not converged."; + +// -- Hardware and speed ------------------------------------------------------ +pub const HW : str = "Railway lab container, CPU only; t27c 0.5.2, zig 0.16.0"; +pub const TRAIN_S_E2 : u64 = 4648354; +pub const WALL_S_E2 : u64 = 4668853; +pub const S_PER_STEP_E4 : u64 = 58104; +pub const TOK_PER_S_E1 : u64 = 3067; +pub const IO_FAIL : u64 = 0; +pub const TRAIN_COST : str = "not measured"; +pub const COST_NOTE : str = "The lab is a shared Railway service; no per-run bill exists."; + +// -- The training curve ------------------------------------------------------ +// source: run.log step lines, valid_full_loss (243 fixed held-out windows, all +// 27 positions) times 10000. Steps 0, 500, ..., 8000. +pub const CURVE_STEPS : [17]u64 = [0, 500, 1000, 1500, 2000, 2500, 3000, 3500, 4000, 4500, 5000, 5500, 6000, 6500, 7000, 7500, 8000]; +pub const CURVE_VALID_FULL_E4 : [17]u64 = [66073, 64200, 61570, 58280, 51755, 45125, 39977, 37013, 35302, 34217, 33418, 32790, 32379, 32010, 31804, 31693, 31591]; +pub const LN_VOCAB_E4 : u64 = 65917; +pub const TRAIN_LOSS_LAST_E4 : u64 = 32188; +pub const MONITOR_LAST_E4 : u64 = 32332; +pub const CURVE_NOTE : str = "The curve is the trainer's own monitor: 243 fixed windows, 6,561 positions. It starts at 6.6073 nats, next to ln 729 = 6.5917 for a uniform guess, and ends at 3.1591. The held-out number below is the larger 19,683-window measure, which is higher (3.2352)."; + +// -- Held-out result --------------------------------------------------------- +// source: eval_8000_w19683.txt, eval_hslm with eval.cfg step=8000 windows=19683 +// stride=0 check=1. Loss in nats times 10000, perplexity times 100. +pub const SRC_EVAL : str = "eval_8000_w19683.txt (eval_hslm, 19683 evenly spaced windows of 28 held-out tokens)"; +pub const EVAL_WINDOWS : u64 = 19683; +pub const EVAL_POSITIONS : u64 = 531441; +pub const EVAL_FULL_LOSS_E4 : u64 = 32352; +pub const EVAL_FULL_PPL_E2 : u64 = 2541; +pub const EVAL_LAST_LOSS_E4 : u64 = 32292; +pub const EVAL_LAST_PPL_E2 : u64 = 2526; +pub const EVAL_CHECK : str = "check tr_valid_loss 3.229189 last_loss 3.229189 same_bits 1"; +pub const EVAL_BPB_E4 : u64 = 15949; +pub const EVAL_BPB : str = "about 1.595"; +pub const EVAL_NOTE : str = "full = mean cross-entropy over all 27 positions of each window; last = position 26 only. The windows cover 531,441 of the 7.69M held-out tokens (about 7 percent), 390 tokens apart. Bits per byte scales the window loss by the stream's tokens per byte (7,689,354 tokens in 22,502,601 bytes), so it is approximate."; + +// -- Baselines --------------------------------------------------------------- +// source: ngram.txt, ngram_hslm: count models fitted on all of train.tok, +// interpolated absolute discounting D = 0.75, no parameter tuned on valid.tok. +// [unigram, bigram, trigram] +pub const SRC_BASE : str = "ngram.txt (ngram_hslm; trigram_types 730582)"; +pub const BASE_ORDERS : [3]str = ["unigram", "bigram", "trigram"]; +pub const BASE_FULL_LOSS_E4 : [3]u64 = [58111, 35240, 25270]; +pub const BASE_FULL_PPL_E2 : [3]u64 = [33398, 3392, 1252]; +pub const BASE_LAST_PPL_E2 : [3]u64 = [33417, 3432, 1198]; +pub const BASE_STREAM_LOSS_E4 : [3]u64 = [58115, 35256, 24912]; +pub const BASE_STREAM_BPB_E4 : [3]u64 = [28650, 17380, 12281]; +pub const STREAM_PREDICTED : u64 = 7689353; +pub const BASE_NOTE : str = "On the same 19,683 windows HSLM (perplexity 25.41) beats the bigram (33.92) and the unigram (333.98) and loses to the trigram (12.52). In bits per byte: unigram 2.865, bigram 1.738, HSLM about 1.595, trigram 1.228; a uniform guess over 729 tokens is about 3.25."; + +// -- Scope and honesty ------------------------------------------------------- +pub const SCOPE_NOTE : str = "A research checkpoint and its full record: a tiny ternary model trained, checkpointed and scored entirely by t27 programs. It is not a usable story generator, and a trigram table predicts the same text better."; +pub const NO_QUALITY_CLAIM : bool = true; +pub const QUALITY_CLAIM_POLICY : str = "No comparison with any third-party model is claimed: the 729-token vocabulary fixes the scale, so published TinyStories perplexities with other tokenizers do not compare. The only comparisons are the count models on the same tokens and windows."; +pub const R5_NOTE : str = "The earlier HSLM record PPL 2.96 (run R5, ctx 27) is not comparable: it was one training minibatch, last position only, best of several seeds, on a different data cut."; + +// -- Release format ---------------------------------------------------------- +// source: wc -c and sha256sum of the files on the lab, re-checked on the +// release machine before the upload. +pub const STATE_BYTES : u64 = 51123376; +pub const STATE_HEADER : u64 = 64; +pub const STATE_SHA256 : str = "9034e049c61bb237a083bec7bcaccd0ab0a3c7e3bf0b3ef2cd9f1c0eb9e9761b"; +pub const STATE_NOTE : str = "ckpt_8000.state is the full checkpoint: a 64-byte header (\"T27S\", version 1, step, nparam, rng, beta1^t, beta2^t, loss, nseg), then the 2,130,138 parameters, LAMB m and LAMB v, f64 little endian. eval_hslm and train_hslm (resume=8000) read it."; +pub const BIN_BYTES : u64 = 4971796; +pub const BIN_HEADER : u64 = 16; +pub const BIN_SHA256 : str = "ae9050f968922d5436dab34a8aa7d1dfa4f01660cefd270c2430cb082c3eec5e"; +pub const BIN_NOTE : str = "ckpt_8000.bin is the MSLH image of nn/hslm_data: a 16-byte header, then f32 output shadow, and per block shadow_up, shadow_down, bias_up, bias_down. It has no attention matrices, embedding, gains or output bias, so it cannot run the model alone; it is kept for the MSLH format."; +pub const RUN_LOG_SHA256 : str = "0180ab209fda0b7c811e1f7df4237d75bebee49162119690de72bf0b5375894e"; +pub const EVAL_TXT_SHA256 : str = "0539cd8207f7fc8cc450c2e53d7f246d5526c970be91c35b2dc290fe15bf345f"; +pub const NGRAM_TXT_SHA256 : str = "6902ba4c3464c4f492cb62167e31bbb17c1d6f8f6c6def8607580f2cc6db8567"; +pub const TRAINER_SHA256 : str = "e3f2d803e5f4a7744a5294039df7899d6401e42b40f20e63a269d9f04bfe71c5"; +pub const SRC_TRAINER : str = "the train_hslm binary of run 2, built 2026-10-18 by t27c from specs/ml/train_hslm.t27 sha256 fa8490d8..."; + +// -- The programs ------------------------------------------------------------ +pub const SPECS : [9]str = ["specs/base/types.t27", "specs/nn/hslm.t27", "specs/nn/hslm_data.t27", "specs/nn/ternary_ste.t27", "specs/nn/hslm_tokenizer.t27", "specs/ml/hslm_corpus.t27", "specs/ml/train_hslm.t27", "specs/ml/eval_hslm.t27", "specs/ml/ngram_hslm.t27"]; +pub const SPEC_BYTES : [9]u64 = [57054, 93160, 30579, 22953, 38463, 28855, 88119, 24404, 20750]; +pub const SPEC_SHA256 : [9]str = ["3c2fb2a2edf20e90bc76798fb5d12690b2f60fc0f5bbf2f6052936e22d6e62e2", "a59d22284d9b95cbe331e0d3a434dbfe7b5cf01ff86cb217503260eb02064822", "99481f1c656ecf08343674cd7e438e3656da773024241f6cdc5275344c4ef374", "b909855bd14a51f8bb4b90e2d6bc0d8f868c25a49d7175f9ec2a9e0380d0f410", "b97c693512dce2f8160d591ad2978cf093d5eed29c1b8ad4aa29cce12ed37616", "6ee83c59f9fd54116b8f460216a873efc32de979ed23da15296db691211ca365", "fa8490d815bde2815fe9bfa89cb9badab241f580977e59be52fc5902f6f8bb03", "09c6729a1509a6ec95616fd50fccf4eb6a3d65dfd22c9aec359e6079a52acec1", "d3e31459bc0702d1b59357dad2b4d2ef679fbe95fcda2185adb612a2bdb6f6ed"]; +pub const HOW_TO_RUN : str = "t27c gen specs/ml/eval_hslm.t27, build it with zig, put ckpt_8000.state and valid.tok in /tmp/hslm, write step=8000 windows=19683 to /tmp/hslm/eval.cfg, and run it: it prints the eval line in eval_8000_w19683.txt."; + +// -- The package ------------------------------------------------------------- +pub const FILES : [8]str = ["README.md", "model_card.t27", "LICENSE", "ckpt_8000.state", "ckpt_8000.bin", "run.log", "eval_8000_w19683.txt", "ngram.txt"]; + + +// Comparison helpers. t27c folds an assert over constants at compile time and +// counts it as a vacuous pass (#6509, T730); routing the comparison through a +// function makes every assert below a runtime assert. +fn eq(a : u64, b : u64) -> bool { return a == b; } +fn le(a : u64, b : u64) -> bool { return a <= b; } +fn lt(a : u64, b : u64) -> bool { return a < b; } +fn ge(a : u64, b : u64) -> bool { return a >= b; } +fn gt(a : u64, b : u64) -> bool { return a > b; } + +// Bits per byte times 10000 from a loss in nats times 10000: +// loss / ln 2 * tokens / bytes, ln 2 = 0.693147. True when bpb_e4 is within 1. +fn bpb_within_one(loss_e4 : u64, tokens : u64, bytes : u64, bpb_e4 : u64) -> bool { + var num : u64 = loss_e4 * 1000000 * tokens; + var den : u64 = 693147 * bytes; + return (bpb_e4 - 1) * den <= num and num <= (bpb_e4 + 1) * den; +} + +// True when every curve value is below the one before it. +fn curve_falls() -> bool { + var i : usize = 1; + while (i < 17) { + if (CURVE_VALID_FULL_E4[i] >= CURVE_VALID_FULL_E4[i - 1]) { + return false; + } + i = i + 1; + } + return true; +} + +// -- Invariants. The card may not render unless these hold. ----------------- +test config_is_powers_of_three { + assert eq(CTX, 3 * 3 * 3); + assert eq(EMBED, 3 * 3 * 3 * 3 * 3); + assert eq(VOCAB, 3 * EMBED); + assert eq(FF, VOCAB); + assert eq(HEAD_DIM, 3 * CTX); + assert eq(N_HEAD * HEAD_DIM, EMBED); + assert eq(N_BLOCK, 3); +} + +test parameter_accounting { + // per block: Q, K, V, O are 243 x 243; up 243 x 729; down 729 x 243; plus the head 243 x 729 + assert eq(PARAMS_TERNARY, N_BLOCK * (4 * EMBED * EMBED + 2 * EMBED * FF) + EMBED * VOCAB); + assert eq(TERNARY_MATRICES, N_BLOCK * 6 + 1); + assert eq(PARAMS_EMBED, VOCAB * EMBED); + // per block floats: RMSNorm gain 243, bias_up 729, bias_down 243 + assert eq(BLOCK_FLOAT_PARAMS, EMBED + FF + EMBED); + assert eq(PARAMS_TOTAL, PARAMS_TERNARY + PARAMS_EMBED + N_BLOCK * BLOCK_FLOAT_PARAMS + OUT_BIAS); + assert eq(PARAMS_TOTAL, 2130138); + // segments: the embedding, 9 per block, the head matrix and its bias + assert eq(SEGMENTS, 1 + N_BLOCK * 9 + 2); +} + +test tokenizer_fills_the_vocabulary { + assert eq(TOK_SPECIALS + TOK_BYTES + TOK_MERGES, VOCAB); +} + +test token_files_match_their_counts { + // HTOK: "HTOK", u32 version, u32 N, then N u16 ids + assert eq(TRAIN_TOK_BYTES, 12 + 2 * TRAIN_TOKENS); + assert eq(VALID_TOK_BYTES, 12 + 2 * VALID_TOKENS); + assert le(TRAIN_TXT_BYTES, TRAIN_RAW_BYTES); + assert gt(TRAIN_TXT_BYTES + 1000, TRAIN_RAW_BYTES); + // about 2.9 bytes per token on both files + assert gt(VALID_TXT_BYTES * 10, VALID_TOKENS * 29); + assert lt(VALID_TXT_BYTES * 10, VALID_TOKENS * 30); + assert gt(TRAIN_TXT_BYTES * 10, TRAIN_TOKENS * 29); + assert lt(TRAIN_TXT_BYTES * 10, TRAIN_TOKENS * 30); +} + +test training_arithmetic { + assert eq(TRAIN_TOKENS_SEEN, TRAIN_BATCH * CTX * TRAIN_STEPS); + assert eq(TRAIN_STEPS, TRAIN_TOTAL); + assert eq(4 * TRAIN_STEPS, DEFAULT_STEPS); + assert lt(TRAIN_WARMUP, TRAIN_STEPS); + assert eq(LOSS_POSITIONS, CTX); + // 1.67 passes over the train tokens + assert gt(TRAIN_TOKENS_SEEN * 100, TRAIN_TOKENS * 166); + assert lt(TRAIN_TOKENS_SEEN * 100, TRAIN_TOKENS * 167); + assert eq(TRAIN_SEED, 1729); +} + +test speed_follows_from_the_done_line { + // tokens / train_s = 306.69 tokens/s, printed 306.7 (within half a unit of the last digit) + assert ge(TRAIN_TOKENS_SEEN * 2000, (TOK_PER_S_E1 * 2 - 1) * TRAIN_S_E2); + assert lt(TRAIN_TOKENS_SEEN * 2000, (TOK_PER_S_E1 * 2 + 1) * TRAIN_S_E2); + // train_s / steps = 5.8104 s per step, the same way + assert ge(TRAIN_S_E2 * 200, (S_PER_STEP_E4 * 2 - 1) * TRAIN_STEPS); + assert lt(TRAIN_S_E2 * 200, (S_PER_STEP_E4 * 2 + 1) * TRAIN_STEPS); + assert le(TRAIN_S_E2, WALL_S_E2); + assert eq(IO_FAIL, 0); + assert TRAIN_COST == "not measured"; +} + +test the_curve_starts_at_a_uniform_guess_and_falls { + assert eq(CURVE_STEPS[16], TRAIN_STEPS); + assert eq(CURVE_STEPS[1] - CURVE_STEPS[0], 500); + assert curve_falls(); + // step 0 is within 0.02 nats of ln 729 + assert lt(CURVE_VALID_FULL_E4[0], LN_VOCAB_E4 + 200); + assert gt(CURVE_VALID_FULL_E4[0], LN_VOCAB_E4 - 200); + // the monitor's last-position loss at 8000 is run.log valid_loss 3.2332 + assert eq(MONITOR_LAST_E4, 32332); + // the held-out measure is higher than the 243-window monitor + assert gt(EVAL_FULL_LOSS_E4, CURVE_VALID_FULL_E4[16]); + // train and held-out loss are within 0.02 nats: no sign of overfitting + assert lt(EVAL_FULL_LOSS_E4, TRAIN_LOSS_LAST_E4 + 200); + assert gt(EVAL_FULL_LOSS_E4 + 200, TRAIN_LOSS_LAST_E4); +} + +test the_held_out_measure_is_stated_honestly { + assert eq(EVAL_POSITIONS, EVAL_WINDOWS * CTX); + // 3^12 positions + assert eq(EVAL_POSITIONS, 531441); + // about 7 percent of the held-out tokens, not a third + assert gt(EVAL_POSITIONS * 100, VALID_TOKENS * 6); + assert lt(EVAL_POSITIONS * 100, VALID_TOKENS * 7); + // windows 390 tokens apart: (N - 28) / 19683 + assert eq((VALID_TOKENS - 28) / EVAL_WINDOWS, 390); + assert bpb_within_one(EVAL_FULL_LOSS_E4, STREAM_PREDICTED, VALID_TXT_BYTES, EVAL_BPB_E4); + assert EVAL_BPB == "about 1.595"; + assert EVAL_CHECK == "check tr_valid_loss 3.229189 last_loss 3.229189 same_bits 1"; +} + +test baselines_order_the_result { + // trigram < HSLM < bigram < unigram < uniform, on full-window loss and perplexity + assert lt(BASE_FULL_LOSS_E4[2], EVAL_FULL_LOSS_E4); + assert lt(EVAL_FULL_LOSS_E4, BASE_FULL_LOSS_E4[1]); + assert lt(BASE_FULL_LOSS_E4[1], BASE_FULL_LOSS_E4[0]); + assert lt(BASE_FULL_LOSS_E4[0], LN_VOCAB_E4); + assert lt(BASE_FULL_PPL_E2[2], EVAL_FULL_PPL_E2); + assert lt(EVAL_FULL_PPL_E2, BASE_FULL_PPL_E2[1]); + assert lt(BASE_FULL_PPL_E2[1], BASE_FULL_PPL_E2[0]); + assert lt(BASE_FULL_PPL_E2[0], VOCAB * 100); + // the same order at the last position + assert lt(BASE_LAST_PPL_E2[2], EVAL_LAST_PPL_E2); + assert lt(EVAL_LAST_PPL_E2, BASE_LAST_PPL_E2[1]); + // and in bits per byte + assert lt(BASE_STREAM_BPB_E4[2], EVAL_BPB_E4); + assert lt(EVAL_BPB_E4, BASE_STREAM_BPB_E4[1]); + assert BASE_ORDERS[2] == "trigram"; +} + +test baseline_bits_per_byte_follow_from_their_loss { + assert bpb_within_one(BASE_STREAM_LOSS_E4[0], STREAM_PREDICTED, VALID_TXT_BYTES, BASE_STREAM_BPB_E4[0]); + assert bpb_within_one(BASE_STREAM_LOSS_E4[1], STREAM_PREDICTED, VALID_TXT_BYTES, BASE_STREAM_BPB_E4[1]); + assert bpb_within_one(BASE_STREAM_LOSS_E4[2], STREAM_PREDICTED, VALID_TXT_BYTES, BASE_STREAM_BPB_E4[2]); + assert eq(STREAM_PREDICTED + 1, VALID_TOKENS); + // uniform over 729: ln 729 / ln 2 * tokens / bytes = 3.25 bits per byte + assert bpb_within_one(LN_VOCAB_E4, STREAM_PREDICTED, VALID_TXT_BYTES, 32496); +} + +test checkpoint_sizes_follow_from_the_shapes { + // the state: header, then parameters, LAMB m and LAMB v, 8 bytes each + assert eq(STATE_BYTES, STATE_HEADER + 3 * 8 * PARAMS_TOTAL); + // MSLH: header, then f32 output shadow and per block up, down, bias_up, bias_down + assert eq(BIN_BYTES, BIN_HEADER + 4 * (EMBED * VOCAB + N_BLOCK * (2 * EMBED * FF + FF + EMBED))); + // MSLH holds less than the ternary weights: no attention matrices + assert lt(BIN_BYTES, 4 * PARAMS_TERNARY); +} + +test measured_facts_are_the_recorded_ones { + assert STATUS == "published"; + assert NO_QUALITY_CLAIM == true; + assert LICENSE == "apache-2.0"; + assert DATA_LICENSE == "CDLA-Sharing-1.0"; + assert MODEL_URL == "https://huggingface.co/playra/hslm-t27-2m"; +} + +test files_are_pinned { + assert STATE_SHA256 == "9034e049c61bb237a083bec7bcaccd0ab0a3c7e3bf0b3ef2cd9f1c0eb9e9761b"; + assert BIN_SHA256 == "ae9050f968922d5436dab34a8aa7d1dfa4f01660cefd270c2430cb082c3eec5e"; + assert RUN_LOG_SHA256 == "0180ab209fda0b7c811e1f7df4237d75bebee49162119690de72bf0b5375894e"; + assert EVAL_TXT_SHA256 == "0539cd8207f7fc8cc450c2e53d7f246d5526c970be91c35b2dc290fe15bf345f"; + assert NGRAM_TXT_SHA256 == "6902ba4c3464c4f492cb62167e31bbb17c1d6f8f6c6def8607580f2cc6db8567"; + assert SPEC_SHA256[6] == "fa8490d815bde2815fe9bfa89cb9badab241f580977e59be52fc5902f6f8bb03"; + assert SPECS[6] == "specs/ml/train_hslm.t27"; + assert eq(SPEC_BYTES[6], 88119); +} + +test package_layout { + assert FILES[0] == "README.md"; + assert FILES[1] == "model_card.t27"; + assert FILES[3] == "ckpt_8000.state"; + assert FILES[6] == "eval_8000_w19683.txt"; + assert SPECS[7] == "specs/ml/eval_hslm.t27"; + assert SPECS[8] == "specs/ml/ngram_hslm.t27"; +} diff --git a/specs/igla/own_model.t27 b/specs/igla/own_model.t27 index 7a0c5f36e8..d4d055e9b8 100644 --- a/specs/igla/own_model.t27 +++ b/specs/igla/own_model.t27 @@ -13,6 +13,7 @@ ; - gHashTag/trinity-fpga at FPGA_COMMIT: 8 tokens on the AX7203, 7682304/7682304 receipts. ; - gHashTag/igla-coder-gpu at CARD_500M_COMMIT: specs/hf/model_card_500m.t27 (cell 9). ; - gHashTag/t27 at SOURCE_COMMIT: the ML specs named per cell. +; - gHashTag/t27 HSLM_CARD, the card of playra/hslm-t27-2m at HF_HSLM_COMMIT (cells 17, 18, 25). ; MEASURED on 2026-10-17: ; - test: t27c test-report (built from SOURCE_COMMIT, zig 0.16.0) on the Railway lab, 17 ML specs: @@ -86,6 +87,27 @@ ; trits, biases and both losses to a 379-byte /tmp/t27_train_slice.bin, reads it back byte for ; byte and exits 0; with that path made a directory it aborts, exit 134. So t27c lowers a model ; spec to a training binary, for one 3-head slice; not for the whole 3-block model (cell 25). +; - trained on 2026-10-18 and 2026-10-19, cell 25, after the PR that added ml/train_hslm (#10387, +; 7e39315ea): `t27c compile specs/ml/train_hslm.t27 --backend ml` builds the binary that trained +; the whole 3-block HSLM on the Railway lab, 2,130,138 parameters (1,948,617 trits under the +; straight-through estimator, shadow weights and LAMB), 8000 steps of 66 windows of 27 tokens +; on TinyStories, 14,256,000 tokens seen, 46,483 s, 306.7 tokens/s, io_fail 0, rc 0. It read +; the token files and wrote MSLH and state checkpoints (cells 17 and 18). ml/eval_hslm scored +; ckpt_8000.state on 19,683 held-out windows (531,441 positions): perplexity 25.41 at every +; position and 25.26 at the last; with check=1 the trainer's own validation gave the same bits, +; and a rerun on the binary rebuilt from master printed the identical line. ml/ngram_hslm scored +; the same windows with count models built from the same train tokens: unigram 333.98, bigram +; 33.92, trigram 12.52. HSLM beats the bigram and loses to the trigram, after a quarter of the +; trainer's default 32000 steps. Live since 2026-10-19: playra/hslm-t27-2m at Hugging Face +; commit HF_HSLM_COMMIT; its model_card.t27 is HSLM_CARD byte for byte, 14/14 tests, 0 +; vacuous, on the lab. Six copies of the card with one number changed each fail the test that +; re-derives that number. The state, the MSLH file, the card and the run log were downloaded +; back and match the card's sha256. This evidence went to review in PR REVIEW_HSLM_PR: review +; REVIEW_HSLM_ID is the reviewer bee on head a99dde709, whose model verdict was approve; the bee +; posted it as NEEDS_PERSON, not APPROVE, because that head changes seal and gen files, and the +; PR merged over that hold under the owner's standing instruction, as #10428 did. Live and +; reviewed, so the cell is published at 70 percent: one under-trained run on a CPU at 307 +; tokens/s. ; - published on 2026-10-18: playra/tern-tc-100m on Hugging Face, the 100M ternary model of the ; igla-coder-gpu ladder (n_layer 12, d_model 768), trained on RunPod; final.pt sha256 ; 620c80b642ff87f06f945f6dbedf122e69fd524e93b7b20d1fd9bfcfd3d08300, both run summaries pinned @@ -146,7 +168,7 @@ ; NEEDS_PERSON, not APPROVE, because that head changes seal files, and the PR merged over that ; hold under the owner's standing instruction, as #10428 did. ; The engine asks an engineering LEARN step for a source link, a PRACTICE step for a passing test -; and a DELIVER step for a review. So: 4 published, 23 verified, 0 drafts, 0 gaps. +; and a DELIVER step for a review. So: 5 published, 22 verified, 0 drafts, 0 gaps. ; PERCENT is a second, separate number per cell: an estimate of how much of that part exists, with ; its basis in SOURCES. It never feeds a status. The lens and overall figures are plain means, every @@ -158,8 +180,11 @@ ; model, its VSA path included (see MEASURED); the ternary STE, the training step and the data ; and checkpoint layout now pass too, on a model slice and on bytes; heap and file I/O are t27 ; (ml/arena_heap, ml/file_io_contract, ml/host_io_model) and `t27c --backend ml` lowers them to a -; binary that writes a real file, and to a training binary for one head slice -; (ml/train_slice_model); the STE and a training binary over the whole model are not done. A 100M ternary model is public; a 0.5B ternary model is public too (1.2B tokens, weaker than the 100M one) and not yet reviewed. +; binary that writes a real file, to a training binary for one head slice (ml/train_slice_model) +; and to one that trains the whole model with the STE (ml/train_hslm). That HSLM, trained 8000 steps +; in t27, is public (playra/hslm-t27-2m): held-out perplexity 25.41, better than a bigram count +; model (33.92) and worse than a trigram one (12.52). A 100M ternary model is public; a 0.5B +; ternary model is public too (1.2B tokens, weaker than the 100M one). ; Not claimed: no model quality beyond the numbers in SOURCES; no GIF or MP4, stills only. ; phi^2 + 1/phi^2 = 3 | TRINITY @@ -203,6 +228,10 @@ pub const FPGA_COMMIT : str = "b2bd5a30cefe32eb7e57e9f2025626f6f0cf4b25"; pub const CARD_500M_COMMIT : str = "510a22c7520df01e9c768b972ed79ae58eaadead"; /// playra/tern-tc-500m on Hugging Face: the commit that put the 0.5B release live (cell 9). pub const HF_500M_COMMIT : str = "7f203b66d53459f8edcfbc5c39c0e0060914875f"; +/// The card of the HSLM release, in this repository (cells 17, 18 and 25). +pub const HSLM_CARD : str = "specs/hf/model_card_hslm.t27"; +/// playra/hslm-t27-2m on Hugging Face: the commit that put the t27-trained HSLM live (cell 25). +pub const HF_HSLM_COMMIT : str = "39df9a77794988a0fff324b2b52fbe9176271a76"; /// The realtime harness: the IGLA board's state endpoint, which trinity compiles in the browser. pub const LIVE_STATE_URL : str = "https://board-production-2dec.up.railway.app/state"; pub const MEASURED_ON : str = "2026-10-17"; @@ -262,15 +291,15 @@ pub const SOURCES : [27]str = [ "t27 specs/ml/optimizer/{sgd,adam,adamw,lamb}.t27", "t27 specs/nn/hslm.t27 and specs/hslm/forward_pass.t27", "t27 specs/nn/hslm.t27 backward and nn/hslm_backward.t27 training step on a head slice, finite-difference checked", - "t27 specs/nn/ternary_ste.t27, 26 tests; whole-model shadow weights not yet", - "t27 specs/nn/hslm_data.t27: batches, curriculum, MSLH layout = 4971796 bytes; no file I/O", + "t27 specs/nn/ternary_ste.t27, 26 tests; whole-model shadow weights in ml/train_hslm.t27, 8000 steps (#10387)", + "t27 specs/nn/hslm_data.t27: batches, curriculum, MSLH layout = 4971796 bytes; ml/train_hslm.t27 reads the token files and writes the checkpoints", "igla-coder-gpu research/MODEL_ON_FPGA_PLAN.md", "trinity-fpga b2bd5a30, 7682304/7682304 receipts", "board-production-2dec.up.railway.app/state", "t27 specs/port/trinity/fpga/openxc7-synth/ternary_matvec.t27", "t27c test-report on 17 ML specs: 17 compile", "t27 specs/ml/host_io_model.t27 3/3 via t27c --backend ml (#10165); arena in ml/arena_heap.t27", - "t27 specs/ml/train_slice_model.t27 5/5; its --backend ml binary trains one slice 20 steps (#10186)", + "t27 specs/hf/model_card_hslm.t27 14/14: the --backend ml binary of ml/train_hslm.t27 trained the whole HSLM, huggingface.co/playra/hslm-t27-2m", "t27 specs/fpga/ddr3_ternary_matvec.t27: tern-tc-9m layer-0 K weights in DDR3, mat-vec receipt PASS on the AX7203", "t27 specs/igla/own_model.t27" ]; @@ -308,14 +337,21 @@ pub const REVIEW_500M_ID : str = "5563181513"; /// changes .trinity/seals files; merged over that hold on the owner's instruction, as #10428 was). pub const REVIEW_DDR3_PR : i32 = 10475; pub const REVIEW_DDR3_ID : str = "5565244743"; -pub const LIVE : [27]bool = [false, false, false, false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, false, false, false]; +/// The review of cell 25's whole-model evidence: PR and review id on gHashTag/t27 (5567974497: +/// t27-bees on a99dde709, 2026-10-19 07:01 UTC, glm-4.5-flash, model verdict approve with FR-001 to +/// FR-005 met, posted as NEEDS_PERSON because the head changes .trinity/seals and gen/json files; +/// merged over that hold on the owner's instruction, as #10428 and #10475 were). REVIEWED[24] +/// rests on REVIEW_ID; this one reviews the HSLM release that made the cell live. +pub const REVIEW_HSLM_PR : i32 = 10836; +pub const REVIEW_HSLM_ID : str = "5567974497"; +pub const LIVE : [27]bool = [false, false, false, false, false, false, true, true, true, false, false, false, false, false, false, false, false, false, false, false, true, false, false, false, true, false, false]; /// What a host passes the viewer, per cell: the earned status code and the step number as a label. -pub const STATUS : [27]u8 = [4, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4]; +pub const STATUS : [27]u8 = [4, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 5, 4, 4]; pub const LABELS : [27]str = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27"]; /// Percent of each part that exists, estimated from its source (see the header). Never a status. -pub const PCT : [27]u8 = [60, 70, 80, 80, 60, 100, 50, 90, 30, 100, 100, 20, 80, 65, 95, 75, 55, 40, 70, 15, 60, 40, 100, 60, 30, 15, 50]; +pub const PCT : [27]u8 = [60, 70, 80, 80, 60, 100, 50, 90, 30, 100, 100, 20, 80, 65, 95, 75, 85, 80, 70, 15, 60, 40, 100, 60, 70, 15, 50]; /// The t27c test-report counts the PRACTICE cells quote. pub const ML_SPECS_MEASURED : i32 = 17; @@ -340,11 +376,11 @@ pub const ROWS : [20]str = [ "In t27: loss, optimizers, HSLM pass", "17 of 17 ML specs compile on the lab", "9 of 9 IGLA CODER specs compile", - "4 published, 23 verified, 0 drafts", - "0 gaps, about 62 percent overall", - "Batched f32 HSLM trainer", - "Shadow weights for the whole model", - "A whole-model training binary", + "5 published, 22 verified, 0 drafts", + "0 gaps, about 66 percent overall", + "Train past 8000 of 32000 steps", + "Beat the trigram: ppl 12.52", + "A trainer faster than 307 tok/s", "" ]; @@ -411,9 +447,9 @@ test a_gap_is_named_not_filled { test a_status_is_earned_not_chosen { assert statuses_earned(STATUS, DOMAIN, GROUNDED, TEST_PASS, REVIEWED, LIVE); - // the evidence slide's "4 published, 23 verified, 0 drafts" and "0 gaps" - assert count_status(STATUS, STATUS_PUBLISHED) == 4; - assert count_status(STATUS, STATUS_VERIFIED) == 23; + // the evidence slide's "5 published, 22 verified, 0 drafts" and "0 gaps" + assert count_status(STATUS, STATUS_PUBLISHED) == 5; + assert count_status(STATUS, STATUS_VERIFIED) == 22; assert count_status(STATUS, STATUS_DRAFT) == 0; assert count_status(STATUS, STATUS_GAP) == 0; assert count_true(REVIEWED) == 9; @@ -438,12 +474,15 @@ test a_status_is_earned_not_chosen { assert REVIEWED[7]; assert STATUS[7] == STATUS_PUBLISHED; assert STATUS[23] == STATUS_VERIFIED; - // the slice training binary (step 25) is a reviewed DELIVER step that is not live: verified + // the whole-model training binary (step 25) is a reviewed DELIVER step whose trained model is + // live on Hugging Face at a full commit id, with its card in this repository: published + assert HF_HSLM_COMMIT.len == 40; + assert HSLM_CARD.len > 0; assert GROUNDED[24]; assert REVIEWED[24]; - assert LIVE[24] == false; + assert LIVE[24]; assert step_stage(24) == STAGE_DELIVER; - assert STATUS[24] == STATUS_VERIFIED; + assert STATUS[24] == STATUS_PUBLISHED; // the board is live and was sourced: a third published cell assert STATUS[20] == STATUS_PUBLISHED; } @@ -457,6 +496,9 @@ test a_review_is_named_not_assumed { assert REVIEW_500M_ID.len > 0; assert REVIEW_DDR3_PR == 10475; assert REVIEW_DDR3_ID.len > 0; + // cell 25's release evidence was reviewed on its own PR, REVIEW_HSLM_PR + assert REVIEW_HSLM_PR == 10836; + assert REVIEW_HSLM_ID.len > 0; var c : i32 = 0; while (c < CELL_COUNT) { const i : usize = @intCast(c); @@ -511,10 +553,10 @@ test the_compile_counts_are_the_measured_ones { test percent_per_lens_is_a_plain_mean { assert mean_pct(0, 9) == 68; - assert mean_pct(9, 9) == 70; - assert mean_pct(18, 9) == 48; - // the evidence slide's "about 62 percent overall" - assert mean_pct(0, CELL_COUNT) == 62; + assert mean_pct(9, 9) == 77; + assert mean_pct(18, 9) == 53; + // the evidence slide's "about 66 percent overall" + assert mean_pct(0, CELL_COUNT) == 66; } test the_training_step_cells_are_verified_once_reviewed { diff --git a/specs/igla/own_model_board.t27 b/specs/igla/own_model_board.t27 index d1817dfc25..20ae7aa7c0 100644 --- a/specs/igla/own_model_board.t27 +++ b/specs/igla/own_model_board.t27 @@ -48,20 +48,20 @@ pub const LENS_CELLS : i32 = 9; pub const JOB : str = "own_model"; pub const STAGE : str = "own_model"; -pub const MSG : str = "4 published, 23 verified, 0 drafts, 0 gaps; 62%"; +pub const MSG : str = "5 published, 22 verified, 0 drafts, 0 gaps; 66%"; /// What MSG says once its numbers are taken out. pub const MSG_WORDS : str = " published, verified, drafts, gaps; %"; -pub const OVERALL_PCT : u8 = 62; -pub const PROGRESS : f64 = 0.62; +pub const OVERALL_PCT : u8 = 66; +pub const PROGRESS : f64 = 0.66; pub const KEY_LENS : str = "lens_pct"; pub const KEY_CELLS : str = "cells"; pub const KEY_STATUS : str = "status"; pub const KEY_PCT : str = "pct"; -pub const LENS_PCT : [3]u8 = [68, 70, 48]; -pub const CELL_STATUS : [27]u8 = [4, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 4, 4, 4]; -pub const CELL_PCT : [27]u8 = [60, 70, 80, 80, 60, 100, 50, 90, 30, 100, 100, 20, 80, 65, 95, 75, 55, 40, 70, 15, 60, 40, 100, 60, 30, 15, 50]; +pub const LENS_PCT : [3]u8 = [68, 77, 53]; +pub const CELL_STATUS : [27]u8 = [4, 4, 4, 4, 4, 4, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 4, 4, 4, 5, 4, 4]; +pub const CELL_PCT : [27]u8 = [60, 70, 80, 80, 60, 100, 50, 90, 30, 100, 100, 20, 80, 65, 95, 75, 85, 80, 70, 15, 60, 40, 100, 60, 70, 15, 50]; /// The size of the compact metrics object, in bytes, computed from the keys and values above. pub const METRICS_BYTES : i32 = 631; @@ -262,8 +262,8 @@ test the_tally_sums_to_twenty_seven { assert count_status(CELL_STATUS, STATUS_LOCKED) == 0; assert count_status(CELL_STATUS, STATUS_OPEN) == 0; assert published + verified + drafts + gaps == CELL_COUNT; - assert published == 4; - assert verified == 23; + assert published == 5; + assert verified == 22; assert drafts == 0; assert gaps == 0; } @@ -275,19 +275,19 @@ test the_message_is_the_tally { const n : i32 = @intCast(MSG.len); assert n <= MSG_MAX; // one number wrong, a word changed, or a number added: each refused - assert msg_matches("4 published, 23 verified, 1 drafts, 0 gaps; 62%", STATUS, overall) == false; - assert msg_matches("4 published, 23 verified, 0 drafts, 0 holes; 62%", STATUS, overall) == false; - assert msg_matches("4 published, 23 verified, 0 drafts, 0 gaps; 62% of 100", STATUS, overall) == false; - assert msg_matches(MSG, STATUS, 61) == false; + assert msg_matches("5 published, 22 verified, 1 drafts, 0 gaps; 66%", STATUS, overall) == false; + assert msg_matches("5 published, 22 verified, 0 drafts, 0 holes; 66%", STATUS, overall) == false; + assert msg_matches("5 published, 22 verified, 0 drafts, 0 gaps; 66% of 100", STATUS, overall) == false; + assert msg_matches(MSG, STATUS, 65) == false; assert nth_number(MSG, 2) == 0; - assert nth_number(MSG, 4) == 62; + assert nth_number(MSG, 4) == 66; assert nth_number(MSG, 5) == -1; } test progress_is_the_overall_percent_over_a_hundred { assert progress_matches(PROGRESS, mean_pct(0, CELL_COUNT)); // a bar one point off, or past the end of the board's 0..1, is refused - assert progress_matches(0.48, mean_pct(0, CELL_COUNT)) == false; + assert progress_matches(0.65, mean_pct(0, CELL_COUNT)) == false; assert progress_matches(1.39, 139) == false; assert progress_matches(-0.01, -1) == false; assert JOB.len > 0;