{"abstract":"Greedy packing flushes one token too early.","category":"Sequence batch packing","checks":6,"contract":"Append sequences in order to the current bin; flush only when adding the next sequence would exceed capacity. Return bins of sequences.","contract_signature":"sequences, capacity","evaluation_group":"w3-seqpack-greedy-bin-v1","failed_approach":"Allowing one extra token still accepts genuinely oversized bins.","family":"w3-sequence-batch-packing-greedy-flush-capacity","id":"FA-98041","implementations":{"attempt":{"sha256":"a68fe2e58df2504e6e125f2256d85214acff131ae5900076d1c79e36599e956a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sequences, capacity):\n    bins=[]; cur=[]; used=0\n    for s in sequences:\n        if used+len(s)>capacity+1 and cur: bins.append(cur); cur=[]; used=0\n        cur.append(s); used+=len(s)\n    if cur: bins.append(cur)\n    return bins\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na=[N]; b=[2]*N\ncheck('exact fill', solve([a,b],N+1), [[a,b]])\ncheck('must flush', solve([a,b],N), [[a],[b]])\ncheck('empty input', solve([],N), [])\ncheck('singleton', solve([a],N), [ [a] ])\ncheck('zero length follows', solve([[],[1]*N],N), [ [[],[1]*N] ])\ncheck('several bins', solve([[1]*N,[2],[3]*N],N), [[[1]*N],[[2]],[[3]*N]])\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":"739c1a62bf0201baff08ec61a7de9f0457b7d0f87416c09bb793e922204242e8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sequences, capacity):\n    bins=[]; cur=[]; used=0\n    for s in sequences:\n        if used+len(s)>=capacity and cur: bins.append(cur); cur=[]; used=0\n        cur.append(s); used+=len(s)\n    if cur: bins.append(cur)\n    return bins\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na=[N]; b=[2]*N\ncheck('exact fill', solve([a,b],N+1), [[a,b]])\ncheck('must flush', solve([a,b],N), [[a],[b]])\ncheck('empty input', solve([],N), [])\ncheck('singleton', solve([a],N), [ [a] ])\ncheck('zero length follows', solve([[],[1]*N],N), [ [[],[1]*N] ])\ncheck('several bins', solve([[1]*N,[2],[3]*N],N), [[[1]*N],[[2]],[[3]*N]])\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":"Inputs are short integer-token lists under the stated toy contract; results do not claim compatibility with a specific training framework. 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":"w3-sequence-batch-packing-greedy-flush-capacity","generated_at":"2026-09-30T16:48:08.895984+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"This deterministic toy packing rule models a common boundary in preparing bounded training sequences.","root_cause":"The capacity comparison treats an exact fit as overflow.","sha256":"ef9892de506e6f60b27b564921f21fd5a01785df90b3f094256f2e75c6d862ef","title":"Greedy packing flushes one token too early · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":29.87,"exit_code":1,"observations":[{"actual":[[[1],[2]]],"check":"exact fill","expected":[[[1],[2]]],"passed":true},{"actual":[[[1],[2]]],"check":"must flush","expected":[[[1]],[[2]]],"passed":false},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[[1]]],"check":"singleton","expected":[[[1]]],"passed":true},{"actual":[[[],[1]]],"check":"zero length follows","expected":[[[],[1]]],"passed":true},{"actual":[[[1],[2]],[[3]]],"check":"several bins","expected":[[[1]],[[2]],[[3]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact fill\", \"actual\": [[[1], [2]]], \"expected\": [[[1], [2]]], \"passed\": true}, {\"check\": \"must flush\", \"actual\": [[[1], [2]]], \"expected\": [[[1]], [[2]]], \"passed\": false}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [[[1]]], \"expected\": [[[1]]], \"passed\": true}, {\"check\": \"zero length follows\", \"actual\": [[[], [1]]], \"expected\": [[[], [1]]], \"passed\": true}, {\"check\": \"several bins\", \"actual\": [[[1], [2]], [[3]]], \"expected\": [[[1]], [[2]], [[3]]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.774,"exit_code":1,"observations":[{"actual":[[[1]],[[2]]],"check":"exact fill","expected":[[[1],[2]]],"passed":false},{"actual":[[[1]],[[2]]],"check":"must flush","expected":[[[1]],[[2]]],"passed":true},{"actual":[],"check":"empty input","expected":[],"passed":true},{"actual":[[[1]]],"check":"singleton","expected":[[[1]]],"passed":true},{"actual":[[[]],[[1]]],"check":"zero length follows","expected":[[[],[1]]],"passed":false},{"actual":[[[1]],[[2]],[[3]]],"check":"several bins","expected":[[[1]],[[2]],[[3]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"exact fill\", \"actual\": [[[1]], [[2]]], \"expected\": [[[1], [2]]], \"passed\": false}, {\"check\": \"must flush\", \"actual\": [[[1]], [[2]]], \"expected\": [[[1]], [[2]]], \"passed\": true}, {\"check\": \"empty input\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [[[1]]], \"expected\": [[[1]]], \"passed\": true}, {\"check\": \"zero length follows\", \"actual\": [[[]], [[1]]], \"expected\": [[[], [1]]], \"passed\": false}, {\"check\": \"several bins\", \"actual\": [[[1]], [[2]], [[3]]], \"expected\": [[[1]], [[2]], [[3]]], \"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."}}