{"abstract":"Batch packing accounts one byte per row regardless of row size.","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":"Replacing cumulative bytes with the last row size undercounts batches.","family":"s3-data-systems-row-batch-packing-occupancy","id":"FA-45186","implementations":{"attempt":{"sha256":"5af481ad9d1aadac826d6ec668e3abac8e0fc50949f5a5ceaddc82696c4cb5eb","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"},"broken":{"sha256":"dd9cea8e6115709dc78b70355aab40ee9af3e9ce4fcb90611850024bcc0b16f8","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+=1\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"},"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-occupancy","generated_at":"2026-09-29T14:44:19.657362+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 accounts one byte per row regardless of row size.","sha256":"5bc642d3c5ddaf679d5789e8c8f3650c58563f00c1fb1d52ec9764a4c8a9ca53","title":"Batch packing accounts one byte per row regardless of row size · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.638,"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,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\": true}, {\"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":46.569,"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"},"fixed":{"elapsed_ms":48.197,"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"}