FAILURE MAP
← Case archive

FA-17471 / Time representation / Open access

Epoch crossings are inferred from duration or a single wrap bit · case 01

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

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

ROOT CAUSE

Epoch crossings are inferred from duration or a single wrap bit.

THE FAILURE

Epoch crossings are inferred from duration or a single wrap bit.

Unsuccessful approach: The partial correction still substitutes int(expanded % 256 < r['previous'] % 256) 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'] + (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 = delta // 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, 1, 4, 520][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, -1, 9, 260][256, -4, False, False, 0, 9, 260]Failed
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, 1, 8, 517][514, 264, True, False, 2, 8, 517]Failed

SHA-256 / 9e279cbf53798f4047028f59265f82f7c757ec4212795c31ffb88001c6134697

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'] + (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 = int(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, 1, 4, 520][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, 0, 88, 800][788, 778, True, True, 3, 88, 800]Failed
fixture 6[256, -4, False, False, 1, 9, 260][256, -4, False, False, 0, 9, 260]Failed
fixture 7[20, 10, True, False, 0, 6, 21][20, 10, True, False, 0, 6, 21]Passed
fixture 8[512, 512, True, True, 0, 0, 528][512, 512, True, True, 2, 0, 528]Failed
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, 1, 8, 517][514, 264, True, False, 2, 8, 517]Failed

SHA-256 / 8c9c5b8a913a6e86c54bd721ecb51099b000b6e89281754c9241939f7e390e94

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 12 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

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

Case digest / 213382022c15ffa2519d07a005dc73219e724733ff9e0cef24fc0e5fb8b9eeb6