{"abstract":"Cosine restarts are misaligned with the end of warmup.","category":"Learning rate schedules","checks":6,"contract":"Warm up linearly, then apply a repeating cosine over a fixed post-warmup period.","contract_signature":"step, base, warmup, period","evaluation_group":"lr-schedule-warmup-cosine-restarts","failed_approach":"Offsetting the corrected phase by one step creates a discontinuity at the warmup boundary.","family":"w3-learning-rate-schedules-warmup-cosine-restarts","id":"FA-99101","implementations":{"attempt":{"sha256":"8720ea168f61d87ba6e7634f3956ed75eee7cae12b1e5ad47b4e4dd6af60c08d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(step, base, warmup, period):\n    import math\n    phase=(step-warmup)%period\n    return base*(step/warmup) if step<warmup else base*(1+math.cos(2*math.pi*(phase+1)/period))/2\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('warmup',solve(1,8,4,3),2); check('boundary',solve(4,8,4,3),8); check('midcycle',solve(6,8,4,4),0); check('quarter cycle',solve(5,8,4,4),4); check('restart',solve(8,8,4,4),8); check('next peak',solve(12,6,4,4),6)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"0066ea9891e121b4d5fc4de613090e907261bdcd768d9ed76c7331292220a82e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(step, base, warmup, period):\n    import math\n    return base*step/warmup if step<warmup else base*(1+math.cos(2*math.pi*(step%period)/period))/2\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('warmup',solve(1,8,4,3),2); check('boundary',solve(4,8,4,3),8); check('midcycle',solve(6,8,4,4),0); check('quarter cycle',solve(5,8,4,4),4); check('restart',solve(8,8,4,4),8); check('next peak',solve(12,6,4,4),6)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w3-learning-rate-schedules-warmup-cosine-restarts","generated_at":"2026-09-30T16:48:20.351688+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic scalar schedule makes step-to-rate mapping explicit for a small training loop.","root_cause":"The restart remainder is calculated from the global step, not elapsed post-warmup steps.","sha256":"8420f94bfe5961f462a11fbf4f3e4495dc2f2ca63247b7ed158121931b70e2ae","title":"Cosine restarts are misaligned with the end of warmup · case 01","variant":1,"variant_policy":"The same explicitly authored fixtures repeat across all five numbered records; runtime N is unused. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":28.01,"exit_code":1,"observations":[{"actual":2.0,"check":"warmup","expected":2,"passed":true},{"actual":2.000000000000001,"check":"boundary","expected":8,"passed":false},{"actual":3.999999999999999,"check":"midcycle","expected":0,"passed":false},{"actual":0.0,"check":"quarter cycle","expected":4,"passed":false},{"actual":4.0,"check":"restart","expected":8,"passed":false},{"actual":3.0,"check":"next peak","expected":6,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"warmup\", \"actual\": 2.0, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary\", \"actual\": 2.000000000000001, \"expected\": 8, \"passed\": false}, {\"check\": \"midcycle\", \"actual\": 3.999999999999999, \"expected\": 0, \"passed\": false}, {\"check\": \"quarter cycle\", \"actual\": 0.0, \"expected\": 4, \"passed\": false}, {\"check\": \"restart\", \"actual\": 4.0, \"expected\": 8, \"passed\": false}, {\"check\": \"next peak\", \"actual\": 3.0, \"expected\": 6, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.981,"exit_code":1,"observations":[{"actual":2.0,"check":"warmup","expected":2,"passed":true},{"actual":2.000000000000001,"check":"boundary","expected":8,"passed":false},{"actual":0.0,"check":"midcycle","expected":0,"passed":true},{"actual":4.0,"check":"quarter cycle","expected":4,"passed":true},{"actual":8.0,"check":"restart","expected":8,"passed":true},{"actual":6.0,"check":"next peak","expected":6,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"warmup\", \"actual\": 2.0, \"expected\": 2, \"passed\": true}, {\"check\": \"boundary\", \"actual\": 2.000000000000001, \"expected\": 8, \"passed\": false}, {\"check\": \"midcycle\", \"actual\": 0.0, \"expected\": 0, \"passed\": true}, {\"check\": \"quarter cycle\", \"actual\": 4.0, \"expected\": 4, \"passed\": true}, {\"check\": \"restart\", \"actual\": 8.0, \"expected\": 8, \"passed\": true}, {\"check\": \"next peak\", \"actual\": 6.0, \"expected\": 6, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}