FA-12021 / Optimization solver contracts / Open access
Trust region accepts steps with a nondecreasing model · case 01
Trust region accepts steps with a nondecreasing model.
ROOT CAUSE
Acceptance tests actual improvement without predicted reduction.
VERIFIED REPAIR
Require positive predicted reduction and ratio at least eta.
Unsuccessful approach: Taking absolute predicted reduction masks a model that forecasts an increase.
Case contract
Accept iff predicted>0 and actual/predicted>=eta, for 0<eta<1; reductions use old-new convention.
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
N = 1
observations = []
def solve(actual, predicted, eta):
return actual > 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('model increase', solve(N, -N, 0.5), False)
check('poor agreement', solve(N, 10*N, 0.5), False)
check('threshold', solve(N, 2*N, 0.5), True)
check('good agreement', solve(2*N, N, 0.5), True)
check('flat model', solve(N, 0, 0.5), False)
check('actual increase', solve(-N, N, 0.5), 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 |
|---|---|---|---|
| model increase | True | False | Failed |
| poor agreement | True | False | Failed |
| threshold | True | True | Passed |
| good agreement | True | True | Passed |
| flat model | True | False | Failed |
| actual increase | False | False | Passed |
SHA-256 / d475b94f1cea49cf1dd54899665ebb6b10f7877768b4230fc83f1d4385901aa8
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(actual, predicted, eta):
return predicted != 0 and actual/abs(predicted) >= eta
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('model increase', solve(N, -N, 0.5), False)
check('poor agreement', solve(N, 10*N, 0.5), False)
check('threshold', solve(N, 2*N, 0.5), True)
check('good agreement', solve(2*N, N, 0.5), True)
check('flat model', solve(N, 0, 0.5), False)
check('actual increase', solve(-N, N, 0.5), 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 |
|---|---|---|---|
| model increase | True | False | Failed |
| poor agreement | False | False | Passed |
| threshold | True | True | Passed |
| good agreement | True | True | Passed |
| flat model | False | False | Passed |
| actual increase | False | False | Passed |
SHA-256 / 0f56f86ffec3b72df42aa9cdd618d6479d62e392327e28aa71efe019b97e6c57
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(actual, predicted, eta):
return predicted > 0 and actual/predicted >= eta
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('model increase', solve(N, -N, 0.5), False)
check('poor agreement', solve(N, 10*N, 0.5), False)
check('threshold', solve(N, 2*N, 0.5), True)
check('good agreement', solve(2*N, N, 0.5), True)
check('flat model', solve(N, 0, 0.5), False)
check('actual increase', solve(-N, N, 0.5), 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 |
|---|---|---|---|
| model increase | False | False | Passed |
| poor agreement | False | False | Passed |
| threshold | True | True | Passed |
| good agreement | True | True | Passed |
| flat model | False | False | Passed |
| actual increase | False | False | Passed |
SHA-256 / f35f9f2470fb05db35b9e1253c238c6c9c5ddf30f7f8d4daeebf8b579e1354f0
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:53.038173+00:00.
Case digest / c94a9365a8d12a3ed84a8763d9b1b3d5158b106869157ff353b35e862a2e8ab5