FAILURE MAP
← Case archive

FA-84116 / Sports scoring and tiebreakers / Open access

Total innings displayed as a decimal fraction · case 01

A total of 20 outs is shown as "6.7" instead of "6.2".

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

ROOT CAUSE

The display divides outs by three and formats one decimal.

VERIFIED REPAIR

Display whole innings and remaining outs.

Unsuccessful approach: Rounding the innings part to the nearest whole inning shows "7.2" for 20 outs.

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 += int(whole) * 3 + part
        er += runs
    ip_str = '%.1f' % (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: innings display', ([['0.1', 0]], 9), ['0.1', '0.00']),
  ('regression: innings display', ([['7.0', 2], ['6.2', 1], ['5', 3]], 7), ['18.2', '2.25']),
  ('variant scenario 1', ([['8.1', 3], ['0.1', 0]], 9), ['8.2', '3.12']),
  ('variant scenario 2', ([['0.3', 1], ['6.2', 3]], 9), 'invalid ip 0.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: innings display', ([['7.2', 3]], 9), ['7.2', '3.52']),
  ('variant scenario 1', ([['3.3', 3], ['0.2', 1], ['6.0', 4], ['8.1', 1]], 9), 'invalid ip 3.3'),
  ('variant scenario 2', ([['1.3', 4]], 9), 'invalid ip 1.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: innings display', ([['1.0', 1], ['8.2', 4], ['8.0', 4]], 9), ['17.2', '4.58']),
  ('variant scenario 1', ([['0.1', 2], ['4.1', 4], ['8.1', 1]], 9), ['13.0', '4.85']),
  ('variant scenario 2',
   ([['1.2', 1], ['4.3', 1], ['7.1', 1], ['4.2', 2], ['2.0', 0]], 9),
   'invalid ip 4.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: innings display',
   ([['3.2', 3], ['6.1', 1], ['3.2', 0], ['6.0', 4]], 7),
   ['19.2', '2.85']),
  ('variant scenario 1', ([['5.3', 0], ['8.1', 2], ['1.2', 2]], 9), 'invalid ip 5.3'),
  ('variant scenario 2', ([['3.2', 4], ['9.1', 2]], 9), ['13.0', '4.15'])],
 [('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: innings display', ([['4', 4], ['3.2', 2], ['0.0', 0]], 7), ['7.2', '5.48']),
  ('variant scenario 1', ([['9', 1], ['8.3', 3], ['7.1', 4]], 7), 'invalid ip 8.3'),
  ('variant scenario 2', ([['9.1', 3], ['4.2', 1]], 9), ['14.0', '2.57'])]]
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 fixtureActualExpectedOutcome
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 digitinvalid ip 4.3invalid ip 4.3Passed
control half-up rounding['8.0', '3.38']['8.0', '3.38']Passed
regression: innings display['0.3', '0.00']['0.1', '0.00']Failed
regression: innings display['18.7', '2.25']['18.2', '2.25']Failed
variant scenario 1['8.7', '3.12']['8.2', '3.12']Failed
variant scenario 2invalid ip 0.3invalid ip 0.3Passed

SHA-256 / f2426fca871aa3e8a6a3d4706833de49fc0e57afa175b35a8473fb4e7b90aef2

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(whole) * 3 + part
        er += runs
    ip_str = '%d.%d' % (round(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: innings display', ([['0.1', 0]], 9), ['0.1', '0.00']),
  ('regression: innings display', ([['7.0', 2], ['6.2', 1], ['5', 3]], 7), ['18.2', '2.25']),
  ('variant scenario 1', ([['8.1', 3], ['0.1', 0]], 9), ['8.2', '3.12']),
  ('variant scenario 2', ([['0.3', 1], ['6.2', 3]], 9), 'invalid ip 0.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: innings display', ([['7.2', 3]], 9), ['7.2', '3.52']),
  ('variant scenario 1', ([['3.3', 3], ['0.2', 1], ['6.0', 4], ['8.1', 1]], 9), 'invalid ip 3.3'),
  ('variant scenario 2', ([['1.3', 4]], 9), 'invalid ip 1.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: innings display', ([['1.0', 1], ['8.2', 4], ['8.0', 4]], 9), ['17.2', '4.58']),
  ('variant scenario 1', ([['0.1', 2], ['4.1', 4], ['8.1', 1]], 9), ['13.0', '4.85']),
  ('variant scenario 2',
   ([['1.2', 1], ['4.3', 1], ['7.1', 1], ['4.2', 2], ['2.0', 0]], 9),
   'invalid ip 4.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: innings display',
   ([['3.2', 3], ['6.1', 1], ['3.2', 0], ['6.0', 4]], 7),
   ['19.2', '2.85']),
  ('variant scenario 1', ([['5.3', 0], ['8.1', 2], ['1.2', 2]], 9), 'invalid ip 5.3'),
  ('variant scenario 2', ([['3.2', 4], ['9.1', 2]], 9), ['13.0', '4.15'])],
 [('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: innings display', ([['4', 4], ['3.2', 2], ['0.0', 0]], 7), ['7.2', '5.48']),
  ('variant scenario 1', ([['9', 1], ['8.3', 3], ['7.1', 4]], 7), 'invalid ip 8.3'),
  ('variant scenario 2', ([['9.1', 3], ['4.2', 1]], 9), ['14.0', '2.57'])]]
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 fixtureActualExpectedOutcome
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 digitinvalid ip 4.3invalid ip 4.3Passed
control half-up rounding['8.0', '3.38']['8.0', '3.38']Passed
regression: innings display['0.1', '0.00']['0.1', '0.00']Passed
regression: innings display['19.2', '2.25']['18.2', '2.25']Failed
variant scenario 1['9.2', '3.12']['8.2', '3.12']Failed
variant scenario 2invalid ip 0.3invalid ip 0.3Passed

SHA-256 / f3d7d68adc08ca156cca0e1c0387b5d498a9dee3c420d49c3de444a00be4edf7

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: innings display', ([['0.1', 0]], 9), ['0.1', '0.00']),
  ('regression: innings display', ([['7.0', 2], ['6.2', 1], ['5', 3]], 7), ['18.2', '2.25']),
  ('variant scenario 1', ([['8.1', 3], ['0.1', 0]], 9), ['8.2', '3.12']),
  ('variant scenario 2', ([['0.3', 1], ['6.2', 3]], 9), 'invalid ip 0.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: innings display', ([['7.2', 3]], 9), ['7.2', '3.52']),
  ('variant scenario 1', ([['3.3', 3], ['0.2', 1], ['6.0', 4], ['8.1', 1]], 9), 'invalid ip 3.3'),
  ('variant scenario 2', ([['1.3', 4]], 9), 'invalid ip 1.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: innings display', ([['1.0', 1], ['8.2', 4], ['8.0', 4]], 9), ['17.2', '4.58']),
  ('variant scenario 1', ([['0.1', 2], ['4.1', 4], ['8.1', 1]], 9), ['13.0', '4.85']),
  ('variant scenario 2',
   ([['1.2', 1], ['4.3', 1], ['7.1', 1], ['4.2', 2], ['2.0', 0]], 9),
   'invalid ip 4.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: innings display',
   ([['3.2', 3], ['6.1', 1], ['3.2', 0], ['6.0', 4]], 7),
   ['19.2', '2.85']),
  ('variant scenario 1', ([['5.3', 0], ['8.1', 2], ['1.2', 2]], 9), 'invalid ip 5.3'),
  ('variant scenario 2', ([['3.2', 4], ['9.1', 2]], 9), ['13.0', '4.15'])],
 [('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: innings display', ([['4', 4], ['3.2', 2], ['0.0', 0]], 7), ['7.2', '5.48']),
  ('variant scenario 1', ([['9', 1], ['8.3', 3], ['7.1', 4]], 7), 'invalid ip 8.3'),
  ('variant scenario 2', ([['9.1', 3], ['4.2', 1]], 9), ['14.0', '2.57'])]]
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 fixtureActualExpectedOutcome
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 digitinvalid ip 4.3invalid ip 4.3Passed
control half-up rounding['8.0', '3.38']['8.0', '3.38']Passed
regression: innings display['0.1', '0.00']['0.1', '0.00']Passed
regression: innings display['18.2', '2.25']['18.2', '2.25']Passed
variant scenario 1['8.2', '3.12']['8.2', '3.12']Passed
variant scenario 2invalid ip 0.3invalid ip 0.3Passed

SHA-256 / acc2dd1b4995d3f5f10608bcaa086924a693532b87f64cf5920c0d34b0a195a7

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

Case digest / f33e8ee42482f6b266fde94969d26038f09b72650ecf0f245519f7bcd25eb2d5