{"abstract":"The exact montgomery residue product result violates the stated contract at wide product retention.","category":"Numerics","checks":8,"contract":"Input [a,b,m,R], odd modulus m<R and R power of2, 0<=a,b<m; return a*b*R^-1 modulo m using Montgomery reduction.","contract_signature":"x","evaluation_group":"s3-numerics-montgomery-residue-product","failed_approach":"The partial repair a+b still violates the wide product retention invariant.","family":"s3-numerics-montgomery-residue-product-wide-product-retention","id":"FA-15771","implementations":{"attempt":{"sha256":"c44c31cfe18933b7f712fd75013988d36c1b6be21f81bb6c79fafea09645557a","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,R=x\n    nprime=(-pow(m,-1,R))%R\n    t=a+b\n    u=(t*nprime)%R\n    v=(t+u*m)//R\n    if v>=m:v-=m\n    return v\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 4, 5, 8], 1), ([0, 1, 3, 8], 0), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([0, 2, 3, 8], 0), ([1, 0, 3, 8], 0), ([1, 1, 3, 8], 2), ([1, 2, 3, 8], 1)], [([3, 3, 5, 8], 3), ([1, 1, 3, 8], 2), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([1, 3, 5, 8], 1), ([1, 4, 5, 8], 3), ([2, 0, 5, 8], 0), ([2, 1, 5, 8], 4)], [([3, 4, 5, 8], 4), ([2, 1, 3, 8], 1), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([0, 0, 7, 8], 0), ([0, 1, 7, 8], 0), ([0, 2, 7, 8], 0), ([0, 3, 7, 8], 0)], [([4, 2, 5, 8], 1), ([0, 3, 5, 8], 0), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([2, 3, 7, 8], 6), ([2, 4, 7, 8], 1), ([2, 5, 7, 8], 3), ([2, 6, 7, 8], 5)], [([4, 3, 5, 8], 4), ([1, 1, 5, 8], 2), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([4, 6, 7, 8], 3), ([5, 0, 7, 8], 0), ([5, 1, 7, 8], 5), ([5, 2, 7, 8], 3)]]\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":"7e305c92d3ebb4ad0dd13ae1e4fd5a229eccbadc8a210bf24cda8e949a7d7635","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,R=x\n    nprime=(-pow(m,-1,R))%R\n    t=(a*b)%R\n    u=(t*nprime)%R\n    v=(t+u*m)//R\n    if v>=m:v-=m\n    return v\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 4, 5, 8], 1), ([0, 1, 3, 8], 0), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([0, 2, 3, 8], 0), ([1, 0, 3, 8], 0), ([1, 1, 3, 8], 2), ([1, 2, 3, 8], 1)], [([3, 3, 5, 8], 3), ([1, 1, 3, 8], 2), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([1, 3, 5, 8], 1), ([1, 4, 5, 8], 3), ([2, 0, 5, 8], 0), ([2, 1, 5, 8], 4)], [([3, 4, 5, 8], 4), ([2, 1, 3, 8], 1), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([0, 0, 7, 8], 0), ([0, 1, 7, 8], 0), ([0, 2, 7, 8], 0), ([0, 3, 7, 8], 0)], [([4, 2, 5, 8], 1), ([0, 3, 5, 8], 0), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([2, 3, 7, 8], 6), ([2, 4, 7, 8], 1), ([2, 5, 7, 8], 3), ([2, 6, 7, 8], 5)], [([4, 3, 5, 8], 4), ([1, 1, 5, 8], 2), ([0, 0, 3, 8], 0), ([30, 30, 31, 32], 1), ([4, 6, 7, 8], 3), ([5, 0, 7, 8], 0), ([5, 1, 7, 8], 5), ([5, 2, 7, 8], 3)]]\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-montgomery-residue-product-wide-product-retention","generated_at":"2026-09-29T14:39:30.117271+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 wide product retention step uses (a*b)%R instead of a*b.","sha256":"1850dfd7f2e22766106a9eef377875f724fbb1585cc30c5b93f131ad8c8fe80e","title":"Montgomery residue product: wide product retention · 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":41.27,"exit_code":1,"observations":[{"actual":2,"check":"explicit oracle 0","expected":1,"passed":false},{"actual":2,"check":"explicit oracle 1","expected":0,"passed":false},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":29,"check":"explicit oracle 3","expected":1,"passed":false},{"actual":1,"check":"explicit oracle 4","expected":0,"passed":false},{"actual":2,"check":"explicit oracle 5","expected":0,"passed":false},{"actual":1,"check":"explicit oracle 6","expected":2,"passed":false},{"actual":0,"check":"explicit oracle 7","expected":1,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 29, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 5\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"explicit oracle 6\", \"actual\": 1, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 7\", \"actual\": 0, \"expected\": 1, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.926,"exit_code":1,"observations":[{"actual":0,"check":"explicit oracle 0","expected":1,"passed":false},{"actual":0,"check":"explicit oracle 1","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":4,"check":"explicit oracle 3","expected":1,"passed":false},{"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":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\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 4, \"expected\": 1, \"passed\": false}, {\"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\": 1, \"expected\": 1, \"passed\": true}], \"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."}}