FAILURE MAP
← Case archive

FA-45431 / Data systems / Open access

UNION pagination stops skipping after the first branch · case 01

UNION pagination stops skipping after the first branch.

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

ROOT CAUSE

union-global-pagination: UNION pagination stops skipping after the first branch.

VERIFIED REPAIR

Preserve the stated physical representation and operation order: Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

Unsuccessful approach: Clamping remaining skip to one branch loses offsets spanning multiple branches.

Case contract

Concatenate ordered input branches with bag semantics, then apply one global nonnegative offset and limit. Branch-local boundaries, empty branches, and repeated rows do not reset pagination counters. Output order is branch order then row order.

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:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            if branch is not branches[0]: remaining=0
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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
offset crosses branches[2, 3][3, 4]Failed
global limit[1, 2, 3][1, 2, 3]Passed
empty middle[2, 3][2, 3]Passed
duplicates[1, 1, 2][1, 1, 2]Passed
zero limit[][]Passed
large offset[2][]Failed
no branches[][]Passed

SHA-256 / 38eb5b574c9dc5e0b38ff8d65d0106c4e7a8be4e58a89e90f0458f0afbf59480

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            remaining=min(remaining,len(branch))
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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
offset crosses branches[2, 3][3, 4]Failed
global limit[1, 2, 3][1, 2, 3]Passed
empty middle[2, 3][2, 3]Passed
duplicates[1, 1, 2][1, 1, 2]Passed
zero limit[][]Passed
large offset[2][]Failed
no branches[][]Passed

SHA-256 / 09f13bdaf14f5ee1c6b02f5caa052ce7abc48f37b523ac097df5df84010b1914

3 / The verified repair

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

N = 1
observations = []
def solve(d):
    try:
        branches,offset,limit=d
        remaining=offset; out=[]
        for branch in branches:
            for row in branch:
                if remaining: remaining-=1; continue
                if len(out)>=limit: return out
                out.append(row)
        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('offset crosses branches', solve([[[1], [2, 3], [4]], 2, 2]), [3, 4])
    check('global limit', solve([[[1, 2], [3, 4]], 0, 3]), [1, 2, 3])
    check('empty middle', solve([[[1], [], [2, 3]], 1, 2]), [2, 3])
    check('duplicates', solve([[[1, 1], [2]], 0, 3]), [1, 1, 2])
    check('zero limit', solve([[[1]], 0, 0]), [])
    check('large offset', solve([[[1], [2]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 2:
    check('offset crosses branches', solve([[[2], [3, 4], [5]], 2, 2]), [4, 5])
    check('global limit', solve([[[2, 3], [4, 5]], 0, 3]), [2, 3, 4])
    check('empty middle', solve([[[2], [], [3, 4]], 1, 2]), [3, 4])
    check('duplicates', solve([[[2, 2], [3]], 0, 3]), [2, 2, 3])
    check('zero limit', solve([[[2]], 0, 0]), [])
    check('large offset', solve([[[2], [3]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 3:
    check('offset crosses branches', solve([[[3], [4, 5], [6]], 2, 2]), [5, 6])
    check('global limit', solve([[[3, 4], [5, 6]], 0, 3]), [3, 4, 5])
    check('empty middle', solve([[[3], [], [4, 5]], 1, 2]), [4, 5])
    check('duplicates', solve([[[3, 3], [4]], 0, 3]), [3, 3, 4])
    check('zero limit', solve([[[3]], 0, 0]), [])
    check('large offset', solve([[[3], [4]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 4:
    check('offset crosses branches', solve([[[4], [5, 6], [7]], 2, 2]), [6, 7])
    check('global limit', solve([[[4, 5], [6, 7]], 0, 3]), [4, 5, 6])
    check('empty middle', solve([[[4], [], [5, 6]], 1, 2]), [5, 6])
    check('duplicates', solve([[[4, 4], [5]], 0, 3]), [4, 4, 5])
    check('zero limit', solve([[[4]], 0, 0]), [])
    check('large offset', solve([[[4], [5]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
elif N == 5:
    check('offset crosses branches', solve([[[5], [6, 7], [8]], 2, 2]), [7, 8])
    check('global limit', solve([[[5, 6], [7, 8]], 0, 3]), [5, 6, 7])
    check('empty middle', solve([[[5], [], [6, 7]], 1, 2]), [6, 7])
    check('duplicates', solve([[[5, 5], [6]], 0, 3]), [5, 5, 6])
    check('zero limit', solve([[[5]], 0, 0]), [])
    check('large offset', solve([[[5], [6]], 4, 2]), [])
    check('no branches', solve([[], 0, 3]), [])
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
offset crosses branches[3, 4][3, 4]Passed
global limit[1, 2, 3][1, 2, 3]Passed
empty middle[2, 3][2, 3]Passed
duplicates[1, 1, 2][1, 1, 2]Passed
zero limit[][]Passed
large offset[][]Passed
no branches[][]Passed

SHA-256 / 7fd7fca5b594ad99cd6f1da4034f6f91f0ce114f9a38731abe6402f659d0170d

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

Case digest / 8ca1df7f40670d429f82e258b55ad5b5a5747c8a75cd2dbfc82301216debc64d