Repository navigation
spec(ml): train_slice_model -- main() trains 20 steps and writes a checkpoint to a real file (Closes #10183) - #10186
Merged
Merged
Conversation
…eckpoint to a real file (Closes #10183) Part of epic #10024, cell 25. specs/ml/train_slice_model.t27 reuses init_model, mean_loss and train_step from specs/nn/hslm_backward.t27 through `use`, runs 20 steps, refuses a run whose loss did not halve, writes a 379-byte checkpoint (trits, biases, alpha, first and last loss) to /tmp/t27_train_slice.bin with host_open/host_write/host_close, reads it back with host_read and compares every byte. 5 tests, 0 vacuous, one negative (0 steps does not halve the loss). Two t27-only adaptations to the import splice, no Rust touched: - use_resolve splices fn/struct/enum/const/type but not module-level `var`, so the new spec declares the sixteen state variables of hslm_backward (declarations only, none of the logic). - use_resolve rewrites `module::name` only in the importing file, not inside the spliced declarations, so hslm_backward now calls ternary_ste functions by bare name (10 call sites). Behaviour is unchanged: 15/15 tests, 0 vacuous, as before. t27b ledger row for the new spec (blocked, host calls) and max_not_pass 32 -> 33. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
gHashTag
enabled auto-merge (squash)
October 18, 2026 03:41
gHashTag
added a commit
that referenced
this pull request
Oct 18, 2026
…or the same review (Refs #10184) #10186 added ml/train_slice_model and merged at 03:42Z through another session's auto-merge, with no review. Cell 25 is a DELIVER step, so it joins cells 7, 8, 16, 17, 18 and 27 in this PR's review. Lab, master 2d358a7 + this change: ml/train_slice_model 5/5, 0 vacuous. Its --backend ml binary exits 0, trains one 3-head slice 20 steps (loss 3.2975044 to 0.32346588) and writes a 379-byte /tmp/t27_train_slice.bin, sha256 0dfdef22...cdbeb; with that path made a directory it aborts, exit 134. Cell 25: grounded, PCT 30 (one slice, not the whole model), DRAFT. Tally 1 published, 17 verified, 7 drafts, 2 gaps; 60%. own_model 9/9, board 6/6, 0 vacuous. Negative control (STATUS[24] back to a gap): 2 FAIL. METRICS_BYTES 629. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 18, 2026
gHashTag
added a commit
that referenced
this pull request
Oct 18, 2026
…of a copy (Closes #10203) (#10205) byte_total in specs/ml/train_slice_model.t27 (added in #10186) was a line-for-line copy of byte_sum in specs/ml/file_io_contract.t27, which that spec already imports. duplicate-bodies has been red on master since. byte_sum is now pub and the copy is deleted; the two bodies were identical, so no checksum changes and no ledger bless is needed. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
gHashTag
added a commit
that referenced
this pull request
Oct 18, 2026
…vidence to review again (Closes #10184) (#10185) * spec(igla): own_model -- ground cells 8 and 24, put the DELIVER evidence to review again (Closes #10184) Cell 8: playra/tern-tc-100m is public (API 200, a made-up name 401). final.pt sha256 620c80b6...d08300, val bits per byte 0.4722 ternary vs 0.4217 fp. It is a DELIVER step with no review, so it is a DRAFT. Cell 24: t27c --backend ml (#10165) lowers host file I/O. ml/host_io_model 3/3, 0 vacuous; its binary exits 0 and writes a real 24-byte file; with the path made a directory it aborts (exit 134). It is a PRACTICE step with a passing test, so it is VERIFIED. Tally 1 published, 17 verified, 6 drafts, 3 gaps; 59%. Lab, master 8887f17: own_model 9/9, board 6/6, 0 vacuous. Negative control (STATUS[23] back to a gap): 2 FAIL. #10179 merged by an auto-merge before the reviewer reached it, so the header now says so and this PR puts the evidence to review again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * spec(igla): own_model -- ground cell 25, the slice training binary, for the same review (Refs #10184) #10186 added ml/train_slice_model and merged at 03:42Z through another session's auto-merge, with no review. Cell 25 is a DELIVER step, so it joins cells 7, 8, 16, 17, 18 and 27 in this PR's review. Lab, master 2d358a7 + this change: ml/train_slice_model 5/5, 0 vacuous. Its --backend ml binary exits 0, trains one 3-head slice 20 steps (loss 3.2975044 to 0.32346588) and writes a 379-byte /tmp/t27_train_slice.bin, sha256 0dfdef22...cdbeb; with that path made a directory it aborts, exit 134. Cell 25: grounded, PCT 30 (one slice, not the whole model), DRAFT. Tally 1 published, 17 verified, 7 drafts, 2 gaps; 60%. own_model 9/9, board 6/6, 0 vacuous. Negative control (STATUS[24] back to a gap): 2 FAIL. METRICS_BYTES 629. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
4 of 8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #10183. Part of epic #10024 ("our own model"), cell 25 "t27c --backend ml". Follows #10165.
What
specs/ml/train_slice_model.t27(pure t27):pub fn main() -> voidtrains the 3-head slice ofspecs/nn/hslm_backward.t27for 20 steps, asserts the last loss is below half the first, writes a 379-byte checkpoint (243 trits, 27 biases, alpha, first and last loss, checksum) to/tmp/t27_train_slice.binwithhost_open/host_write/host_close, reads it back withhost_read, compares every byte, and re-checks the losses decoded from the bytes that came off the disk. The training step (init_model,mean_loss,train_step) is reached throughuse, not copied.put_u32/get_u32and the magic bytes come fromml::file_io_contract; itsckpt_writeis not used because the checkpoint (379 bytes) does not fit one 256-byte slot.No Rust, no other language:
t27c compile --backend mlfrom #10165 lowered the spec as it is. Two t27-only adaptations to the import splice were needed and are in the diff:use_resolvesplices fn/struct/enum/const/type from an import but not module-levelvar. The new spec declares the sixteen state variables ofhslm_backward(declarations only; if one is added there, this file stops compiling with "use of undeclared identifier" instead of drifting).use_resolverewritesmodule::nameonly in the importing file, not inside spliced declarations, soternary_ste::requantize(...)inside the splicedtrain_stepreached Zig as an undeclaredternary_ste.specs/nn/hslm_backward.t27now calls the fiveternary_stefunctions by bare name (10 call sites,use nn::ternary_ste;unchanged). Its result is identical: 15/15 pass, 0 vacuous before and after.Both are limits of
use_resolve.rs(hand-written Rust), recorded here and not patched.Lab measurements (Railway lab, x86_64, t27c built from origin/master 8887f17, zig 0.16.0)
t27c test-report specs/ml/train_slice_model.t27: tests 5, pass 5, FAIL 0, vacuous 0 of 5 (runtime asserts per test: 1, 1, 6, 1, 3).t27c test-report specs/nn/hslm_backward.t27after the edit: tests 15, pass 15, FAIL 0, invariants 3 proved, vacuous 0 of 15.t27c compile specs/ml/train_slice_model.t27 --backend mlbuilt a 10118114-byte binary; running it: exit 0./tmp/t27_train_slice.binis 379 bytes, sha2560dfdef2200b3daa2930cb081f8fb4a58caf5677bae3f329ee23f0e2c328cdbeb(identical on a second run). Losses recorded in the file (f32): first 3.2975044, last 0.32346588 (ratio 0.098, bar is below 0.5). A third f32, alpha, is 0.57535255./tmp/t27_train_slice.binmade a directory the binary aborts, exit 134,run(STEPS) = 61(TRAIN_ERR_OPEN) againstTRAIN_OK = 0. Removing the directory and rerunning gives exit 0 and the same sha256. In the spec itself,zero_steps_do_not_halve_the_lossshows the loss check can fail (TRAIN_ERR_LOSS, nothing reaches the disk) anda_flipped_byte_is_refusedshows the checksum and magic checks can fail.t27b ledger
t27b test --blockers specs/ml/train_slice_model.t27on the lab: exit 2, first blockerExprCall(undeclared fn)(host_open), same ashost_io_model. One row added todocs/reports/t27b_expectations.json(blocked, unimplemented) andmax_not_pass32 -> 33; the ledger holds 33 non-pass entries, equal to the cap.Not claimed
Head slice only (9 inputs, 27 classes), not the three transformer blocks; plain SGD, not AdamW; one fixed batch; f32 checkpoint; Linux x86_64 syscall shim only.
specs/igla/own_model.t27andown_model_board.t27are not touched.🤖 Generated with Claude Code