{"abstract":"Length bucketing reverses equal-length input order.","category":"Sequence batch packing","checks":6,"contract":"Sort sequences by ascending length while preserving original order among equal lengths.","contract_signature":"sequences","evaluation_group":"w3-seqpack-stable-bucket-v1","failed_approach":"Lexical token sorting is deterministic but violates stable input ownership.","family":"w3-sequence-batch-packing-length-sort-stable","id":"FA-98096","implementations":{"attempt":{"sha256":"d56178c6007689f87364b887c6bb5f0f9a81178a73380c330fa51feea133ccb6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sequences):\n    return sorted(sequences,key=lambda s:(len(s),str(s)))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na=[N]; b=[-N]\ncheck('equal length stability', solve([a,b,[1,2]]), [a,b,[1,2]])\ncheck('length order', solve([[1,2],[3],[4,5,6]]), [[3],[1,2],[4,5,6]])\ncheck('empty', solve([]), [])\ncheck('singleton', solve([[N]]), [[N]])\ncheck('duplicate values', solve([[1],[1],[2,3]]), [[1],[1],[2,3]])\ncheck('ties after shorter', solve([[1,2],[3],[4,5]]), [[3],[1,2],[4,5]])\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":"3a124942e5ebaab99205cde4a7f2be6a024fdb5202347fa4d52df3031fc5f3f2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(sequences):\n    return sorted(sequences,key=lambda s:(len(s),-sequences.index(s)))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na=[N]; b=[-N]\ncheck('equal length stability', solve([a,b,[1,2]]), [a,b,[1,2]])\ncheck('length order', solve([[1,2],[3],[4,5,6]]), [[3],[1,2],[4,5,6]])\ncheck('empty', solve([]), [])\ncheck('singleton', solve([[N]]), [[N]])\ncheck('duplicate values', solve([[1],[1],[2,3]]), [[1],[1],[2,3]])\ncheck('ties after shorter', solve([[1,2],[3],[4,5]]), [[3],[1,2],[4,5]])\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-length-sort-stable","generated_at":"2026-09-30T16:48:09.321943+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 tie key reverses the source index or imposes token-value order.","sha256":"cd14822dbb40058a54809b32d39e9179ebcec126abd6bf3430b0f8471f2f2a2a","title":"Length bucketing reverses equal-length input order · 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.016,"exit_code":1,"observations":[{"actual":[[-1],[1],[1,2]],"check":"equal length stability","expected":[[1],[-1],[1,2]],"passed":false},{"actual":[[3],[1,2],[4,5,6]],"check":"length order","expected":[[3],[1,2],[4,5,6]],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[[1]],"check":"singleton","expected":[[1]],"passed":true},{"actual":[[1],[1],[2,3]],"check":"duplicate values","expected":[[1],[1],[2,3]],"passed":true},{"actual":[[3],[1,2],[4,5]],"check":"ties after shorter","expected":[[3],[1,2],[4,5]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"equal length stability\", \"actual\": [[-1], [1], [1, 2]], \"expected\": [[1], [-1], [1, 2]], \"passed\": false}, {\"check\": \"length order\", \"actual\": [[3], [1, 2], [4, 5, 6]], \"expected\": [[3], [1, 2], [4, 5, 6]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"duplicate values\", \"actual\": [[1], [1], [2, 3]], \"expected\": [[1], [1], [2, 3]], \"passed\": true}, {\"check\": \"ties after shorter\", \"actual\": [[3], [1, 2], [4, 5]], \"expected\": [[3], [1, 2], [4, 5]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.087,"exit_code":1,"observations":[{"actual":[[-1],[1],[1,2]],"check":"equal length stability","expected":[[1],[-1],[1,2]],"passed":false},{"actual":[[3],[1,2],[4,5,6]],"check":"length order","expected":[[3],[1,2],[4,5,6]],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true},{"actual":[[1]],"check":"singleton","expected":[[1]],"passed":true},{"actual":[[1],[1],[2,3]],"check":"duplicate values","expected":[[1],[1],[2,3]],"passed":true},{"actual":[[3],[4,5],[1,2]],"check":"ties after shorter","expected":[[3],[1,2],[4,5]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"equal length stability\", \"actual\": [[-1], [1], [1, 2]], \"expected\": [[1], [-1], [1, 2]], \"passed\": false}, {\"check\": \"length order\", \"actual\": [[3], [1, 2], [4, 5, 6]], \"expected\": [[3], [1, 2], [4, 5, 6]], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}, {\"check\": \"duplicate values\", \"actual\": [[1], [1], [2, 3]], \"expected\": [[1], [1], [2, 3]], \"passed\": true}, {\"check\": \"ties after shorter\", \"actual\": [[3], [4, 5], [1, 2]], \"expected\": [[3], [1, 2], [4, 5]], \"passed\": false}], \"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."}}