Repository navigation
spec(port): port specs/port/trios/crates/trios-phi-schedule/src/lib.t27 (Closes #9443) - #9927
Conversation
…27 (Closes gHashTag#9443) Port gHashTag/trios:crates/trios-phi-schedule/src/lib.rs (at 8b229e9489ee, 200+ lines) as specs/port/trios/crates/ trios-phi-schedule/src/lib.t27 - Roadmap Stage 6, goal gHashTag#4548, target t27c gen-rust. The phi-LR scheduler's decisions are ported as pure functions and tested (13 tests, 13 pass, 0 vacuous, 44 runtime asserts, 100% function coverage), including the original's own no-decay-at-zero, monotonic-decay and phi-factor tests: phi_schedule = base * phi^(-epoch/warmup) with phi from a Newton sqrt and the power from a binary-expansion root ladder (no powf builtin), flat_lr the constant baseline, cosine_lr = base * (1 + cos(pi t))/2 with cos from a Taylor window (no cos builtin), phi_decay_lr with the warmup gate, tau = max_steps/(phi*27), the exponent cap at 10 and the 1e-6 floor - measured, the cap binds first: base*phi^(-10) = 2.4e-6 stays above the floor, so the floor is the deeper safety net - and lr_schedule_54 fixing BASE_LR 3e-4, warmup 100, and dispatching the three schedules. The Issue gHashTag#53 finding rides along: alpha_phi is not a valid initial rate; its role is the asymptotic floor. Verified: parse OK, spec-status IMPLEMENTED, typecheck 0 errors, coverage 16/16, test-report 13/13 pass, 0 BLOCKED, gen 216 lines with 0 'not yet implemented', boundary exactly this one file, dupe_scan: all 13 introduced 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))
|
@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 #9443 port — What is verified:
CI (head 5a4d6f1): 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 #9443 auto-closed, and file the 14-step report. Dmitrii Fedorov (@dmitrii-f-t27) |
Summary
Port
gHashTag/trios:crates/trios-phi-schedule/src/lib.rs(at8b229e9489ee, 200+ lines) asspecs/port/trios/crates/trios-phi-schedule/src/lib.t27— Roadmap Stage 6 (goal #4548), target t27c gen-rust. Closes #9443.The original is the φ-LR scheduler for the Issue #54 calibration: three schedules — flat (the constant baseline), cosine (decaying to 0), and the φ-decay hypothesis (LR = base·φ^(−t/τ), τ = max_steps/(φ·27)) — with the Issue #53 finding riding along: α_φ is not a valid initial rate; its role is the asymptotic floor.
Per the issue's rule ("Port the decision, not the plumbing"), all five listed functions are ported under their names as pure functions (no transports) with 13 tests (44 runtime asserts, 0 vacuous, 100% function coverage), including the original's own no-decay-at-zero, monotonic-decay and φ-factor tests:
phi_schedule— base·φ^(−epoch/warmup): φ from a Newton square root, the power from a binary-expansion root ladder (nopowfbuiltin);flat_lr— the constant baseline;cosine_lr— base·(1+cos(πt))/2, the cosine from a Taylor window (nocosbuiltin);phi_decay_lr— the warmup gate, τ = max_steps/(φ·27), the exponent cap at 10, the 1e-6 floor. Measured, the cap binds first: base·φ^(−10) ≈ 2.4e-6 stays above the floor — the floor is the deeper safety net, and the test pins that honestly;lr_schedule_54— the unified dispatch with BASE_LR fixed at 3e-4 and the warmup at 100 steps.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: 16/16 tested (100%) — no transports in this port.t27c test-report: 13 tests / 13 pass / 0 FAIL / 0 BLOCKED, 0 vacuous passes — φ in its window (1.61803–1.61804), the sqrt ladder (√2, √5), the φ-power ladder (φ⁰=1, φ⁻¹=1/φ), the Taylor cosine (0, π/2, π), the no-decay-at-zero, the monotonic decay, the φ-factor at warmup 1, the flat constancy, the cosine curve (base at 0, below base at the midpoint, near 0 at 999), the warmup gate, the post-warmup decay above the floor, the cap pinning base·φ⁻¹⁰ above the floor, τ in its window (22.88–22.90), and the unified dispatch with the α_φ finding.t27c gen | grep -c 'not yet implemented': 0;gen | wc -l: 216 (> 12).grep -cE '^\s*(pub )?fn (phi_schedule|flat_lr|cosine_lr|phi_decay_lr|lr_schedule_54)\(': 5.grep -cE '^\s*test\s+(["|[A-Za-z_])': 13 (≥ 5).git status --short— exactly this one file. The repo's lefthook pre-commit passed.dupe_scan: all 13 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)