FAILURE MAP
← Case archive

FA-11996 / Optimization solver contracts / Open access

Bound constrained termination rejects a valid boundary optimum · case 01

Bound constrained termination rejects a valid boundary optimum.

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

ROOT CAUSE

Termination checks raw gradient magnitude.

VERIFIED REPAIR

Check the projected gradient mapping x-clip(x-g,lo,hi).

Unsuccessful approach: Suppressing all gradients at a bound also suppresses feasible descent directions.

Case contract

Given feasible scalar x and lo<=hi, return whether the unit-step projected gradient mapping is exactly zero.

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(x, g, lo, hi):
    return g == 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('lower optimum', solve(0, N, 0, 10), True)
check('lower needs inward step', solve(0, -N, 0, 10), False)
check('upper optimum', solve(10, -N, 0, 10), True)
check('upper needs inward step', solve(10, N, 0, 10), False)
check('interior stationary', solve(5, 0, 0, 10), True)
check('interior moving', solve(5, 1, 0, 10), False)
check('singleton feasible set', solve(3, -N, 3, 3), True)
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
lower optimumFalseTrueFailed
lower needs inward stepFalseFalsePassed
upper optimumFalseTrueFailed
upper needs inward stepFalseFalsePassed
interior stationaryTrueTruePassed
interior movingFalseFalsePassed
singleton feasible setFalseTrueFailed

SHA-256 / 2599beb5cea48608f318dc5037a3fe6ca2422ce88d6ee7dccd15ff88ec8b4177

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(x, g, lo, hi):
    return g == 0 or x == lo or x == hi
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('lower optimum', solve(0, N, 0, 10), True)
check('lower needs inward step', solve(0, -N, 0, 10), False)
check('upper optimum', solve(10, -N, 0, 10), True)
check('upper needs inward step', solve(10, N, 0, 10), False)
check('interior stationary', solve(5, 0, 0, 10), True)
check('interior moving', solve(5, 1, 0, 10), False)
check('singleton feasible set', solve(3, -N, 3, 3), True)
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
lower optimumTrueTruePassed
lower needs inward stepTrueFalseFailed
upper optimumTrueTruePassed
upper needs inward stepTrueFalseFailed
interior stationaryTrueTruePassed
interior movingFalseFalsePassed
singleton feasible setTrueTruePassed

SHA-256 / e4d10e8e3566afe6ec83f98b9332114c7f370a2d374991657aaf8bc30025f2f4

3 / The verified repair

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

N = 1
observations = []
def solve(x, g, lo, hi):
    return x == min(hi, max(lo, x-g))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('lower optimum', solve(0, N, 0, 10), True)
check('lower needs inward step', solve(0, -N, 0, 10), False)
check('upper optimum', solve(10, -N, 0, 10), True)
check('upper needs inward step', solve(10, N, 0, 10), False)
check('interior stationary', solve(5, 0, 0, 10), True)
check('interior moving', solve(5, 1, 0, 10), False)
check('singleton feasible set', solve(3, -N, 3, 3), True)
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
lower optimumTrueTruePassed
lower needs inward stepFalseFalsePassed
upper optimumTrueTruePassed
upper needs inward stepFalseFalsePassed
interior stationaryTrueTruePassed
interior movingFalseFalsePassed
singleton feasible setTrueTruePassed

SHA-256 / 9ae44aa3301d221b843c344e35a1fdff0bbf957a80f092115181b81ff31a27df

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.942676+00:00.

Case digest / a40cd6f3c2569e25a78f60af6b4a58a32e0bae9504d3386f560c14473fc43144