Skip to content

spec(port): port specs/port/trios-railway/crates/trios-igla-race/src/bin/reset_queue.t27 (Closes #9743) - #10056

Open
dmitrii-f-t27 wants to merge 3 commits into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9743-reset-queue
Open

dmitrii-f-t27 wants to merge 3 commits into
gHashTag:masterfrom
dmitrii-f-t27:zcode-port-9743-reset-queue

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Summary

Port gHashTag/trios-railway:crates/trios-igla-race/src/bin/reset_queue.rs (at 5cc46e798dda, 78 lines) as specs/port/trios-railway/crates/trios-igla-race/src/bin/reset_queue.t27 — Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9743.

The original is the queue reset tool: it resolves the Postgres URL through a three-tier chain, optionally inserts a CPU LR-sweep batch, and lists the active experiments.

Per the issue's rule ("Port the decision, not the plumbing"), the one listed function is ported under its name as a pure function (no transports — the PullQueueDb connection, raw_query and raw_execute are the callers' plumbing) with 9 tests (57 runtime asserts, 0 vacuous, 100% function coverage):

  • the three-tier URL chain (original lines 11-19, the R5/GitGuardian and L-NEON-RENAME rules): an explicit `` argument beats RAILWAY_POSTGRES_URL, which beats the legacy `NEON_DATABASE_URL`; when no tier holds a URL the tool dies;
  • the --cpu-batch switch (line 24): on when any argument equals --cpu-batch;
  • the LR sweep grid (lines 25-32): four learning rates × three seeds = 12 experiments; the flat walk pairs every LR with every seed, the seed running fastest (reset_queue_batch_index);
  • the fixed sweep facts (lines 36-47) as a typed plan: h=1024, ctx=12, steps=120000, priority 99, phase CPU-LR-SWEEP, account acc0, author seed-agent;
  • the active-row filter (line 62): pending, claimed and running rows — done and everything else stay out;
  • the listing order (line 62): priority DESC, then id ascending on a tie;
  • the SQL quote doubling (lines 48-49): every single quote in the canon name and the config is doubled before landing in the SQL string;
  • main's URL gate (line 5): exit 1 before any queue work when no tier holds a URL, else 0 after the optional sweep insert and the listing.

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: 9 tests / 9 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — the URL chain all four combinations, main's gate at each tier, the switch on/off/midway/absent, the grid indices at the corners, the sweep constants, the plan's typed fields, the active filter's three states and three non-states, the order both ways plus the id tie-break, and the quote counts at 0/1/3.
  • t27c gen | grep -c 'not yet implemented': 0; gen | wc -l: 200 (> 12).
  • grep -cE '^\s*(pub )?fn (main)\(': 1. grep -cE '^[[:space:]]*test[[:space:]]+("|[A-Za-z_])': 9 (≥ 1).
  • Boundary: git status --short — exactly this one file. The repo's lefthook pre-commit passed.
  • dupe_scan: all 9 function names unique across the corpus (checked before the commit); the bare body scan adds no duplicate group and none of the known groups grew (726 bodies / 219 groups, unchanged).

Dmitrii Fedorov (@dmitrii-f-t27)

…bin/reset_queue.t27 (Closes gHashTag#9743)

Port gHashTag/trios-railway:crates/trios-igla-race/src/bin/reset_queue.rs
(at 5cc46e798dda, 78 lines) as specs/port/trios-railway/crates/
trios-igla-race/src/bin/reset_queue.t27 - Roadmap Stage 6, goal gHashTag#4548,
target t27c gen-rust.

The queue reset tool's decisions are ported as pure functions and
tested (9 tests, 9 pass, 0 vacuous, 57 runtime asserts, 100% function
coverage): the three-tier postgres URL chain of the R5/GitGuardian rule
and the L-NEON-RENAME law (an explicit $1 argument beats
RAILWAY_POSTGRES_URL, which beats the legacy NEON_DATABASE_URL; none
is the missing-URL abort), the --cpu-batch switch (on when any
argument equals it), the LR sweep grid (four LRs by three seeds = 12
experiments, the seed running fastest in the flat walk), the fixed
sweep facts of one experiment (h=1024, ctx=12, 120000 steps,
priority 99, phase CPU-LR-SWEEP, account acc0, author seed-agent) as a
typed plan, the active-row filter (pending, claimed, running), the
listing order (priority DESC, then id ASC), the SQL quote doubling
every single quote undergoes, and main's URL gate (exit 1 before any
queue work when no tier holds a URL, else 0). The PullQueueDb
connection, raw_query and raw_execute are the callers' plumbing.

Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors,
coverage 9/9, test-report 9/9 pass, 0 BLOCKED, gen 200 lines with
0 'not yet implemented', boundary exactly this one file, dupe_scan:
all 9 function names unique, bare body scan 726/219 unchanged.

Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
…loses gHashTag#9743)

The corpus ratchet runs every spec through gen, gen-rust, gen-c and
gen-verilog; the first cut of this port held local [N][]const u8
argument arrays in its test, a 2-D aggregate the Verilog lowering
does not implement yet (W469), which the ratchet reported as
'UNEXPECTED FAILURES: + reset_queue.t27 [gen-verilog]'.

The --cpu-batch decision is re-ported Verilog-safely with the same
behaviour: reset_queue_arg_is_batch decides one argument, and
reset_queue_batch_flag_count carries the any-argument shape over three
fixed argument slots (the caller walks argv). All four generators now
emit this spec; 9 tests, 9 pass, 0 vacuous, 0 BLOCKED; dupe_scan
unchanged; boundary still exactly this one file.

Dmitrii Fedorov ([@dmitrii-f-t27](https://github.com/dmitrii-f-t27))
@dmitrii-f-t27 dmitrii-f-t27 reopened this Oct 17, 2026
This was referenced Oct 18, 2026

This branch has not been deployed

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

Labels

None yet

Projects

None yet

1 participant