{"abstract":"The exact baby step giant step logarithm result violates the stated contract at baby group progression.","category":"Numerics","checks":8,"contract":"Input [g,h,p], p prime and nonzero g,h; return least e>=0 with g^e=h mod p or None.","evaluation_group":"s3-numerics-baby-step-giant-step-logarithm","failed_approach":"The partial repair g%p still violates the baby group progression invariant.","family":"s3-numerics-baby-step-giant-step-logarithm-baby-group-progression","id":"FA-15071","implementations":{"attempt":{"sha256":"3bac78d82a9ac11d7f0f99831a1a77e8b17cc893c0d662fd13713615299e23c6","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    g,h,p=x;m=math.isqrt(p-1)+1\n    baby={};v=1\n    for j in range(m):\n     if v not in baby:baby[v]=j\n     v=g%p\n    factor=pow(pow(g,m,p),-1,p)\n    v=h\n    answers=[]\n    for i in range(m+1):\n     if v in baby:\n      e=i*m+baby[v]\n      if pow(g,e,p)==h:answers.append(e)\n     v=v*factor%p\n    return min(answers) if answers else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 2, 3], 1), ([2, 4, 5], 2), ([1, 1, 3], 0), ([22, 22, 23], 1), ([1, 2, 3], None), ([2, 1, 3], 0), ([1, 1, 5], 0), ([1, 2, 5], None)], [([2, 2, 5], 1), ([3, 2, 7], 2), ([1, 1, 3], 0), ([22, 22, 23], 1), ([4, 2, 5], None), ([4, 3, 5], None), ([4, 4, 5], 1), ([1, 1, 7], 0)], [([2, 4, 5], 2), ([5, 3, 7], 5), ([1, 1, 3], 0), ([22, 22, 23], 1), ([3, 3, 7], 1), ([3, 4, 7], 4), ([3, 5, 7], 5), ([3, 6, 7], 3)], [([3, 3, 5], 1), ([2, 7, 11], 7), ([1, 1, 3], 0), ([22, 22, 23], 1), ([6, 2, 7], None), ([6, 3, 7], None), ([6, 4, 7], None), ([6, 5, 7], None)], [([3, 4, 5], 2), ([3, 5, 11], 3), ([1, 1, 3], 0), ([22, 22, 23], 1), ([2, 3, 11], 8), ([2, 4, 11], 2), ([2, 5, 11], 4), ([2, 6, 11], 9)]]\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":"50a89a8751ba76deceff5849ee87c973cb9df8432f4bde6d920ae9c8e3581b44","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    g,h,p=x;m=math.isqrt(p-1)+1\n    baby={};v=1\n    for j in range(m):\n     if v not in baby:baby[v]=j\n     v=v+g%p\n    factor=pow(pow(g,m,p),-1,p)\n    v=h\n    answers=[]\n    for i in range(m+1):\n     if v in baby:\n      e=i*m+baby[v]\n      if pow(g,e,p)==h:answers.append(e)\n     v=v*factor%p\n    return min(answers) if answers else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 2, 3], 1), ([2, 4, 5], 2), ([1, 1, 3], 0), ([22, 22, 23], 1), ([1, 2, 3], None), ([2, 1, 3], 0), ([1, 1, 5], 0), ([1, 2, 5], None)], [([2, 2, 5], 1), ([3, 2, 7], 2), ([1, 1, 3], 0), ([22, 22, 23], 1), ([4, 2, 5], None), ([4, 3, 5], None), ([4, 4, 5], 1), ([1, 1, 7], 0)], [([2, 4, 5], 2), ([5, 3, 7], 5), ([1, 1, 3], 0), ([22, 22, 23], 1), ([3, 3, 7], 1), ([3, 4, 7], 4), ([3, 5, 7], 5), ([3, 6, 7], 3)], [([3, 3, 5], 1), ([2, 7, 11], 7), ([1, 1, 3], 0), ([22, 22, 23], 1), ([6, 2, 7], None), ([6, 3, 7], None), ([6, 4, 7], None), ([6, 5, 7], None)], [([3, 4, 5], 2), ([3, 5, 11], 3), ([1, 1, 3], 0), ([22, 22, 23], 1), ([2, 3, 11], 8), ([2, 4, 11], 2), ([2, 5, 11], 4), ([2, 6, 11], 9)]]\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":"ef4048e1429b4010ed8aab1b0205ce07df58df2464fff4561cc3b15d1dc51834","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    g,h,p=x;m=math.isqrt(p-1)+1\n    baby={};v=1\n    for j in range(m):\n     if v not in baby:baby[v]=j\n     v=v*g%p\n    factor=pow(pow(g,m,p),-1,p)\n    v=h\n    answers=[]\n    for i in range(m+1):\n     if v in baby:\n      e=i*m+baby[v]\n      if pow(g,e,p)==h:answers.append(e)\n     v=v*factor%p\n    return min(answers) if answers else None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[([2, 2, 3], 1), ([2, 4, 5], 2), ([1, 1, 3], 0), ([22, 22, 23], 1), ([1, 2, 3], None), ([2, 1, 3], 0), ([1, 1, 5], 0), ([1, 2, 5], None)], [([2, 2, 5], 1), ([3, 2, 7], 2), ([1, 1, 3], 0), ([22, 22, 23], 1), ([4, 2, 5], None), ([4, 3, 5], None), ([4, 4, 5], 1), ([1, 1, 7], 0)], [([2, 4, 5], 2), ([5, 3, 7], 5), ([1, 1, 3], 0), ([22, 22, 23], 1), ([3, 3, 7], 1), ([3, 4, 7], 4), ([3, 5, 7], 5), ([3, 6, 7], 3)], [([3, 3, 5], 1), ([2, 7, 11], 7), ([1, 1, 3], 0), ([22, 22, 23], 1), ([6, 2, 7], None), ([6, 3, 7], None), ([6, 4, 7], None), ([6, 5, 7], None)], [([3, 4, 5], 2), ([3, 5, 11], 3), ([1, 1, 3], 0), ([22, 22, 23], 1), ([2, 3, 11], 8), ([2, 4, 11], 2), ([2, 5, 11], 4), ([2, 6, 11], 9)]]\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-baby-step-giant-step-logarithm-baby-group-progression","generated_at":"2026-09-29T14:39:23.184023+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 v*g%p at the baby group progression step.","root_cause":"The baby group progression step uses v+g%p instead of v*g%p.","sha256":"127e918b340b5b35fd428ec7f62e5f55acb6669986f06b16147342407066353c","title":"Baby step giant step logarithm: baby group progression · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.888,"exit_code":1,"observations":[{"actual":1,"check":"explicit oracle 0","expected":1,"passed":true},{"actual":6,"check":"explicit oracle 1","expected":2,"passed":false},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 3","expected":1,"passed":true},{"actual":null,"check":"explicit oracle 4","expected":null,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 6","expected":0,"passed":true},{"actual":null,"check":"explicit oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 1\", \"actual\": 6, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.922,"exit_code":1,"observations":[{"actual":null,"check":"explicit oracle 0","expected":1,"passed":false},{"actual":6,"check":"explicit oracle 1","expected":2,"passed":false},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":5,"check":"explicit oracle 3","expected":1,"passed":false},{"actual":null,"check":"explicit oracle 4","expected":null,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 6","expected":0,"passed":true},{"actual":null,"check":"explicit oracle 7","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": null, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 1\", \"actual\": 6, \"expected\": 2, \"passed\": false}, {\"check\": \"explicit oracle 2\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 3\", \"actual\": 5, \"expected\": 1, \"passed\": false}, {\"check\": \"explicit oracle 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.718,"exit_code":0,"observations":[{"actual":1,"check":"explicit oracle 0","expected":1,"passed":true},{"actual":2,"check":"explicit oracle 1","expected":2,"passed":true},{"actual":0,"check":"explicit oracle 2","expected":0,"passed":true},{"actual":1,"check":"explicit oracle 3","expected":1,"passed":true},{"actual":null,"check":"explicit oracle 4","expected":null,"passed":true},{"actual":0,"check":"explicit oracle 5","expected":0,"passed":true},{"actual":0,"check":"explicit oracle 6","expected":0,"passed":true},{"actual":null,"check":"explicit oracle 7","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"explicit oracle 0\", \"actual\": 1, \"expected\": 1, \"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\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"explicit oracle 4\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"explicit oracle 5\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 6\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"explicit oracle 7\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}