FAILURE MAP
← Case archive

FA-161 / Storage and queries / Open access

An overlap join misses containment or admits adjacent nonoverlapping intervals · case 01

An interval join drops a left interval entirely enclosed by a right interval, then an endpoint-based repair creates false matches.

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

ROOT CAUSE

Testing only one interval's start is insufficient for containment; inclusive comparisons also misinterpret half-open intervals.

VERIFIED REPAIR

Require both intervals to be nonempty and compare max(start) < min(end), preserving relation multiplicity and order.

Unsuccessful approach: Checking inclusive end-to-start comparisons handles containment but joins touching boundaries and empty intervals.

Case contract

Each input row is [string_id,integer_start,integer_end] with start <= end. Treat intervals as half-open. Return [left_id,right_id] for every pair with a nonempty intersection, in left input order then right input order.

Why this case matters

Isolates a temporal join predicate, including containment, symmetry and degenerate intervals. It is distinct from assigning point samples to windows and does not implement a temporal-index query planner.

1 / The failure

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

N = 1
observations = []
def solve(left, right):
    return [[a[0], b[0]] for a in left for b in right if a[1] <= b[1] < a[2]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left interval is fully contained', solve([['a', N, 2*N]], [['b', 0, 3*N]]), [['a', 'b']])
check('right interval is fully contained', solve([['a', 0, 3*N]], [['b', N, 2*N]]), [['a', 'b']])
check('touching boundary is not an overlap', solve([['a', 0, N]], [['b', N, 2*N]]), [])
check('empty interval does not join an enclosing interval', solve([['a', N, N]], [['b', 0, 2*N]]), [])
check('right empty interval is not a point event', solve([['a', 0, 2*N]], [['b', N, N]]), [])
check('partial intersection crosses starting order', solve([['a', N, 3*N]], [['b', 0, 2*N]]), [['a', 'b']])
check('ordered many-to-many pairs', solve([['a', 0, 2*N], ['c', 2*N, 4*N]], [['b', N, 3*N], ['d', 4*N, 5*N]]), [['a', 'b'], ['c', 'b']])
check('empty relation', solve([], [['b', 0, N]]), [])
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
left interval is fully contained[][['a', 'b']]Failed
right interval is fully contained[['a', 'b']][['a', 'b']]Passed
touching boundary is not an overlap[][]Passed
empty interval does not join an enclosing interval[][]Passed
right empty interval is not a point event[['a', 'b']][]Failed
partial intersection crosses starting order[][['a', 'b']]Failed
ordered many-to-many pairs[['a', 'b']][['a', 'b'], ['c', 'b']]Failed
empty relation[][]Passed

SHA-256 / 565b1e539242c4889cca505dec10afa14a883053004608cdae0536ad17131f7f

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(left, right):
    return [[a[0], b[0]] for a in left for b in right if a[1] <= b[2] and b[1] <= a[2]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left interval is fully contained', solve([['a', N, 2*N]], [['b', 0, 3*N]]), [['a', 'b']])
check('right interval is fully contained', solve([['a', 0, 3*N]], [['b', N, 2*N]]), [['a', 'b']])
check('touching boundary is not an overlap', solve([['a', 0, N]], [['b', N, 2*N]]), [])
check('empty interval does not join an enclosing interval', solve([['a', N, N]], [['b', 0, 2*N]]), [])
check('right empty interval is not a point event', solve([['a', 0, 2*N]], [['b', N, N]]), [])
check('partial intersection crosses starting order', solve([['a', N, 3*N]], [['b', 0, 2*N]]), [['a', 'b']])
check('ordered many-to-many pairs', solve([['a', 0, 2*N], ['c', 2*N, 4*N]], [['b', N, 3*N], ['d', 4*N, 5*N]]), [['a', 'b'], ['c', 'b']])
check('empty relation', solve([], [['b', 0, N]]), [])
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
left interval is fully contained[['a', 'b']][['a', 'b']]Passed
right interval is fully contained[['a', 'b']][['a', 'b']]Passed
touching boundary is not an overlap[['a', 'b']][]Failed
empty interval does not join an enclosing interval[['a', 'b']][]Failed
right empty interval is not a point event[['a', 'b']][]Failed
partial intersection crosses starting order[['a', 'b']][['a', 'b']]Passed
ordered many-to-many pairs[['a', 'b'], ['c', 'b'], ['c', 'd']][['a', 'b'], ['c', 'b']]Failed
empty relation[][]Passed

SHA-256 / 5790b3306d8200d97a67a8dc9aeea44c06f1c0b9bad6d3292ee2294b4a5defda

3 / The verified repair

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

N = 1
observations = []
def solve(left, right):
    return [[a[0], b[0]] for a in left for b in right if a[1] < a[2] and b[1] < b[2] and max(a[1], b[1]) < min(a[2], b[2])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('left interval is fully contained', solve([['a', N, 2*N]], [['b', 0, 3*N]]), [['a', 'b']])
check('right interval is fully contained', solve([['a', 0, 3*N]], [['b', N, 2*N]]), [['a', 'b']])
check('touching boundary is not an overlap', solve([['a', 0, N]], [['b', N, 2*N]]), [])
check('empty interval does not join an enclosing interval', solve([['a', N, N]], [['b', 0, 2*N]]), [])
check('right empty interval is not a point event', solve([['a', 0, 2*N]], [['b', N, N]]), [])
check('partial intersection crosses starting order', solve([['a', N, 3*N]], [['b', 0, 2*N]]), [['a', 'b']])
check('ordered many-to-many pairs', solve([['a', 0, 2*N], ['c', 2*N, 4*N]], [['b', N, 3*N], ['d', 4*N, 5*N]]), [['a', 'b'], ['c', 'b']])
check('empty relation', solve([], [['b', 0, N]]), [])
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
left interval is fully contained[['a', 'b']][['a', 'b']]Passed
right interval is fully contained[['a', 'b']][['a', 'b']]Passed
touching boundary is not an overlap[][]Passed
empty interval does not join an enclosing interval[][]Passed
right empty interval is not a point event[][]Passed
partial intersection crosses starting order[['a', 'b']][['a', 'b']]Passed
ordered many-to-many pairs[['a', 'b'], ['c', 'b']][['a', 'b'], ['c', 'b']]Passed
empty relation[][]Passed

SHA-256 / 3e5b36b9a983cb4f3e95aef6a98f91176f690bd61f95576264f138fa5994a0a6

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

Case digest / b0267043968b8157e3259a862caf57e916d50f6d6c3f228d40f7dc7be26ef45d