FAILURE MAP
← Case archive

FA-18281 / Time representation / Open access

Unrounded timestamp drops residue or gives it wrong unit denominator · case 01

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

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

ROOT CAUSE

Unrounded timestamp drops residue or gives it wrong unit denominator.

THE FAILURE

Unrounded timestamp drops residue or gives it wrong unit denominator.

Unsuccessful approach: The partial correction still substitutes Fraction(coordinate) + Fraction(residue,r['p']) 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['q']
    old_target = 0 if r['reset'] else r['target']
    target = old_target + emitted
    coordinate = r['origin'] + target
    exact = Fraction(coordinate)
    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, '111', True, 11, 1][111, 1, '334/3', True, 11, 1]Failed
fixture 2[100, 2, '100', True, 0, 0][100, 2, '302/3', True, 0, 0]Failed
fixture 3[0, 2, '0', True, 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, 1, '102', True, 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, 5, '105', True, 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 / 858f8b4386eb29c1c008324a00f2e7291d7b86119053b02d060946ea9637c41e

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 = 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['p'])
    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, '223/2', True, 11, 1][111, 1, '334/3', True, 11, 1]Failed
fixture 2[100, 2, '101', True, 0, 0][100, 2, '302/3', True, 0, 0]Failed
fixture 3[0, 2, '1', True, 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, 1, '103', True, 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, 5, '110', True, 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 / 82db469449e14c97b45be6e607387d12b6151614c50a05ce2bcacaa6a3033620

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 11 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:56.136441+00:00.

Case digest / 0a71e407d74e857b47c24228160b23973848467b2d6fa9401aaf0f86c892686f