Skip to content

spec(port): port specs/port/trios-railway/crates/trios-railway-smoke/src/lib.t27 (Closes #9796) - #9852

Merged
gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9796-railway-smoke
Oct 17, 2026
Merged

gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9796-railway-smoke

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trios-railway:crates/trios-railway-smoke/src/lib.rs (at 8b229e9489ee, 200+ lines) as specs/port/trios-railway/crates/trios-railway-smoke/src/lib.t27 — Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9796.

The original validates the IGLA RACE pipeline in under sixty seconds with synthetic data: a deterministic trainer emitting one step=N val_bpb=F JSONL line per step, the seed-agent's line parser, and the local run with no database behind it.

Per the issue's rule ("Port the decision, not the plumbing"), all four listed functions are ported under their names as pure functions (no transports in this port) with 7 tests (37 runtime asserts, 0 vacuous, 100% function coverage), including the original's own config and parser tests:

  • SmokeConfig_default — steps 1, batch 2, seed 42, synthetic, timeout 30 (original lines 33-43);
  • run_synthetic_trainer — the plan of the deterministic trainer: the BPB starting at 3.0 and decaying by 0.99 per step (powi computed by repeated multiplication — no power builtin here), the loss at 80% of the BPB, the done line reporting the last step's BPB with 0.0 for no steps (lines 69-107);
  • parse_step_line — the seed-agent parser's four presence gates (both markers present AND a parseable token after each), with the two markers carried as constants step= and val_bpb= (lines 110-126); the string finding and number parsing are the caller's plumbing;
  • run_local — the local run's shape: one JSONL line and one sample per step, no DB behind the run, the insert verdict absent (lines 130-141).

Float asserts are windowed throughout: 0.8 and 0.99 are not binary-representable, so products are asserted inside tight windows, never by equality.

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: 9/9 tested (100%) — no transports in this port.
  • t27c test-report: 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the decay windows (first step ≈ 2.97, strictly monotone), the loss windows, the done-best rule, the plan shape at 1 and 3 steps, all four parser gates, and the local view without a DB.
  • t27c gen | grep -c 'not yet implemented': 0; gen | wc -l: 139 (> 12).
  • grep -cE '^\s*(pub )?fn (SmokeConfig_default|run_synthetic_trainer|parse_step_line|run_local)\(': 4. grep -cE '^\s*test\s+(["|[A-Za-z_])': 7 (≥ 4).
  • Boundary: git status --short — exactly this one file. The repo's lefthook pre-commit passed.
  • dupe_scan: all 9 introduced names unique across 2040 specs (checked before the commit); the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).

Dmitrii Fedorov (@dmitrii-f-t27)

…src/lib.t27 (Closes gHashTag#9796)

Port gHashTag/trios-railway:crates/trios-railway-smoke/src/lib.rs
(at 8b229e9489ee, 200+ lines) as specs/port/trios-railway/crates/
trios-railway-smoke/src/lib.t27 - Roadmap Stage 6, goal gHashTag#4548,
target t27c gen-rust.

The smoke pipeline's decisions are ported as pure functions and
tested (7 tests, 7 pass, 0 vacuous, 37 runtime asserts, 100%
function coverage), including the original's own config and parser
tests: the configuration defaults (steps 1, batch 2, seed 42,
synthetic, timeout 30), the deterministic trainer - the BPB
starting at 3.0 and decaying by 0.99 per step (powi computed by
repeated multiplication), the loss at 80% of the BPB, the done
line reporting the last step's BPB with 0.0 for no steps - the
seed-agent parser's four presence gates with its two markers, and
the local run's shape (one JSONL line and one sample per step, no
DB behind the run). Float asserts are windowed: 0.8 and 0.99 are
not binary-representable, so products are asserted inside tight
windows, never by equality.

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 9/9, test-report 7/7 pass, 0 BLOCKED, gen 139 lines with
0 'not yet implemented', boundary exactly this one file, dupe_scan:
all 9 names unique across 2040 specs (checked before the commit),
bare body scan adds no duplicate group (752/221 unchanged).

Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
@dmitrii-f-t27

Copy link
Copy Markdown
Contributor Author

@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 #9796 port — crates/trios-railway-smoke/src/lib.rs (gHashTag/trios-railway, at 8b229e9489ee, 200+ lines) re-authored as specs/port/trios-railway/crates/trios-railway-smoke/src/lib.t27. One file, one commit, head c5ebeeb9b, Closes #9796.

What is verified:

  • t27c parse OK, spec-status IMPLEMENTED, typecheck 0 errors / 0 warnings, coverage 9/9 (100%) — no transports in this port, t27c test-report 7 tests / 7 pass / 0 FAIL / 0 BLOCKED, 0 vacuous — including the original's own config and parser tests: the five configuration defaults, the deterministic trainer's decay windows (first step ≈ 2.97, strictly monotone; the powi computed by repeated multiplication), the loss at 80% of BPB, the done-line best (0.0 with no steps), the four parser presence gates with their two markers, and the local run's one-line-one-sample shape without a DB.
  • gen → 139 lines, 0 not yet implemented; the 4 required names count exactly 4; 7 test blocks; boundary exactly the one file.
  • dupe_scan: all 9 introduced names unique across 2040 specs (checked before the commit); the bare body scan adds no duplicate group (752/221 unchanged).
  • The t27b-native-run artifact of this head (commit c5ebeeb, run 39007019839): lib.t27 row — reference pass, t27b pass, tests 7, invariants 0, asserts 34, blockers [], detail empty, reference_disagree: [].

CI (head c5ebeeb): required trio green — validate, check-linked-issue, parse-ratchet — and Check L1 TRACEABILITY green (the single commit carries its issue reference); 26 checks pass overall, incl. emit-bitexact, t27b-native-linux, t27b-native-macos.

The 3 reds are the base-red trio, not this change: cli-tri (the #3324 include_str!), duplicate-bodies (only the known base names), t27b-native-ratchet (the same verdict red the Queen's port PRs carry; this spec's own row is reference pass + t27b pass — the registration debt is the UNLISTED class).

After the merge I will: verify the spec file live on the merge SHA, confirm #9796 auto-closed, and file the 14-step report.

Dmitrii Fedorov (@dmitrii-f-t27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Port gHashTag/trios-railway:crates/trios-railway-smoke/src/lib.rs (Rust, 4 functions) to specs/port/trios-railway/crates/trios-railway-smoke/src/lib.t27

2 participants