{"abstract":"The exact polynomial long division result violates the stated contract at leading coefficient cancellation.","category":"Numerics","checks":8,"contract":"Input [A,B] integer ascending coefficients, B nonzero canonical; return rational quotient/remainder coefficient pairs; zero polynomial is []. Bounds: len(A)<=4 and 1<=len(B)<=4.","contract_signature":"x","evaluation_group":"s3-numerics-polynomial-long-division","failed_approach":"The partial repair r[-1]*b[-1] still violates the leading coefficient cancellation invariant.","family":"s3-numerics-polynomial-long-division-leading-coefficient-cancellation","id":"FA-14596","implementations":{"attempt":{"sha256":"27c81fd2d1bbff251b2e08c377bd5a9d3c66cda2977c620433030708886e1a89","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    A,B=x\n    r=list(map(Fraction,A));b=list(map(Fraction,B))\n    while r and r[-1]==0:r.pop()\n    q=[Fraction(0)]*max(0,len(r)-len(b)+1)\n    for _ in range(20):\n     if len(r)<len(b):break\n     k=len(r)-len(b)\n     if k<0 or k>=len(q):return None\n     c=r[-1]*b[-1]\n     q[k]=q[k]+c\n     for j in range(len(b)):\n      if j+k>=len(r):return None\n      r[j+k]=r[j+k]-c*b[j]\n     while r and r[-1]==0:r.pop()\n    while q and q[-1]==0:q.pop()\n    return [[[v.numerator,v.denominator] for v in z] for z in (q,r)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, -1, -1], [-1, 1]], [[[-2, 1], [-1, 1]], [[-3, 1]]]), ([[-1, -1, -1], [0, -1]], [[[1, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [0, 1]], [[[-1, 1], [-1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [0, 2]], [[[-1, 2], [-1, 2]], [[-1, 1]]]), ([[-1, -1, -1], [1, -1]], [[[2, 1], [1, 1]], [[-3, 1]]])], [([[-1, -1, -1], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[-1, -1, -1], [2, 2]], [[[0, 1], [-1, 2]], [[-1, 1]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, -1, 0], [0, 2]], [[[-1, 2]], [[-1, 1]]]), ([[-1, -1, 0], [1, -1]], [[[1, 1]], [[-2, 1]]]), ([[-1, -1, 0], [1, 1]], [[[-1, 1]], []]), ([[-1, -1, 0], [1, 2]], [[[-1, 2]], [[-1, 2]]])], [([[-1, -1, -1], [0, -1]], [[[1, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, 0], [1, 2]], [[[-1, 2]], [[-1, 2]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, -1, 1], [2, 1]], [[[-3, 1], [1, 1]], [[5, 1]]]), ([[-1, -1, 1], [2, 2]], [[[-1, 1], [1, 2]], [[1, 1]]]), ([[-1, -1, 2], [-1, -1]], [[[3, 1], [-2, 1]], [[2, 1]]]), ([[-1, -1, 2], [-1, 1]], [[[1, 1], [2, 1]], []])], [([[-1, -1, -1], [0, 2]], [[[-1, 2], [-1, 2]], [[-1, 1]]]), ([[-1, -1, 1], [0, 2]], [[[-1, 2], [1, 2]], [[-1, 1]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, 0, -1], [0, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[-1, 0, -1], [0, 1]], [[[0, 1], [-1, 1]], [[-1, 1]]]), ([[-1, 0, -1], [0, 2]], [[[0, 1], [-1, 2]], [[-1, 1]]]), ([[-1, 0, -1], [1, -1]], [[[1, 1], [1, 1]], [[-2, 1]]])], [([[-1, -1, -1], [1, -1]], [[[2, 1], [1, 1]], [[-3, 1]]]), ([[-1, -1, 2], [-1, 2]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, 0, 0], [1, 2]], [[], [[-1, 1]]]), ([[-1, 0, 0], [2, -1]], [[], [[-1, 1]]]), ([[-1, 0, 0], [2, 1]], [[], [[-1, 1]]]), ([[-1, 0, 0], [2, 2]], [[], [[-1, 1]]])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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":"c3dc5321076c60b22d0ebe26afe5172fa9075df3df45000fb53be4f461475271","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport itertools\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    A,B=x\n    r=list(map(Fraction,A));b=list(map(Fraction,B))\n    while r and r[-1]==0:r.pop()\n    q=[Fraction(0)]*max(0,len(r)-len(b)+1)\n    for _ in range(20):\n     if len(r)<len(b):break\n     k=len(r)-len(b)\n     if k<0 or k>=len(q):return None\n     c=r[-1]\n     q[k]=q[k]+c\n     for j in range(len(b)):\n      if j+k>=len(r):return None\n      r[j+k]=r[j+k]-c*b[j]\n     while r and r[-1]==0:r.pop()\n    while q and q[-1]==0:q.pop()\n    return [[[v.numerator,v.denominator] for v in z] for z in (q,r)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, -1, -1], [-1, 1]], [[[-2, 1], [-1, 1]], [[-3, 1]]]), ([[-1, -1, -1], [0, -1]], [[[1, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [0, 1]], [[[-1, 1], [-1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [0, 2]], [[[-1, 2], [-1, 2]], [[-1, 1]]]), ([[-1, -1, -1], [1, -1]], [[[2, 1], [1, 1]], [[-3, 1]]])], [([[-1, -1, -1], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[-1, -1, -1], [2, 2]], [[[0, 1], [-1, 2]], [[-1, 1]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, -1, 0], [0, 2]], [[[-1, 2]], [[-1, 1]]]), ([[-1, -1, 0], [1, -1]], [[[1, 1]], [[-2, 1]]]), ([[-1, -1, 0], [1, 1]], [[[-1, 1]], []]), ([[-1, -1, 0], [1, 2]], [[[-1, 2]], [[-1, 2]]])], [([[-1, -1, -1], [0, -1]], [[[1, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, 0], [1, 2]], [[[-1, 2]], [[-1, 2]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, -1, 1], [2, 1]], [[[-3, 1], [1, 1]], [[5, 1]]]), ([[-1, -1, 1], [2, 2]], [[[-1, 1], [1, 2]], [[1, 1]]]), ([[-1, -1, 2], [-1, -1]], [[[3, 1], [-2, 1]], [[2, 1]]]), ([[-1, -1, 2], [-1, 1]], [[[1, 1], [2, 1]], []])], [([[-1, -1, -1], [0, 2]], [[[-1, 2], [-1, 2]], [[-1, 1]]]), ([[-1, -1, 1], [0, 2]], [[[-1, 2], [1, 2]], [[-1, 1]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, 0, -1], [0, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[-1, 0, -1], [0, 1]], [[[0, 1], [-1, 1]], [[-1, 1]]]), ([[-1, 0, -1], [0, 2]], [[[0, 1], [-1, 2]], [[-1, 1]]]), ([[-1, 0, -1], [1, -1]], [[[1, 1], [1, 1]], [[-2, 1]]])], [([[-1, -1, -1], [1, -1]], [[[2, 1], [1, 1]], [[-3, 1]]]), ([[-1, -1, 2], [-1, 2]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [-1, -1]], [[[0, 1], [1, 1]], [[-1, 1]]]), ([[1, 2, 3, 4], [1, 0, 2]], [[[3, 2], [2, 1]], [[-1, 2]]]), ([[-1, 0, 0], [1, 2]], [[], [[-1, 1]]]), ([[-1, 0, 0], [2, -1]], [[], [[-1, 1]]]), ([[-1, 0, 0], [2, 1]], [[], [[-1, 1]]]), ([[-1, 0, 0], [2, 2]], [[], [[-1, 1]]])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"explicit oracle %d\" % i, solve(args), expected)\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":"A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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":"s3-numerics-polynomial-long-division-leading-coefficient-cancellation","generated_at":"2026-09-29T14:39:18.489017+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.","root_cause":"The leading coefficient cancellation step uses r[-1] instead of r[-1]/b[-1].","sha256":"b3cdcc2811b319da6c2e6c53f4c92563a22de3cf82afe266e56d6b6737d9be2e","title":"Polynomial long division: leading coefficient cancellation · 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":43.469,"exit_code":1,"observations":[{"actual":[[[0,1],[1,1]],[[-1,1]]],"check":"explicit oracle 0","expected":[[[0,1],[1,1]],[[-1,1]]],"passed":true},{"actual":[[[0,1],[1743392200,1]],[[-1,1],[1743392199,1],[-3486784401,1]]],"check":"explicit oracle 1","expected":[[[-3,4],[-1,2]],[[-7,4]]],"passed":false},{"actual":[[[0,1],[-6973568800,1]],[[1,1],[6973568802,1],[3,1],[13947137604,1]]],"check":"explicit oracle 2","expected":[[[3,2],[2,1]],[[-1,2]]],"passed":false},{"actual":[[[-2,1],[-1,1]],[[-3,1]]],"check":"explicit oracle 3","expected":[[[-2,1],[-1,1]],[[-3,1]]],"passed":true},{"actual":[[[1,1],[1,1]],[[-1,1]]],"check":"explicit oracle 4","expected":[[[1,1],[1,1]],[[-1,1]]],"passed":true},{"actual":[[[-1,1],[-1,1]],[[-1,1]]],"check":"explicit oracle 5","expected":[[[-1,1],[-1,1]],[[-1,1]]],"passed":true},{"actual":[[[0,1],[1743392200,1]],[[-1,1],[-1,1],[-3486784401,1]]],"check":"explicit oracle 6","expected":[[[-1,2],[-1,2]],[[-1,1]]],"passed":false},{"actual":[[[2,1],[1,1]],[[-3,1]]],"check":"explicit oracle 7","expected":[[[2,1],[1,1]],[[-3,1]]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [[[0, 1], [1, 1]], [[-1, 1]]], \"expected\": [[[0, 1], [1, 1]], [[-1, 1]]], \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": [[[0, 1], [1743392200, 1]], [[-1, 1], [1743392199, 1], [-3486784401, 1]]], \"expected\": [[[-3, 4], [-1, 2]], [[-7, 4]]], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [[[0, 1], [-6973568800, 1]], [[1, 1], [6973568802, 1], [3, 1], [13947137604, 1]]], \"expected\": [[[3, 2], [2, 1]], [[-1, 2]]], \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": [[[-2, 1], [-1, 1]], [[-3, 1]]], \"expected\": [[[-2, 1], [-1, 1]], [[-3, 1]]], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [[[1, 1], [1, 1]], [[-1, 1]]], \"expected\": [[[1, 1], [1, 1]], [[-1, 1]]], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [[[-1, 1], [-1, 1]], [[-1, 1]]], \"expected\": [[[-1, 1], [-1, 1]], [[-1, 1]]], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [[[0, 1], [1743392200, 1]], [[-1, 1], [-1, 1], [-3486784401, 1]]], \"expected\": [[[-1, 2], [-1, 2]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [[[2, 1], [1, 1]], [[-3, 1]]], \"expected\": [[[2, 1], [1, 1]], [[-3, 1]]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.874,"exit_code":1,"observations":[{"actual":[[[0,1],[-1048575,1]],[[-1,1],[-1048576,1],[-1048576,1]]],"check":"explicit oracle 0","expected":[[[0,1],[1,1]],[[-1,1]]],"passed":false},{"actual":[[],[[-1,1],[-1,1],[-1,1]]],"check":"explicit oracle 1","expected":[[[-3,4],[-1,2]],[[-7,4]]],"passed":false},{"actual":[[],[[1,1],[2,1],[3,1],[4,1]]],"check":"explicit oracle 2","expected":[[[3,2],[2,1]],[[-1,2]]],"passed":false},{"actual":[[[-2,1],[-1,1]],[[-3,1]]],"check":"explicit oracle 3","expected":[[[-2,1],[-1,1]],[[-3,1]]],"passed":true},{"actual":[[[0,1],[-1048575,1]],[[-1,1],[-1,1],[-1048576,1]]],"check":"explicit oracle 4","expected":[[[1,1],[1,1]],[[-1,1]]],"passed":false},{"actual":[[[-1,1],[-1,1]],[[-1,1]]],"check":"explicit oracle 5","expected":[[[-1,1],[-1,1]],[[-1,1]]],"passed":true},{"actual":[[],[[-1,1],[-1,1],[-1,1]]],"check":"explicit oracle 6","expected":[[[-1,2],[-1,2]],[[-1,1]]],"passed":false},{"actual":[[[0,1],[-1048575,1]],[[-1,1],[1048574,1],[-1048576,1]]],"check":"explicit oracle 7","expected":[[[2,1],[1,1]],[[-3,1]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [[[0, 1], [-1048575, 1]], [[-1, 1], [-1048576, 1], [-1048576, 1]]], \"expected\": [[[0, 1], [1, 1]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [[], [[-1, 1], [-1, 1], [-1, 1]]], \"expected\": [[[-3, 4], [-1, 2]], [[-7, 4]]], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [[], [[1, 1], [2, 1], [3, 1], [4, 1]]], \"expected\": [[[3, 2], [2, 1]], [[-1, 2]]], \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": [[[-2, 1], [-1, 1]], [[-3, 1]]], \"expected\": [[[-2, 1], [-1, 1]], [[-3, 1]]], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [[[0, 1], [-1048575, 1]], [[-1, 1], [-1, 1], [-1048576, 1]]], \"expected\": [[[1, 1], [1, 1]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": [[[-1, 1], [-1, 1]], [[-1, 1]]], \"expected\": [[[-1, 1], [-1, 1]], [[-1, 1]]], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [[], [[-1, 1], [-1, 1], [-1, 1]]], \"expected\": [[[-1, 2], [-1, 2]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [[[0, 1], [-1048575, 1]], [[-1, 1], [1048574, 1], [-1048576, 1]]], \"expected\": [[[2, 1], [1, 1]], [[-3, 1]]], \"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."}}