{"abstract":"The exact linear congruence solutions result violates the stated contract at reduced residue.","category":"Numerics","checks":8,"contract":"Input [a,b,m], m>0; sorted all x in [0,m) with a*x congruent b modulo m.","evaluation_group":"s3-numerics-linear-congruence-solutions","failed_approach":"The partial repair (b//g)%q if q>1 else 0 still violates the reduced residue invariant.","family":"s3-numerics-linear-congruence-solutions-reduced-residue","id":"FA-14376","implementations":{"attempt":{"sha256":"c6cba10acc21b40d7096883e766280f8e24b48c0ff5b7b154b3a7a83c510106b","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,m=x\n    g=math.gcd(a,m)\n    if b%g != 0: return []\n    q=m//g\n    r=(b//g)%q if q>1 else 0\n    return sorted(r+k*q for k in range(g))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, -6, 4], [1, 3]), ([2, -6, 5], [2]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -6, 2], [0]), ([1, -6, 3], [0]), ([1, -6, 4], [2]), ([1, -6, 5], [4])], [([2, -6, 8], [1, 5]), ([2, -6, 11], [8]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -5, 6], [1]), ([1, -5, 7], [2]), ([1, -5, 8], [3]), ([1, -5, 9], [4])], [([2, -6, 10], [2, 7]), ([2, -5, 9], [2]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -4, 11], [7]), ([1, -4, 12], [8]), ([1, -3, 1], [0]), ([1, -3, 2], [1])], [([2, -6, 12], [3, 9]), ([2, -4, 5], [3]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -2, 4], [2]), ([1, -2, 5], [3]), ([1, -2, 6], [4]), ([1, -2, 7], [5])], [([2, -4, 6], [1, 4]), ([2, -4, 11], [9]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -1, 9], [8]), ([1, -1, 10], [9]), ([1, -1, 11], [10]), ([1, -1, 12], [11])]]\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":"0520b3eb9677052a7a783ef760340b590028d4103620b72e7df81e8752f2c814","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,m=x\n    g=math.gcd(a,m)\n    if b%g != 0: return []\n    q=m//g\n    r=(b*pow(a//g,-1,q))%q if q>1 else 0\n    return sorted(r+k*q for k in range(g))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, -6, 4], [1, 3]), ([2, -6, 5], [2]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -6, 2], [0]), ([1, -6, 3], [0]), ([1, -6, 4], [2]), ([1, -6, 5], [4])], [([2, -6, 8], [1, 5]), ([2, -6, 11], [8]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -5, 6], [1]), ([1, -5, 7], [2]), ([1, -5, 8], [3]), ([1, -5, 9], [4])], [([2, -6, 10], [2, 7]), ([2, -5, 9], [2]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -4, 11], [7]), ([1, -4, 12], [8]), ([1, -3, 1], [0]), ([1, -3, 2], [1])], [([2, -6, 12], [3, 9]), ([2, -4, 5], [3]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -2, 4], [2]), ([1, -2, 5], [3]), ([1, -2, 6], [4]), ([1, -2, 7], [5])], [([2, -4, 6], [1, 4]), ([2, -4, 11], [9]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -1, 9], [8]), ([1, -1, 10], [9]), ([1, -1, 11], [10]), ([1, -1, 12], [11])]]\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":"15fd6e62c6886b7804ed5f5ef1a0deea85335ed935c34ddba4959149f917d4c9","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,m=x\n    g=math.gcd(a,m)\n    if b%g != 0: return []\n    q=m//g\n    r=((b//g)*pow(a//g,-1,q))%q if q>1 else 0\n    return sorted(r+k*q for k in range(g))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, -6, 4], [1, 3]), ([2, -6, 5], [2]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -6, 2], [0]), ([1, -6, 3], [0]), ([1, -6, 4], [2]), ([1, -6, 5], [4])], [([2, -6, 8], [1, 5]), ([2, -6, 11], [8]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -5, 6], [1]), ([1, -5, 7], [2]), ([1, -5, 8], [3]), ([1, -5, 9], [4])], [([2, -6, 10], [2, 7]), ([2, -5, 9], [2]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -4, 11], [7]), ([1, -4, 12], [8]), ([1, -3, 1], [0]), ([1, -3, 2], [1])], [([2, -6, 12], [3, 9]), ([2, -4, 5], [3]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -2, 4], [2]), ([1, -2, 5], [3]), ([1, -2, 6], [4]), ([1, -2, 7], [5])], [([2, -4, 6], [1, 4]), ([2, -4, 11], [9]), ([1, -6, 1], [0]), ([11, 6, 12], [6]), ([1, -1, 9], [8]), ([1, -1, 10], [9]), ([1, -1, 11], [10]), ([1, -1, 12], [11])]]\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-linear-congruence-solutions-reduced-residue","generated_at":"2026-09-29T14:39:16.362174+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 ((b//g)*pow(a//g,-1,q))%q if q>1 else 0 at the reduced residue step.","root_cause":"The reduced residue step uses (b*pow(a//g,-1,q))%q if q>1 else 0 instead of ((b//g)*pow(a//g,-1,q))%q if q>1 else 0.","sha256":"ff6826efbf86e5bb38de0a88b99e688ceda7b3203f17357675d2cd6a46e5750b","title":"Linear congruence solutions: reduced residue · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.424,"exit_code":1,"observations":[{"actual":[1,3],"check":"explicit oracle 0","expected":[1,3],"passed":true},{"actual":[4],"check":"explicit oracle 1","expected":[2],"passed":false},{"actual":[0],"check":"explicit oracle 2","expected":[0],"passed":true},{"actual":[6],"check":"explicit oracle 3","expected":[6],"passed":true},{"actual":[0],"check":"explicit oracle 4","expected":[0],"passed":true},{"actual":[0],"check":"explicit oracle 5","expected":[0],"passed":true},{"actual":[2],"check":"explicit oracle 6","expected":[2],"passed":true},{"actual":[4],"check":"explicit oracle 7","expected":[4],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [1, 3], \"expected\": [1, 3], \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": [4], \"expected\": [2], \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [6], \"expected\": [6], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": [4], \"expected\": [4], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.935,"exit_code":1,"observations":[{"actual":[0,2],"check":"explicit oracle 0","expected":[1,3],"passed":false},{"actual":[2],"check":"explicit oracle 1","expected":[2],"passed":true},{"actual":[0],"check":"explicit oracle 2","expected":[0],"passed":true},{"actual":[6],"check":"explicit oracle 3","expected":[6],"passed":true},{"actual":[0],"check":"explicit oracle 4","expected":[0],"passed":true},{"actual":[0],"check":"explicit oracle 5","expected":[0],"passed":true},{"actual":[2],"check":"explicit oracle 6","expected":[2],"passed":true},{"actual":[4],"check":"explicit oracle 7","expected":[4],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [0, 2], \"expected\": [1, 3], \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [6], \"expected\": [6], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": [4], \"expected\": [4], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":45.504,"exit_code":0,"observations":[{"actual":[1,3],"check":"explicit oracle 0","expected":[1,3],"passed":true},{"actual":[2],"check":"explicit oracle 1","expected":[2],"passed":true},{"actual":[0],"check":"explicit oracle 2","expected":[0],"passed":true},{"actual":[6],"check":"explicit oracle 3","expected":[6],"passed":true},{"actual":[0],"check":"explicit oracle 4","expected":[0],"passed":true},{"actual":[0],"check":"explicit oracle 5","expected":[0],"passed":true},{"actual":[2],"check":"explicit oracle 6","expected":[2],"passed":true},{"actual":[4],"check":"explicit oracle 7","expected":[4],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": [1, 3], \"expected\": [1, 3], \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": [6], \"expected\": [6], \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": [2], \"expected\": [2], \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": [4], \"expected\": [4], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}