{"abstract":"Residual fraction is returned instead of explained fraction.","category":"Statistics","checks":4,"contract":"Integer finite observations and equal lengths for paired samples. Counts and weights are nonnegative. Rational results use reduced Fraction strings. Empty or undefined statistics return None where shown. Nonempty actual observations have positive variance; R squared may be negative and is not clamped. Exact operational definition: str(1-Fraction(sum((a-p)**2 for a,p in zip(actual,predicted)),sum((Fraction(a)-Fraction(sum(actual),len(actual)))**2 for a in actual)))","evaluation_group":"model-0966faea2bc3d16b","failed_approach":"Clamping discards valid negative scores for predictions worse than the mean.","family":"xn-coefficient-of-determination-rational","id":"FA-6256","implementations":{"attempt":{"sha256":"4c1d05e064f071075f67fa0d64e58e36bb032e44ba37ad11c4f56cc3c85a6091","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(actual, predicted):\n    return str(max(0,1-Fraction(sum((a-p)**2 for a,p in zip(actual,predicted)),sum((Fraction(a)-Fraction(sum(actual),len(actual)))**2 for a in actual))))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: ([1, 2, 3], [1, 2, 3])', solve(*([1, 2, 3], [1, 2, 3])), '1')\ncheck('fixture 2: ([1, 2, 3], [2, 2, 2])', solve(*([1, 2, 3], [2, 2, 2])), '0')\ncheck('fixture 3: ([1, 2, 3], [4, 4, 4])', solve(*([1, 2, 3], [4, 4, 4])), '-6')\ncheck('fixture 4: ([0, 2], [0, 0])', solve(*([0, 2], [0, 0])), '-1')\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":"0c28089ce4193d256b3501839736a79222826f458b0b39f066bda9a4aff06522","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(actual, predicted):\n    return str(Fraction(sum((a-p)**2 for a,p in zip(actual,predicted)),sum((Fraction(a)-Fraction(sum(actual),len(actual)))**2 for a in actual)))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: ([1, 2, 3], [1, 2, 3])', solve(*([1, 2, 3], [1, 2, 3])), '1')\ncheck('fixture 2: ([1, 2, 3], [2, 2, 2])', solve(*([1, 2, 3], [2, 2, 2])), '0')\ncheck('fixture 3: ([1, 2, 3], [4, 4, 4])', solve(*([1, 2, 3], [4, 4, 4])), '-6')\ncheck('fixture 4: ([0, 2], [0, 0])', solve(*([0, 2], [0, 0])), '-1')\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"},"fixed":{"sha256":"350c712a5bc9eaa13407abfe959d4f2eb0710c4c48dc73a6a7613999badfa864","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport calendar\nimport statistics\nimport itertools\nfrom fractions import Fraction\nfrom datetime import date, datetime, timedelta, timezone\nfrom decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR\n\nN = 1\nobservations = []\ndef solve(actual, predicted):\n    return str(1-Fraction(sum((a-p)**2 for a,p in zip(actual,predicted)),sum((Fraction(a)-Fraction(sum(actual),len(actual)))**2 for a in actual)))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1: ([1, 2, 3], [1, 2, 3])', solve(*([1, 2, 3], [1, 2, 3])), '1')\ncheck('fixture 2: ([1, 2, 3], [2, 2, 2])', solve(*([1, 2, 3], [2, 2, 2])), '0')\ncheck('fixture 3: ([1, 2, 3], [4, 4, 4])', solve(*([1, 2, 3], [4, 4, 4])), '-6')\ncheck('fixture 4: ([0, 2], [0, 0])', solve(*([0, 2], [0, 0])), '-1')\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":" 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":"xn-coefficient-of-determination-rational","generated_at":"2026-09-29T14:37:59.530423+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Statistical estimators results depend on the stated convention.","repair":"Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(1-Fraction(sum((a-p)**2 for a,p in zip(actual,predicted)),sum((Fraction(a)-Fraction(sum(actual),len(actual)))**2 for a in actual)))","root_cause":"Residual fraction is returned instead of explained fraction.","sha256":"63d5101f7d7c545913ee7080c73cd81cb37d281669a82bd120f6e603ee9a3683","title":"Coefficient of determination rational · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":47.235,"exit_code":1,"observations":[{"actual":"1","check":"fixture 1: ([1, 2, 3], [1, 2, 3])","expected":"1","passed":true},{"actual":"0","check":"fixture 2: ([1, 2, 3], [2, 2, 2])","expected":"0","passed":true},{"actual":"0","check":"fixture 3: ([1, 2, 3], [4, 4, 4])","expected":"-6","passed":false},{"actual":"0","check":"fixture 4: ([0, 2], [0, 0])","expected":"-1","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: ([1, 2, 3], [1, 2, 3])\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"fixture 2: ([1, 2, 3], [2, 2, 2])\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"fixture 3: ([1, 2, 3], [4, 4, 4])\", \"actual\": \"0\", \"expected\": \"-6\", \"passed\": false}, {\"check\": \"fixture 4: ([0, 2], [0, 0])\", \"actual\": \"0\", \"expected\": \"-1\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":46.077,"exit_code":1,"observations":[{"actual":"0","check":"fixture 1: ([1, 2, 3], [1, 2, 3])","expected":"1","passed":false},{"actual":"1","check":"fixture 2: ([1, 2, 3], [2, 2, 2])","expected":"0","passed":false},{"actual":"7","check":"fixture 3: ([1, 2, 3], [4, 4, 4])","expected":"-6","passed":false},{"actual":"2","check":"fixture 4: ([0, 2], [0, 0])","expected":"-1","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: ([1, 2, 3], [1, 2, 3])\", \"actual\": \"0\", \"expected\": \"1\", \"passed\": false}, {\"check\": \"fixture 2: ([1, 2, 3], [2, 2, 2])\", \"actual\": \"1\", \"expected\": \"0\", \"passed\": false}, {\"check\": \"fixture 3: ([1, 2, 3], [4, 4, 4])\", \"actual\": \"7\", \"expected\": \"-6\", \"passed\": false}, {\"check\": \"fixture 4: ([0, 2], [0, 0])\", \"actual\": \"2\", \"expected\": \"-1\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":62.776,"exit_code":0,"observations":[{"actual":"1","check":"fixture 1: ([1, 2, 3], [1, 2, 3])","expected":"1","passed":true},{"actual":"0","check":"fixture 2: ([1, 2, 3], [2, 2, 2])","expected":"0","passed":true},{"actual":"-6","check":"fixture 3: ([1, 2, 3], [4, 4, 4])","expected":"-6","passed":true},{"actual":"-1","check":"fixture 4: ([0, 2], [0, 0])","expected":"-1","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1: ([1, 2, 3], [1, 2, 3])\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"fixture 2: ([1, 2, 3], [2, 2, 2])\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"fixture 3: ([1, 2, 3], [4, 4, 4])\", \"actual\": \"-6\", \"expected\": \"-6\", \"passed\": true}, {\"check\": \"fixture 4: ([0, 2], [0, 0])\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}