{"abstract":"Allowed probabilities sum below one when disallowed logits remain in the denominator.","category":"Token sampling filters","checks":6,"contract":"Return normalized probabilities over only allowed tokens using a stable softmax; empty allowed support returns an empty mapping.","contract_signature":"logits, allowed","evaluation_group":"w3-tsf-allowlist-before-softmax","failed_approach":"Selecting the allowed support but returning shifted exponentials without dividing by their sum leaves values unnormalized.","family":"w3-token-sampling-filters-allowlist-before-softmax","id":"FA-98386","implementations":{"attempt":{"sha256":"6055ee4240dacead91ecee5fc295f0abb3accc6134a4b9142ea7b9a4efc77a5e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(logits, allowed):\n    import math\n    xs={t:v for t,v in logits.items() if t in allowed}\n    if not xs:return {}\n    m=max(xs.values()); ex={t:math.exp(v-m) for t,v in xs.items()}\n    return ex\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('excluded mass removed',solve({'a':0.0,'b':0.0,'x':10.0},['a','b']),{'a':.5,'b':.5})\ncheck('single allowed',solve({'a':N,'b':0.0},['b']),{'b':1.0})\ncheck('no allowed',solve({'a':1.0},[]),{})\ncheck('unknown allowlist',solve({'a':1.0},['z']),{})\ncheck('stable large logits',solve({'a':1000.0,'b':1000.0},['a','b']),{'a':.5,'b':.5})\ncheck('one candidate',solve({'x':-100.0},['x']),{'x':1.0})\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":"fe86b1dd9ac8a7ed4558caac22cec8b6b57af94fb8e9e1f2620e39aa587df8a8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(logits, allowed):\n    import math\n    m=max((logits[t] for t in allowed if t in logits),default=0); ex={t:math.exp(v-m) for t,v in logits.items()}; z=sum(ex.values())\n    return {t:ex[t]/z for t in allowed if t in ex}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('excluded mass removed',solve({'a':0.0,'b':0.0,'x':10.0},['a','b']),{'a':.5,'b':.5})\ncheck('single allowed',solve({'a':N,'b':0.0},['b']),{'b':1.0})\ncheck('no allowed',solve({'a':1.0},[]),{})\ncheck('unknown allowlist',solve({'a':1.0},['z']),{})\ncheck('stable large logits',solve({'a':1000.0,'b':1000.0},['a','b']),{'a':.5,'b':.5})\ncheck('one candidate',solve({'x':-100.0},['x']),{'x':1.0})\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-allowlist-before-softmax","generated_at":"2026-09-30T16:48:12.370674+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":"Normalization includes excluded vocabulary items before the allowlist is applied.","sha256":"5c1977239ef6d4add390b012d78ab7fd4647c33ac624fce0502576186a15989a","title":"Token sampling: Allowed probabilities sum below one when disallowed logits remain in the denominator · 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":27.621,"exit_code":1,"observations":[{"actual":{"a":1.0,"b":1.0},"check":"excluded mass removed","expected":{"a":0.5,"b":0.5},"passed":false},{"actual":{"b":1.0},"check":"single allowed","expected":{"b":1.0},"passed":true},{"actual":{},"check":"no allowed","expected":{},"passed":true},{"actual":{},"check":"unknown allowlist","expected":{},"passed":true},{"actual":{"a":1.0,"b":1.0},"check":"stable large logits","expected":{"a":0.5,"b":0.5},"passed":false},{"actual":{"x":1.0},"check":"one candidate","expected":{"x":1.0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"excluded mass removed\", \"actual\": {\"a\": 1.0, \"b\": 1.0}, \"expected\": {\"a\": 0.5, \"b\": 0.5}, \"passed\": false}, {\"check\": \"single allowed\", \"actual\": {\"b\": 1.0}, \"expected\": {\"b\": 1.0}, \"passed\": true}, {\"check\": \"no allowed\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"unknown allowlist\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"stable large logits\", \"actual\": {\"a\": 1.0, \"b\": 1.0}, \"expected\": {\"a\": 0.5, \"b\": 0.5}, \"passed\": false}, {\"check\": \"one candidate\", \"actual\": {\"x\": 1.0}, \"expected\": {\"x\": 1.0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":29.054,"exit_code":1,"observations":[{"actual":{"a":4.539580782951091e-05,"b":4.539580782951091e-05},"check":"excluded mass removed","expected":{"a":0.5,"b":0.5},"passed":false},{"actual":{"b":0.2689414213699951},"check":"single allowed","expected":{"b":1.0},"passed":false},{"actual":{},"check":"no allowed","expected":{},"passed":true},{"actual":{},"check":"unknown allowlist","expected":{},"passed":true},{"actual":{"a":0.5,"b":0.5},"check":"stable large logits","expected":{"a":0.5,"b":0.5},"passed":true},{"actual":{"x":1.0},"check":"one candidate","expected":{"x":1.0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"excluded mass removed\", \"actual\": {\"a\": 4.539580782951091e-05, \"b\": 4.539580782951091e-05}, \"expected\": {\"a\": 0.5, \"b\": 0.5}, \"passed\": false}, {\"check\": \"single allowed\", \"actual\": {\"b\": 0.2689414213699951}, \"expected\": {\"b\": 1.0}, \"passed\": false}, {\"check\": \"no allowed\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"unknown allowlist\", \"actual\": {}, \"expected\": {}, \"passed\": true}, {\"check\": \"stable large logits\", \"actual\": {\"a\": 0.5, \"b\": 0.5}, \"expected\": {\"a\": 0.5, \"b\": 0.5}, \"passed\": true}, {\"check\": \"one candidate\", \"actual\": {\"x\": 1.0}, \"expected\": {\"x\": 1.0}, \"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."}}