FA-17446 / Time representation / Open access
Serviced overflow is not backed out for an earlier high capture · case 01
The decoded time state disagrees with the explicit regression oracle for previous_epoch.
ROOT CAUSE
Serviced overflow is not backed out for an earlier high capture.
VERIFIED REPAIR
Preserve the declared coordinate and state contract at previous_epoch: previous_epoch = epoch - (1 if r['before_isr'] and not r['pending'] and r['counter'] >= 128 else 0).
Unsuccessful approach: The partial correction still substitutes epoch - int(r['before_isr']) 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
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 | [762, 262, True, False, 1, 2, 770] | [506, 6, True, True, 0, 6, 510] | Failed |
| 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 / aa0d572e5f18dc31da609b13e5d913f6e649b84e8a676bf10631dfc86e1ee87d
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 - int(r['before_isr'])
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 | [258, -254, False, False, -1, 8, 260] | [514, 2, True, True, 0, 4, 520] | Failed |
| variant capture | [514, 264, True, False, 2, 8, 517] | [514, 264, True, False, 2, 8, 517] | Passed |
SHA-256 / e204d716fc8e6095cba7b7f91c8e4ac1c909ce6d861a7ecf6f648b7913a617a8
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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.542116+00:00.
Case digest / 7bb7b4efc389ee509ba83f57758d1b9e82cc44fd0a06c74849c6175df73ea409