FAILURE MAP
← Case archive

FA-44621 / Data systems / Open access

Join delta weights lose retraction signs · case 01

Join delta weights lose retraction signs.

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

ROOT CAUSE

delta-inner-join: Join delta weights lose retraction signs.

THE FAILURE

delta-inner-join: Join delta weights lose retraction signs.

Unsuccessful approach: Preserving only left signs still turns right retractions into additions.

Case contract

Apply simultaneous signed changes to two bag relations. Emit the consolidated join delta Ldelta*Rold + Lold*Rdelta + Ldelta*Rdelta. Inputs are [key,value,weight]; ordinary non-null equality joins. Return sorted [leftvalue,rightvalue,weight] nonzero rows.

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,right,dl,dr=d
        terms=[(dl,right),(left,dr),(dl,dr)]
        weights={}
        for a,b in terms:
            for ka,va,wa in a:
                for kb,vb,wb in b:
                    if ka is None or kb is None or ka!=kb: continue
                    key=(va,vb)
                    weights[key]=weights.get(key,0)+abs(wa*wb)
        return [[a,b,w] for (a,b),w in sorted(weights.items()) if w!=0]
    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('simultaneous insert', solve([[], [], [['k', 1, 1]], [['k', 2, 1]]]), [[1, 2, 1]])
    check('right retraction', solve([[['k', 1, 2]], [['k', 2, 1]], [], [['k', 2, -1]]]), [[1, 2, -2]])
    check('left retraction', solve([[['k', 1, 1]], [['k', 2, 3]], [['k', 1, -1]], []]), [[1, 2, -3]])
    check('null equality', solve([[], [[None, 2, 1]], [[None, 1, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 2, 1]], [['k', 1, 1], ['k', 1, -1]], []]), [])
    check('two payloads', solve([[], [['k', 2, 1], ['k', 3, 1]], [['k', 1, 1]], []]), [[1, 2, 1], [1, 3, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 2:
    check('simultaneous insert', solve([[], [], [['k', 2, 1]], [['k', 3, 1]]]), [[2, 3, 1]])
    check('right retraction', solve([[['k', 2, 2]], [['k', 3, 1]], [], [['k', 3, -1]]]), [[2, 3, -2]])
    check('left retraction', solve([[['k', 2, 1]], [['k', 3, 3]], [['k', 2, -1]], []]), [[2, 3, -3]])
    check('null equality', solve([[], [[None, 3, 1]], [[None, 2, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 3, 1]], [['k', 2, 1], ['k', 2, -1]], []]), [])
    check('two payloads', solve([[], [['k', 3, 1], ['k', 4, 1]], [['k', 2, 1]], []]), [[2, 3, 1], [2, 4, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 3:
    check('simultaneous insert', solve([[], [], [['k', 3, 1]], [['k', 4, 1]]]), [[3, 4, 1]])
    check('right retraction', solve([[['k', 3, 2]], [['k', 4, 1]], [], [['k', 4, -1]]]), [[3, 4, -2]])
    check('left retraction', solve([[['k', 3, 1]], [['k', 4, 3]], [['k', 3, -1]], []]), [[3, 4, -3]])
    check('null equality', solve([[], [[None, 4, 1]], [[None, 3, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 4, 1]], [['k', 3, 1], ['k', 3, -1]], []]), [])
    check('two payloads', solve([[], [['k', 4, 1], ['k', 5, 1]], [['k', 3, 1]], []]), [[3, 4, 1], [3, 5, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 4:
    check('simultaneous insert', solve([[], [], [['k', 4, 1]], [['k', 5, 1]]]), [[4, 5, 1]])
    check('right retraction', solve([[['k', 4, 2]], [['k', 5, 1]], [], [['k', 5, -1]]]), [[4, 5, -2]])
    check('left retraction', solve([[['k', 4, 1]], [['k', 5, 3]], [['k', 4, -1]], []]), [[4, 5, -3]])
    check('null equality', solve([[], [[None, 5, 1]], [[None, 4, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 5, 1]], [['k', 4, 1], ['k', 4, -1]], []]), [])
    check('two payloads', solve([[], [['k', 5, 1], ['k', 6, 1]], [['k', 4, 1]], []]), [[4, 5, 1], [4, 6, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 5:
    check('simultaneous insert', solve([[], [], [['k', 5, 1]], [['k', 6, 1]]]), [[5, 6, 1]])
    check('right retraction', solve([[['k', 5, 2]], [['k', 6, 1]], [], [['k', 6, -1]]]), [[5, 6, -2]])
    check('left retraction', solve([[['k', 5, 1]], [['k', 6, 3]], [['k', 5, -1]], []]), [[5, 6, -3]])
    check('null equality', solve([[], [[None, 6, 1]], [[None, 5, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 6, 1]], [['k', 5, 1], ['k', 5, -1]], []]), [])
    check('two payloads', solve([[], [['k', 6, 1], ['k', 7, 1]], [['k', 5, 1]], []]), [[5, 6, 1], [5, 7, 1]])
    check('empty change', 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
simultaneous insert[[1, 2, 1]][[1, 2, 1]]Passed
right retraction[[1, 2, 2]][[1, 2, -2]]Failed
left retraction[[1, 2, 3]][[1, 2, -3]]Failed
null equality[][]Passed
cancelled delta[[1, 2, 2]][]Failed
two payloads[[1, 2, 1], [1, 3, 1]][[1, 2, 1], [1, 3, 1]]Passed
empty change[][]Passed

SHA-256 / b0278d25dcf05acb910fd05b22cb075f3d696c53abf95ed1bd7febbd97f70ff4

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    try:
        left,right,dl,dr=d
        terms=[(dl,right),(left,dr),(dl,dr)]
        weights={}
        for a,b in terms:
            for ka,va,wa in a:
                for kb,vb,wb in b:
                    if ka is None or kb is None or ka!=kb: continue
                    key=(va,vb)
                    weights[key]=weights.get(key,0)+wa*abs(wb)
        return [[a,b,w] for (a,b),w in sorted(weights.items()) if w!=0]
    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('simultaneous insert', solve([[], [], [['k', 1, 1]], [['k', 2, 1]]]), [[1, 2, 1]])
    check('right retraction', solve([[['k', 1, 2]], [['k', 2, 1]], [], [['k', 2, -1]]]), [[1, 2, -2]])
    check('left retraction', solve([[['k', 1, 1]], [['k', 2, 3]], [['k', 1, -1]], []]), [[1, 2, -3]])
    check('null equality', solve([[], [[None, 2, 1]], [[None, 1, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 2, 1]], [['k', 1, 1], ['k', 1, -1]], []]), [])
    check('two payloads', solve([[], [['k', 2, 1], ['k', 3, 1]], [['k', 1, 1]], []]), [[1, 2, 1], [1, 3, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 2:
    check('simultaneous insert', solve([[], [], [['k', 2, 1]], [['k', 3, 1]]]), [[2, 3, 1]])
    check('right retraction', solve([[['k', 2, 2]], [['k', 3, 1]], [], [['k', 3, -1]]]), [[2, 3, -2]])
    check('left retraction', solve([[['k', 2, 1]], [['k', 3, 3]], [['k', 2, -1]], []]), [[2, 3, -3]])
    check('null equality', solve([[], [[None, 3, 1]], [[None, 2, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 3, 1]], [['k', 2, 1], ['k', 2, -1]], []]), [])
    check('two payloads', solve([[], [['k', 3, 1], ['k', 4, 1]], [['k', 2, 1]], []]), [[2, 3, 1], [2, 4, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 3:
    check('simultaneous insert', solve([[], [], [['k', 3, 1]], [['k', 4, 1]]]), [[3, 4, 1]])
    check('right retraction', solve([[['k', 3, 2]], [['k', 4, 1]], [], [['k', 4, -1]]]), [[3, 4, -2]])
    check('left retraction', solve([[['k', 3, 1]], [['k', 4, 3]], [['k', 3, -1]], []]), [[3, 4, -3]])
    check('null equality', solve([[], [[None, 4, 1]], [[None, 3, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 4, 1]], [['k', 3, 1], ['k', 3, -1]], []]), [])
    check('two payloads', solve([[], [['k', 4, 1], ['k', 5, 1]], [['k', 3, 1]], []]), [[3, 4, 1], [3, 5, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 4:
    check('simultaneous insert', solve([[], [], [['k', 4, 1]], [['k', 5, 1]]]), [[4, 5, 1]])
    check('right retraction', solve([[['k', 4, 2]], [['k', 5, 1]], [], [['k', 5, -1]]]), [[4, 5, -2]])
    check('left retraction', solve([[['k', 4, 1]], [['k', 5, 3]], [['k', 4, -1]], []]), [[4, 5, -3]])
    check('null equality', solve([[], [[None, 5, 1]], [[None, 4, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 5, 1]], [['k', 4, 1], ['k', 4, -1]], []]), [])
    check('two payloads', solve([[], [['k', 5, 1], ['k', 6, 1]], [['k', 4, 1]], []]), [[4, 5, 1], [4, 6, 1]])
    check('empty change', solve([[], [], [], []]), [])
elif N == 5:
    check('simultaneous insert', solve([[], [], [['k', 5, 1]], [['k', 6, 1]]]), [[5, 6, 1]])
    check('right retraction', solve([[['k', 5, 2]], [['k', 6, 1]], [], [['k', 6, -1]]]), [[5, 6, -2]])
    check('left retraction', solve([[['k', 5, 1]], [['k', 6, 3]], [['k', 5, -1]], []]), [[5, 6, -3]])
    check('null equality', solve([[], [[None, 6, 1]], [[None, 5, 1]], []]), [])
    check('cancelled delta', solve([[], [['k', 6, 1]], [['k', 5, 1], ['k', 5, -1]], []]), [])
    check('two payloads', solve([[], [['k', 6, 1], ['k', 7, 1]], [['k', 5, 1]], []]), [[5, 6, 1], [5, 7, 1]])
    check('empty change', 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
simultaneous insert[[1, 2, 1]][[1, 2, 1]]Passed
right retraction[[1, 2, 2]][[1, 2, -2]]Failed
left retraction[[1, 2, -3]][[1, 2, -3]]Passed
null equality[][]Passed
cancelled delta[][]Passed
two payloads[[1, 2, 1], [1, 3, 1]][[1, 2, 1], [1, 3, 1]]Passed
empty change[][]Passed

SHA-256 / 1d2890ace549a2fd2d1c72d47f6275b6ec7820ab1bc6706e9f6ff33d19b945fa

HELD IN THE MEMBER ARCHIVE

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

This mechanism has 7 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:14.163433+00:00.

Case digest / e421a4faf5135ceee2d4ee0efa0edca0ef3757f24fd20ef1f14dfb8ac6a0be40