FA-17396 / Time representation / Open access
Signed second word misses the minimum negative code · case 01
The decoded time state disagrees with the explicit regression oracle for seconds.
ROOT CAUSE
Signed second word misses the minimum negative code.
VERIFIED REPAIR
Preserve the declared coordinate and state contract at seconds: seconds = word - 65536 if word >= 32768 else word.
Unsuccessful approach: The partial correction still substitutes word - 65536 if word > 32768 else word at the same fault site.
Case contract
Decode four unsigned bytes: signed 16-bit big-endian seconds and unsigned 16-bit fractional microticks, 1000 per second. Fraction >=1000 is invalid. Return validity and, only for valid input, exact total microticks, signed decimal timestamp with three fractional digits, and whole-second coordinate after a one-microtick increment. Negative display uses magnitude decomposition.
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):
word = r[0] * 256 + r[1]
seconds = word
fraction = r[2] * 256 + r[3]
valid = fraction < 1000
total = seconds * 1000 + fraction
negative = total < 0
magnitude = abs(total)
whole = magnitude // 1000
part = magnitude % 1000
next_second = seconds + (fraction + 1) // 1000
return [valid, total if valid else None, ('-' if negative else '') + str(whole) + '.' + str(part).zfill(3) if valid else None,next_second if valid else None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([0, 1, 0, 0]), [True, 1000, '1.000', 1])
check('fixture 2', solve([255, 255, 0, 1]), [True, -999, '-0.999', -1])
check('fixture 3', solve([128, 0, 3, 231]), [True, -32767001, '-32767.001', -32767])
check('fixture 4', solve([0, 0, 0, 0]), [True, 0, '0.000', 0])
check('fixture 5', solve([0, 0, 3, 232]), [False, None, None, None])
check('fixture 6', solve([255, 255, 3, 232]), [False, None, None, None])
check('fixture 7', solve([0, 2, 1, 3]), [True, 2259, '2.259', 2])
check('fixture 8', solve([127, 255, 3, 231]), [True, 32767999, '32767.999', 32768])
check('fixture 9', solve([255, 254, 0, 0]), [True, -2000, '-2.000', -2])
check('fixture 10', solve([0, 0, 3, 231]), [True, 999, '0.999', 1])
variant = [([0, 2, 0, 0], [True, 2000, '2.000', 2]), ([0, 3, 0, 0], [True, 3000, '3.000', 3]), ([0, 4, 0, 0], [True, 4000, '4.000', 4]), ([0, 5, 0, 0], [True, 5000, '5.000', 5]), ([0, 6, 0, 0], [True, 6000, '6.000', 6])]
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 | [True, 1000, '1.000', 1] | [True, 1000, '1.000', 1] | Passed |
| fixture 2 | [True, 65535001, '65535.001', 65535] | [True, -999, '-0.999', -1] | Failed |
| fixture 3 | [True, 32768999, '32768.999', 32769] | [True, -32767001, '-32767.001', -32767] | Failed |
| fixture 4 | [True, 0, '0.000', 0] | [True, 0, '0.000', 0] | Passed |
| fixture 5 | [False, None, None, None] | [False, None, None, None] | Passed |
| fixture 6 | [False, None, None, None] | [False, None, None, None] | Passed |
| fixture 7 | [True, 2259, '2.259', 2] | [True, 2259, '2.259', 2] | Passed |
| fixture 8 | [True, 32767999, '32767.999', 32768] | [True, 32767999, '32767.999', 32768] | Passed |
| fixture 9 | [True, 65534000, '65534.000', 65534] | [True, -2000, '-2.000', -2] | Failed |
| fixture 10 | [True, 999, '0.999', 1] | [True, 999, '0.999', 1] | Passed |
| variant capture | [True, 2000, '2.000', 2] | [True, 2000, '2.000', 2] | Passed |
SHA-256 / 3a14babc45404184c7396382b3f247875ee4c414999181646bd10a7bfa9ef3ba
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):
word = r[0] * 256 + r[1]
seconds = word - 65536 if word > 32768 else word
fraction = r[2] * 256 + r[3]
valid = fraction < 1000
total = seconds * 1000 + fraction
negative = total < 0
magnitude = abs(total)
whole = magnitude // 1000
part = magnitude % 1000
next_second = seconds + (fraction + 1) // 1000
return [valid, total if valid else None, ('-' if negative else '') + str(whole) + '.' + str(part).zfill(3) if valid else None,next_second if valid else None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([0, 1, 0, 0]), [True, 1000, '1.000', 1])
check('fixture 2', solve([255, 255, 0, 1]), [True, -999, '-0.999', -1])
check('fixture 3', solve([128, 0, 3, 231]), [True, -32767001, '-32767.001', -32767])
check('fixture 4', solve([0, 0, 0, 0]), [True, 0, '0.000', 0])
check('fixture 5', solve([0, 0, 3, 232]), [False, None, None, None])
check('fixture 6', solve([255, 255, 3, 232]), [False, None, None, None])
check('fixture 7', solve([0, 2, 1, 3]), [True, 2259, '2.259', 2])
check('fixture 8', solve([127, 255, 3, 231]), [True, 32767999, '32767.999', 32768])
check('fixture 9', solve([255, 254, 0, 0]), [True, -2000, '-2.000', -2])
check('fixture 10', solve([0, 0, 3, 231]), [True, 999, '0.999', 1])
variant = [([0, 2, 0, 0], [True, 2000, '2.000', 2]), ([0, 3, 0, 0], [True, 3000, '3.000', 3]), ([0, 4, 0, 0], [True, 4000, '4.000', 4]), ([0, 5, 0, 0], [True, 5000, '5.000', 5]), ([0, 6, 0, 0], [True, 6000, '6.000', 6])]
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 | [True, 1000, '1.000', 1] | [True, 1000, '1.000', 1] | Passed |
| fixture 2 | [True, -999, '-0.999', -1] | [True, -999, '-0.999', -1] | Passed |
| fixture 3 | [True, 32768999, '32768.999', 32769] | [True, -32767001, '-32767.001', -32767] | Failed |
| fixture 4 | [True, 0, '0.000', 0] | [True, 0, '0.000', 0] | Passed |
| fixture 5 | [False, None, None, None] | [False, None, None, None] | Passed |
| fixture 6 | [False, None, None, None] | [False, None, None, None] | Passed |
| fixture 7 | [True, 2259, '2.259', 2] | [True, 2259, '2.259', 2] | Passed |
| fixture 8 | [True, 32767999, '32767.999', 32768] | [True, 32767999, '32767.999', 32768] | Passed |
| fixture 9 | [True, -2000, '-2.000', -2] | [True, -2000, '-2.000', -2] | Passed |
| fixture 10 | [True, 999, '0.999', 1] | [True, 999, '0.999', 1] | Passed |
| variant capture | [True, 2000, '2.000', 2] | [True, 2000, '2.000', 2] | Passed |
SHA-256 / 9869defb2035da74240fa65934cc1e031fc133c2f6ba65c2d3742dd255034336
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):
word = r[0] * 256 + r[1]
seconds = word - 65536 if word >= 32768 else word
fraction = r[2] * 256 + r[3]
valid = fraction < 1000
total = seconds * 1000 + fraction
negative = total < 0
magnitude = abs(total)
whole = magnitude // 1000
part = magnitude % 1000
next_second = seconds + (fraction + 1) // 1000
return [valid, total if valid else None, ('-' if negative else '') + str(whole) + '.' + str(part).zfill(3) if valid else None,next_second if valid else None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve([0, 1, 0, 0]), [True, 1000, '1.000', 1])
check('fixture 2', solve([255, 255, 0, 1]), [True, -999, '-0.999', -1])
check('fixture 3', solve([128, 0, 3, 231]), [True, -32767001, '-32767.001', -32767])
check('fixture 4', solve([0, 0, 0, 0]), [True, 0, '0.000', 0])
check('fixture 5', solve([0, 0, 3, 232]), [False, None, None, None])
check('fixture 6', solve([255, 255, 3, 232]), [False, None, None, None])
check('fixture 7', solve([0, 2, 1, 3]), [True, 2259, '2.259', 2])
check('fixture 8', solve([127, 255, 3, 231]), [True, 32767999, '32767.999', 32768])
check('fixture 9', solve([255, 254, 0, 0]), [True, -2000, '-2.000', -2])
check('fixture 10', solve([0, 0, 3, 231]), [True, 999, '0.999', 1])
variant = [([0, 2, 0, 0], [True, 2000, '2.000', 2]), ([0, 3, 0, 0], [True, 3000, '3.000', 3]), ([0, 4, 0, 0], [True, 4000, '4.000', 4]), ([0, 5, 0, 0], [True, 5000, '5.000', 5]), ([0, 6, 0, 0], [True, 6000, '6.000', 6])]
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 | [True, 1000, '1.000', 1] | [True, 1000, '1.000', 1] | Passed |
| fixture 2 | [True, -999, '-0.999', -1] | [True, -999, '-0.999', -1] | Passed |
| fixture 3 | [True, -32767001, '-32767.001', -32767] | [True, -32767001, '-32767.001', -32767] | Passed |
| fixture 4 | [True, 0, '0.000', 0] | [True, 0, '0.000', 0] | Passed |
| fixture 5 | [False, None, None, None] | [False, None, None, None] | Passed |
| fixture 6 | [False, None, None, None] | [False, None, None, None] | Passed |
| fixture 7 | [True, 2259, '2.259', 2] | [True, 2259, '2.259', 2] | Passed |
| fixture 8 | [True, 32767999, '32767.999', 32768] | [True, 32767999, '32767.999', 32768] | Passed |
| fixture 9 | [True, -2000, '-2.000', -2] | [True, -2000, '-2.000', -2] | Passed |
| fixture 10 | [True, 999, '0.999', 1] | [True, 999, '0.999', 1] | Passed |
| variant capture | [True, 2000, '2.000', 2] | [True, 2000, '2.000', 2] | Passed |
SHA-256 / 6a0b68021316fa2c78faae39a976ebeefa970eae96bebc4cd1a690315d9557bb
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:45.783388+00:00.
Case digest / 2d19eddcf3785a6d495df97b69b517536e78ac3f5d51875024e7fa8e1eb97712