{"abstract":"Batch packing retains byte occupancy after flushing rows.","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.","contract_signature":"d","evaluation_group":"s3-data-systems-row-batch-packing","failed_approach":"Charging the pending row before appending it double counts its bytes.","family":"s3-data-systems-row-batch-packing-flush-reset","id":"FA-45191","implementations":{"attempt":{"sha256":"e469dc095b5df019bf980b2ff622c5b237310e2f02314831471ce0cd25991125","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=size\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"},"broken":{"sha256":"1f4269d88b5f9c6000689f680bc87a87183aa8de09f1304c04296b19aa2f47cd","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=[]\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-flush-reset","generated_at":"2026-09-29T14:44:19.851434+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":"row-batch-packing: Batch packing retains byte occupancy after flushing rows.","sha256":"ffa9e3d91a6793599174719a17ec0adcd1ab066b8ac9df25b5b81abca159becb","title":"Batch packing retains byte occupancy after flushing rows · 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":47.877,"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":false},{"actual":[[1],[2],[3,4]],"check":"reset after flush","expected":[[1],[2,3],[4]],"passed":false},{"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":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\": false}, {\"check\": \"reset after flush\", \"actual\": [[1], [2], [3, 4]], \"expected\": [[1], [2, 3], [4]], \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":51.373,"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":false},{"actual":[[1],[2],[3],[4]],"check":"reset after flush","expected":[[1],[2,3],[4]],"passed":false},{"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":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\": false}, {\"check\": \"reset after flush\", \"actual\": [[1], [2], [3], [4]], \"expected\": [[1], [2, 3], [4]], \"passed\": false}, {\"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\": 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."}}