Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# NOW -- Implement part 2 of 3 of the empty bodies in specs/ml/optimizer/adamw.t27 (8 functions) (published 2026-09-21)

## A bee's work on #4356, published from `queen-4356` (Closes #4356)

- The branch changes 1 file(s): `specs/ml/optimizer/adamw.t27`.
- `git diff --stat origin/master...queen-4356` reads: 1 file changed, 22 insertions(+), 27 deletions(-)
- This entry is written by the publisher, not by the bee. A pull request must
add exactly one `docs/now/` entry and a bee has no way to know that: its brief
names a boundary file and acceptance criteria, and `docs/now/` is neither.
- What this entry does NOT establish: that the work is correct. The gates on the
pull request judge that, and they are the same gates every other change meets.
49 changes: 22 additions & 27 deletions specs/ml/optimizer/adamw.t27
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,11 @@ module AdamW;
// amsgrad_update(v: gf16::GF16, v_max: gf16::GF16) → f32
// Computes AMSGrad maximum tracking.
fn amsgrad_update(v: gf16::GF16, v_max: gf16::GF16) -> gf16::GF16 {
// return max(v_max, v)
if v > v_max {
v
} else {
v_max
}
}

// ═══════════════════════════════════════════════════════════
Expand Down Expand Up @@ -568,7 +572,7 @@ module AdamW;
DEFAULT_BETA1
}

test get_effective_betas {
test get_effective_betas
// Test Canonical variant
given (b1, b2, wd) = get_effective_betas(PhiVariant.Canonical)
then approximately_equal(b1, PHI_CANONICAL_BETA1) // ~ 0.618
Expand All @@ -592,37 +596,28 @@ module AdamW;
then approximately_equal(b1, RATIONAL_BETA1) // 4/7 ~ 0.5714
and approximately_equal(b2, DEFAULT_BETA2) // 0.999
and approximately_equal(wd, RATIONAL_WEIGHT_DECAY) // 7/30 ~ 0.2333
}

fn amsgrad_update(v: gf16::GF16, v_max: gf16::GF16) -> gf16::GF16 {
// return max(v_max, v)
when v > v_max {
v
} else {
v_max
}
}


test amsgrad_update {
// Test when v > v_max
given result = amsgrad_update(5.0, 3.0)
then result == 5.0
test amsgrad_update
// Test when v > v_max
given result = amsgrad_update(5.0, 3.0)
then result == 5.0

// Test when v <= v_max
given result = amsgrad_update(2.0, 4.0)
then result == 4.0
// Test when v <= v_max
given result = amsgrad_update(2.0, 4.0)
then result == 4.0

// Test when v == v_max
given result = amsgrad_update(3.0, 3.0)
then result == 3.0
// Test when v == v_max
given result = amsgrad_update(3.0, 3.0)
then result == 3.0

// Test with negative values
given result = amsgrad_update(-1.0, -2.0)
then result == -1.0
// Test with negative values
given result = amsgrad_update(-1.0, -2.0)
then result == -1.0

given result = amsgrad_update(-3.0, -1.0)
then result == -1.0
}
given result = amsgrad_update(-3.0, -1.0)
then result == -1.0

// =========================================================
// EXISTING TDD: Tests (preserved from pre-B1 spec)
Expand Down
Loading