{"abstract":"Quantile bin assignment uses held-out rows while fitting.","category":"Feature preprocessing fit scope","checks":8,"contract":"Train is nonempty, bins is positive. Select empirical cut values at floor(i*n/bins), capped to the final training index. Count strict greater-than cut comparisons, so equality stays in the lower bin.","contract_signature":"train, values, bins","evaluation_group":"w3-feature-preprocessing-fit-scope-quantile-binning","failed_approach":"Filtering rows after computing the statistic still leaves held-out influence.","family":"w3-feature-preprocessing-fit-scope-quantile-binning-fit-leakage","id":"FA-100421","implementations":{"attempt":{"sha256":"ec3fe8b5402f086c7e2e736a2dc22cd2783698dcd846f6bad081e9a2ae46ce1c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values, bins):\n    v=sorted(train); edges=[v[min(len(v)-1,((i*len(v)+bins-1)//bins))] for i in range(1,bins)]; return [sum(x>e for e in edges) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('three equal-width ranks',solve([0,1,2,3,4,5],[0,2,5],3),[0,0,2])\ncheck('nondivisible rank boundary',solve([0,1,2,3,4],[3],2),[1])\ncheck('heldout cannot set cuts',solve([0,10,20],[8,12,18],3),[0,1,1])\ncheck('boundary equality stays lower',solve([0,2,4,6],[2,3,4],2),[0,0,0])\ncheck('repeated training values',solve([1,1,1,9],[1,9],2),[0,1])\ncheck('one bin',solve([0,2,4],[N,100],1),[0,0])\ncheck('empty values',solve([0,2],[],2),[])\ncheck('upper extreme',solve([0,10],[10],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":"0a09914c76a9d1a71ca5b16c488d1d59d3e8980eb16305a925ab7e58f0bc9c23","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values, bins):\n    v=sorted(train+values); edges=[v[(i*len(v))//bins] for i in range(1,bins)]; return [sum(x>e for e in edges) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('three equal-width ranks',solve([0,1,2,3,4,5],[0,2,5],3),[0,0,2])\ncheck('nondivisible rank boundary',solve([0,1,2,3,4],[3],2),[1])\ncheck('heldout cannot set cuts',solve([0,10,20],[8,12,18],3),[0,1,1])\ncheck('boundary equality stays lower',solve([0,2,4,6],[2,3,4],2),[0,0,0])\ncheck('repeated training values',solve([1,1,1,9],[1,9],2),[0,1])\ncheck('one bin',solve([0,2,4],[N,100],1),[0,0])\ncheck('empty values',solve([0,2],[],2),[])\ncheck('upper extreme',solve([0,10],[10],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":"Toy empirical rank binning with duplicate cuts permitted and equality assigned to the lower bin. 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-feature-preprocessing-fit-scope-quantile-binning-fit-leakage","generated_at":"2026-09-30T16:48:35.362781+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small deterministic preprocessing contract makes the fit boundary and transform behavior directly inspectable.","root_cause":"Fitting reads values outside the designated training rows.","sha256":"59c3b5ce29a0878e5dd40cbfe3b54b24135327f015aca553da07d0d409140a91","title":"Quantile bin assignment uses held-out rows while fitting · 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":26.628,"exit_code":1,"observations":[{"actual":[0,0,2],"check":"three equal-width ranks","expected":[0,0,2],"passed":true},{"actual":[0],"check":"nondivisible rank boundary","expected":[1],"passed":false},{"actual":[0,1,1],"check":"heldout cannot set cuts","expected":[0,1,1],"passed":true},{"actual":[0,0,0],"check":"boundary equality stays lower","expected":[0,0,0],"passed":true},{"actual":[0,1],"check":"repeated training values","expected":[0,1],"passed":true},{"actual":[0,0],"check":"one bin","expected":[0,0],"passed":true},{"actual":[],"check":"empty values","expected":[],"passed":true},{"actual":[0],"check":"upper extreme","expected":[0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"three equal-width ranks\", \"actual\": [0, 0, 2], \"expected\": [0, 0, 2], \"passed\": true}, {\"check\": \"nondivisible rank boundary\", \"actual\": [0], \"expected\": [1], \"passed\": false}, {\"check\": \"heldout cannot set cuts\", \"actual\": [0, 1, 1], \"expected\": [0, 1, 1], \"passed\": true}, {\"check\": \"boundary equality stays lower\", \"actual\": [0, 0, 0], \"expected\": [0, 0, 0], \"passed\": true}, {\"check\": \"repeated training values\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"one bin\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"upper extreme\", \"actual\": [0], \"expected\": [0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.067,"exit_code":1,"observations":[{"actual":[0,0,2],"check":"three equal-width ranks","expected":[0,0,2],"passed":true},{"actual":[0],"check":"nondivisible rank boundary","expected":[1],"passed":false},{"actual":[0,1,1],"check":"heldout cannot set cuts","expected":[0,1,1],"passed":true},{"actual":[0,0,1],"check":"boundary equality stays lower","expected":[0,0,0],"passed":false},{"actual":[0,1],"check":"repeated training values","expected":[0,1],"passed":true},{"actual":[0,0],"check":"one bin","expected":[0,0],"passed":true},{"actual":[],"check":"empty values","expected":[],"passed":true},{"actual":[0],"check":"upper extreme","expected":[0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"three equal-width ranks\", \"actual\": [0, 0, 2], \"expected\": [0, 0, 2], \"passed\": true}, {\"check\": \"nondivisible rank boundary\", \"actual\": [0], \"expected\": [1], \"passed\": false}, {\"check\": \"heldout cannot set cuts\", \"actual\": [0, 1, 1], \"expected\": [0, 1, 1], \"passed\": true}, {\"check\": \"boundary equality stays lower\", \"actual\": [0, 0, 1], \"expected\": [0, 0, 0], \"passed\": false}, {\"check\": \"repeated training values\", \"actual\": [0, 1], \"expected\": [0, 1], \"passed\": true}, {\"check\": \"one bin\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"upper extreme\", \"actual\": [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."}}