FAILURE MAP
← Case archive

FA-99096 / Learning rate schedules / Open access

Cosine decay fails to restart at each cycle boundary · case 01

Cosine decay fails to restart at each cycle boundary.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The schedule uses a half cosine over absolute time and never resets its phase.

THE FAILURE

The schedule uses a half cosine over absolute time and never resets its phase.

Unsuccessful approach: A one-step phase shift misses the specified rates at cycle starts and interior points.

Case contract

With fixed period, cosine restarts at zero every period; each cycle begins at base.

Why this case matters

A deterministic scalar schedule makes step-to-rate mapping explicit for a small training loop.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(step, base, period):
    import math
    return base*(1+math.cos(math.pi*step/period))/2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial',solve(0,10,4),10); check('quarter',solve(1,8,4),4); check('half',solve(2,12,4),0); check('restart',solve(4,7,4),7); check('next quarter',solve(5,8,4),4); check('negative clamp',solve(-1,6,4),6)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
initial10.010Passed
quarter6.828427124746194Failed
half6.00Failed
restart0.07Failed
next quarter1.17157287525380934Failed
negative clamp5.1213203435596426Failed

SHA-256 / 0be8f398c7aab920c1064c42d11713e8d7767b40be86c9ba7933c6fbb77e47fc

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(step, base, period):
    import math
    phase=step%period
    return base*(1+math.cos(math.pi*(phase+1)/period))/2
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('initial',solve(0,10,4),10); check('quarter',solve(1,8,4),4); check('half',solve(2,12,4),0); check('restart',solve(4,7,4),7); check('next quarter',solve(5,8,4),4); check('negative clamp',solve(-1,6,4),6)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
initial8.53553390593273810Failed
quarter4.04Passed
half1.75735931288071520Failed
restart5.9748737341529167Failed
next quarter4.04Passed
negative clamp0.06Failed

SHA-256 / ce7cc66518e9157793e269a29911d7081d5146715322f8e2a92c5791a286ac58

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

These are toy scalar contracts with integer steps and finite parameters; they do not model framework defaults or optimizer state. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:20.352075+00:00.

Case digest / 78eb1e9084f5d867333182f1af4ee7e0769b9122299753b69e9cd9a306753363