FAILURE MAP
← Case archive

FA-17441 / Time representation / Open access

Pending overflow is assigned to a pre-wrap capture · case 01

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

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

ROOT CAUSE

Pending overflow is assigned to a pre-wrap capture.

VERIFIED REPAIR

Preserve the declared coordinate and state contract at epoch: epoch = r['epoch'] + (1 if r['pending'] and r['counter'] < 128 else 0).

Unsuccessful approach: The partial correction still substitutes r['epoch'] at the same fault site.

Case contract

Expand a 256-tick hardware capture with an ISR epoch. Pending overflow applies only to low-half captures; a pre-ISR high-half capture backs out one serviced epoch. Return expanded coordinate, signed delta from previous capture, nonnegative-order flag, bounded-interval flag, epoch crossings, phase on a positive external grid, and strictly next grid edge.

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):
    epoch = r['epoch'] + int(r['pending'])
    previous_epoch = epoch - (1 if r['before_isr'] and not r['pending'] and r['counter'] >= 128 else 0)
    expanded = previous_epoch * 256 + r['counter']
    delta = expanded - r['previous']
    forward = delta >= 0
    within = 0 <= delta <= r['max_interval']
    wraps = expanded // 256 - r['previous'] // 256
    phase = expanded % r['period']
    cycles = expanded // r['period']
    next_edge = (cycles + 1) * r['period']
    return [expanded,delta,forward,within,wraps,phase,next_edge]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 10}), [514, 264, True, False, 2, 4, 520])
check('fixture 2', solve({'epoch': 1, 'pending': True, 'counter': 250, 'before_isr': False, 'previous': 490, 'max_interval': 16, 'period': 30}), [506, 16, True, True, 0, 26, 510])
check('fixture 3', solve({'epoch': 2, 'pending': False, 'counter': 250, 'before_isr': True, 'previous': 500, 'max_interval': 6, 'period': 10}), [506, 6, True, True, 0, 6, 510])
check('fixture 4', solve({'epoch': 1, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 256, 'max_interval': 0, 'period': 7}), [256, 0, True, True, 0, 4, 259])
check('fixture 5', solve({'epoch': 3, 'pending': False, 'counter': 20, 'before_isr': False, 'previous': 10, 'max_interval': 800, 'period': 100}), [788, 778, True, True, 3, 88, 800])
check('fixture 6', solve({'epoch': 1, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 260, 'max_interval': 10, 'period': 13}), [256, -4, False, False, 0, 9, 260])
check('fixture 7', solve({'epoch': 0, 'pending': False, 'counter': 20, 'before_isr': False, 'previous': 10, 'max_interval': 9, 'period': 7}), [20, 10, True, False, 0, 6, 21])
check('fixture 8', solve({'epoch': 2, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 0, 'max_interval': 512, 'period': 16}), [512, 512, True, True, 2, 0, 528])
check('fixture 9', solve({'epoch': 0, 'pending': False, 'counter': 127, 'before_isr': False, 'previous': 0, 'max_interval': 127, 'period': 20}), [127, 127, True, True, 0, 7, 140])
check('fixture 10', solve({'epoch': 0, 'pending': True, 'counter': 128, 'before_isr': False, 'previous': 0, 'max_interval': 128, 'period': 10}), [128, 128, True, True, 0, 8, 130])
check('fixture 11', solve({'epoch': 2, 'pending': False, 'counter': 2, 'before_isr': True, 'previous': 512, 'max_interval': 20, 'period': 10}), [514, 2, True, True, 0, 4, 520])
variant = [({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 11}, [514, 264, True, False, 2, 8, 517]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 12}, [514, 264, True, False, 2, 10, 516]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 13}, [514, 264, True, False, 2, 7, 520]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 14}, [514, 264, True, False, 2, 10, 518]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 15}, [514, 264, True, False, 2, 4, 525])]
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[514, 264, True, False, 2, 4, 520][514, 264, True, False, 2, 4, 520]Passed
fixture 2[762, 272, True, False, 1, 12, 780][506, 16, True, True, 0, 26, 510]Failed
fixture 3[506, 6, True, True, 0, 6, 510][506, 6, True, True, 0, 6, 510]Passed
fixture 4[256, 0, True, True, 0, 4, 259][256, 0, True, True, 0, 4, 259]Passed
fixture 5[788, 778, True, True, 3, 88, 800][788, 778, True, True, 3, 88, 800]Passed
fixture 6[256, -4, False, False, 0, 9, 260][256, -4, False, False, 0, 9, 260]Passed
fixture 7[20, 10, True, False, 0, 6, 21][20, 10, True, False, 0, 6, 21]Passed
fixture 8[512, 512, True, True, 2, 0, 528][512, 512, True, True, 2, 0, 528]Passed
fixture 9[127, 127, True, True, 0, 7, 140][127, 127, True, True, 0, 7, 140]Passed
fixture 10[384, 384, True, False, 1, 4, 390][128, 128, True, True, 0, 8, 130]Failed
fixture 11[514, 2, True, True, 0, 4, 520][514, 2, True, True, 0, 4, 520]Passed
variant capture[514, 264, True, False, 2, 8, 517][514, 264, True, False, 2, 8, 517]Passed

SHA-256 / 120b4c51293fb18fe2936dd7c7eac3ba5e26153192e114728e9a84da9fbbde05

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):
    epoch = r['epoch']
    previous_epoch = epoch - (1 if r['before_isr'] and not r['pending'] and r['counter'] >= 128 else 0)
    expanded = previous_epoch * 256 + r['counter']
    delta = expanded - r['previous']
    forward = delta >= 0
    within = 0 <= delta <= r['max_interval']
    wraps = expanded // 256 - r['previous'] // 256
    phase = expanded % r['period']
    cycles = expanded // r['period']
    next_edge = (cycles + 1) * r['period']
    return [expanded,delta,forward,within,wraps,phase,next_edge]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 10}), [514, 264, True, False, 2, 4, 520])
check('fixture 2', solve({'epoch': 1, 'pending': True, 'counter': 250, 'before_isr': False, 'previous': 490, 'max_interval': 16, 'period': 30}), [506, 16, True, True, 0, 26, 510])
check('fixture 3', solve({'epoch': 2, 'pending': False, 'counter': 250, 'before_isr': True, 'previous': 500, 'max_interval': 6, 'period': 10}), [506, 6, True, True, 0, 6, 510])
check('fixture 4', solve({'epoch': 1, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 256, 'max_interval': 0, 'period': 7}), [256, 0, True, True, 0, 4, 259])
check('fixture 5', solve({'epoch': 3, 'pending': False, 'counter': 20, 'before_isr': False, 'previous': 10, 'max_interval': 800, 'period': 100}), [788, 778, True, True, 3, 88, 800])
check('fixture 6', solve({'epoch': 1, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 260, 'max_interval': 10, 'period': 13}), [256, -4, False, False, 0, 9, 260])
check('fixture 7', solve({'epoch': 0, 'pending': False, 'counter': 20, 'before_isr': False, 'previous': 10, 'max_interval': 9, 'period': 7}), [20, 10, True, False, 0, 6, 21])
check('fixture 8', solve({'epoch': 2, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 0, 'max_interval': 512, 'period': 16}), [512, 512, True, True, 2, 0, 528])
check('fixture 9', solve({'epoch': 0, 'pending': False, 'counter': 127, 'before_isr': False, 'previous': 0, 'max_interval': 127, 'period': 20}), [127, 127, True, True, 0, 7, 140])
check('fixture 10', solve({'epoch': 0, 'pending': True, 'counter': 128, 'before_isr': False, 'previous': 0, 'max_interval': 128, 'period': 10}), [128, 128, True, True, 0, 8, 130])
check('fixture 11', solve({'epoch': 2, 'pending': False, 'counter': 2, 'before_isr': True, 'previous': 512, 'max_interval': 20, 'period': 10}), [514, 2, True, True, 0, 4, 520])
variant = [({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 11}, [514, 264, True, False, 2, 8, 517]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 12}, [514, 264, True, False, 2, 10, 516]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 13}, [514, 264, True, False, 2, 7, 520]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 14}, [514, 264, True, False, 2, 10, 518]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 15}, [514, 264, True, False, 2, 4, 525])]
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[258, 8, True, True, 1, 8, 260][514, 264, True, False, 2, 4, 520]Failed
fixture 2[506, 16, True, True, 0, 26, 510][506, 16, True, True, 0, 26, 510]Passed
fixture 3[506, 6, True, True, 0, 6, 510][506, 6, True, True, 0, 6, 510]Passed
fixture 4[256, 0, True, True, 0, 4, 259][256, 0, True, True, 0, 4, 259]Passed
fixture 5[788, 778, True, True, 3, 88, 800][788, 778, True, True, 3, 88, 800]Passed
fixture 6[256, -4, False, False, 0, 9, 260][256, -4, False, False, 0, 9, 260]Passed
fixture 7[20, 10, True, False, 0, 6, 21][20, 10, True, False, 0, 6, 21]Passed
fixture 8[512, 512, True, True, 2, 0, 528][512, 512, True, True, 2, 0, 528]Passed
fixture 9[127, 127, True, True, 0, 7, 140][127, 127, True, True, 0, 7, 140]Passed
fixture 10[128, 128, True, True, 0, 8, 130][128, 128, True, True, 0, 8, 130]Passed
fixture 11[514, 2, True, True, 0, 4, 520][514, 2, True, True, 0, 4, 520]Passed
variant capture[258, 8, True, True, 1, 5, 264][514, 264, True, False, 2, 8, 517]Failed

SHA-256 / f1a039b16af415b2e7f4d148c72909a9a4d509d631e465d6f68a09514b23edb8

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):
    epoch = r['epoch'] + (1 if r['pending'] and r['counter'] < 128 else 0)
    previous_epoch = epoch - (1 if r['before_isr'] and not r['pending'] and r['counter'] >= 128 else 0)
    expanded = previous_epoch * 256 + r['counter']
    delta = expanded - r['previous']
    forward = delta >= 0
    within = 0 <= delta <= r['max_interval']
    wraps = expanded // 256 - r['previous'] // 256
    phase = expanded % r['period']
    cycles = expanded // r['period']
    next_edge = (cycles + 1) * r['period']
    return [expanded,delta,forward,within,wraps,phase,next_edge]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 10}), [514, 264, True, False, 2, 4, 520])
check('fixture 2', solve({'epoch': 1, 'pending': True, 'counter': 250, 'before_isr': False, 'previous': 490, 'max_interval': 16, 'period': 30}), [506, 16, True, True, 0, 26, 510])
check('fixture 3', solve({'epoch': 2, 'pending': False, 'counter': 250, 'before_isr': True, 'previous': 500, 'max_interval': 6, 'period': 10}), [506, 6, True, True, 0, 6, 510])
check('fixture 4', solve({'epoch': 1, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 256, 'max_interval': 0, 'period': 7}), [256, 0, True, True, 0, 4, 259])
check('fixture 5', solve({'epoch': 3, 'pending': False, 'counter': 20, 'before_isr': False, 'previous': 10, 'max_interval': 800, 'period': 100}), [788, 778, True, True, 3, 88, 800])
check('fixture 6', solve({'epoch': 1, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 260, 'max_interval': 10, 'period': 13}), [256, -4, False, False, 0, 9, 260])
check('fixture 7', solve({'epoch': 0, 'pending': False, 'counter': 20, 'before_isr': False, 'previous': 10, 'max_interval': 9, 'period': 7}), [20, 10, True, False, 0, 6, 21])
check('fixture 8', solve({'epoch': 2, 'pending': False, 'counter': 0, 'before_isr': False, 'previous': 0, 'max_interval': 512, 'period': 16}), [512, 512, True, True, 2, 0, 528])
check('fixture 9', solve({'epoch': 0, 'pending': False, 'counter': 127, 'before_isr': False, 'previous': 0, 'max_interval': 127, 'period': 20}), [127, 127, True, True, 0, 7, 140])
check('fixture 10', solve({'epoch': 0, 'pending': True, 'counter': 128, 'before_isr': False, 'previous': 0, 'max_interval': 128, 'period': 10}), [128, 128, True, True, 0, 8, 130])
check('fixture 11', solve({'epoch': 2, 'pending': False, 'counter': 2, 'before_isr': True, 'previous': 512, 'max_interval': 20, 'period': 10}), [514, 2, True, True, 0, 4, 520])
variant = [({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 11}, [514, 264, True, False, 2, 8, 517]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 12}, [514, 264, True, False, 2, 10, 516]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 13}, [514, 264, True, False, 2, 7, 520]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 14}, [514, 264, True, False, 2, 10, 518]), ({'epoch': 1, 'pending': True, 'counter': 2, 'before_isr': False, 'previous': 250, 'max_interval': 8, 'period': 15}, [514, 264, True, False, 2, 4, 525])]
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[514, 264, True, False, 2, 4, 520][514, 264, True, False, 2, 4, 520]Passed
fixture 2[506, 16, True, True, 0, 26, 510][506, 16, True, True, 0, 26, 510]Passed
fixture 3[506, 6, True, True, 0, 6, 510][506, 6, True, True, 0, 6, 510]Passed
fixture 4[256, 0, True, True, 0, 4, 259][256, 0, True, True, 0, 4, 259]Passed
fixture 5[788, 778, True, True, 3, 88, 800][788, 778, True, True, 3, 88, 800]Passed
fixture 6[256, -4, False, False, 0, 9, 260][256, -4, False, False, 0, 9, 260]Passed
fixture 7[20, 10, True, False, 0, 6, 21][20, 10, True, False, 0, 6, 21]Passed
fixture 8[512, 512, True, True, 2, 0, 528][512, 512, True, True, 2, 0, 528]Passed
fixture 9[127, 127, True, True, 0, 7, 140][127, 127, True, True, 0, 7, 140]Passed
fixture 10[128, 128, True, True, 0, 8, 130][128, 128, True, True, 0, 8, 130]Passed
fixture 11[514, 2, True, True, 0, 4, 520][514, 2, True, True, 0, 4, 520]Passed
variant capture[514, 264, True, False, 2, 8, 517][514, 264, True, False, 2, 8, 517]Passed

SHA-256 / d05430c34635613fea1ab88b7bf981a96524ca7742b141ab83df1aa4722723fe

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

Case digest / 1ead9fa1a9353eca9a6ad39131b56b224f158cb4721784555be829c500c2714d