FA-98941 / Optimizer update state / Open access
SGD adds the gradient instead of taking a descent step · case 01
SGD adds the gradient instead of taking a descent step.
ROOT CAUSE
The gradient is added to the parameter.
THE FAILURE
The gradient is added to the parameter.
Unsuccessful approach: Taking the gradient magnitude fixes positive gradients but still mishandles negative ones.
Case contract
One scalar SGD step returns p-lr*g for finite inputs and nonnegative lr.
Why this case matters
Optimizer implementations must associate each parameter with its own mathematically specified update state.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(p, g, lr):
return p+lr*g
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive gradient',solve(5,2,N),5-2*N)
check('negative gradient',solve(5,-2,N),5+2*N)
check('zero gradient',solve(N,0,N),N)
check('zero rate',solve(3,-4,0),3)
check('fractional rate',solve(2,1,0.5),1.5)
check('negative parameter',solve(-N,1,2),-N-2)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| positive gradient | 7 | 3 | Failed |
| negative gradient | 3 | 7 | Failed |
| zero gradient | 1 | 1 | Passed |
| zero rate | 3 | 3 | Passed |
| fractional rate | 2.5 | 1.5 | Failed |
| negative parameter | 1 | -3 | Failed |
SHA-256 / ad199038872cedda8c3ccad61a8fc2bafe6860f5ae7c3e590a8a36752c26ec21
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(p, g, lr):
return p-lr*abs(g)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive gradient',solve(5,2,N),5-2*N)
check('negative gradient',solve(5,-2,N),5+2*N)
check('zero gradient',solve(N,0,N),N)
check('zero rate',solve(3,-4,0),3)
check('fractional rate',solve(2,1,0.5),1.5)
check('negative parameter',solve(-N,1,2),-N-2)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| positive gradient | 3 | 3 | Passed |
| negative gradient | 3 | 7 | Failed |
| zero gradient | 1 | 1 | Passed |
| zero rate | 3 | 3 | Passed |
| fractional rate | 1.5 | 1.5 | Passed |
| negative parameter | -3 | -3 | Passed |
SHA-256 / d6e047089e0dfde423a97ebbaa0fb4cb76fe33c63952dac96c33912b531ab011
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 deterministic scalar or short-vector toy contracts, not claims about production optimizer APIs or training quality. 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:18.534164+00:00.
Case digest / 487db718c739f51065dd586ca3f0658b6a786ef0cf5c02999eb2acbd40792cc4