{"abstract":"Batch packing drops the final partially filled batch.","category":"Data systems","checks":8,"contract":"Pack indivisible [id,size] rows into ordered batches under a positive byte budget. A row exceeding budget occupies its own batch. Flush before an overflowing row, permit exact fits, and omit empty batches.","evaluation_group":"s3-data-systems-row-batch-packing","failed_approach":"Dropping singleton tails still loses valid rows.","family":"s3-data-systems-row-batch-packing-tail-flush","id":"FA-45201","implementations":{"attempt":{"sha256":"2bb9e933a56e457044a573591dc4dc71df92ca94f89750968443b024a8b0d3a0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,budget=d\n        batches=[]; current=[]; used=0\n        for ident,size in rows:\n            if current and used+size>budget:\n                batches.append(current); current=[]; used=0\n            current.append(ident); used+=size\n            if size>budget:\n                batches.append(current); current=[]; used=0\n        if current and len(current)>1: batches.append(current)\n        return batches\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('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])\n    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])\n    check('single partial', solve([[[1, 1]], 3]), [[1]])\n    check('no rows', solve([[], 3]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])\nelif N == 2:\n    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])\n    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])\n    check('single partial', solve([[[1, 2]], 6]), [[1]])\n    check('no rows', solve([[], 6]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])\nelif N == 3:\n    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])\n    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])\n    check('single partial', solve([[[1, 3]], 9]), [[1]])\n    check('no rows', solve([[], 9]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])\nelif N == 4:\n    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])\n    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])\n    check('single partial', solve([[[1, 4]], 12]), [[1]])\n    check('no rows', solve([[], 12]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])\nelif N == 5:\n    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])\n    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])\n    check('single partial', solve([[[1, 5]], 15]), [[1]])\n    check('no rows', solve([[], 15]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])\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":"e5158fb0b931919ea377e6b6fbbfac28d98d8c98df9c1d85d409766210a2778b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,budget=d\n        batches=[]; current=[]; used=0\n        for ident,size in rows:\n            if current and used+size>budget:\n                batches.append(current); current=[]; used=0\n            current.append(ident); used+=size\n            if size>budget:\n                batches.append(current); current=[]; used=0\n        if current and used>=budget: batches.append(current)\n        return batches\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('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])\n    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])\n    check('single partial', solve([[[1, 1]], 3]), [[1]])\n    check('no rows', solve([[], 3]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])\nelif N == 2:\n    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])\n    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])\n    check('single partial', solve([[[1, 2]], 6]), [[1]])\n    check('no rows', solve([[], 6]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])\nelif N == 3:\n    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])\n    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])\n    check('single partial', solve([[[1, 3]], 9]), [[1]])\n    check('no rows', solve([[], 9]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])\nelif N == 4:\n    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])\n    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])\n    check('single partial', solve([[[1, 4]], 12]), [[1]])\n    check('no rows', solve([[], 12]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])\nelif N == 5:\n    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])\n    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])\n    check('single partial', solve([[[1, 5]], 15]), [[1]])\n    check('no rows', solve([[], 15]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])\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"},"fixed":{"sha256":"38740d6b6bf767ecfbd18edd55ee82214585d49d629c011cedc9fa6e4cb2c171","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(d):\n    try:\n        rows,budget=d\n        batches=[]; current=[]; used=0\n        for ident,size in rows:\n            if current and used+size>budget:\n                batches.append(current); current=[]; used=0\n            current.append(ident); used+=size\n            if size>budget:\n                batches.append(current); current=[]; used=0\n        if current: batches.append(current)\n        return batches\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('exact fit', solve([[[1, 1], [2, 1]], 2]), [[1, 2]])\n    check('byte budget', solve([[[1, 2], [2, 2], [3, 1]], 3]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 2], [2, 2], [3, 1], [4, 1]], 3]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 4], [2, 0]], 3]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 3], [2, 0]], 3]), [[1, 2]])\n    check('single partial', solve([[[1, 1]], 3]), [[1]])\n    check('no rows', solve([[], 3]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 1]), [[1, 2]])\nelif N == 2:\n    check('exact fit', solve([[[1, 2], [2, 2]], 4]), [[1, 2]])\n    check('byte budget', solve([[[1, 4], [2, 4], [3, 2]], 6]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 4], [2, 4], [3, 2], [4, 2]], 6]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 8], [2, 0]], 6]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 6], [2, 0]], 6]), [[1, 2]])\n    check('single partial', solve([[[1, 2]], 6]), [[1]])\n    check('no rows', solve([[], 6]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 2]), [[1, 2]])\nelif N == 3:\n    check('exact fit', solve([[[1, 3], [2, 3]], 6]), [[1, 2]])\n    check('byte budget', solve([[[1, 6], [2, 6], [3, 3]], 9]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 6], [2, 6], [3, 3], [4, 3]], 9]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 12], [2, 0]], 9]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 9], [2, 0]], 9]), [[1, 2]])\n    check('single partial', solve([[[1, 3]], 9]), [[1]])\n    check('no rows', solve([[], 9]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 3]), [[1, 2]])\nelif N == 4:\n    check('exact fit', solve([[[1, 4], [2, 4]], 8]), [[1, 2]])\n    check('byte budget', solve([[[1, 8], [2, 8], [3, 4]], 12]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 8], [2, 8], [3, 4], [4, 4]], 12]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 16], [2, 0]], 12]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 12], [2, 0]], 12]), [[1, 2]])\n    check('single partial', solve([[[1, 4]], 12]), [[1]])\n    check('no rows', solve([[], 12]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 4]), [[1, 2]])\nelif N == 5:\n    check('exact fit', solve([[[1, 5], [2, 5]], 10]), [[1, 2]])\n    check('byte budget', solve([[[1, 10], [2, 10], [3, 5]], 15]), [[1], [2, 3]])\n    check('reset after flush', solve([[[1, 10], [2, 10], [3, 5], [4, 5]], 15]), [[1], [2, 3], [4]])\n    check('oversize and zero', solve([[[1, 20], [2, 0]], 15]), [[1], [2]])\n    check('full followed by zero', solve([[[1, 15], [2, 0]], 15]), [[1, 2]])\n    check('single partial', solve([[[1, 5]], 15]), [[1]])\n    check('no rows', solve([[], 15]), [])\n    check('zero-sized rows', solve([[[1, 0], [2, 0]], 5]), [[1, 2]])\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-row-batch-packing-tail-flush","generated_at":"2026-09-29T14:44:19.786683+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.","repair":"Preserve the stated physical representation and operation order: Pack indivisible [id,size] rows into ordered batches under a positive byte budget. A row exceeding budget occupies its own batch. Flush before an overflowing row, permit exact fits, and omit empty batches.","root_cause":"row-batch-packing: Batch packing drops the final partially filled batch.","sha256":"6f5ca72b03a827f9ce32a8b8b7bb51af063af81dec8f267f0d5d00a0ea5f545f","title":"Batch packing drops the final partially filled batch · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.8,"exit_code":1,"observations":[{"actual":[[1,2]],"check":"exact fit","expected":[[1,2]],"passed":true},{"actual":[[1],[2,3]],"check":"byte budget","expected":[[1],[2,3]],"passed":true},{"actual":[[1],[2,3]],"check":"reset after flush","expected":[[1],[2,3],[4]],"passed":false},{"actual":[[1]],"check":"oversize and zero","expected":[[1],[2]],"passed":false},{"actual":[[1,2]],"check":"full followed by zero","expected":[[1,2]],"passed":true},{"actual":[],"check":"single partial","expected":[[1]],"passed":false},{"actual":[],"check":"no rows","expected":[],"passed":true},{"actual":[[1,2]],"check":"zero-sized rows","expected":[[1,2]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact fit\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"byte budget\", \"actual\": [[1], [2, 3]], \"expected\": [[1], [2, 3]], \"passed\": true}, {\"check\": \"reset after flush\", \"actual\": [[1], [2, 3]], \"expected\": [[1], [2, 3], [4]], \"passed\": false}, {\"check\": \"oversize and zero\", \"actual\": [[1]], \"expected\": [[1], [2]], \"passed\": false}, {\"check\": \"full followed by zero\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"single partial\", \"actual\": [], \"expected\": [[1]], \"passed\": false}, {\"check\": \"no rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero-sized rows\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":48.512,"exit_code":1,"observations":[{"actual":[[1,2]],"check":"exact fit","expected":[[1,2]],"passed":true},{"actual":[[1],[2,3]],"check":"byte budget","expected":[[1],[2,3]],"passed":true},{"actual":[[1],[2,3]],"check":"reset after flush","expected":[[1],[2,3],[4]],"passed":false},{"actual":[[1]],"check":"oversize and zero","expected":[[1],[2]],"passed":false},{"actual":[[1,2]],"check":"full followed by zero","expected":[[1,2]],"passed":true},{"actual":[],"check":"single partial","expected":[[1]],"passed":false},{"actual":[],"check":"no rows","expected":[],"passed":true},{"actual":[],"check":"zero-sized rows","expected":[[1,2]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact fit\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"byte budget\", \"actual\": [[1], [2, 3]], \"expected\": [[1], [2, 3]], \"passed\": true}, {\"check\": \"reset after flush\", \"actual\": [[1], [2, 3]], \"expected\": [[1], [2, 3], [4]], \"passed\": false}, {\"check\": \"oversize and zero\", \"actual\": [[1]], \"expected\": [[1], [2]], \"passed\": false}, {\"check\": \"full followed by zero\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"single partial\", \"actual\": [], \"expected\": [[1]], \"passed\": false}, {\"check\": \"no rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero-sized rows\", \"actual\": [], \"expected\": [[1, 2]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.07,"exit_code":0,"observations":[{"actual":[[1,2]],"check":"exact fit","expected":[[1,2]],"passed":true},{"actual":[[1],[2,3]],"check":"byte budget","expected":[[1],[2,3]],"passed":true},{"actual":[[1],[2,3],[4]],"check":"reset after flush","expected":[[1],[2,3],[4]],"passed":true},{"actual":[[1],[2]],"check":"oversize and zero","expected":[[1],[2]],"passed":true},{"actual":[[1,2]],"check":"full followed by zero","expected":[[1,2]],"passed":true},{"actual":[[1]],"check":"single partial","expected":[[1]],"passed":true},{"actual":[],"check":"no rows","expected":[],"passed":true},{"actual":[[1,2]],"check":"zero-sized rows","expected":[[1,2]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact fit\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"byte budget\", \"actual\": [[1], [2, 3]], \"expected\": [[1], [2, 3]], \"passed\": true}, {\"check\": \"reset after flush\", \"actual\": [[1], [2, 3], [4]], \"expected\": [[1], [2, 3], [4]], \"passed\": true}, {\"check\": \"oversize and zero\", \"actual\": [[1], [2]], \"expected\": [[1], [2]], \"passed\": true}, {\"check\": \"full followed by zero\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}, {\"check\": \"single partial\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"no rows\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"zero-sized rows\", \"actual\": [[1, 2]], \"expected\": [[1, 2]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}