{"abstract":"Merge join matches only the first row of a repeated left key.","category":"Data systems","checks":7,"contract":"Join two key-sorted non-null relations [key,id] by matching equal-key runs. Emit the full left-major Cartesian product for each matching run. Advance the lower unmatched run and preserve physical order within equal-key runs.","contract_signature":"d","evaluation_group":"s3-data-systems-merge-join-runs","failed_approach":"Comparing whole rows rather than keys breaks runs with distinct row IDs.","family":"s3-data-systems-merge-join-runs-left-run","id":"FA-44971","implementations":{"attempt":{"sha256":"40baefbf430043d14347a3d1c6fc0f673bcf3c81ed3742c132de0412e00bca1f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        left,right=d\n        i=j=0; out=[]\n        while i<len(left) and j<len(right):\n            a=left[i][0]; b=right[j][0]\n            if a<b: i+=1; continue\n            if a>b: j+=1; continue\n            ie=i+1\n            while ie<len(left) and left[ie]==left[i]: ie+=1\n            je=j+1\n            while je<len(right) and right[je][0]==b: je+=1\n            for x in left[i:ie]:\n                for y in right[j:je]: out.append([x[1],y[1]])\n            i,j=ie,je\n        return out\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('duplicate runs', solve([[[1, 10], [1, 11]], [[1, 20], [1, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[1, 10], [2, 11]], [[2, 20]]]), [[11, 20]])\n    check('right gap', solve([[[2, 10]], [[1, 20], [2, 21]]]), [[10, 21]])\n    check('single match', solve([[[1, 10]], [[1, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[1, 10]], [[3, 20]]]), [])\n    check('empty left', solve([[], [[1, 20]]]), [])\n    check('empty right', solve([[[1, 10]], []]), [])\nelif N == 2:\n    check('duplicate runs', solve([[[2, 10], [2, 11]], [[2, 20], [2, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[2, 10], [3, 11]], [[3, 20]]]), [[11, 20]])\n    check('right gap', solve([[[3, 10]], [[2, 20], [3, 21]]]), [[10, 21]])\n    check('single match', solve([[[2, 10]], [[2, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[2, 10]], [[4, 20]]]), [])\n    check('empty left', solve([[], [[2, 20]]]), [])\n    check('empty right', solve([[[2, 10]], []]), [])\nelif N == 3:\n    check('duplicate runs', solve([[[3, 10], [3, 11]], [[3, 20], [3, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[3, 10], [4, 11]], [[4, 20]]]), [[11, 20]])\n    check('right gap', solve([[[4, 10]], [[3, 20], [4, 21]]]), [[10, 21]])\n    check('single match', solve([[[3, 10]], [[3, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[3, 10]], [[5, 20]]]), [])\n    check('empty left', solve([[], [[3, 20]]]), [])\n    check('empty right', solve([[[3, 10]], []]), [])\nelif N == 4:\n    check('duplicate runs', solve([[[4, 10], [4, 11]], [[4, 20], [4, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[4, 10], [5, 11]], [[5, 20]]]), [[11, 20]])\n    check('right gap', solve([[[5, 10]], [[4, 20], [5, 21]]]), [[10, 21]])\n    check('single match', solve([[[4, 10]], [[4, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[4, 10]], [[6, 20]]]), [])\n    check('empty left', solve([[], [[4, 20]]]), [])\n    check('empty right', solve([[[4, 10]], []]), [])\nelif N == 5:\n    check('duplicate runs', solve([[[5, 10], [5, 11]], [[5, 20], [5, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[5, 10], [6, 11]], [[6, 20]]]), [[11, 20]])\n    check('right gap', solve([[[6, 10]], [[5, 20], [6, 21]]]), [[10, 21]])\n    check('single match', solve([[[5, 10]], [[5, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[5, 10]], [[7, 20]]]), [])\n    check('empty left', solve([[], [[5, 20]]]), [])\n    check('empty right', solve([[[5, 10]], []]), [])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"e7d52b8960ddc5287a8a502467052d16d33a897445d7bf76bf4414f7682b72bf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        left,right=d\n        i=j=0; out=[]\n        while i<len(left) and j<len(right):\n            a=left[i][0]; b=right[j][0]\n            if a<b: i+=1; continue\n            if a>b: j+=1; continue\n            ie=i+1\n            while False: ie+=1\n            je=j+1\n            while je<len(right) and right[je][0]==b: je+=1\n            for x in left[i:ie]:\n                for y in right[j:je]: out.append([x[1],y[1]])\n            i,j=ie,je\n        return out\n    except (IndexError, KeyError, ValueError, StopIteration) as exc:\n        return {\"representation_error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('duplicate runs', solve([[[1, 10], [1, 11]], [[1, 20], [1, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[1, 10], [2, 11]], [[2, 20]]]), [[11, 20]])\n    check('right gap', solve([[[2, 10]], [[1, 20], [2, 21]]]), [[10, 21]])\n    check('single match', solve([[[1, 10]], [[1, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[1, 10]], [[3, 20]]]), [])\n    check('empty left', solve([[], [[1, 20]]]), [])\n    check('empty right', solve([[[1, 10]], []]), [])\nelif N == 2:\n    check('duplicate runs', solve([[[2, 10], [2, 11]], [[2, 20], [2, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[2, 10], [3, 11]], [[3, 20]]]), [[11, 20]])\n    check('right gap', solve([[[3, 10]], [[2, 20], [3, 21]]]), [[10, 21]])\n    check('single match', solve([[[2, 10]], [[2, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[2, 10]], [[4, 20]]]), [])\n    check('empty left', solve([[], [[2, 20]]]), [])\n    check('empty right', solve([[[2, 10]], []]), [])\nelif N == 3:\n    check('duplicate runs', solve([[[3, 10], [3, 11]], [[3, 20], [3, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[3, 10], [4, 11]], [[4, 20]]]), [[11, 20]])\n    check('right gap', solve([[[4, 10]], [[3, 20], [4, 21]]]), [[10, 21]])\n    check('single match', solve([[[3, 10]], [[3, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[3, 10]], [[5, 20]]]), [])\n    check('empty left', solve([[], [[3, 20]]]), [])\n    check('empty right', solve([[[3, 10]], []]), [])\nelif N == 4:\n    check('duplicate runs', solve([[[4, 10], [4, 11]], [[4, 20], [4, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[4, 10], [5, 11]], [[5, 20]]]), [[11, 20]])\n    check('right gap', solve([[[5, 10]], [[4, 20], [5, 21]]]), [[10, 21]])\n    check('single match', solve([[[4, 10]], [[4, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[4, 10]], [[6, 20]]]), [])\n    check('empty left', solve([[], [[4, 20]]]), [])\n    check('empty right', solve([[[4, 10]], []]), [])\nelif N == 5:\n    check('duplicate runs', solve([[[5, 10], [5, 11]], [[5, 20], [5, 21]]]), [[10, 20], [10, 21], [11, 20], [11, 21]])\n    check('left gap', solve([[[5, 10], [6, 11]], [[6, 20]]]), [[11, 20]])\n    check('right gap', solve([[[6, 10]], [[5, 20], [6, 21]]]), [[10, 21]])\n    check('single match', solve([[[5, 10]], [[5, 20]]]), [[10, 20]])\n    check('no overlap', solve([[[5, 10]], [[7, 20]]]), [])\n    check('empty left', solve([[], [[5, 20]]]), [])\n    check('empty right', solve([[[5, 10]], []]), [])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-data-systems-merge-join-runs-left-run","generated_at":"2026-09-29T14:44:17.685378+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A bounded deterministic data engine model makes representation and changelog faults reproducible.","root_cause":"merge-join-runs: Merge join matches only the first row of a repeated left key.","sha256":"3ed7a188107de8ad533ffcae93680284386e587b53d1fe74d07f16db762f3815","title":"Merge join matches only the first row of a repeated left key · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":45.39,"exit_code":1,"observations":[{"actual":[[10,20],[10,21]],"check":"duplicate runs","expected":[[10,20],[10,21],[11,20],[11,21]],"passed":false},{"actual":[[11,20]],"check":"left gap","expected":[[11,20]],"passed":true},{"actual":[[10,21]],"check":"right gap","expected":[[10,21]],"passed":true},{"actual":[[10,20]],"check":"single match","expected":[[10,20]],"passed":true},{"actual":[],"check":"no overlap","expected":[],"passed":true},{"actual":[],"check":"empty left","expected":[],"passed":true},{"actual":[],"check":"empty right","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicate runs\", \"actual\": [[10, 20], [10, 21]], \"expected\": [[10, 20], [10, 21], [11, 20], [11, 21]], \"passed\": false}, {\"check\": \"left gap\", \"actual\": [[11, 20]], \"expected\": [[11, 20]], \"passed\": true}, {\"check\": \"right gap\", \"actual\": [[10, 21]], \"expected\": [[10, 21]], \"passed\": true}, {\"check\": \"single match\", \"actual\": [[10, 20]], \"expected\": [[10, 20]], \"passed\": true}, {\"check\": \"no overlap\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty left\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty right\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.626,"exit_code":1,"observations":[{"actual":[[10,20],[10,21]],"check":"duplicate runs","expected":[[10,20],[10,21],[11,20],[11,21]],"passed":false},{"actual":[[11,20]],"check":"left gap","expected":[[11,20]],"passed":true},{"actual":[[10,21]],"check":"right gap","expected":[[10,21]],"passed":true},{"actual":[[10,20]],"check":"single match","expected":[[10,20]],"passed":true},{"actual":[],"check":"no overlap","expected":[],"passed":true},{"actual":[],"check":"empty left","expected":[],"passed":true},{"actual":[],"check":"empty right","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicate runs\", \"actual\": [[10, 20], [10, 21]], \"expected\": [[10, 20], [10, 21], [11, 20], [11, 21]], \"passed\": false}, {\"check\": \"left gap\", \"actual\": [[11, 20]], \"expected\": [[11, 20]], \"passed\": true}, {\"check\": \"right gap\", \"actual\": [[10, 21]], \"expected\": [[10, 21]], \"passed\": true}, {\"check\": \"single match\", \"actual\": [[10, 20]], \"expected\": [[10, 20]], \"passed\": true}, {\"check\": \"no overlap\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty left\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty right\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}