You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
spec(ml): adamw.t27 heap-free rewrite so it compiles and its tests can fail (Refs #10024) #10091
Make specs/ml/optimizer/adamw.t27 compile and pass t27c test-report with every test passing and zero vacuous tests. Part of epic #10024 (cell 23, "ML specs that compile": 6 of 17 compile today). The spec is blocked on allocate_array, a heap call t27c does not lower, and its function bodies were comments, so no test could run.
Boundary
In: specs/ml/optimizer/adamw.t27 only. Heap-free rewrite in the style of adam.t27 and lamb.t27: the caller owns the buffers (params, grads, m, v, v_max) and passes them in.
Out: seals under .trinity/seals/ (refreshed by the reseal workflows), any other optimizer spec, any non-t27 file.
Out: the BPB ablation itself. The four hyper-parameter arms (phi canonical, phi damped, tuned standard, random rational) stay as named constants, labelled [Open conjecture].
Scenarios
One AdamW step on a hand-computed 2-element case gives the expected parameters and moments.
With weight decay 0 the update equals adam.t27's over several steps with changing gradients.
With a zero gradient AdamW still shrinks theta by lr * wd * theta, while Adam with L2 in the gradient does not (decoupled decay).
Bias correction at step 1 recovers m_hat = g.
AMSGrad keeps the largest v and takes a smaller step than plain AdamW afterwards.
NaN and infinite gradients are refused and change nothing.
Each test asserts something a wrong implementation would fail; a mutation check (flip the update sign, flip the decay sign, drop bias correction, ignore v_max) fails at least one test each.
Tests that were placeholders, called undefined helpers, or asserted nothing are dropped, and the PR lists what was dropped and why.
.t27 only, ASCII only, English only.
Close criteria
The PR for this issue is merged with the measured test-report table in its body.
On master, t27c test-report specs/ml/optimizer/adamw.t27 reports all tests passing and 0 vacuous.
Activity
gHashTag commentedon Oct 17, 2026
Superseded by #10077 / PR #10088, which rewrites adamw.t27 heap-free on the arena.