{"abstract":"The exact jacobi symbol result violates the stated contract at initial residue.","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 if a>0 else 0 still violates the initial residue invariant.","family":"s3-numerics-jacobi-symbol-initial-residue","id":"FA-14841","implementations":{"attempt":{"sha256":"e10c19fd24c46fb71b4877f672aaba45f5c9ccd4b0193401424a900a06934f75","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 if a>0 else 0;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), ([-30, 1], 1), ([50, 69], -1), ([-29, 1], 1), ([-28, 1], 1), ([-27, 1], 1), ([-26, 1], 1), ([-25, 1], 1)], [([-28, 3], -1), ([-25, 3], -1), ([-30, 1], 1), ([50, 69], -1), ([-13, 1], 1), ([-12, 1], 1), ([-11, 1], 1), ([-10, 1], 1)], [([-26, 3], 1), ([-20, 3], 1), ([-30, 1], 1), ([50, 69], -1), ([4, 1], 1), ([5, 1], 1), ([6, 1], 1), ([7, 1], 1)], [([-25, 3], -1), ([-16, 3], -1), ([-30, 1], 1), ([50, 69], -1), ([21, 1], 1), ([22, 1], 1), ([23, 1], 1), ([24, 1], 1)], [([-23, 3], 1), ([-11, 3], 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":"9ff727fd2f75cc70882ba7c6f62e88c44307268e27e4133a404133c5804c840c","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=abs(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), ([-30, 1], 1), ([50, 69], -1), ([-29, 1], 1), ([-28, 1], 1), ([-27, 1], 1), ([-26, 1], 1), ([-25, 1], 1)], [([-28, 3], -1), ([-25, 3], -1), ([-30, 1], 1), ([50, 69], -1), ([-13, 1], 1), ([-12, 1], 1), ([-11, 1], 1), ([-10, 1], 1)], [([-26, 3], 1), ([-20, 3], 1), ([-30, 1], 1), ([50, 69], -1), ([4, 1], 1), ([5, 1], 1), ([6, 1], 1), ([7, 1], 1)], [([-25, 3], -1), ([-16, 3], -1), ([-30, 1], 1), ([50, 69], -1), ([21, 1], 1), ([22, 1], 1), ([23, 1], 1), ([24, 1], 1)], [([-23, 3], 1), ([-11, 3], 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":"795bc6dfd9085061d21559862a7e1cfe0a14acedff2bb0185621040c823120ef","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), ([-30, 1], 1), ([50, 69], -1), ([-29, 1], 1), ([-28, 1], 1), ([-27, 1], 1), ([-26, 1], 1), ([-25, 1], 1)], [([-28, 3], -1), ([-25, 3], -1), ([-30, 1], 1), ([50, 69], -1), ([-13, 1], 1), ([-12, 1], 1), ([-11, 1], 1), ([-10, 1], 1)], [([-26, 3], 1), ([-20, 3], 1), ([-30, 1], 1), ([50, 69], -1), ([4, 1], 1), ([5, 1], 1), ([6, 1], 1), ([7, 1], 1)], [([-25, 3], -1), ([-16, 3], -1), ([-30, 1], 1), ([50, 69], -1), ([21, 1], 1), ([22, 1], 1), ([23, 1], 1), ([24, 1], 1)], [([-23, 3], 1), ([-11, 3], 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-initial-residue","generated_at":"2026-09-29T14:39:20.926783+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%n at the initial residue step.","root_cause":"The initial residue step uses abs(a)%n instead of a%n.","sha256":"f712493649dc26841f31b4203baf38633913e0e34432052559bddba001ec26d3","title":"Jacobi symbol: initial residue · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":47.84,"exit_code":1,"observations":[{"actual":0,"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\": 0, \"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"},"broken":{"elapsed_ms":45.831,"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":41.202,"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"}