FAILURE MAP
← Case archive

FA-45486 / Data systems / Open access

Position deletes use fragment-local row positions · case 01

Position deletes use fragment-local row positions.

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

ROOT CAUSE

position-delete-scan: Position deletes use fragment-local row positions.

VERIFIED REPAIR

Preserve the stated physical representation and operation order: Scan fragments [file-id,base-row-position,values] applying position-delete pairs [file-id,absolute-row-position]. Deletions are file-scoped and use physical positions before filtering. Return [file-id,absolute-position,value] for surviving rows, including null values.

Unsuccessful approach: A global survivor count is not a fragment physical offset.

Case contract

Scan fragments [file-id,base-row-position,values] applying position-delete pairs [file-id,absolute-row-position]. Deletions are file-scoped and use physical positions before filtering. Return [file-id,absolute-position,value] for surviving rows, including null values.

Why this case matters

A bounded deterministic data engine model makes representation and changelog faults reproducible.

1 / The failure

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

N = 1
observations = []
def solve(d):
    try:
        fragments,deletes=d
        tombstones=set(tuple(x) for x in deletes)
        out=[]
        for file,base,values in fragments:
            for local,value in enumerate(values):
                position=local
                if (file,position) in tombstones: continue
                out.append([file,position,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('file scope', solve([[['b', 0, [1]], ['a', 0, [2]]], [['a', 0]]]), [['b', 0, 1]])
    check('fragment origin', solve([[['a', 5, [1, 2]]], [['a', 5]]]), [['a', 6, 2]])
    check('physical holes', solve([[['a', 0, [1, 2, 3]]], [['a', 0], ['a', 2]]]), [['a', 1, 2]])
    check('repeated tombstone', solve([[['a', 0, [1]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 1]]], []]), [['a', 0, None], ['a', 1, 1]])
    check('fragment order', solve([[['b', 0, [1]], ['a', 0, [2]]], []]), [['b', 0, 1], ['a', 0, 2]])
    check('empty input', solve([[], []]), [])
elif N == 2:
    check('file scope', solve([[['b', 0, [2]], ['a', 0, [3]]], [['a', 0]]]), [['b', 0, 2]])
    check('fragment origin', solve([[['a', 5, [2, 3]]], [['a', 5]]]), [['a', 6, 3]])
    check('physical holes', solve([[['a', 0, [2, 3, 4]]], [['a', 0], ['a', 2]]]), [['a', 1, 3]])
    check('repeated tombstone', solve([[['a', 0, [2]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 2]]], []]), [['a', 0, None], ['a', 1, 2]])
    check('fragment order', solve([[['b', 0, [2]], ['a', 0, [3]]], []]), [['b', 0, 2], ['a', 0, 3]])
    check('empty input', solve([[], []]), [])
elif N == 3:
    check('file scope', solve([[['b', 0, [3]], ['a', 0, [4]]], [['a', 0]]]), [['b', 0, 3]])
    check('fragment origin', solve([[['a', 5, [3, 4]]], [['a', 5]]]), [['a', 6, 4]])
    check('physical holes', solve([[['a', 0, [3, 4, 5]]], [['a', 0], ['a', 2]]]), [['a', 1, 4]])
    check('repeated tombstone', solve([[['a', 0, [3]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 3]]], []]), [['a', 0, None], ['a', 1, 3]])
    check('fragment order', solve([[['b', 0, [3]], ['a', 0, [4]]], []]), [['b', 0, 3], ['a', 0, 4]])
    check('empty input', solve([[], []]), [])
elif N == 4:
    check('file scope', solve([[['b', 0, [4]], ['a', 0, [5]]], [['a', 0]]]), [['b', 0, 4]])
    check('fragment origin', solve([[['a', 5, [4, 5]]], [['a', 5]]]), [['a', 6, 5]])
    check('physical holes', solve([[['a', 0, [4, 5, 6]]], [['a', 0], ['a', 2]]]), [['a', 1, 5]])
    check('repeated tombstone', solve([[['a', 0, [4]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 4]]], []]), [['a', 0, None], ['a', 1, 4]])
    check('fragment order', solve([[['b', 0, [4]], ['a', 0, [5]]], []]), [['b', 0, 4], ['a', 0, 5]])
    check('empty input', solve([[], []]), [])
elif N == 5:
    check('file scope', solve([[['b', 0, [5]], ['a', 0, [6]]], [['a', 0]]]), [['b', 0, 5]])
    check('fragment origin', solve([[['a', 5, [5, 6]]], [['a', 5]]]), [['a', 6, 6]])
    check('physical holes', solve([[['a', 0, [5, 6, 7]]], [['a', 0], ['a', 2]]]), [['a', 1, 6]])
    check('repeated tombstone', solve([[['a', 0, [5]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 5]]], []]), [['a', 0, None], ['a', 1, 5]])
    check('fragment order', solve([[['b', 0, [5]], ['a', 0, [6]]], []]), [['b', 0, 5], ['a', 0, 6]])
    check('empty input', solve([[], []]), [])
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
file scope[['b', 0, 1]][['b', 0, 1]]Passed
fragment origin[['a', 0, 1], ['a', 1, 2]][['a', 6, 2]]Failed
physical holes[['a', 1, 2]][['a', 1, 2]]Passed
repeated tombstone[][]Passed
surviving null[['a', 0, None], ['a', 1, 1]][['a', 0, None], ['a', 1, 1]]Passed
fragment order[['b', 0, 1], ['a', 0, 2]][['b', 0, 1], ['a', 0, 2]]Passed
empty input[][]Passed

SHA-256 / f5f4e0fd23323f6c6c644b8fe93013ec0c62cdbfc6027ff5ae4e0e7a7a7f29b3

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    try:
        fragments,deletes=d
        tombstones=set(tuple(x) for x in deletes)
        out=[]
        for file,base,values in fragments:
            for local,value in enumerate(values):
                position=base+len(out)
                if (file,position) in tombstones: continue
                out.append([file,position,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('file scope', solve([[['b', 0, [1]], ['a', 0, [2]]], [['a', 0]]]), [['b', 0, 1]])
    check('fragment origin', solve([[['a', 5, [1, 2]]], [['a', 5]]]), [['a', 6, 2]])
    check('physical holes', solve([[['a', 0, [1, 2, 3]]], [['a', 0], ['a', 2]]]), [['a', 1, 2]])
    check('repeated tombstone', solve([[['a', 0, [1]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 1]]], []]), [['a', 0, None], ['a', 1, 1]])
    check('fragment order', solve([[['b', 0, [1]], ['a', 0, [2]]], []]), [['b', 0, 1], ['a', 0, 2]])
    check('empty input', solve([[], []]), [])
elif N == 2:
    check('file scope', solve([[['b', 0, [2]], ['a', 0, [3]]], [['a', 0]]]), [['b', 0, 2]])
    check('fragment origin', solve([[['a', 5, [2, 3]]], [['a', 5]]]), [['a', 6, 3]])
    check('physical holes', solve([[['a', 0, [2, 3, 4]]], [['a', 0], ['a', 2]]]), [['a', 1, 3]])
    check('repeated tombstone', solve([[['a', 0, [2]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 2]]], []]), [['a', 0, None], ['a', 1, 2]])
    check('fragment order', solve([[['b', 0, [2]], ['a', 0, [3]]], []]), [['b', 0, 2], ['a', 0, 3]])
    check('empty input', solve([[], []]), [])
elif N == 3:
    check('file scope', solve([[['b', 0, [3]], ['a', 0, [4]]], [['a', 0]]]), [['b', 0, 3]])
    check('fragment origin', solve([[['a', 5, [3, 4]]], [['a', 5]]]), [['a', 6, 4]])
    check('physical holes', solve([[['a', 0, [3, 4, 5]]], [['a', 0], ['a', 2]]]), [['a', 1, 4]])
    check('repeated tombstone', solve([[['a', 0, [3]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 3]]], []]), [['a', 0, None], ['a', 1, 3]])
    check('fragment order', solve([[['b', 0, [3]], ['a', 0, [4]]], []]), [['b', 0, 3], ['a', 0, 4]])
    check('empty input', solve([[], []]), [])
elif N == 4:
    check('file scope', solve([[['b', 0, [4]], ['a', 0, [5]]], [['a', 0]]]), [['b', 0, 4]])
    check('fragment origin', solve([[['a', 5, [4, 5]]], [['a', 5]]]), [['a', 6, 5]])
    check('physical holes', solve([[['a', 0, [4, 5, 6]]], [['a', 0], ['a', 2]]]), [['a', 1, 5]])
    check('repeated tombstone', solve([[['a', 0, [4]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 4]]], []]), [['a', 0, None], ['a', 1, 4]])
    check('fragment order', solve([[['b', 0, [4]], ['a', 0, [5]]], []]), [['b', 0, 4], ['a', 0, 5]])
    check('empty input', solve([[], []]), [])
elif N == 5:
    check('file scope', solve([[['b', 0, [5]], ['a', 0, [6]]], [['a', 0]]]), [['b', 0, 5]])
    check('fragment origin', solve([[['a', 5, [5, 6]]], [['a', 5]]]), [['a', 6, 6]])
    check('physical holes', solve([[['a', 0, [5, 6, 7]]], [['a', 0], ['a', 2]]]), [['a', 1, 6]])
    check('repeated tombstone', solve([[['a', 0, [5]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 5]]], []]), [['a', 0, None], ['a', 1, 5]])
    check('fragment order', solve([[['b', 0, [5]], ['a', 0, [6]]], []]), [['b', 0, 5], ['a', 0, 6]])
    check('empty input', solve([[], []]), [])
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
file scope[['b', 0, 1], ['a', 1, 2]][['b', 0, 1]]Failed
fragment origin[][['a', 6, 2]]Failed
physical holes[][['a', 1, 2]]Failed
repeated tombstone[][]Passed
surviving null[['a', 0, None], ['a', 1, 1]][['a', 0, None], ['a', 1, 1]]Passed
fragment order[['b', 0, 1], ['a', 1, 2]][['b', 0, 1], ['a', 0, 2]]Failed
empty input[][]Passed

SHA-256 / 45ff3e87c8bd1ab62b090480be00e5afb29c45349895f03eefcc26aabe3083a7

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    try:
        fragments,deletes=d
        tombstones=set(tuple(x) for x in deletes)
        out=[]
        for file,base,values in fragments:
            for local,value in enumerate(values):
                position=base+local
                if (file,position) in tombstones: continue
                out.append([file,position,value])
        return out
    except (IndexError, KeyError, ValueError, StopIteration) as exc:
        return {"representation_error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('file scope', solve([[['b', 0, [1]], ['a', 0, [2]]], [['a', 0]]]), [['b', 0, 1]])
    check('fragment origin', solve([[['a', 5, [1, 2]]], [['a', 5]]]), [['a', 6, 2]])
    check('physical holes', solve([[['a', 0, [1, 2, 3]]], [['a', 0], ['a', 2]]]), [['a', 1, 2]])
    check('repeated tombstone', solve([[['a', 0, [1]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 1]]], []]), [['a', 0, None], ['a', 1, 1]])
    check('fragment order', solve([[['b', 0, [1]], ['a', 0, [2]]], []]), [['b', 0, 1], ['a', 0, 2]])
    check('empty input', solve([[], []]), [])
elif N == 2:
    check('file scope', solve([[['b', 0, [2]], ['a', 0, [3]]], [['a', 0]]]), [['b', 0, 2]])
    check('fragment origin', solve([[['a', 5, [2, 3]]], [['a', 5]]]), [['a', 6, 3]])
    check('physical holes', solve([[['a', 0, [2, 3, 4]]], [['a', 0], ['a', 2]]]), [['a', 1, 3]])
    check('repeated tombstone', solve([[['a', 0, [2]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 2]]], []]), [['a', 0, None], ['a', 1, 2]])
    check('fragment order', solve([[['b', 0, [2]], ['a', 0, [3]]], []]), [['b', 0, 2], ['a', 0, 3]])
    check('empty input', solve([[], []]), [])
elif N == 3:
    check('file scope', solve([[['b', 0, [3]], ['a', 0, [4]]], [['a', 0]]]), [['b', 0, 3]])
    check('fragment origin', solve([[['a', 5, [3, 4]]], [['a', 5]]]), [['a', 6, 4]])
    check('physical holes', solve([[['a', 0, [3, 4, 5]]], [['a', 0], ['a', 2]]]), [['a', 1, 4]])
    check('repeated tombstone', solve([[['a', 0, [3]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 3]]], []]), [['a', 0, None], ['a', 1, 3]])
    check('fragment order', solve([[['b', 0, [3]], ['a', 0, [4]]], []]), [['b', 0, 3], ['a', 0, 4]])
    check('empty input', solve([[], []]), [])
elif N == 4:
    check('file scope', solve([[['b', 0, [4]], ['a', 0, [5]]], [['a', 0]]]), [['b', 0, 4]])
    check('fragment origin', solve([[['a', 5, [4, 5]]], [['a', 5]]]), [['a', 6, 5]])
    check('physical holes', solve([[['a', 0, [4, 5, 6]]], [['a', 0], ['a', 2]]]), [['a', 1, 5]])
    check('repeated tombstone', solve([[['a', 0, [4]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 4]]], []]), [['a', 0, None], ['a', 1, 4]])
    check('fragment order', solve([[['b', 0, [4]], ['a', 0, [5]]], []]), [['b', 0, 4], ['a', 0, 5]])
    check('empty input', solve([[], []]), [])
elif N == 5:
    check('file scope', solve([[['b', 0, [5]], ['a', 0, [6]]], [['a', 0]]]), [['b', 0, 5]])
    check('fragment origin', solve([[['a', 5, [5, 6]]], [['a', 5]]]), [['a', 6, 6]])
    check('physical holes', solve([[['a', 0, [5, 6, 7]]], [['a', 0], ['a', 2]]]), [['a', 1, 6]])
    check('repeated tombstone', solve([[['a', 0, [5]]], [['a', 0], ['a', 0]]]), [])
    check('surviving null', solve([[['a', 0, [None, 5]]], []]), [['a', 0, None], ['a', 1, 5]])
    check('fragment order', solve([[['b', 0, [5]], ['a', 0, [6]]], []]), [['b', 0, 5], ['a', 0, 6]])
    check('empty input', solve([[], []]), [])
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
file scope[['b', 0, 1]][['b', 0, 1]]Passed
fragment origin[['a', 6, 2]][['a', 6, 2]]Passed
physical holes[['a', 1, 2]][['a', 1, 2]]Passed
repeated tombstone[][]Passed
surviving null[['a', 0, None], ['a', 1, 1]][['a', 0, None], ['a', 1, 1]]Passed
fragment order[['b', 0, 1], ['a', 0, 2]][['b', 0, 1], ['a', 0, 2]]Passed
empty input[][]Passed

SHA-256 / 7592e37b5ed37b83adf08e1480c2be55a352e3dc01a3d815bf08bc1e9c8c01f0

Verification & scope

Offline stipulated semantics over valid small inputs; no performance, concurrency, or production-engine conformance claim. 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:44:22.736886+00:00.

Case digest / dc714d79b28697674433346cf309bdac8ad8037c63dd3865ec1663e40bc3d148