{"abstract":"The exact jacobi symbol result violates the stated contract at quadratic reciprocity.","category":"Numerics","checks":8,"contract":"Input [a,n], positive odd n; return Jacobi symbol in {-1,0,1}. Bounds: |a|<=100 and odd n<=99.","evaluation_group":"s3-numerics-jacobi-symbol","failed_approach":"The partial repair a%4==1 and n%4==1 still violates the quadratic reciprocity invariant.","family":"s3-numerics-jacobi-symbol-quadratic-reciprocity","id":"FA-14851","implementations":{"attempt":{"sha256":"1cd1c053c38d4f2ccfdbce5ebc1357499fb90024e04284c711e9a4f665ba02e1","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,n=x\n    a=a%n;sign=1\n    for _ in range(100):\n     if a==0:break\n     while a%2==0:\n      a//=2\n      if n%8 in (3,5):sign=-sign\n     if a%4==1 and n%4==1:sign=-sign\n     a,n=n%a,a\n    return sign if n==1 else 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-29, 3], 1), ([-29, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([-29, 1], 1), ([-28, 1], 1), ([-27, 1], 1), ([-26, 1], 1)], [([-28, 3], -1), ([-24, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([-13, 1], 1), ([-12, 1], 1), ([-11, 1], 1), ([-10, 1], 1)], [([-26, 3], 1), ([-19, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([4, 1], 1), ([5, 1], 1), ([6, 1], 1), ([7, 1], 1)], [([-25, 3], -1), ([-14, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([21, 1], 1), ([22, 1], 1), ([23, 1], 1), ([24, 1], 1)], [([-23, 3], 1), ([-9, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([38, 1], 1), ([39, 1], 1), ([40, 1], 1), ([41, 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":"4d65ba5bfd0a5a35d26b9cba131d066f2086a8b8db474033d94bf2dca188e011","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,n=x\n    a=a%n;sign=1\n    for _ in range(100):\n     if a==0:break\n     while a%2==0:\n      a//=2\n      if n%8 in (3,5):sign=-sign\n     if a%4==3 or n%4==3:sign=-sign\n     a,n=n%a,a\n    return sign if n==1 else 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-29, 3], 1), ([-29, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([-29, 1], 1), ([-28, 1], 1), ([-27, 1], 1), ([-26, 1], 1)], [([-28, 3], -1), ([-24, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([-13, 1], 1), ([-12, 1], 1), ([-11, 1], 1), ([-10, 1], 1)], [([-26, 3], 1), ([-19, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([4, 1], 1), ([5, 1], 1), ([6, 1], 1), ([7, 1], 1)], [([-25, 3], -1), ([-14, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([21, 1], 1), ([22, 1], 1), ([23, 1], 1), ([24, 1], 1)], [([-23, 3], 1), ([-9, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([38, 1], 1), ([39, 1], 1), ([40, 1], 1), ([41, 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"},"fixed":{"sha256":"f3ca1817240da32e11b44a807444b3e45fe38b093861002c80c4928bad485d49","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,n=x\n    a=a%n;sign=1\n    for _ in range(100):\n     if a==0:break\n     while a%2==0:\n      a//=2\n      if n%8 in (3,5):sign=-sign\n     if a%4==3 and n%4==3:sign=-sign\n     a,n=n%a,a\n    return sign if n==1 else 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([-29, 3], 1), ([-29, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([-29, 1], 1), ([-28, 1], 1), ([-27, 1], 1), ([-26, 1], 1)], [([-28, 3], -1), ([-24, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([-13, 1], 1), ([-12, 1], 1), ([-11, 1], 1), ([-10, 1], 1)], [([-26, 3], 1), ([-19, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([4, 1], 1), ([5, 1], 1), ([6, 1], 1), ([7, 1], 1)], [([-25, 3], -1), ([-14, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([21, 1], 1), ([22, 1], 1), ([23, 1], 1), ([24, 1], 1)], [([-23, 3], 1), ([-9, 5], 1), ([-30, 1], 1), ([50, 69], -1), ([38, 1], 1), ([39, 1], 1), ([40, 1], 1), ([41, 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-jacobi-symbol-quadratic-reciprocity","generated_at":"2026-09-29T14:39:21.112103+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.","repair":"Use a%4==3 and n%4==3 at the quadratic reciprocity step.","root_cause":"The quadratic reciprocity step uses a%4==3 or n%4==3 instead of a%4==3 and n%4==3.","sha256":"8446ce85961ac122f4764559d833242fec41a5cb2d24031b732b5e25e680f0ba","title":"Jacobi symbol: quadratic reciprocity · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.958,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":1,"passed":true},{"actual":-1,"check":"explicit oracle 1","expected":1,"passed":false},{"actual":1,"check":"explicit oracle 2","expected":1,"passed":true},{"actual":-1,"check":"explicit oracle 3","expected":-1,"passed":true},{"actual":1,"check":"explicit oracle 4","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 5","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 6","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 7","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": -1, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.956,"exit_code":1,"observations":[{"actual":-1,"check":"explicit oracle 0","expected":1,"passed":false},{"actual":1,"check":"explicit oracle 1","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 2","expected":1,"passed":true},{"actual":-1,"check":"explicit oracle 3","expected":-1,"passed":true},{"actual":1,"check":"explicit oracle 4","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 5","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 6","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 7","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": -1, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.64,"exit_code":0,"observations":[{"actual":1,"check":"explicit oracle 0","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 1","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 2","expected":1,"passed":true},{"actual":-1,"check":"explicit oracle 3","expected":-1,"passed":true},{"actual":1,"check":"explicit oracle 4","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 5","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 6","expected":1,"passed":true},{"actual":1,"check":"explicit oracle 7","expected":1,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": -1, \"expected\": -1, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}