{"abstract":"Domain filtering silently changes the target denominator.","category":"Survey sampling estimators","checks":6,"contract":"Rows are (value, inverse-inclusion weight, in-domain boolean); domain_size is a known nonnegative population count. Return HT domain total/domain_size, or None when size is zero, rounded to eight decimals.","contract_signature":"rows, domain_size","evaluation_group":"model-f52fd92053951de6","failed_approach":"Dividing by estimated domain weight changes the specified HT domain mean into a ratio estimator.","family":"z-survey_sampling-domain-denominator","id":"FA-12606","implementations":{"attempt":{"sha256":"3a3abd7649134bbc9c616e8d7fcc9e2042de9335be2e558ba08d1bff61ec8366","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, domain_size):\n    d=[(y,w) for y,w,in_domain in rows if in_domain]\n    return round(sum(y*w for y,w in d)/sum(w for y,w in d),8) if d else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('known domain denominator',solve([(2*N,2,True),(99,10,False)],8),N/2)\ncheck('no sampled domain members',solve([(N,1,False)],4),0)\ncheck('zero population domain',solve([],0),None)\ncheck('census domain',solve([(N,1,True),(3*N,1,True)],2),2*N)\ncheck('unequal weighted members',solve([(N,2,True),(2*N,4,True)],5),2*N)\ncheck('outside values do not contribute',solve([(0,4,True),(100*N,2,False)],8),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":"73c50334b18e58529963b4b28f2ae344811979df2e90621f8e1b2dca67a53b54","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, domain_size):\n    d=[(y,w) for y,w,in_domain in rows if in_domain]\n    return round(sum(y*w for y,w in d)/len(d),8) if d else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('known domain denominator',solve([(2*N,2,True),(99,10,False)],8),N/2)\ncheck('no sampled domain members',solve([(N,1,False)],4),0)\ncheck('zero population domain',solve([],0),None)\ncheck('census domain',solve([(N,1,True),(3*N,1,True)],2),2*N)\ncheck('unequal weighted members',solve([(N,2,True),(2*N,4,True)],5),2*N)\ncheck('outside values do not contribute',solve([(0,4,True),(100*N,2,False)],8),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":"Controlled finite fixtures; not a general survey-analysis package. 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":"z-survey_sampling-domain-denominator","generated_at":"2026-09-29T14:38:58.499317+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic survey-design model isolates this sampling contract before it is embedded in a larger estimation pipeline.","root_cause":"A subpopulation total is divided by observed domain membership rather than the known domain population.","sha256":"dd4858ad3958e42dd5ded707ebc975185cda2f99f2c6033033da96cb834e6915","title":"Domain filtering silently changes the target denominator · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.763,"exit_code":1,"observations":[{"actual":2.0,"check":"known domain denominator","expected":0.5,"passed":false},{"actual":null,"check":"no sampled domain members","expected":0,"passed":false},{"actual":null,"check":"zero population domain","expected":null,"passed":true},{"actual":2.0,"check":"census domain","expected":2,"passed":true},{"actual":1.66666667,"check":"unequal weighted members","expected":2,"passed":false},{"actual":0.0,"check":"outside values do not contribute","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"known domain denominator\", \"actual\": 2.0, \"expected\": 0.5, \"passed\": false}, {\"check\": \"no sampled domain members\", \"actual\": null, \"expected\": 0, \"passed\": false}, {\"check\": \"zero population domain\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"census domain\", \"actual\": 2.0, \"expected\": 2, \"passed\": true}, {\"check\": \"unequal weighted members\", \"actual\": 1.66666667, \"expected\": 2, \"passed\": false}, {\"check\": \"outside values do not contribute\", \"actual\": 0.0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.435,"exit_code":1,"observations":[{"actual":4.0,"check":"known domain denominator","expected":0.5,"passed":false},{"actual":null,"check":"no sampled domain members","expected":0,"passed":false},{"actual":null,"check":"zero population domain","expected":null,"passed":true},{"actual":2.0,"check":"census domain","expected":2,"passed":true},{"actual":5.0,"check":"unequal weighted members","expected":2,"passed":false},{"actual":0.0,"check":"outside values do not contribute","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"known domain denominator\", \"actual\": 4.0, \"expected\": 0.5, \"passed\": false}, {\"check\": \"no sampled domain members\", \"actual\": null, \"expected\": 0, \"passed\": false}, {\"check\": \"zero population domain\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"census domain\", \"actual\": 2.0, \"expected\": 2, \"passed\": true}, {\"check\": \"unequal weighted members\", \"actual\": 5.0, \"expected\": 2, \"passed\": false}, {\"check\": \"outside values do not contribute\", \"actual\": 0.0, \"expected\": 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."}}