{"abstract":"Presence penalty scales with repeated history count.","category":"Token sampling filters","checks":6,"contract":"Subtract penalty exactly once from each scored token appearing at least once in history; other scores are unchanged.","contract_signature":"scores, history, penalty","evaluation_group":"w3-tsf-presence-unique-history","failed_approach":"Dropping tokens whose history count exceeds one loses valid scored candidates.","family":"w3-token-sampling-filters-presence-unique-history","id":"FA-98376","implementations":{"attempt":{"sha256":"ded05def9377e8cef083c0034a25bb402aed79a57da9059393dc0e8f886f9555","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(scores, history, penalty):\n    return {t:v-(penalty if t in history else 0) for t,v in scores.items() if t not in history or history.count(t)==1}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('duplicate history',solve({'a':5.0,'b':2.0},['a']*(N+1),1.5),{'a':3.5,'b':2.0})\ncheck('single occurrence',solve({'a':N},['a'],2),{'a':N-2})\ncheck('empty history',solve({'a':N},[],2),{'a':N})\ncheck('unknown history token',solve({'a':2.0},['z','z'],1),{'a':2.0})\ncheck('negative penalty',solve({'a':1.0},['a'], -2),{'a':3.0})\ncheck('multiple ids',solve({'a':4.0,'b':3.0},['b','b','a'],1),{'a':3.0,'b':2.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":"12d646bb57c3bf57a395d295cad8afeb32505390dcf9d201778d4464d22fe2e3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(scores, history, penalty):\n    from collections import Counter\n    c=Counter(history)\n    return {t:v-penalty*c[t] for t,v in scores.items()}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('duplicate history',solve({'a':5.0,'b':2.0},['a']*(N+1),1.5),{'a':3.5,'b':2.0})\ncheck('single occurrence',solve({'a':N},['a'],2),{'a':N-2})\ncheck('empty history',solve({'a':N},[],2),{'a':N})\ncheck('unknown history token',solve({'a':2.0},['z','z'],1),{'a':2.0})\ncheck('negative penalty',solve({'a':1.0},['a'], -2),{'a':3.0})\ncheck('multiple ids',solve({'a':4.0,'b':3.0},['b','b','a'],1),{'a':3.0,'b':2.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-presence-unique-history","generated_at":"2026-09-30T16:48:12.371227+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":"Penalty magnitude is multiplied by occurrence count instead of recording a one-time presence.","sha256":"efe85056d1b9a98cf0200681e7ace12146a5ae6edec22593f9053690c864d8dc","title":"Token sampling: Presence penalty scales with repeated history count · 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.819,"exit_code":1,"observations":[{"actual":{"b":2.0},"check":"duplicate history","expected":{"a":3.5,"b":2.0},"passed":false},{"actual":{"a":-1},"check":"single occurrence","expected":{"a":-1},"passed":true},{"actual":{"a":1},"check":"empty history","expected":{"a":1},"passed":true},{"actual":{"a":2.0},"check":"unknown history token","expected":{"a":2.0},"passed":true},{"actual":{"a":3.0},"check":"negative penalty","expected":{"a":3.0},"passed":true},{"actual":{"a":3.0},"check":"multiple ids","expected":{"a":3.0,"b":2.0},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicate history\", \"actual\": {\"b\": 2.0}, \"expected\": {\"a\": 3.5, \"b\": 2.0}, \"passed\": false}, {\"check\": \"single occurrence\", \"actual\": {\"a\": -1}, \"expected\": {\"a\": -1}, \"passed\": true}, {\"check\": \"empty history\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 1}, \"passed\": true}, {\"check\": \"unknown history token\", \"actual\": {\"a\": 2.0}, \"expected\": {\"a\": 2.0}, \"passed\": true}, {\"check\": \"negative penalty\", \"actual\": {\"a\": 3.0}, \"expected\": {\"a\": 3.0}, \"passed\": true}, {\"check\": \"multiple ids\", \"actual\": {\"a\": 3.0}, \"expected\": {\"a\": 3.0, \"b\": 2.0}, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.429,"exit_code":1,"observations":[{"actual":{"a":2.0,"b":2.0},"check":"duplicate history","expected":{"a":3.5,"b":2.0},"passed":false},{"actual":{"a":-1},"check":"single occurrence","expected":{"a":-1},"passed":true},{"actual":{"a":1},"check":"empty history","expected":{"a":1},"passed":true},{"actual":{"a":2.0},"check":"unknown history token","expected":{"a":2.0},"passed":true},{"actual":{"a":3.0},"check":"negative penalty","expected":{"a":3.0},"passed":true},{"actual":{"a":3.0,"b":1.0},"check":"multiple ids","expected":{"a":3.0,"b":2.0},"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"duplicate history\", \"actual\": {\"a\": 2.0, \"b\": 2.0}, \"expected\": {\"a\": 3.5, \"b\": 2.0}, \"passed\": false}, {\"check\": \"single occurrence\", \"actual\": {\"a\": -1}, \"expected\": {\"a\": -1}, \"passed\": true}, {\"check\": \"empty history\", \"actual\": {\"a\": 1}, \"expected\": {\"a\": 1}, \"passed\": true}, {\"check\": \"unknown history token\", \"actual\": {\"a\": 2.0}, \"expected\": {\"a\": 2.0}, \"passed\": true}, {\"check\": \"negative penalty\", \"actual\": {\"a\": 3.0}, \"expected\": {\"a\": 3.0}, \"passed\": true}, {\"check\": \"multiple ids\", \"actual\": {\"a\": 3.0, \"b\": 1.0}, \"expected\": {\"a\": 3.0, \"b\": 2.0}, \"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."}}