FAILURE MAP
← Case archive

FA-45561 / Data systems / Open access

Membership maintenance uses whole-right emptiness for every left key · case 01

Membership maintenance uses whole-right emptiness for every left key.

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

ROOT CAUSE

right-membership-delta: Membership maintenance uses whole-right emptiness for every left key.

THE FAILURE

right-membership-delta: Membership maintenance uses whole-right emptiness for every left key.

Unsuccessful approach: Total right cardinality does not determine membership of a particular key.

Case contract

For a fixed left bag [id,key,multiplicity], apply a right-key count delta batch and emit signed left rows only when right membership crosses zero. Null keys never match. Emit [id,signed-left-multiplicity] in left order; duplicate right updates consolidate before crossing detection.

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:
        left,old,delta=d
        before=dict(old); after=dict(old)
        for key,weight in delta: after[key]=after.get(key,0)+weight
        out=[]
        for ident,key,multiplicity in left:
            if key is None: continue
            was=any(before.values()); now=any(after.values())
            if was!=now: out.append([ident,multiplicity*(1 if now else -1)])
        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('new right key', solve([[[10, 'a', 1]], [], [['a', 1]]]), [[10, 1]])
    check('last right removed', solve([[[10, 'a', 1]], [['a', 1]], [['a', -1]]]), [[10, -1]])
    check('right duplicate remains', solve([[[10, 'a', 1]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 1]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 1]], [['b', 1]], [['a', 1]]]), [[10, 1]])
    check('null key', solve([[[10, None, 1]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 1]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -1]])
    check('left multiplicity', solve([[[10, 'a', 2]], [], [['a', 1]]]), [[10, 2]])
elif N == 2:
    check('new right key', solve([[[10, 'a', 2]], [], [['a', 1]]]), [[10, 2]])
    check('last right removed', solve([[[10, 'a', 2]], [['a', 1]], [['a', -1]]]), [[10, -2]])
    check('right duplicate remains', solve([[[10, 'a', 2]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 2]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 2]], [['b', 1]], [['a', 1]]]), [[10, 2]])
    check('null key', solve([[[10, None, 2]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 2]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -2]])
    check('left multiplicity', solve([[[10, 'a', 3]], [], [['a', 1]]]), [[10, 3]])
elif N == 3:
    check('new right key', solve([[[10, 'a', 3]], [], [['a', 1]]]), [[10, 3]])
    check('last right removed', solve([[[10, 'a', 3]], [['a', 1]], [['a', -1]]]), [[10, -3]])
    check('right duplicate remains', solve([[[10, 'a', 3]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 3]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 3]], [['b', 1]], [['a', 1]]]), [[10, 3]])
    check('null key', solve([[[10, None, 3]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 3]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -3]])
    check('left multiplicity', solve([[[10, 'a', 4]], [], [['a', 1]]]), [[10, 4]])
elif N == 4:
    check('new right key', solve([[[10, 'a', 4]], [], [['a', 1]]]), [[10, 4]])
    check('last right removed', solve([[[10, 'a', 4]], [['a', 1]], [['a', -1]]]), [[10, -4]])
    check('right duplicate remains', solve([[[10, 'a', 4]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 4]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 4]], [['b', 1]], [['a', 1]]]), [[10, 4]])
    check('null key', solve([[[10, None, 4]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 4]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -4]])
    check('left multiplicity', solve([[[10, 'a', 5]], [], [['a', 1]]]), [[10, 5]])
elif N == 5:
    check('new right key', solve([[[10, 'a', 5]], [], [['a', 1]]]), [[10, 5]])
    check('last right removed', solve([[[10, 'a', 5]], [['a', 1]], [['a', -1]]]), [[10, -5]])
    check('right duplicate remains', solve([[[10, 'a', 5]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 5]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 5]], [['b', 1]], [['a', 1]]]), [[10, 5]])
    check('null key', solve([[[10, None, 5]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 5]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -5]])
    check('left multiplicity', solve([[[10, 'a', 6]], [], [['a', 1]]]), [[10, 6]])
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
new right key[[10, 1]][[10, 1]]Passed
last right removed[[10, -1]][[10, -1]]Passed
right duplicate remains[][]Passed
right batch cancellation[][]Passed
other right key[][[10, 1]]Failed
null key[][]Passed
two removals cross zero[[10, -1]][[10, -1]]Passed
left multiplicity[[10, 2]][[10, 2]]Passed

SHA-256 / 45bff2ad77f1f8456ed4c33b41a9c065df0c9c98a5c5fe5e513e5a0ff0f5c26e

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    try:
        left,old,delta=d
        before=dict(old); after=dict(old)
        for key,weight in delta: after[key]=after.get(key,0)+weight
        out=[]
        for ident,key,multiplicity in left:
            if key is None: continue
            was=sum(before.values())>0; now=sum(after.values())>0
            if was!=now: out.append([ident,multiplicity*(1 if now else -1)])
        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('new right key', solve([[[10, 'a', 1]], [], [['a', 1]]]), [[10, 1]])
    check('last right removed', solve([[[10, 'a', 1]], [['a', 1]], [['a', -1]]]), [[10, -1]])
    check('right duplicate remains', solve([[[10, 'a', 1]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 1]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 1]], [['b', 1]], [['a', 1]]]), [[10, 1]])
    check('null key', solve([[[10, None, 1]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 1]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -1]])
    check('left multiplicity', solve([[[10, 'a', 2]], [], [['a', 1]]]), [[10, 2]])
elif N == 2:
    check('new right key', solve([[[10, 'a', 2]], [], [['a', 1]]]), [[10, 2]])
    check('last right removed', solve([[[10, 'a', 2]], [['a', 1]], [['a', -1]]]), [[10, -2]])
    check('right duplicate remains', solve([[[10, 'a', 2]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 2]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 2]], [['b', 1]], [['a', 1]]]), [[10, 2]])
    check('null key', solve([[[10, None, 2]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 2]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -2]])
    check('left multiplicity', solve([[[10, 'a', 3]], [], [['a', 1]]]), [[10, 3]])
elif N == 3:
    check('new right key', solve([[[10, 'a', 3]], [], [['a', 1]]]), [[10, 3]])
    check('last right removed', solve([[[10, 'a', 3]], [['a', 1]], [['a', -1]]]), [[10, -3]])
    check('right duplicate remains', solve([[[10, 'a', 3]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 3]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 3]], [['b', 1]], [['a', 1]]]), [[10, 3]])
    check('null key', solve([[[10, None, 3]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 3]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -3]])
    check('left multiplicity', solve([[[10, 'a', 4]], [], [['a', 1]]]), [[10, 4]])
elif N == 4:
    check('new right key', solve([[[10, 'a', 4]], [], [['a', 1]]]), [[10, 4]])
    check('last right removed', solve([[[10, 'a', 4]], [['a', 1]], [['a', -1]]]), [[10, -4]])
    check('right duplicate remains', solve([[[10, 'a', 4]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 4]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 4]], [['b', 1]], [['a', 1]]]), [[10, 4]])
    check('null key', solve([[[10, None, 4]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 4]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -4]])
    check('left multiplicity', solve([[[10, 'a', 5]], [], [['a', 1]]]), [[10, 5]])
elif N == 5:
    check('new right key', solve([[[10, 'a', 5]], [], [['a', 1]]]), [[10, 5]])
    check('last right removed', solve([[[10, 'a', 5]], [['a', 1]], [['a', -1]]]), [[10, -5]])
    check('right duplicate remains', solve([[[10, 'a', 5]], [['a', 2]], [['a', -1]]]), [])
    check('right batch cancellation', solve([[[10, 'a', 5]], [], [['a', 1], ['a', -1]]]), [])
    check('other right key', solve([[[10, 'a', 5]], [['b', 1]], [['a', 1]]]), [[10, 5]])
    check('null key', solve([[[10, None, 5]], [], [[None, 1]]]), [])
    check('two removals cross zero', solve([[[10, 'a', 5]], [['a', 2]], [['a', -1], ['a', -1]]]), [[10, -5]])
    check('left multiplicity', solve([[[10, 'a', 6]], [], [['a', 1]]]), [[10, 6]])
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
new right key[[10, 1]][[10, 1]]Passed
last right removed[[10, -1]][[10, -1]]Passed
right duplicate remains[][]Passed
right batch cancellation[][]Passed
other right key[][[10, 1]]Failed
null key[][]Passed
two removals cross zero[[10, -1]][[10, -1]]Passed
left multiplicity[[10, 2]][[10, 2]]Passed

SHA-256 / 69ad7a977372cd967332e40a9c73f35429e5d21eaff5639064d306e099df377b

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 8 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

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

Case digest / fc9971871acb6bad59a2b766357db2566ba9608681b56c1bec425edd3476f0bb