{"abstract":"The exact polynomial long division result violates the stated contract at quotient coefficient placement.","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 q[k]-c still violates the quotient coefficient placement invariant.","family":"s3-numerics-polynomial-long-division-quotient-coefficient-placement","id":"FA-14601","implementations":{"attempt":{"sha256":"0b4c842d74615ca47e55aa1d3a0c7f6a00f1d28fd6ac7cd511a22f874bd734ec","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, 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], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[-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, 1]], [[[-2, 1], [-1, 1]], [[-3, 1]]]), ([[-1, -1, -1], [0, -1]], [[[1, 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, -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], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[-1, -1, -1], [1, -1]], [[[2, 1], [1, 1]], [[-3, 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, 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, -1]], [[[1, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [2, -1]], [[[3, 1], [1, 1]], [[-7, 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], [0, 1]], [[[-1, 1], [-1, 1]], [[-1, 1]]]), ([[-1, -1, 0], [-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":"45e5c934ed01391a0238d4244a0f9557bff811d84aa10dc7140e388163fae541","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]=c if k==0 else q[k]\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, 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], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[-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, 1]], [[[-2, 1], [-1, 1]], [[-3, 1]]]), ([[-1, -1, -1], [0, -1]], [[[1, 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, -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], [-1, 2]], [[[-3, 4], [-1, 2]], [[-7, 4]]]), ([[-1, -1, -1], [1, -1]], [[[2, 1], [1, 1]], [[-3, 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, 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, -1]], [[[1, 1], [1, 1]], [[-1, 1]]]), ([[-1, -1, -1], [2, -1]], [[[3, 1], [1, 1]], [[-7, 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], [0, 1]], [[[-1, 1], [-1, 1]], [[-1, 1]]]), ([[-1, -1, 0], [-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-quotient-coefficient-placement","generated_at":"2026-09-29T14:39:18.493385+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 quotient coefficient placement step uses c if k==0 else q[k] instead of q[k]+c.","sha256":"ea4b61b0467429662eda9d2afb244f4dbbcae0ffdaf5f20aac7db22f9da66f33","title":"Polynomial long division: quotient coefficient placement · 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":44.692,"exit_code":1,"observations":[{"actual":[[[0,1],[-1,1]],[[-1,1]]],"check":"explicit oracle 0","expected":[[[0,1],[1,1]],[[-1,1]]],"passed":false},{"actual":[[[-3,2],[-2,1]],[[-1,2]]],"check":"explicit oracle 1","expected":[[[3,2],[2,1]],[[-1,2]]],"passed":false},{"actual":[[[2,1],[1,1]],[[-3,1]]],"check":"explicit oracle 2","expected":[[[-2,1],[-1,1]],[[-3,1]]],"passed":false},{"actual":[[[3,4],[1,2]],[[-7,4]]],"check":"explicit oracle 3","expected":[[[-3,4],[-1,2]],[[-7,4]]],"passed":false},{"actual":[[[-1,1],[-1,1]],[[-1,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":false},{"actual":[[[1,2],[1,2]],[[-1,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":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [[[0, 1], [-1, 1]], [[-1, 1]]], \"expected\": [[[0, 1], [1, 1]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [[[-3, 2], [-2, 1]], [[-1, 2]]], \"expected\": [[[3, 2], [2, 1]], [[-1, 2]]], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [[[2, 1], [1, 1]], [[-3, 1]]], \"expected\": [[[-2, 1], [-1, 1]], [[-3, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": [[[3, 4], [1, 2]], [[-7, 4]]], \"expected\": [[[-3, 4], [-1, 2]], [[-7, 4]]], \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": [[[-1, 1], [-1, 1]], [[-1, 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\": false}, {\"check\": \"explicit oracle 6\", \"actual\": [[[1, 2], [1, 2]], [[-1, 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\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.594,"exit_code":1,"observations":[{"actual":[[],[[-1,1]]],"check":"explicit oracle 0","expected":[[[0,1],[1,1]],[[-1,1]]],"passed":false},{"actual":[[[3,2]],[[-1,2]]],"check":"explicit oracle 1","expected":[[[3,2],[2,1]],[[-1,2]]],"passed":false},{"actual":[[[-2,1]],[[-3,1]]],"check":"explicit oracle 2","expected":[[[-2,1],[-1,1]],[[-3,1]]],"passed":false},{"actual":[[[-3,4]],[[-7,4]]],"check":"explicit oracle 3","expected":[[[-3,4],[-1,2]],[[-7,4]]],"passed":false},{"actual":[[[1,1]],[[-1,1]]],"check":"explicit oracle 4","expected":[[[1,1],[1,1]],[[-1,1]]],"passed":false},{"actual":[[[-1,1]],[[-1,1]]],"check":"explicit oracle 5","expected":[[[-1,1],[-1,1]],[[-1,1]]],"passed":false},{"actual":[[[-1,2]],[[-1,1]]],"check":"explicit oracle 6","expected":[[[-1,2],[-1,2]],[[-1,1]]],"passed":false},{"actual":[[[2,1]],[[-3,1]]],"check":"explicit oracle 7","expected":[[[2,1],[1,1]],[[-3,1]]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [[], [[-1, 1]]], \"expected\": [[[0, 1], [1, 1]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [[[3, 2]], [[-1, 2]]], \"expected\": [[[3, 2], [2, 1]], [[-1, 2]]], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [[[-2, 1]], [[-3, 1]]], \"expected\": [[[-2, 1], [-1, 1]], [[-3, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 3\", \"actual\": [[[-3, 4]], [[-7, 4]]], \"expected\": [[[-3, 4], [-1, 2]], [[-7, 4]]], \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": [[[1, 1]], [[-1, 1]]], \"expected\": [[[1, 1], [1, 1]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": [[[-1, 1]], [[-1, 1]]], \"expected\": [[[-1, 1], [-1, 1]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": [[[-1, 2]], [[-1, 1]]], \"expected\": [[[-1, 2], [-1, 2]], [[-1, 1]]], \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": [[[2, 1]], [[-3, 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."}}