FA-84111 / Sports scoring and tiebreakers / Open access
Innings pitched summed as decimal numbers · case 01
Two outings of 5.2 and 1.1 innings total 6.3 instead of 7.0.
ROOT CAUSE
The innings string is multiplied as a float by three and rounded, treating .2 as two tenths.
VERIFIED REPAIR
Parse the digit after the point as outs.
Unsuccessful approach: Truncating float(ip) * 3 instead of rounding still misreads partial innings.
Case contract
Pitching line aggregation. outings rows are [innings_pitched, earned_runs] where innings pitched use baseball notation "6.2" = 6 innings and 2 outs (the digit after the point is 0-2; otherwise return "invalid ip <text>"). Sum outs exactly. ERA = innings_per_game * earned runs / innings, rounded half up to two decimals. Return [total innings "I.O", ERA string]; with zero outs ERA is "INF" if any earned runs else "0.00".
Why this case matters
Box scores and stat pages aggregate outs across appearances; thirds of an inning are notorious.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(outings, innings_per_game):
outs = er = 0
for ip, runs in outings:
whole, _, part = ip.partition('.')
part = int(part or 0)
if part > 2:
return 'invalid ip ' + ip
outs += round(float(ip) * 3)
er += runs
ip_str = '%d.%d' % (outs // 3, outs % 3)
if outs == 0:
return [ip_str, 'INF' if er else '0.00']
v = Fraction(innings_per_game * er * 3, outs)
cents = math.floor(v * 100 + Fraction(1, 2))
return [ip_str, '%d.%02d' % (cents // 100, cents % 100)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['6.2', 4]], 7), ['6.2', '4.20']),
('variant scenario 1', ([['5.2', 1], ['7.0', 2], ['0.3', 4]], 9), 'invalid ip 0.3'),
('variant scenario 2', ([['9', 1], ['6.0', 0]], 9), ['15.0', '0.60'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['4.1', 3], ['2.0', 4], ['6.2', 2]], 9), ['13.0', '6.23']),
('variant scenario 1', ([['5.2', 2], ['9.1', 3], ['9', 3]], 9), ['24.0', '3.00']),
('variant scenario 2', ([['5.0', 1], ['2.0', 3], ['3.1', 4], ['1.0', 3]], 9), ['11.1', '8.74'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['8.2', 3], ['4.0', 3]], 9), ['12.2', '4.26']),
('variant scenario 1', ([['1', 0], ['4.0', 4]], 9), ['5.0', '7.20']),
('variant scenario 2', ([['4.1', 0], ['5.2', 3], ['7.1', 4], ['4.0', 2]], 7), ['21.1', '2.95'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['4.1', 1], ['4.2', 1], ['0.1', 0]], 7), ['9.1', '1.50']),
('variant scenario 1', ([['8.3', 1], ['4.2', 4], ['9', 2]], 9), 'invalid ip 8.3'),
('variant scenario 2', ([['6.3', 0]], 7), 'invalid ip 6.3')],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['3.2', 0], ['6.0', 0], ['2.1', 4]], 7), ['12.0', '2.33']),
('variant scenario 1',
([['9.2', 4], ['0.2', 1], ['6.2', 1], ['3.3', 3], ['3.1', 4], ['9.1', 1]], 7),
'invalid ip 3.3'),
('variant scenario 2',
([['6.3', 4], ['4.1', 3], ['7.0', 0], ['7.0', 2], ['2.1', 4], ['7.2', 4], ['0.0', 0]], 9),
'invalid ip 6.3')]]
for label, args, expected in cases[N - 1]:
check(label, run(args), expected)
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 |
|---|---|---|---|
| control complete game | ['9.0', '2.00'] | ['9.0', '2.00'] | Passed |
| boundary thirds carry | ['6.1', '1.42'] | ['7.0', '1.29'] | Failed |
| boundary seven-inning game | ['7.0', '3.00'] | ['7.0', '3.00'] | Passed |
| boundary no outs with runs | ['0.0', 'INF'] | ['0.0', 'INF'] | Passed |
| boundary invalid out digit | invalid ip 4.3 | invalid ip 4.3 | Passed |
| control half-up rounding | ['8.0', '3.38'] | ['8.0', '3.38'] | Passed |
| regression: outs notation | ['6.1', '4.42'] | ['6.2', '4.20'] | Failed |
| variant scenario 1 | invalid ip 0.3 | invalid ip 0.3 | Passed |
| variant scenario 2 | ['15.0', '0.60'] | ['15.0', '0.60'] | Passed |
SHA-256 / f34a5c5daba6666aa55d006151cc0c6030866f9fbb3aa40a819bb73792fcbf20
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(outings, innings_per_game):
outs = er = 0
for ip, runs in outings:
whole, _, part = ip.partition('.')
part = int(part or 0)
if part > 2:
return 'invalid ip ' + ip
outs += int(float(ip) * 3)
er += runs
ip_str = '%d.%d' % (outs // 3, outs % 3)
if outs == 0:
return [ip_str, 'INF' if er else '0.00']
v = Fraction(innings_per_game * er * 3, outs)
cents = math.floor(v * 100 + Fraction(1, 2))
return [ip_str, '%d.%02d' % (cents // 100, cents % 100)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['6.2', 4]], 7), ['6.2', '4.20']),
('variant scenario 1', ([['5.2', 1], ['7.0', 2], ['0.3', 4]], 9), 'invalid ip 0.3'),
('variant scenario 2', ([['9', 1], ['6.0', 0]], 9), ['15.0', '0.60'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['4.1', 3], ['2.0', 4], ['6.2', 2]], 9), ['13.0', '6.23']),
('variant scenario 1', ([['5.2', 2], ['9.1', 3], ['9', 3]], 9), ['24.0', '3.00']),
('variant scenario 2', ([['5.0', 1], ['2.0', 3], ['3.1', 4], ['1.0', 3]], 9), ['11.1', '8.74'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['8.2', 3], ['4.0', 3]], 9), ['12.2', '4.26']),
('variant scenario 1', ([['1', 0], ['4.0', 4]], 9), ['5.0', '7.20']),
('variant scenario 2', ([['4.1', 0], ['5.2', 3], ['7.1', 4], ['4.0', 2]], 7), ['21.1', '2.95'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['4.1', 1], ['4.2', 1], ['0.1', 0]], 7), ['9.1', '1.50']),
('variant scenario 1', ([['8.3', 1], ['4.2', 4], ['9', 2]], 9), 'invalid ip 8.3'),
('variant scenario 2', ([['6.3', 0]], 7), 'invalid ip 6.3')],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['3.2', 0], ['6.0', 0], ['2.1', 4]], 7), ['12.0', '2.33']),
('variant scenario 1',
([['9.2', 4], ['0.2', 1], ['6.2', 1], ['3.3', 3], ['3.1', 4], ['9.1', 1]], 7),
'invalid ip 3.3'),
('variant scenario 2',
([['6.3', 4], ['4.1', 3], ['7.0', 0], ['7.0', 2], ['2.1', 4], ['7.2', 4], ['0.0', 0]], 9),
'invalid ip 6.3')]]
for label, args, expected in cases[N - 1]:
check(label, run(args), expected)
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 |
|---|---|---|---|
| control complete game | ['9.0', '2.00'] | ['9.0', '2.00'] | Passed |
| boundary thirds carry | ['6.0', '1.50'] | ['7.0', '1.29'] | Failed |
| boundary seven-inning game | ['7.0', '3.00'] | ['7.0', '3.00'] | Passed |
| boundary no outs with runs | ['0.0', 'INF'] | ['0.0', 'INF'] | Passed |
| boundary invalid out digit | invalid ip 4.3 | invalid ip 4.3 | Passed |
| control half-up rounding | ['8.0', '3.38'] | ['8.0', '3.38'] | Passed |
| regression: outs notation | ['6.0', '4.67'] | ['6.2', '4.20'] | Failed |
| variant scenario 1 | invalid ip 0.3 | invalid ip 0.3 | Passed |
| variant scenario 2 | ['15.0', '0.60'] | ['15.0', '0.60'] | Passed |
SHA-256 / edd75ba115b566cc0f80e500165c836ba1ee20b70a239cc190ccf455dfc05527
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
import math
N = 1
observations = []
def solve(outings, innings_per_game):
outs = er = 0
for ip, runs in outings:
whole, _, part = ip.partition('.')
part = int(part or 0)
if part > 2:
return 'invalid ip ' + ip
outs += int(whole) * 3 + part
er += runs
ip_str = '%d.%d' % (outs // 3, outs % 3)
if outs == 0:
return [ip_str, 'INF' if er else '0.00']
v = Fraction(innings_per_game * er * 3, outs)
cents = math.floor(v * 100 + Fraction(1, 2))
return [ip_str, '%d.%02d' % (cents // 100, cents % 100)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
def run(args):
try:
return solve(*args)
except Exception as exc:
return 'raised ' + type(exc).__name__
cases = [[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['6.2', 4]], 7), ['6.2', '4.20']),
('variant scenario 1', ([['5.2', 1], ['7.0', 2], ['0.3', 4]], 9), 'invalid ip 0.3'),
('variant scenario 2', ([['9', 1], ['6.0', 0]], 9), ['15.0', '0.60'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['4.1', 3], ['2.0', 4], ['6.2', 2]], 9), ['13.0', '6.23']),
('variant scenario 1', ([['5.2', 2], ['9.1', 3], ['9', 3]], 9), ['24.0', '3.00']),
('variant scenario 2', ([['5.0', 1], ['2.0', 3], ['3.1', 4], ['1.0', 3]], 9), ['11.1', '8.74'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['8.2', 3], ['4.0', 3]], 9), ['12.2', '4.26']),
('variant scenario 1', ([['1', 0], ['4.0', 4]], 9), ['5.0', '7.20']),
('variant scenario 2', ([['4.1', 0], ['5.2', 3], ['7.1', 4], ['4.0', 2]], 7), ['21.1', '2.95'])],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['4.1', 1], ['4.2', 1], ['0.1', 0]], 7), ['9.1', '1.50']),
('variant scenario 1', ([['8.3', 1], ['4.2', 4], ['9', 2]], 9), 'invalid ip 8.3'),
('variant scenario 2', ([['6.3', 0]], 7), 'invalid ip 6.3')],
[('control complete game', ([['9.0', 2]], 9), ['9.0', '2.00']),
('boundary thirds carry', ([['5.2', 1], ['1.1', 0]], 9), ['7.0', '1.29']),
('boundary seven-inning game', ([['7.0', 3]], 7), ['7.0', '3.00']),
('boundary no outs with runs', ([['0.0', 2]], 9), ['0.0', 'INF']),
('boundary invalid out digit', ([['4.3', 1]], 9), 'invalid ip 4.3'),
('control half-up rounding', ([['8.0', 3]], 9), ['8.0', '3.38']),
('regression: outs notation', ([['3.2', 0], ['6.0', 0], ['2.1', 4]], 7), ['12.0', '2.33']),
('variant scenario 1',
([['9.2', 4], ['0.2', 1], ['6.2', 1], ['3.3', 3], ['3.1', 4], ['9.1', 1]], 7),
'invalid ip 3.3'),
('variant scenario 2',
([['6.3', 4], ['4.1', 3], ['7.0', 0], ['7.0', 2], ['2.1', 4], ['7.2', 4], ['0.0', 0]], 9),
'invalid ip 6.3')]]
for label, args, expected in cases[N - 1]:
check(label, run(args), expected)
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 |
|---|---|---|---|
| control complete game | ['9.0', '2.00'] | ['9.0', '2.00'] | Passed |
| boundary thirds carry | ['7.0', '1.29'] | ['7.0', '1.29'] | Passed |
| boundary seven-inning game | ['7.0', '3.00'] | ['7.0', '3.00'] | Passed |
| boundary no outs with runs | ['0.0', 'INF'] | ['0.0', 'INF'] | Passed |
| boundary invalid out digit | invalid ip 4.3 | invalid ip 4.3 | Passed |
| control half-up rounding | ['8.0', '3.38'] | ['8.0', '3.38'] | Passed |
| regression: outs notation | ['6.2', '4.20'] | ['6.2', '4.20'] | Passed |
| variant scenario 1 | invalid ip 0.3 | invalid ip 0.3 | Passed |
| variant scenario 2 | ['15.0', '0.60'] | ['15.0', '0.60'] | Passed |
SHA-256 / 2bdc3a50a4e65a18b4279122413c3eea7b565dc4d1f2d302629dfd17bc780c73
Verification & scope
Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any governing body rulebook or operator house rules. 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:50:27.834101+00:00.
Case digest / 37dddae29ef615003fb0e806c732ff1950cad1808be8d1861727458eae8df8ec