FAILURE MAP
← Case archive

FA-17746 / Time representation / Open access

Leap label validator admits next midnight or rejects extra second · case 01

The decoded time state disagrees with the explicit regression oracle for valid.

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

ROOT CAUSE

Leap label validator admits next midnight or rejects extra second.

VERIFIED REPAIR

Preserve the declared coordinate and state contract at valid: valid = 0 <= r['label'] < length.

Unsuccessful approach: The partial correction still substitutes 0 <= r['label'] < 86400 at the same fault site.

Case contract

A stipulated positive-leap day has label 86400 following ordinary 0..86399; a normal day does not. Return validity, atomic origin+label or None, display [hour,minute,second] (23:59:60 for extra label), final-label flag, ticks until next midnight or None, and atomic next-midnight coordinate. No real-world leap table is claimed.

Why this case matters

Clock transfer and timestamp consumers require preserved coordinate, phase, validity and elapsed-time semantics.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    length = 86400 + int(r['leap'])
    valid = 0 <= r['label'] <= length
    atomic = r['origin'] + r['label'] if valid else None
    extra = valid and r['label'] == 86400
    hour = None if not valid else (23 if extra else r['label'] // 3600)
    minute = None if not valid else (59 if extra else r['label'] // 60 % 60)
    second = None if not valid else (60 if extra else r['label'] % 60)
    last = valid and r['label'] == length - 1
    remaining = None if not valid else length - r['label']
    midnight = r['origin'] + length
    return [valid,atomic,[hour,minute,second],last,remaining,midnight]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'leap': True, 'label': 86400, 'origin': 100000}), [True, 186400, [23, 59, 60], True, 1, 186401])
check('fixture 2', solve({'leap': False, 'label': 86400, 'origin': 100000}), [False, None, [None, None, None], False, None, 186400])
check('fixture 3', solve({'leap': True, 'label': 86399, 'origin': 50}), [True, 86449, [23, 59, 59], False, 2, 86451])
check('fixture 4', solve({'leap': False, 'label': 86399, 'origin': 50}), [True, 86449, [23, 59, 59], True, 1, 86450])
check('fixture 5', solve({'leap': True, 'label': 0, 'origin': -100}), [True, -100, [0, 0, 0], False, 86401, 86301])
check('fixture 6', solve({'leap': False, 'label': 3601, 'origin': 0}), [True, 3601, [1, 0, 1], False, 82799, 86400])
check('fixture 7', solve({'leap': True, 'label': -1, 'origin': 100}), [False, None, [None, None, None], False, None, 86501])
check('fixture 8', solve({'leap': True, 'label': 86401, 'origin': 20}), [False, None, [None, None, None], False, None, 86421])
check('fixture 9', solve({'leap': False, 'label': 0, 'origin': 0}), [True, 0, [0, 0, 0], False, 86400, 86400])
check('fixture 10', solve({'leap': True, 'label': 3661, 'origin': -20}), [True, 3641, [1, 1, 1], False, 82740, 86381])
variant = [({'leap': True, 'label': 86400, 'origin': 100001}, [True, 186401, [23, 59, 60], True, 1, 186402]), ({'leap': True, 'label': 86400, 'origin': 100002}, [True, 186402, [23, 59, 60], True, 1, 186403]), ({'leap': True, 'label': 86400, 'origin': 100003}, [True, 186403, [23, 59, 60], True, 1, 186404]), ({'leap': True, 'label': 86400, 'origin': 100004}, [True, 186404, [23, 59, 60], True, 1, 186405]), ({'leap': True, 'label': 86400, 'origin': 100005}, [True, 186405, [23, 59, 60], True, 1, 186406])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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
fixture 1[True, 186400, [23, 59, 60], True, 1, 186401][True, 186400, [23, 59, 60], True, 1, 186401]Passed
fixture 2[True, 186400, [23, 59, 60], False, 0, 186400][False, None, [None, None, None], False, None, 186400]Failed
fixture 3[True, 86449, [23, 59, 59], False, 2, 86451][True, 86449, [23, 59, 59], False, 2, 86451]Passed
fixture 4[True, 86449, [23, 59, 59], True, 1, 86450][True, 86449, [23, 59, 59], True, 1, 86450]Passed
fixture 5[True, -100, [0, 0, 0], False, 86401, 86301][True, -100, [0, 0, 0], False, 86401, 86301]Passed
fixture 6[True, 3601, [1, 0, 1], False, 82799, 86400][True, 3601, [1, 0, 1], False, 82799, 86400]Passed
fixture 7[False, None, [None, None, None], False, None, 86501][False, None, [None, None, None], False, None, 86501]Passed
fixture 8[True, 86421, [24, 0, 1], False, 0, 86421][False, None, [None, None, None], False, None, 86421]Failed
fixture 9[True, 0, [0, 0, 0], False, 86400, 86400][True, 0, [0, 0, 0], False, 86400, 86400]Passed
fixture 10[True, 3641, [1, 1, 1], False, 82740, 86381][True, 3641, [1, 1, 1], False, 82740, 86381]Passed
variant capture[True, 186401, [23, 59, 60], True, 1, 186402][True, 186401, [23, 59, 60], True, 1, 186402]Passed

SHA-256 / 869b05df8b056bf41a40d5560d1504066aeee0b3005bc8e10136a13b1a223ef6

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    length = 86400 + int(r['leap'])
    valid = 0 <= r['label'] < 86400
    atomic = r['origin'] + r['label'] if valid else None
    extra = valid and r['label'] == 86400
    hour = None if not valid else (23 if extra else r['label'] // 3600)
    minute = None if not valid else (59 if extra else r['label'] // 60 % 60)
    second = None if not valid else (60 if extra else r['label'] % 60)
    last = valid and r['label'] == length - 1
    remaining = None if not valid else length - r['label']
    midnight = r['origin'] + length
    return [valid,atomic,[hour,minute,second],last,remaining,midnight]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'leap': True, 'label': 86400, 'origin': 100000}), [True, 186400, [23, 59, 60], True, 1, 186401])
check('fixture 2', solve({'leap': False, 'label': 86400, 'origin': 100000}), [False, None, [None, None, None], False, None, 186400])
check('fixture 3', solve({'leap': True, 'label': 86399, 'origin': 50}), [True, 86449, [23, 59, 59], False, 2, 86451])
check('fixture 4', solve({'leap': False, 'label': 86399, 'origin': 50}), [True, 86449, [23, 59, 59], True, 1, 86450])
check('fixture 5', solve({'leap': True, 'label': 0, 'origin': -100}), [True, -100, [0, 0, 0], False, 86401, 86301])
check('fixture 6', solve({'leap': False, 'label': 3601, 'origin': 0}), [True, 3601, [1, 0, 1], False, 82799, 86400])
check('fixture 7', solve({'leap': True, 'label': -1, 'origin': 100}), [False, None, [None, None, None], False, None, 86501])
check('fixture 8', solve({'leap': True, 'label': 86401, 'origin': 20}), [False, None, [None, None, None], False, None, 86421])
check('fixture 9', solve({'leap': False, 'label': 0, 'origin': 0}), [True, 0, [0, 0, 0], False, 86400, 86400])
check('fixture 10', solve({'leap': True, 'label': 3661, 'origin': -20}), [True, 3641, [1, 1, 1], False, 82740, 86381])
variant = [({'leap': True, 'label': 86400, 'origin': 100001}, [True, 186401, [23, 59, 60], True, 1, 186402]), ({'leap': True, 'label': 86400, 'origin': 100002}, [True, 186402, [23, 59, 60], True, 1, 186403]), ({'leap': True, 'label': 86400, 'origin': 100003}, [True, 186403, [23, 59, 60], True, 1, 186404]), ({'leap': True, 'label': 86400, 'origin': 100004}, [True, 186404, [23, 59, 60], True, 1, 186405]), ({'leap': True, 'label': 86400, 'origin': 100005}, [True, 186405, [23, 59, 60], True, 1, 186406])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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
fixture 1[False, None, [None, None, None], False, None, 186401][True, 186400, [23, 59, 60], True, 1, 186401]Failed
fixture 2[False, None, [None, None, None], False, None, 186400][False, None, [None, None, None], False, None, 186400]Passed
fixture 3[True, 86449, [23, 59, 59], False, 2, 86451][True, 86449, [23, 59, 59], False, 2, 86451]Passed
fixture 4[True, 86449, [23, 59, 59], True, 1, 86450][True, 86449, [23, 59, 59], True, 1, 86450]Passed
fixture 5[True, -100, [0, 0, 0], False, 86401, 86301][True, -100, [0, 0, 0], False, 86401, 86301]Passed
fixture 6[True, 3601, [1, 0, 1], False, 82799, 86400][True, 3601, [1, 0, 1], False, 82799, 86400]Passed
fixture 7[False, None, [None, None, None], False, None, 86501][False, None, [None, None, None], False, None, 86501]Passed
fixture 8[False, None, [None, None, None], False, None, 86421][False, None, [None, None, None], False, None, 86421]Passed
fixture 9[True, 0, [0, 0, 0], False, 86400, 86400][True, 0, [0, 0, 0], False, 86400, 86400]Passed
fixture 10[True, 3641, [1, 1, 1], False, 82740, 86381][True, 3641, [1, 1, 1], False, 82740, 86381]Passed
variant capture[False, None, [None, None, None], False, None, 186402][True, 186401, [23, 59, 60], True, 1, 186402]Failed

SHA-256 / e4fe2a538b4313a80a29fb5fc60e4305105357d6ba3154b5336e80cf55b50131

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(r):
    length = 86400 + int(r['leap'])
    valid = 0 <= r['label'] < length
    atomic = r['origin'] + r['label'] if valid else None
    extra = valid and r['label'] == 86400
    hour = None if not valid else (23 if extra else r['label'] // 3600)
    minute = None if not valid else (59 if extra else r['label'] // 60 % 60)
    second = None if not valid else (60 if extra else r['label'] % 60)
    last = valid and r['label'] == length - 1
    remaining = None if not valid else length - r['label']
    midnight = r['origin'] + length
    return [valid,atomic,[hour,minute,second],last,remaining,midnight]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'leap': True, 'label': 86400, 'origin': 100000}), [True, 186400, [23, 59, 60], True, 1, 186401])
check('fixture 2', solve({'leap': False, 'label': 86400, 'origin': 100000}), [False, None, [None, None, None], False, None, 186400])
check('fixture 3', solve({'leap': True, 'label': 86399, 'origin': 50}), [True, 86449, [23, 59, 59], False, 2, 86451])
check('fixture 4', solve({'leap': False, 'label': 86399, 'origin': 50}), [True, 86449, [23, 59, 59], True, 1, 86450])
check('fixture 5', solve({'leap': True, 'label': 0, 'origin': -100}), [True, -100, [0, 0, 0], False, 86401, 86301])
check('fixture 6', solve({'leap': False, 'label': 3601, 'origin': 0}), [True, 3601, [1, 0, 1], False, 82799, 86400])
check('fixture 7', solve({'leap': True, 'label': -1, 'origin': 100}), [False, None, [None, None, None], False, None, 86501])
check('fixture 8', solve({'leap': True, 'label': 86401, 'origin': 20}), [False, None, [None, None, None], False, None, 86421])
check('fixture 9', solve({'leap': False, 'label': 0, 'origin': 0}), [True, 0, [0, 0, 0], False, 86400, 86400])
check('fixture 10', solve({'leap': True, 'label': 3661, 'origin': -20}), [True, 3641, [1, 1, 1], False, 82740, 86381])
variant = [({'leap': True, 'label': 86400, 'origin': 100001}, [True, 186401, [23, 59, 60], True, 1, 186402]), ({'leap': True, 'label': 86400, 'origin': 100002}, [True, 186402, [23, 59, 60], True, 1, 186403]), ({'leap': True, 'label': 86400, 'origin': 100003}, [True, 186403, [23, 59, 60], True, 1, 186404]), ({'leap': True, 'label': 86400, 'origin': 100004}, [True, 186404, [23, 59, 60], True, 1, 186405]), ({'leap': True, 'label': 86400, 'origin': 100005}, [True, 186405, [23, 59, 60], True, 1, 186406])]
check("variant capture", solve(variant[N-1][0]), variant[N-1][1])
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
fixture 1[True, 186400, [23, 59, 60], True, 1, 186401][True, 186400, [23, 59, 60], True, 1, 186401]Passed
fixture 2[False, None, [None, None, None], False, None, 186400][False, None, [None, None, None], False, None, 186400]Passed
fixture 3[True, 86449, [23, 59, 59], False, 2, 86451][True, 86449, [23, 59, 59], False, 2, 86451]Passed
fixture 4[True, 86449, [23, 59, 59], True, 1, 86450][True, 86449, [23, 59, 59], True, 1, 86450]Passed
fixture 5[True, -100, [0, 0, 0], False, 86401, 86301][True, -100, [0, 0, 0], False, 86401, 86301]Passed
fixture 6[True, 3601, [1, 0, 1], False, 82799, 86400][True, 3601, [1, 0, 1], False, 82799, 86400]Passed
fixture 7[False, None, [None, None, None], False, None, 86501][False, None, [None, None, None], False, None, 86501]Passed
fixture 8[False, None, [None, None, None], False, None, 86421][False, None, [None, None, None], False, None, 86421]Passed
fixture 9[True, 0, [0, 0, 0], False, 86400, 86400][True, 0, [0, 0, 0], False, 86400, 86400]Passed
fixture 10[True, 3641, [1, 1, 1], False, 82740, 86381][True, 3641, [1, 1, 1], False, 82740, 86381]Passed
variant capture[True, 186401, [23, 59, 60], True, 1, 186402][True, 186401, [23, 59, 60], True, 1, 186402]Passed

SHA-256 / f3916ac5f40c0fa3b0131c2fee03d434e8e3f18a2f9f87478e53adbca738f845

Verification & scope

Deterministic integer reference model with stipulated units and policies; not a complete clock, wire standard or platform implementation. 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:39:49.976352+00:00.

Case digest / 15265ac9183d73217dceb896c3c4c15e889bcb07e09cbe1e22947866eefe3a79