{"abstract":"Nucleus filtering excludes the token that crosses p.","category":"Token sampling filters","checks":6,"contract":"Sort by descending probability then token ID; retain the shortest prefix whose cumulative mass is at least p. For p<=0 keep none; p>1 keeps all.","contract_signature":"probabilities, p","evaluation_group":"w3-tsf-nucleus-crossing-token","failed_approach":"The attempted strict crossing rule adds one extra token when the cumulative mass exactly equals p.","family":"w3-token-sampling-filters-nucleus-crossing-token","id":"FA-98346","implementations":{"attempt":{"sha256":"4c0894742f214c5cfd2dfaa325f2171e45badb9b460d4961421e178b44cc5a69","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(probabilities, p):\n    if p<=0:return []\n    ranked=sorted(probabilities,key=lambda t:(-probabilities[t],t)); out=[]; mass=0\n    for t in ranked:\n        mass += probabilities[t]\n        if mass > p: out.append(t); break\n        out.append(t)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('crossing included',solve({'a':.6,'b':.3,'c':.1},.8),['a','b'])\ncheck('exact boundary',solve({'a':.5,'b':.5},.5),['a'])\ncheck('zero mass target',solve({'a':1.0},0),[])\ncheck('all mass',solve({'a':.6,'b':.4},1),['a','b'])\ncheck('tie order',solve({'z':.5,'a':.5},.5),['a'])\ncheck('empty',solve({},.7),[])\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":"9023cb5612ea9f852aab49ce6b85ce79e5fdce965ebc49412bf171ecc529794d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(probabilities, p):\n    if p<=0:return []\n    ranked=sorted(probabilities,key=lambda t:(-probabilities[t],t)); out=[]; mass=0\n    for t in ranked:\n        mass += probabilities[t]\n        if mass > p: break\n        out.append(t)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('crossing included',solve({'a':.6,'b':.3,'c':.1},.8),['a','b'])\ncheck('exact boundary',solve({'a':.5,'b':.5},.5),['a'])\ncheck('zero mass target',solve({'a':1.0},0),[])\ncheck('all mass',solve({'a':.6,'b':.4},1),['a','b'])\ncheck('tie order',solve({'z':.5,'a':.5},.5),['a'])\ncheck('empty',solve({},.7),[])\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":"These are toy finite-vocabulary contracts with supplied scores, histories, and draws; they do not claim production model quality or compatibility. 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-token-sampling-filters-nucleus-crossing-token","generated_at":"2026-09-30T16:48:11.932923+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A finite, deterministic token-selection contract isolates one decoding operation from model inference and runtime behavior.","root_cause":"The candidate that takes cumulative mass past p is discarded before it is appended to the retained prefix.","sha256":"d7be039b0f0332c49603abd1e9aececd13514f500efbf97949b8d1ada73053d1","title":"Token sampling: Nucleus filtering excludes the token that crosses p · case 01","variant":1,"variant_policy":"The same explicitly authored fixtures repeat across all five numbered records; runtime N is unused. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":29.303,"exit_code":1,"observations":[{"actual":["a","b"],"check":"crossing included","expected":["a","b"],"passed":true},{"actual":["a","b"],"check":"exact boundary","expected":["a"],"passed":false},{"actual":[],"check":"zero mass target","expected":[],"passed":true},{"actual":["a","b"],"check":"all mass","expected":["a","b"],"passed":true},{"actual":["a","z"],"check":"tie order","expected":["a"],"passed":false},{"actual":[],"check":"empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"crossing included\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"exact boundary\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"zero mass target\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"all mass\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"tie order\", \"actual\": [\"a\", \"z\"], \"expected\": [\"a\"], \"passed\": false}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":26.947,"exit_code":1,"observations":[{"actual":["a"],"check":"crossing included","expected":["a","b"],"passed":false},{"actual":["a"],"check":"exact boundary","expected":["a"],"passed":true},{"actual":[],"check":"zero mass target","expected":[],"passed":true},{"actual":["a","b"],"check":"all mass","expected":["a","b"],"passed":true},{"actual":["a"],"check":"tie order","expected":["a"],"passed":true},{"actual":[],"check":"empty","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"crossing included\", \"actual\": [\"a\"], \"expected\": [\"a\", \"b\"], \"passed\": false}, {\"check\": \"exact boundary\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"zero mass target\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"all mass\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"tie order\", \"actual\": [\"a\"], \"expected\": [\"a\"], \"passed\": true}, {\"check\": \"empty\", \"actual\": [], \"expected\": [], \"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."}}