Repository navigation
spec(port): port specs/port/trios/crates/trios-model/src/lib.t27 (Closes #9449) - #9872
Conversation
gHashTag#9449) Port gHashTag/trios:crates/trios-model/src/lib.rs (at 8b229e9489ee, 250+ lines) as specs/port/trios/crates/trios-model/src/lib.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The IGLA-GF16 hybrid-precision model's decisions are ported as pure functions and tested (7 tests, 7 pass, 0 vacuous, 33 runtime asserts, 100% function coverage), including the original's own size-window test: the five-layer precision routing per the STATIC_ROUTING_TABLE (GF16 for embedding, attention QKV and FFN down; Ternary for the FFN gate and up), the empty start, the documented forward stub answering no logits, load_weights carrying the five counts, the parameter sum across all layers, the quantization pricing (GF16 at 2 bytes per parameter, the Ternary pair's bytes divided by 5 - the 1.58-bit packing; the balanced 100x5 model prices at 640 bytes, inside the original's 600-800 window), and Default delegating to new. The growable weight vectors are the callers' plumbing. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 13/13, test-report 7/7 pass, 0 BLOCKED, gen 149 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 7 introduced names unique across 2040 specs AND the ModelWeights struct verified absent from the corpus type set by grep before the commit, bare body scan adds no duplicate group (752/221 unchanged). Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
|
@gHashTag Please merge this PR into master via the golden chain — rights on gHashTag/t27 are read-only for me (403), so the merge itself needs your action. What this is: the #9449 port — What is verified:
CI (head 133906e): required trio green — The 3 reds are the base-red trio, not this change: After the merge I will: verify the spec file live on the merge SHA, confirm #9449 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios:crates/trios-model/src/lib.rs(at8b229e9489ee, 250+ lines) asspecs/port/trios/crates/trios-model/src/lib.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9449.The original is the IGLA-GF16 hybrid-precision model architecture (Φ5.1): GF16 for the critical layers and Ternary for the bulk compute layers, per the STATIC_ROUTING_TABLE.
Per the issue's rule ("Port the decision, not the plumbing"), all six listed functions are ported under their names as pure functions (no transports — the growable weight vectors are the callers' plumbing) with 7 tests (33 runtime asserts, 0 vacuous, 100% function coverage):
IglaModel_new— the empty five-layer start (original lines 77-85);IglaModel_forward— the documented stub: the full pass has not landed, so it answers no logits (lines 106-113);IglaModel_load_weights— the five counts carried (lines 142-155);IglaModel_num_parameters— the sum across all five layers (lines 171-177);IglaModel_size_bytes— the quantization pricing: GF16 at 2 bytes per parameter across its three layers, the Ternary pair's byte count divided by 5 (the ~1.58-bit packing) — the balanced 100×5 model prices at 640 bytes, inside the original's own 600–800 test window (lines 206-210);IglaModel_default— the delegation to new (lines 213-217);Verification (all run live from the worktree root, zig 0.16.0)
t27c parse: OK.t27c spec-status: IMPLEMENTED.t27c typecheck: 0 errors, 0 warnings.t27c coverage: 13/13 tested (100%) — no transports in this port.t27c test-report: 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 149 (> 12).grep -cE '^\s*(pub )?fn (IglaModel_new|IglaModel_forward|IglaModel_load_weights|IglaModel_num_parameters|IglaModel_size_bytes|IglaModel_default)\(': 6.grep -cE '^\s*test\s+(["|[A-Za-z_])': 7 (≥ 6).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 7 introduced names unique across 2040 specs, and theModelWeightsstruct verified absent from the corpus type set by grep before the commit (the corpus-ratchet lesson applied); the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).Dmitrii Fedorov (@dmitrii-f-t27)