FAILURE MAP
← Case archive

FA-18261 / Time representation / Open access

Tick residue is reduced in source scale or lost after emission · case 01

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

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

ROOT CAUSE

Tick residue is reduced in source scale or lost after emission.

VERIFIED REPAIR

Preserve the declared coordinate and state contract at residue: residue = accumulated % r['q'].

Unsuccessful approach: The partial correction still substitutes 0 at the same fault site.

Case contract

An elapsed-time converter maps incoming nonnegative source ticks to target ticks with exact rate numerator/denominator and retained residue. Each step adds source*p to prior numerator residue; emit quotient and preserve remainder. A reset invalidates old remainder. A phase origin belongs to emitted target coordinate. Report emitted ticks, new residue, cumulative target, exact unrounded cumulative coordinate and reset marker.

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):
    old_residue = 0 if r['reset'] else r['residue']
    scaled = r['source'] * r['p']
    accumulated = scaled + old_residue
    emitted = accumulated // r['q']
    residue = accumulated % r['p']
    old_target = 0 if r['reset'] else r['target']
    target = old_target + emitted
    coordinate = r['origin'] + target
    exact = Fraction(coordinate) + Fraction(residue,r['q'])
    needs_tick = residue != 0
    return [coordinate,residue,str(exact),needs_tick,target,emitted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reset': False, 'residue': 2, 'source': 1, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}), [111, 1, '334/3', True, 11, 1])
check('fixture 2', solve({'reset': True, 'residue': 2, 'source': 1, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}), [100, 2, '302/3', True, 0, 0])
check('fixture 3', solve({'reset': False, 'residue': 0, 'source': 1, 'p': 2, 'q': 3, 'target': 0, 'origin': 0}), [0, 2, '2/3', True, 0, 0])
check('fixture 4', solve({'reset': False, 'residue': 1, 'source': 1, 'p': 2, 'q': 3, 'target': 5, 'origin': 10}), [16, 0, '16', False, 6, 1])
check('fixture 5', solve({'reset': False, 'residue': 0, 'source': 3, 'p': 2, 'q': 3, 'target': 7, 'origin': -10}), [-1, 0, '-1', False, 9, 2])
check('fixture 6', solve({'reset': False, 'residue': 1, 'source': 0, 'p': 1, 'q': 4, 'target': 2, 'origin': 100}), [102, 1, '409/4', True, 2, 0])
check('fixture 7', solve({'reset': True, 'residue': 1, 'source': 0, 'p': 1, 'q': 4, 'target': 9, 'origin': 50}), [50, 0, '50', False, 0, 0])
check('fixture 8', solve({'reset': False, 'residue': 4, 'source': 2, 'p': 3, 'q': 5, 'target': 10, 'origin': 0}), [12, 0, '12', False, 12, 2])
check('fixture 9', solve({'reset': False, 'residue': 0, 'source': 0, 'p': 2, 'q': 3, 'target': 0, 'origin': 0}), [0, 0, '0', False, 0, 0])
check('fixture 10', solve({'reset': False, 'residue': 2, 'source': 10, 'p': 1, 'q': 7, 'target': 100, 'origin': 4}), [105, 5, '740/7', True, 101, 1])
variant = [({'reset': False, 'residue': 2, 'source': 2, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [112, 0, '112', False, 12, 2]), ({'reset': False, 'residue': 2, 'source': 3, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [112, 2, '338/3', True, 12, 2]), ({'reset': False, 'residue': 2, 'source': 4, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [113, 1, '340/3', True, 13, 3]), ({'reset': False, 'residue': 2, 'source': 5, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [114, 0, '114', False, 14, 4]), ({'reset': False, 'residue': 2, 'source': 6, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [114, 2, '344/3', True, 14, 4])]
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[111, 0, '111', False, 11, 1][111, 1, '334/3', True, 11, 1]Failed
fixture 2[100, 0, '100', False, 0, 0][100, 2, '302/3', True, 0, 0]Failed
fixture 3[0, 0, '0', False, 0, 0][0, 2, '2/3', True, 0, 0]Failed
fixture 4[16, 1, '49/3', True, 6, 1][16, 0, '16', False, 6, 1]Failed
fixture 5[-1, 0, '-1', False, 9, 2][-1, 0, '-1', False, 9, 2]Passed
fixture 6[102, 0, '102', False, 2, 0][102, 1, '409/4', True, 2, 0]Failed
fixture 7[50, 0, '50', False, 0, 0][50, 0, '50', False, 0, 0]Passed
fixture 8[12, 1, '61/5', True, 12, 2][12, 0, '12', False, 12, 2]Failed
fixture 9[0, 0, '0', False, 0, 0][0, 0, '0', False, 0, 0]Passed
fixture 10[105, 0, '105', False, 101, 1][105, 5, '740/7', True, 101, 1]Failed
variant capture[112, 0, '112', False, 12, 2][112, 0, '112', False, 12, 2]Passed

SHA-256 / aebd821906ecca2ebf74390829d109df50f0fb7cac8ace8c043ab9139fed0e30

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):
    old_residue = 0 if r['reset'] else r['residue']
    scaled = r['source'] * r['p']
    accumulated = scaled + old_residue
    emitted = accumulated // r['q']
    residue = 0
    old_target = 0 if r['reset'] else r['target']
    target = old_target + emitted
    coordinate = r['origin'] + target
    exact = Fraction(coordinate) + Fraction(residue,r['q'])
    needs_tick = residue != 0
    return [coordinate,residue,str(exact),needs_tick,target,emitted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reset': False, 'residue': 2, 'source': 1, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}), [111, 1, '334/3', True, 11, 1])
check('fixture 2', solve({'reset': True, 'residue': 2, 'source': 1, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}), [100, 2, '302/3', True, 0, 0])
check('fixture 3', solve({'reset': False, 'residue': 0, 'source': 1, 'p': 2, 'q': 3, 'target': 0, 'origin': 0}), [0, 2, '2/3', True, 0, 0])
check('fixture 4', solve({'reset': False, 'residue': 1, 'source': 1, 'p': 2, 'q': 3, 'target': 5, 'origin': 10}), [16, 0, '16', False, 6, 1])
check('fixture 5', solve({'reset': False, 'residue': 0, 'source': 3, 'p': 2, 'q': 3, 'target': 7, 'origin': -10}), [-1, 0, '-1', False, 9, 2])
check('fixture 6', solve({'reset': False, 'residue': 1, 'source': 0, 'p': 1, 'q': 4, 'target': 2, 'origin': 100}), [102, 1, '409/4', True, 2, 0])
check('fixture 7', solve({'reset': True, 'residue': 1, 'source': 0, 'p': 1, 'q': 4, 'target': 9, 'origin': 50}), [50, 0, '50', False, 0, 0])
check('fixture 8', solve({'reset': False, 'residue': 4, 'source': 2, 'p': 3, 'q': 5, 'target': 10, 'origin': 0}), [12, 0, '12', False, 12, 2])
check('fixture 9', solve({'reset': False, 'residue': 0, 'source': 0, 'p': 2, 'q': 3, 'target': 0, 'origin': 0}), [0, 0, '0', False, 0, 0])
check('fixture 10', solve({'reset': False, 'residue': 2, 'source': 10, 'p': 1, 'q': 7, 'target': 100, 'origin': 4}), [105, 5, '740/7', True, 101, 1])
variant = [({'reset': False, 'residue': 2, 'source': 2, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [112, 0, '112', False, 12, 2]), ({'reset': False, 'residue': 2, 'source': 3, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [112, 2, '338/3', True, 12, 2]), ({'reset': False, 'residue': 2, 'source': 4, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [113, 1, '340/3', True, 13, 3]), ({'reset': False, 'residue': 2, 'source': 5, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [114, 0, '114', False, 14, 4]), ({'reset': False, 'residue': 2, 'source': 6, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [114, 2, '344/3', True, 14, 4])]
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[111, 0, '111', False, 11, 1][111, 1, '334/3', True, 11, 1]Failed
fixture 2[100, 0, '100', False, 0, 0][100, 2, '302/3', True, 0, 0]Failed
fixture 3[0, 0, '0', False, 0, 0][0, 2, '2/3', True, 0, 0]Failed
fixture 4[16, 0, '16', False, 6, 1][16, 0, '16', False, 6, 1]Passed
fixture 5[-1, 0, '-1', False, 9, 2][-1, 0, '-1', False, 9, 2]Passed
fixture 6[102, 0, '102', False, 2, 0][102, 1, '409/4', True, 2, 0]Failed
fixture 7[50, 0, '50', False, 0, 0][50, 0, '50', False, 0, 0]Passed
fixture 8[12, 0, '12', False, 12, 2][12, 0, '12', False, 12, 2]Passed
fixture 9[0, 0, '0', False, 0, 0][0, 0, '0', False, 0, 0]Passed
fixture 10[105, 0, '105', False, 101, 1][105, 5, '740/7', True, 101, 1]Failed
variant capture[112, 0, '112', False, 12, 2][112, 0, '112', False, 12, 2]Passed

SHA-256 / 91e967ad71e17ea3d074a99c6f6780490bec005e3ccc29193807c7eb4ccfa7c3

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):
    old_residue = 0 if r['reset'] else r['residue']
    scaled = r['source'] * r['p']
    accumulated = scaled + old_residue
    emitted = accumulated // r['q']
    residue = accumulated % r['q']
    old_target = 0 if r['reset'] else r['target']
    target = old_target + emitted
    coordinate = r['origin'] + target
    exact = Fraction(coordinate) + Fraction(residue,r['q'])
    needs_tick = residue != 0
    return [coordinate,residue,str(exact),needs_tick,target,emitted]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve({'reset': False, 'residue': 2, 'source': 1, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}), [111, 1, '334/3', True, 11, 1])
check('fixture 2', solve({'reset': True, 'residue': 2, 'source': 1, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}), [100, 2, '302/3', True, 0, 0])
check('fixture 3', solve({'reset': False, 'residue': 0, 'source': 1, 'p': 2, 'q': 3, 'target': 0, 'origin': 0}), [0, 2, '2/3', True, 0, 0])
check('fixture 4', solve({'reset': False, 'residue': 1, 'source': 1, 'p': 2, 'q': 3, 'target': 5, 'origin': 10}), [16, 0, '16', False, 6, 1])
check('fixture 5', solve({'reset': False, 'residue': 0, 'source': 3, 'p': 2, 'q': 3, 'target': 7, 'origin': -10}), [-1, 0, '-1', False, 9, 2])
check('fixture 6', solve({'reset': False, 'residue': 1, 'source': 0, 'p': 1, 'q': 4, 'target': 2, 'origin': 100}), [102, 1, '409/4', True, 2, 0])
check('fixture 7', solve({'reset': True, 'residue': 1, 'source': 0, 'p': 1, 'q': 4, 'target': 9, 'origin': 50}), [50, 0, '50', False, 0, 0])
check('fixture 8', solve({'reset': False, 'residue': 4, 'source': 2, 'p': 3, 'q': 5, 'target': 10, 'origin': 0}), [12, 0, '12', False, 12, 2])
check('fixture 9', solve({'reset': False, 'residue': 0, 'source': 0, 'p': 2, 'q': 3, 'target': 0, 'origin': 0}), [0, 0, '0', False, 0, 0])
check('fixture 10', solve({'reset': False, 'residue': 2, 'source': 10, 'p': 1, 'q': 7, 'target': 100, 'origin': 4}), [105, 5, '740/7', True, 101, 1])
variant = [({'reset': False, 'residue': 2, 'source': 2, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [112, 0, '112', False, 12, 2]), ({'reset': False, 'residue': 2, 'source': 3, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [112, 2, '338/3', True, 12, 2]), ({'reset': False, 'residue': 2, 'source': 4, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [113, 1, '340/3', True, 13, 3]), ({'reset': False, 'residue': 2, 'source': 5, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [114, 0, '114', False, 14, 4]), ({'reset': False, 'residue': 2, 'source': 6, 'p': 2, 'q': 3, 'target': 10, 'origin': 100}, [114, 2, '344/3', True, 14, 4])]
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[111, 1, '334/3', True, 11, 1][111, 1, '334/3', True, 11, 1]Passed
fixture 2[100, 2, '302/3', True, 0, 0][100, 2, '302/3', True, 0, 0]Passed
fixture 3[0, 2, '2/3', True, 0, 0][0, 2, '2/3', True, 0, 0]Passed
fixture 4[16, 0, '16', False, 6, 1][16, 0, '16', False, 6, 1]Passed
fixture 5[-1, 0, '-1', False, 9, 2][-1, 0, '-1', False, 9, 2]Passed
fixture 6[102, 1, '409/4', True, 2, 0][102, 1, '409/4', True, 2, 0]Passed
fixture 7[50, 0, '50', False, 0, 0][50, 0, '50', False, 0, 0]Passed
fixture 8[12, 0, '12', False, 12, 2][12, 0, '12', False, 12, 2]Passed
fixture 9[0, 0, '0', False, 0, 0][0, 0, '0', False, 0, 0]Passed
fixture 10[105, 5, '740/7', True, 101, 1][105, 5, '740/7', True, 101, 1]Passed
variant capture[112, 0, '112', False, 12, 2][112, 0, '112', False, 12, 2]Passed

SHA-256 / 62ca7d413f76c74251c3f90cbd7233d10971ac06497383ac70c34f13c9c456c1

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

Case digest / e4d15bb5d966c5e4c4f50a15a779b43921dc82d4a53c5024f10cc49ee7ff7a50