FAILURE MAP
← Case archive

FA-10446 / Caching / Open access

Completion of an old flush clears a newer dirty update · case 01

Completion of an old flush clears a newer dirty update.

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

ROOT CAUSE

Flush completion has no version comparison with the currently cached write.

VERIFIED REPAIR

Preserve the cache-state invariant: Entry is [key,value,version,dirty]. Clear dirty only when flush succeeded for this exact current version; preserve all other fields.

Unsuccessful approach: Matching versions clear dirty even when persistence failed.

Case contract

Entry is [key,value,version,dirty]. Clear dirty only when flush succeeded for this exact current version; preserve all other fields.

Why this case matters

A deterministic cache state transformation. Inputs are copied or treated as immutable; no remote storage, real clock, or concurrent interleaving is simulated.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(entry, flushed_version, success):
    return [entry[0],entry[1],entry[2],False if success else entry[3]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(['a', 'new', 2, True], 1, True)), ['a', 'new', 2, True])
check('fixture 2', solve(*(['a', 'new', 2, True], 2, False)), ['a', 'new', 2, True])
check('fixture 3', solve(*(['a', 'new', 2, True], 2, True)), ['a', 'new', 2, False])
check('fixture 4', solve(*(['a', 'new', 2, False], 1, False)), ['a', 'new', 2, False])
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['a', 'new', 2, False]['a', 'new', 2, True]Failed
fixture 2['a', 'new', 2, True]['a', 'new', 2, True]Passed
fixture 3['a', 'new', 2, False]['a', 'new', 2, False]Passed
fixture 4['a', 'new', 2, False]['a', 'new', 2, False]Passed

SHA-256 / 58cff6f8e1b9555f6412a1dd9f9b49103b65550b608f693db2d367ef4497f4e8

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(entry, flushed_version, success):
    return [entry[0],entry[1],entry[2],entry[3] and entry[2]!=flushed_version]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(['a', 'new', 2, True], 1, True)), ['a', 'new', 2, True])
check('fixture 2', solve(*(['a', 'new', 2, True], 2, False)), ['a', 'new', 2, True])
check('fixture 3', solve(*(['a', 'new', 2, True], 2, True)), ['a', 'new', 2, False])
check('fixture 4', solve(*(['a', 'new', 2, False], 1, False)), ['a', 'new', 2, False])
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['a', 'new', 2, True]['a', 'new', 2, True]Passed
fixture 2['a', 'new', 2, False]['a', 'new', 2, True]Failed
fixture 3['a', 'new', 2, False]['a', 'new', 2, False]Passed
fixture 4['a', 'new', 2, False]['a', 'new', 2, False]Passed

SHA-256 / ca5a3e836fc71eb6b65f190ceef88d92bd24cde036f3b72073106fdd2aa924f6

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(entry, flushed_version, success):
    return [entry[0],entry[1],entry[2],entry[3] and not (success and entry[2]==flushed_version)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*(['a', 'new', 2, True], 1, True)), ['a', 'new', 2, True])
check('fixture 2', solve(*(['a', 'new', 2, True], 2, False)), ['a', 'new', 2, True])
check('fixture 3', solve(*(['a', 'new', 2, True], 2, True)), ['a', 'new', 2, False])
check('fixture 4', solve(*(['a', 'new', 2, False], 1, False)), ['a', 'new', 2, False])
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['a', 'new', 2, True]['a', 'new', 2, True]Passed
fixture 2['a', 'new', 2, True]['a', 'new', 2, True]Passed
fixture 3['a', 'new', 2, False]['a', 'new', 2, False]Passed
fixture 4['a', 'new', 2, False]['a', 'new', 2, False]Passed

SHA-256 / 62ee51428ce31f373073ad96001c8c2a368f5e4f85e78560b1b937c31edfb0cc

Verification & scope

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

Case digest / 7833e6abe03e1ebedeac6dad8272555ae0c162551f83d9b913fb0063d6967503