FA-83976 / Sports scoring and tiebreakers / Open access
Positive net run rate printed without its sign · case 01
Standings show "0.512" instead of "+0.512", and negative rates may show a doubled sign.
ROOT CAUSE
The value is formatted with "%.3f", dropping the explicit plus sign.
THE FAILURE
The value is formatted with "%.3f", dropping the explicit plus sign.
Unsuccessful approach: Prefixing a literal plus sign produces "+-0.250" for negative rates.
Case contract
Tournament net run rate. Each match row is [runs_for, overs_faced, all_out_for, runs_against, overs_bowled, all_out_against]. Overs strings use cricket notation "O.B" where B is balls 0-5 ("43.4" = 43 overs 4 balls); a ball digit above 5 returns "invalid overs". When a side was all out its innings counts as the full quota of overs. NRR = total runs for / total overs faced - total runs against / total overs bowled, aggregated over all matches before dividing, formatted as "%+.3f" of the exact value. If either overs total is zero return "no overs".
Why this case matters
Group-stage standings use net run rate as the first tiebreaker after points.
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(matches, quota):
def balls(text):
whole, _, part = text.partition('.')
part = int(part or 0)
if part > 5:
return None
return int(whole) * 6 + part
rf = bf = ra = ba = 0
for runs_for, faced, out_for, runs_against, bowled, out_against in matches:
f = quota * 6 if out_for else balls(faced)
g = quota * 6 if out_against else balls(bowled)
if f is None or g is None:
return 'invalid overs'
rf += runs_for
bf += f
ra += runs_against
ba += g
if bf == 0 or ba == 0:
return 'no overs'
value = Fraction(rf * 6, bf) - Fraction(ra * 6, ba)
return '%.3f' % float(value)
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 single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format', ([[117, '8.2', False, 249, '48.1', False]], 50), '+8.870'),
('regression: signed format',
([[142, '41.4', False, 177, '21', True],
[164, '4.3', True, 198, '25.6', True],
[249, '18.2', False, 154, '34.4', False]],
20),
'-0.147'),
('variant scenario 1',
([[244, '32.0', True, 245, '29.2', False], [136, '5.2', False, 309, '36.2', False]], 20),
'+6.563'),
('variant scenario 2',
([[305, '0.2', False, 323, '48.4', True], [300, '1', False, 289, '43.5', False]], 20),
'+444.163')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format',
([[337, '42.5', False, 347, '42.2', False],
[272, '1.3', True, 291, '8.1', False],
[345, '0.2', False, 254, '30.3', False],
[350, '35.2', False, 96, '46.3', False]],
50),
'+2.399'),
('regression: signed format',
([[260, '44.0', False, 188, '34.4', True], [285, '32.4', True, 343, '12.5', False]], 50),
'-2.653'),
('variant scenario 1',
([[153, '33.3', False, 283, '14.5', False],
[81, '7.1', True, 186, '28.3', False],
[171, '50.0', False, 88, '47.4', True],
[251, '33.7', False, 264, '32.2', True]],
50),
'invalid overs'),
('variant scenario 2', ([[122, '43.5', True, 196, '46.3', False]], 20), '+1.885')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format',
([[346, '14.5', False, 358, '2', False], [334, '28.1', False, 343, '4.1', False]], 20),
'-97.862'),
('regression: signed format',
([[235, '0.2', True, 147, '40.2', False], [244, '6.4', True, 292, '11.4', False]], 20),
'+3.533'),
('variant scenario 1', ([[309, '10.0', False, 288, '21.1', True]], 50), '+25.140'),
('variant scenario 2',
([[294, '35.4', False, 358, '14.2', True],
[196, '32.3', False, 198, '20.1', False],
[208, '15.3', True, 108, '16.0', False],
[307, '41.3', True, 167, '48.5', False]],
50),
'-0.179')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format',
([[302, '14', True, 149, '1.3', False], [327, '9.1', False, 331, '30.3', True]], 20),
'-0.760'),
('regression: signed format',
([[333, '25.0', True, 148, '28.1', False],
[94, '0.0', False, 102, '36.3', True],
[114, '1.2', False, 242, '9.2', False]],
20),
'+16.803'),
('variant scenario 1',
([[158, '24.3', False, 222, '40.0', True],
[153, '44.2', True, 220, '22.2', False],
[108, '26.4', False, 312, '2.3', False],
[317, '50.4', True, 132, '49', False]],
20),
'-1.369'),
('variant scenario 2',
([[220, '0.6', False, 358, '37.4', False],
[297, '12.2', True, 340, '50', False],
[209, '47.3', True, 198, '38.5', False],
[331, '11.1', False, 245, '30.5', True],
[324, '41.5', True, 219, '29.7', False]],
50),
'invalid overs')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format', ([[248, '40.3', False, 238, '37.5', True]], 50), '+1.363'),
('regression: signed format',
([[254, '38.0', False, 285, '35.3', False],
[345, '5.2', False, 85, '45.1', True],
[201, '5.2', False, 249, '4.5', False],
[358, '16.0', True, 311, '10.3', True],
[254, '48.4', False, 181, '0.4', False],
[176, '38.5', True, 340, '49.2', False],
[195, '33.1', True, 280, '1.1', False]],
50),
'-1.830'),
('variant scenario 1', ([[292, '33.4', False, 333, '28.6', True]], 50), '+2.013'),
('variant scenario 2',
([[264, '5.0', True, 270, '27.4', False],
[323, '38.5', False, 241, '28.1', True],
[271, '30.5', False, 261, '17.5', False],
[192, '26.1', True, 258, '35', True],
[197, '49.5', False, 190, '24.2', False],
[356, '46.5', False, 276, '33.4', False],
[342, '29.4', True, 191, '20.0', False]],
50),
'-1.400')]]
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 single match | 1.000 | +1.000 | Failed |
| boundary partial over | 1.317 | +1.317 | Failed |
| boundary all out uses quota | -0.661 | -0.661 | Passed |
| boundary invalid ball digit | invalid overs | invalid overs | Passed |
| control no overs | no overs | no overs | Passed |
| control negative rate | -3.000 | -3.000 | Passed |
| regression: signed format | 8.870 | +8.870 | Failed |
| regression: signed format | -0.147 | -0.147 | Passed |
| variant scenario 1 | 6.563 | +6.563 | Failed |
| variant scenario 2 | 444.163 | +444.163 | Failed |
SHA-256 / 33bdc95b4f31909d2975ba9307afec1853e21940322b2d26bf4e6463e26c7efb
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(matches, quota):
def balls(text):
whole, _, part = text.partition('.')
part = int(part or 0)
if part > 5:
return None
return int(whole) * 6 + part
rf = bf = ra = ba = 0
for runs_for, faced, out_for, runs_against, bowled, out_against in matches:
f = quota * 6 if out_for else balls(faced)
g = quota * 6 if out_against else balls(bowled)
if f is None or g is None:
return 'invalid overs'
rf += runs_for
bf += f
ra += runs_against
ba += g
if bf == 0 or ba == 0:
return 'no overs'
value = Fraction(rf * 6, bf) - Fraction(ra * 6, ba)
return '+%.3f' % float(value)
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 single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format', ([[117, '8.2', False, 249, '48.1', False]], 50), '+8.870'),
('regression: signed format',
([[142, '41.4', False, 177, '21', True],
[164, '4.3', True, 198, '25.6', True],
[249, '18.2', False, 154, '34.4', False]],
20),
'-0.147'),
('variant scenario 1',
([[244, '32.0', True, 245, '29.2', False], [136, '5.2', False, 309, '36.2', False]], 20),
'+6.563'),
('variant scenario 2',
([[305, '0.2', False, 323, '48.4', True], [300, '1', False, 289, '43.5', False]], 20),
'+444.163')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format',
([[337, '42.5', False, 347, '42.2', False],
[272, '1.3', True, 291, '8.1', False],
[345, '0.2', False, 254, '30.3', False],
[350, '35.2', False, 96, '46.3', False]],
50),
'+2.399'),
('regression: signed format',
([[260, '44.0', False, 188, '34.4', True], [285, '32.4', True, 343, '12.5', False]], 50),
'-2.653'),
('variant scenario 1',
([[153, '33.3', False, 283, '14.5', False],
[81, '7.1', True, 186, '28.3', False],
[171, '50.0', False, 88, '47.4', True],
[251, '33.7', False, 264, '32.2', True]],
50),
'invalid overs'),
('variant scenario 2', ([[122, '43.5', True, 196, '46.3', False]], 20), '+1.885')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format',
([[346, '14.5', False, 358, '2', False], [334, '28.1', False, 343, '4.1', False]], 20),
'-97.862'),
('regression: signed format',
([[235, '0.2', True, 147, '40.2', False], [244, '6.4', True, 292, '11.4', False]], 20),
'+3.533'),
('variant scenario 1', ([[309, '10.0', False, 288, '21.1', True]], 50), '+25.140'),
('variant scenario 2',
([[294, '35.4', False, 358, '14.2', True],
[196, '32.3', False, 198, '20.1', False],
[208, '15.3', True, 108, '16.0', False],
[307, '41.3', True, 167, '48.5', False]],
50),
'-0.179')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format',
([[302, '14', True, 149, '1.3', False], [327, '9.1', False, 331, '30.3', True]], 20),
'-0.760'),
('regression: signed format',
([[333, '25.0', True, 148, '28.1', False],
[94, '0.0', False, 102, '36.3', True],
[114, '1.2', False, 242, '9.2', False]],
20),
'+16.803'),
('variant scenario 1',
([[158, '24.3', False, 222, '40.0', True],
[153, '44.2', True, 220, '22.2', False],
[108, '26.4', False, 312, '2.3', False],
[317, '50.4', True, 132, '49', False]],
20),
'-1.369'),
('variant scenario 2',
([[220, '0.6', False, 358, '37.4', False],
[297, '12.2', True, 340, '50', False],
[209, '47.3', True, 198, '38.5', False],
[331, '11.1', False, 245, '30.5', True],
[324, '41.5', True, 219, '29.7', False]],
50),
'invalid overs')],
[('control single match', ([[300, '50', False, 250, '50', False]], 50), '+1.000'),
('boundary partial over', ([[150, '20.3', False, 150, '25', False]], 50), '+1.317'),
('boundary all out uses quota', ([[120, '15.2', True, 121, '18.1', False]], 20), '-0.661'),
('boundary invalid ball digit', ([[100, '10.6', False, 90, '10', False]], 20), 'invalid overs'),
('control no overs', ([[0, '0', False, 0, '0', False]], 20), 'no overs'),
('control negative rate', ([[100, '20', False, 160, '20', False]], 20), '-3.000'),
('regression: signed format', ([[248, '40.3', False, 238, '37.5', True]], 50), '+1.363'),
('regression: signed format',
([[254, '38.0', False, 285, '35.3', False],
[345, '5.2', False, 85, '45.1', True],
[201, '5.2', False, 249, '4.5', False],
[358, '16.0', True, 311, '10.3', True],
[254, '48.4', False, 181, '0.4', False],
[176, '38.5', True, 340, '49.2', False],
[195, '33.1', True, 280, '1.1', False]],
50),
'-1.830'),
('variant scenario 1', ([[292, '33.4', False, 333, '28.6', True]], 50), '+2.013'),
('variant scenario 2',
([[264, '5.0', True, 270, '27.4', False],
[323, '38.5', False, 241, '28.1', True],
[271, '30.5', False, 261, '17.5', False],
[192, '26.1', True, 258, '35', True],
[197, '49.5', False, 190, '24.2', False],
[356, '46.5', False, 276, '33.4', False],
[342, '29.4', True, 191, '20.0', False]],
50),
'-1.400')]]
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 single match | +1.000 | +1.000 | Passed |
| boundary partial over | +1.317 | +1.317 | Passed |
| boundary all out uses quota | +-0.661 | -0.661 | Failed |
| boundary invalid ball digit | invalid overs | invalid overs | Passed |
| control no overs | no overs | no overs | Passed |
| control negative rate | +-3.000 | -3.000 | Failed |
| regression: signed format | +8.870 | +8.870 | Passed |
| regression: signed format | +-0.147 | -0.147 | Failed |
| variant scenario 1 | +6.563 | +6.563 | Passed |
| variant scenario 2 | +444.163 | +444.163 | Passed |
SHA-256 / cc39ca1ab88541273f0f7d48f205746b32b47236824527c5ef1839ec129669d9
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:26.554347+00:00.
Case digest / 2c946733a3a522b8155fa3ba4fcecf62d93ed20731b331ce67d3bfdc3096d5ab