FAILURE MAP
← Case archive

FA-10436 / Caching / Open access

Eviction discards a dirty value without writing it back · case 01

Eviction discards a dirty value without writing it back.

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

ROOT CAUSE

The eviction path removes the resident record before preserving its pending write.

VERIFIED REPAIR

Preserve the cache-state invariant: Unique entries are [key,value,dirty]. Remove victim and return [remaining,writeback records]; emit [key,value] only for a dirty resident victim.

Unsuccessful approach: Writing every eviction publishes clean read-through values unnecessarily.

Case contract

Unique entries are [key,value,dirty]. Remove victim and return [remaining,writeback records]; emit [key,value] only for a dirty resident victim.

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(entries, victim):
    return [[x for x in entries if x[0]!=victim],[]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([['a', 3, True], ['b', 4, False]], 'a')), [[['b', 4, False]], [['a', 3]]])
check('fixture 2', solve(*([['a', 3, False]], 'a')), [[], []])
check('fixture 3', solve(*([['a', 3, True]], 'z')), [[['a', 3, True]], []])
check('fixture 4', solve(*([], 'a')), [[], []])
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[[['b', 4, False]], []][[['b', 4, False]], [['a', 3]]]Failed
fixture 2[[], []][[], []]Passed
fixture 3[[['a', 3, True]], []][[['a', 3, True]], []]Passed
fixture 4[[], []][[], []]Passed

SHA-256 / 5218f2b3acae4dde0e0b447a1b9c91e5ed815830bb3213e10ef69c92e13243c7

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(entries, victim):
    return [[x for x in entries if x[0]!=victim],[[x[0],x[1]] for x in entries if x[0]==victim]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([['a', 3, True], ['b', 4, False]], 'a')), [[['b', 4, False]], [['a', 3]]])
check('fixture 2', solve(*([['a', 3, False]], 'a')), [[], []])
check('fixture 3', solve(*([['a', 3, True]], 'z')), [[['a', 3, True]], []])
check('fixture 4', solve(*([], 'a')), [[], []])
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[[['b', 4, False]], [['a', 3]]][[['b', 4, False]], [['a', 3]]]Passed
fixture 2[[], [['a', 3]]][[], []]Failed
fixture 3[[['a', 3, True]], []][[['a', 3, True]], []]Passed
fixture 4[[], []][[], []]Passed

SHA-256 / 53787517d2b75bc2188aecae427340ab3584f5d326f2bf9eaaca7ae3fd204388

3 / The verified repair

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

N = 1
observations = []
def solve(entries, victim):
    return [[x for x in entries if x[0]!=victim],[[x[0],x[1]] for x in entries if x[0]==victim and x[2]]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1', solve(*([['a', 3, True], ['b', 4, False]], 'a')), [[['b', 4, False]], [['a', 3]]])
check('fixture 2', solve(*([['a', 3, False]], 'a')), [[], []])
check('fixture 3', solve(*([['a', 3, True]], 'z')), [[['a', 3, True]], []])
check('fixture 4', solve(*([], 'a')), [[], []])
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[[['b', 4, False]], [['a', 3]]][[['b', 4, False]], [['a', 3]]]Passed
fixture 2[[], []][[], []]Passed
fixture 3[[['a', 3, True]], []][[['a', 3, True]], []]Passed
fixture 4[[], []][[], []]Passed

SHA-256 / b521d4ec1665041ca6466e2ebd33cc6addeb4df6c97f20e509aa6483e6ae3e6d

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

Case digest / 5c31d2c66638ab6779f881bce0ca38dacbfd7144fec4a1c75f8162e0d9a5d368