FA-12001 / Optimization solver contracts / Open access
Quasi Newton update admits nonpositive curvature · case 01
Quasi Newton update admits nonpositive curvature.
ROOT CAUSE
The secant pair is used whenever its dot product is nonzero.
VERIFIED REPAIR
Compute the dot product exactly from represented inputs and accept only a strictly positive result, avoiding overflow and cancellation in the sign test.
Unsuccessful approach: Taking an absolute value before testing positivity admits negative curvature.
Case contract
Return whether a finite Python integer/float vector pair may enter an undamped BFGS update under the strict curvature condition s dot y>0, evaluated exactly for the represented inputs; equal vector lengths are assumed.
Why this case matters
This deterministic solver-step model isolates an algorithmic invariant used by iterative optimization implementations.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(s, y):
return sum(a*b for a,b in zip(s,y)) != 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative pair', solve([N], [-1]), False)
check('positive pair', solve([N], [1]), True)
check('zero step', solve([0], [N]), False)
check('orthogonal', solve([1,0], [0,N]), False)
check('cancellation', solve([1,1], [N,-N]), False)
check('mixed positive', solve([1,2], [-N,N]), True)
check('mixed negative', solve([2,1], [-N,N]), False)
check('overflow cancellation retains positive curvature', solve([1e308,1e308,N],[2.0,-2.0,1.0]), True)
check('overflow cancellation retains negative curvature', solve([1e308,1e308,N],[2.0,-2.0,-1.0]), False)
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 |
|---|---|---|---|
| negative pair | True | False | Failed |
| positive pair | True | True | Passed |
| zero step | False | False | Passed |
| orthogonal | False | False | Passed |
| cancellation | False | False | Passed |
| mixed positive | True | True | Passed |
| mixed negative | True | False | Failed |
| overflow cancellation retains positive curvature | True | True | Passed |
| overflow cancellation retains negative curvature | True | False | Failed |
SHA-256 / 68b9ef59f95af0d13fb703a46249f6f9eaf3c1b1a653edb4141e924ce8cda49c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(s, y):
return abs(sum(a*b for a,b in zip(s,y))) > 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative pair', solve([N], [-1]), False)
check('positive pair', solve([N], [1]), True)
check('zero step', solve([0], [N]), False)
check('orthogonal', solve([1,0], [0,N]), False)
check('cancellation', solve([1,1], [N,-N]), False)
check('mixed positive', solve([1,2], [-N,N]), True)
check('mixed negative', solve([2,1], [-N,N]), False)
check('overflow cancellation retains positive curvature', solve([1e308,1e308,N],[2.0,-2.0,1.0]), True)
check('overflow cancellation retains negative curvature', solve([1e308,1e308,N],[2.0,-2.0,-1.0]), False)
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 |
|---|---|---|---|
| negative pair | True | False | Failed |
| positive pair | True | True | Passed |
| zero step | False | False | Passed |
| orthogonal | False | False | Passed |
| cancellation | False | False | Passed |
| mixed positive | True | True | Passed |
| mixed negative | True | False | Failed |
| overflow cancellation retains positive curvature | False | True | Failed |
| overflow cancellation retains negative curvature | False | False | Passed |
SHA-256 / f860649c73083b7a2c1a1a7211da5c12b6abd8db33e054043359c6b2d3bb16f6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(s, y):
return sum(Fraction(a)*Fraction(b) for a,b in zip(s,y)) > 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('negative pair', solve([N], [-1]), False)
check('positive pair', solve([N], [1]), True)
check('zero step', solve([0], [N]), False)
check('orthogonal', solve([1,0], [0,N]), False)
check('cancellation', solve([1,1], [N,-N]), False)
check('mixed positive', solve([1,2], [-N,N]), True)
check('mixed negative', solve([2,1], [-N,N]), False)
check('overflow cancellation retains positive curvature', solve([1e308,1e308,N],[2.0,-2.0,1.0]), True)
check('overflow cancellation retains negative curvature', solve([1e308,1e308,N],[2.0,-2.0,-1.0]), False)
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 |
|---|---|---|---|
| negative pair | False | False | Passed |
| positive pair | True | True | Passed |
| zero step | False | False | Passed |
| orthogonal | False | False | Passed |
| cancellation | False | False | Passed |
| mixed positive | True | True | Passed |
| mixed negative | False | False | Passed |
| overflow cancellation retains positive curvature | True | True | Passed |
| overflow cancellation retains negative curvature | False | False | Passed |
SHA-256 / 37d9b02d02408212e240b998f15a2acf87042cc807497ff7ff41b2796f0cef47
Verification & scope
Controlled finite inputs and explicit one-step contracts; this is not a production solver or a numerical stability benchmark. 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-29T14:38:52.960065+00:00.
Case digest / 13aac874718a9fa87e3cb61d756dce1ac5435b0f01c60c9ab8d0774ba31c6f36