FAILURE MAP
← Case archive

FA-84121 / Sports scoring and tiebreakers / Open access

ERA scaled to nine innings for every league · case 01

A softball or seven-inning league ERA is computed per nine innings.

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

ROOT CAUSE

The multiplier is hard-coded to 9 instead of innings_per_game.

THE FAILURE

The multiplier is hard-coded to 9 instead of innings_per_game.

Unsuccessful approach: Using innings_per_game but dividing by outs instead of innings understates ERA threefold.

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 = '%d.%d' % (outs // 3, outs % 3)
    if outs == 0:
        return [ip_str, 'INF' if er else '0.00']
    v = Fraction(9 * 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: game length scale', ([['9.0', 0], ['5.1', 1], ['1.1', 1]], 9), ['15.2', '1.15']),
  ('regression: game length scale', ([['9.2', 2], ['7.0', 4], ['8.1', 1]], 7), ['25.0', '1.96']),
  ('variant scenario 1', ([['8.0', 2]], 9), ['8.0', '2.25']),
  ('variant scenario 2', ([['3.2', 1]], 9), ['3.2', '2.45'])],
 [('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: game length scale', ([['6', 4], ['5.0', 1]], 9), ['11.0', '4.09']),
  ('regression: game length scale', ([['7.0', 2], ['5', 0], ['5.2', 4]], 7), ['17.2', '2.38']),
  ('variant scenario 1', ([['0.1', 0], ['6.0', 3]], 9), ['6.1', '4.26']),
  ('variant scenario 2', ([['2.1', 4], ['5.1', 4], ['6.1', 2], ['3.2', 0]], 9), ['17.2', '5.09'])],
 [('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: game length scale', ([['4', 3], ['3.1', 1]], 9), ['7.1', '4.91']),
  ('regression: game length scale', ([['3.2', 4]], 7), ['3.2', '7.64']),
  ('variant scenario 1', ([['6.2', 3], ['4.0', 0], ['5.3', 0], ['6', 3]], 9), 'invalid ip 5.3'),
  ('variant scenario 2', ([['6.1', 4], ['0.2', 2]], 9), ['7.0', '7.71'])],
 [('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: game length scale',
   ([['5.2', 4], ['0.1', 1], ['9.0', 1], ['9.0', 4]], 9),
   ['24.0', '3.75']),
  ('regression: game length scale',
   ([['5.0', 2], ['1.0', 4], ['1.2', 3], ['7.0', 4]], 7),
   ['14.2', '6.20']),
  ('variant scenario 1',
   ([['4.1', 3], ['2.0', 2], ['4.0', 2], ['9.2', 4], ['0.2', 2], ['6.3', 3]], 7),
   'invalid ip 6.3'),
  ('variant scenario 2',
   ([['5.2', 0], ['0', 2], ['1.3', 0], ['8.0', 3], ['7.0', 3], ['3.2', 4]], 7),
   '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: game length scale', ([['4.2', 1]], 9), ['4.2', '1.93']),
  ('regression: game length scale',
   ([['0.2', 3], ['1', 2], ['9.1', 2], ['2.1', 4], ['6.1', 1], ['2.0', 1]], 7),
   ['21.2', '4.20']),
  ('variant scenario 1',
   ([['3.0', 0], ['8.0', 3], ['8.1', 1], ['5.0', 3], ['4.1', 0], ['7.2', 1]], 9),
   ['36.1', '1.98']),
  ('variant scenario 2', ([['8.2', 4], ['9.1', 0]], 9), ['18.0', '2.00'])]]
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.86']['7.0', '3.00']Failed
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: game length scale['15.2', '1.15']['15.2', '1.15']Passed
regression: game length scale['25.0', '2.52']['25.0', '1.96']Failed
variant scenario 1['8.0', '2.25']['8.0', '2.25']Passed
variant scenario 2['3.2', '2.45']['3.2', '2.45']Passed

SHA-256 / 9ab56bd2f23e9cd1b3f6f1b20daf4e8614391bb40dc1bc9625346740a61476f5

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' % (outs // 3, outs % 3)
    if outs == 0:
        return [ip_str, 'INF' if er else '0.00']
    v = Fraction(innings_per_game * er, 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: game length scale', ([['9.0', 0], ['5.1', 1], ['1.1', 1]], 9), ['15.2', '1.15']),
  ('regression: game length scale', ([['9.2', 2], ['7.0', 4], ['8.1', 1]], 7), ['25.0', '1.96']),
  ('variant scenario 1', ([['8.0', 2]], 9), ['8.0', '2.25']),
  ('variant scenario 2', ([['3.2', 1]], 9), ['3.2', '2.45'])],
 [('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: game length scale', ([['6', 4], ['5.0', 1]], 9), ['11.0', '4.09']),
  ('regression: game length scale', ([['7.0', 2], ['5', 0], ['5.2', 4]], 7), ['17.2', '2.38']),
  ('variant scenario 1', ([['0.1', 0], ['6.0', 3]], 9), ['6.1', '4.26']),
  ('variant scenario 2', ([['2.1', 4], ['5.1', 4], ['6.1', 2], ['3.2', 0]], 9), ['17.2', '5.09'])],
 [('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: game length scale', ([['4', 3], ['3.1', 1]], 9), ['7.1', '4.91']),
  ('regression: game length scale', ([['3.2', 4]], 7), ['3.2', '7.64']),
  ('variant scenario 1', ([['6.2', 3], ['4.0', 0], ['5.3', 0], ['6', 3]], 9), 'invalid ip 5.3'),
  ('variant scenario 2', ([['6.1', 4], ['0.2', 2]], 9), ['7.0', '7.71'])],
 [('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: game length scale',
   ([['5.2', 4], ['0.1', 1], ['9.0', 1], ['9.0', 4]], 9),
   ['24.0', '3.75']),
  ('regression: game length scale',
   ([['5.0', 2], ['1.0', 4], ['1.2', 3], ['7.0', 4]], 7),
   ['14.2', '6.20']),
  ('variant scenario 1',
   ([['4.1', 3], ['2.0', 2], ['4.0', 2], ['9.2', 4], ['0.2', 2], ['6.3', 3]], 7),
   'invalid ip 6.3'),
  ('variant scenario 2',
   ([['5.2', 0], ['0', 2], ['1.3', 0], ['8.0', 3], ['7.0', 3], ['3.2', 4]], 7),
   '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: game length scale', ([['4.2', 1]], 9), ['4.2', '1.93']),
  ('regression: game length scale',
   ([['0.2', 3], ['1', 2], ['9.1', 2], ['2.1', 4], ['6.1', 1], ['2.0', 1]], 7),
   ['21.2', '4.20']),
  ('variant scenario 1',
   ([['3.0', 0], ['8.0', 3], ['8.1', 1], ['5.0', 3], ['4.1', 0], ['7.2', 1]], 9),
   ['36.1', '1.98']),
  ('variant scenario 2', ([['8.2', 4], ['9.1', 0]], 9), ['18.0', '2.00'])]]
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', '0.67']['9.0', '2.00']Failed
boundary thirds carry['7.0', '0.43']['7.0', '1.29']Failed
boundary seven-inning game['7.0', '1.00']['7.0', '3.00']Failed
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', '1.13']['8.0', '3.38']Failed
regression: game length scale['15.2', '0.38']['15.2', '1.15']Failed
regression: game length scale['25.0', '0.65']['25.0', '1.96']Failed
variant scenario 1['8.0', '0.75']['8.0', '2.25']Failed
variant scenario 2['3.2', '0.82']['3.2', '2.45']Failed

SHA-256 / 2e5e71d23db338ab69892f0f4872425998c52224fbe4f0ccac1bb8e5aaecf2f1

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 10 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 7e7c1097e5fc7bc452ba3d6605c922a587646f17299b7bba84e3ee99ced4aba0