{"abstract":"Length bin packing uses next-fit instead of first-fit.","category":"Sequence batch packing","checks":6,"contract":"Sort lengths descending with stable ties, then place each item into the first existing bin with enough remaining capacity; otherwise open a bin.","contract_signature":"lengths, capacity","evaluation_group":"w3-seqpack-ffd-v1","failed_approach":"A strict comparison rejects exact fits and still changes valid allocations.","family":"w3-sequence-batch-packing-first-fit-decreasing","id":"FA-98101","implementations":{"attempt":{"sha256":"8fe8ac50e94ec9044b555e4f530ded9e259cf1b6f33aeac698907073fcd52cee","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lengths, capacity):\n    bins=[]\n    for x in sorted(lengths,reverse=True):\n        i=next((i for i,b in enumerate(bins) if sum(b)+x<capacity),None)\n        if i is None: bins.append([x])\n        else: bins[i].append(x)\n    return bins\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nvals=[N+2,N+1,2,1]\ncheck('reuse earlier bin', solve(vals,N+3), [[N+2,1],[N+1,2]])\ncheck('exact fit', solve([N,1],N+1), [[N,1]])\ncheck('empty', solve([],N), [])\ncheck('single', solve([N],N), [[N]])\ncheck('new bin', solve([N,N],N), [[N],[N]])\ncheck('descending input order', solve([1,N],N+1), [[N,1]])\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":"2b1dd78269b284140fdd4d567093e6d534355883513ca426181278197bf0503d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(lengths, capacity):\n    bins=[]\n    for x in sorted(lengths,reverse=True):\n        if bins and sum(bins[-1])+x<=capacity: bins[-1].append(x)\n        else: bins.append([x])\n    return bins\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nvals=[N+2,N+1,2,1]\ncheck('reuse earlier bin', solve(vals,N+3), [[N+2,1],[N+1,2]])\ncheck('exact fit', solve([N,1],N+1), [[N,1]])\ncheck('empty', solve([],N), [])\ncheck('single', solve([N],N), [[N]])\ncheck('new bin', solve([N,N],N), [[N],[N]])\ncheck('descending input order', solve([1,N],N+1), [[N,1]])\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-first-fit-decreasing","generated_at":"2026-09-30T16:48:09.321515+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 heuristic checks only the newest bin, leaving earlier slack unused.","sha256":"2d8488cf17b9acae816b48b4684b9cf9c680357cfb0aa2bf21de7870ba02c2b5","title":"Length bin packing uses next-fit instead of first-fit · 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":28.019,"exit_code":1,"observations":[{"actual":[[3],[2,1],[2]],"check":"reuse earlier bin","expected":[[3,1],[2,2]],"passed":false},{"actual":[[1],[1]],"check":"exact fit","expected":[[1,1]],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[[1]],"check":"single","expected":[[1]],"passed":true},{"actual":[[1],[1]],"check":"new bin","expected":[[1],[1]],"passed":true},{"actual":[[1],[1]],"check":"descending input order","expected":[[1,1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"reuse earlier bin\", \"actual\": [[3], [2, 1], [2]], \"expected\": [[3, 1], [2, 2]], \"passed\": false}, {\"check\": \"exact fit\", \"actual\": [[1], [1]], \"expected\": [[1, 1]], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"single\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"new bin\", \"actual\": [[1], [1]], \"expected\": [[1], [1]], \"passed\": true}, {\"check\": \"descending input order\", \"actual\": [[1], [1]], \"expected\": [[1, 1]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.546,"exit_code":1,"observations":[{"actual":[[3],[2,2],[1]],"check":"reuse earlier bin","expected":[[3,1],[2,2]],"passed":false},{"actual":[[1,1]],"check":"exact fit","expected":[[1,1]],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[[1]],"check":"single","expected":[[1]],"passed":true},{"actual":[[1],[1]],"check":"new bin","expected":[[1],[1]],"passed":true},{"actual":[[1,1]],"check":"descending input order","expected":[[1,1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"reuse earlier bin\", \"actual\": [[3], [2, 2], [1]], \"expected\": [[3, 1], [2, 2]], \"passed\": false}, {\"check\": \"exact fit\", \"actual\": [[1, 1]], \"expected\": [[1, 1]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"single\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"new bin\", \"actual\": [[1], [1]], \"expected\": [[1], [1]], \"passed\": true}, {\"check\": \"descending input order\", \"actual\": [[1, 1]], \"expected\": [[1, 1]], \"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."}}