Skip to content

spec(port): port specs/port/trios-railway/crates/trios-igla-race/src/sampler.t27 (Closes #9664) - #9832

Merged
gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9664-race-sampler
Oct 17, 2026
Merged

gHashTag merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9664-race-sampler

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trios-railway:crates/trios-igla-race/src/sampler.rs (at 385c2143ef46, 14 lines) as specs/port/trios-railway/crates/trios-igla-race/src/sampler.t27 — Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9664.

The original is the config sampler's zero-sized unit: a struct with no fields, new building it, and Default delegating to new.

Per the issue's rule ("Port the decision, not the plumbing"), both listed functions are ported under their names as tested pure functions:

  • ConfigSampler_new — the constructor builds the unit (original lines 3-8);
  • ConfigSampler_default — the default value delegates to the constructor, and the delegation is this port's body exactly as it is the original's (lines 10-14);
  • sampler_field_count — the countable design decision: the sampler carries no state — no held configuration, no pending sample, no RNG handle — so anything grown onto this struct would be hidden state. The tests assert the zero-field pin against both construction paths.

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: 3/3 tested (100%) — no transports in this port.
  • t27c test-report: 2 tests / 2 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes.
  • t27c gen | grep -c 'not yet implemented': 0; gen | wc -l: 38 (> 12).
  • grep -cE '^\s*(pub )?fn (ConfigSampler_new|ConfigSampler_default)\(': 2. grep -cE '^\s*test\s+(["|[A-Za-z_])': 2 (≥ 2).
  • Boundary: git status --short — exactly this one file. The repo's lefthook pre-commit passed.
  • dupe_scan: all 3 names unique across 2040 specs; the bare body scan adds no duplicate group (752 bodies / 221 groups on base, identical with this spec present).

Dmitrii Fedorov (@dmitrii-f-t27)

…sampler.t27 (Closes gHashTag#9664)

Port gHashTag/trios-railway:crates/trios-igla-race/src/sampler.rs
(at 385c2143ef46, 14 lines) as specs/port/trios-railway/crates/
trios-igla-race/src/sampler.t27 - Roadmap Stage 6, goal gHashTag#4548,
target t27c gen-rust.

The config sampler's zero-sized unit is ported as pure functions and
tested (2 tests, 2 pass, 0 vacuous, 100% function coverage), the
same shape the ASHA scheduler port uses for its own unit: the
constructor builds the unit, the default delegates to the
constructor (the delegation is this port's body, as in the
original), and the field-count pin asserts the zero-field design -
the sampler carries no state, so anything grown onto it would be
hidden state. No transport exists in this port.

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 3/3, test-report 2/2 pass, 0 BLOCKED, gen 38 lines with 0
'not yet implemented', boundary exactly this one file, dupe_scan:
all 3 names unique across 2040 specs, 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 #9664 port — crates/trios-igla-race/src/sampler.rs (gHashTag/trios-railway, at 385c2143ef46, 14 lines) re-authored as specs/port/trios-railway/crates/trios-igla-race/src/sampler.t27. One file, head ecd6f7fc8, Closes #9664.

What is verified:

  • t27c parse OK, spec-status IMPLEMENTED, typecheck 0 errors / 0 warnings, coverage 3/3 (100%) — no transports, t27c test-report 2 tests / 2 pass / 0 FAIL / 0 BLOCKED, 0 vacuous.
  • gen → 38 lines, 0 not yet implemented; the 2 required names count exactly 2; 2 test blocks; boundary exactly the one file.
  • dupe_scan: all 3 names unique across 2040 specs; bare body scan adds no duplicate group (752/221 unchanged).
  • The t27b-native-run artifact of this head (commit ecd6f7f, run 39001097661): sampler.t27 row — reference pass, t27b pass, tests 2, invariants 0, asserts 2, blockers [], detail empty, reference_disagree: [].

CI (head ecd6f7f): required trio green — validate, check-linked-issue, parse-ratchet; 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 #9664 auto-closed, and file the 14-step report.

Dmitrii Fedorov (@dmitrii-f-t27)

@gHashTag
gHashTag merged commit afec663 into gHashTag:master Oct 17, 2026
26 of 29 checks passed
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-igla-race/src/sampler.rs (Rust, 2 functions) to specs/port/trios-railway/crates/trios-igla-race/src/sampler.t27

2 participants