{"abstract":"ISINs containing letters get the wrong computed check digit.","category":"Check-digit algorithms","checks":8,"contract":"Input a 12-character ISIN: two uppercase ASCII letters (country), nine uppercase alphanumerics, one check digit; anything else is \"malformed\". Letters expand to two digits (A=10 .. Z=35), then Luhn doubling starts at the rightmost digit of the expanded 11-character payload. Return [computed check digit, whether it matches].","evaluation_group":"w2-check_digit_algorithms-isin-check","failed_approach":"Expanding with ord(ch) - 65 (A=0) is still off by ten for every letter.","family":"w2-check_digit_algorithms-isin-check-letter-value","id":"FA-72366","implementations":{"attempt":{"sha256":"481de792fa70b649fea355362cf96a9086041dce6afed7392d35c15f16aee041","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 12 or not s.isascii() or not s[:2].isalpha() or not s[:2].isupper():\n        return 'malformed'\n    if not s[2:11].isalnum() or s[2:11] != s[2:11].upper() or not s[11].isdigit():\n        return 'malformed'\n    digits = ''\n    for ch in s[:11]:\n        digits += ch if ch.isdigit() else str(ord(ch) - 65)\n    total = 0\n    for i, ch in enumerate(reversed(digits)):\n        d = int(ch)\n        if i % 2 == 0:\n            d *= 2\n            if d > 9:\n                d -= 9\n        total += d\n    check = (10 - total % 10) % 10\n    return [check, check == int(s[11])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"US4V5PGS4IX8\"]', ['US4V5PGS4IX8'], [0, False]], ['regression [\"GBOV8F5J6090\"]', ['GBOV8F5J6090'], [7, False]], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed']], [['regression [\"JPFWKDL124I1\"]', ['JPFWKDL124I1'], [1, True]], ['regression [\"CHXVXSVIT016\"]', ['CHXVXSVIT016'], [1, False]], ['partial-repair [\"FRLWNIYHPT37\"]', ['FRLWNIYHPT37'], [5, False]], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed']], [['regression [\"XS0K4JDSXBN1\"]', ['XS0K4JDSXBN1'], [4, False]], ['regression [\"AUKWRNHD2XR3\"]', ['AUKWRNHD2XR3'], [8, False]], ['partial-repair [\"NL5BVKR8BB60\"]', ['NL5BVKR8BB60'], [3, False]], ['partial-repair [\"CA3CKMM2IAN8\"]', ['CA3CKMM2IAN8'], [0, False]], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed']], [['regression [\"US6754047769\"]', ['US6754047769'], [8, False]], ['regression [\"IE9141151847\"]', ['IE9141151847'], [0, False]], ['partial-repair [\"LU7763909076\"]', ['LU7763909076'], [8, False]], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed']], [['regression [\"KY3791880781\"]', ['KY3791880781'], [4, False]], ['regression [\"BM9170095145\"]', ['BM9170095145'], [7, False]], ['partial-repair [\"US0378331005\"]', ['US0378331005'], [5, True]], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed']]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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":"a5689026595c6cc5b3250e4c57945d5ff1db3bab97bffdc9322c119072d69443","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 12 or not s.isascii() or not s[:2].isalpha() or not s[:2].isupper():\n        return 'malformed'\n    if not s[2:11].isalnum() or s[2:11] != s[2:11].upper() or not s[11].isdigit():\n        return 'malformed'\n    digits = ''\n    for ch in s[:11]:\n        digits += ch if ch.isdigit() else str(ord(ch) - 64)\n    total = 0\n    for i, ch in enumerate(reversed(digits)):\n        d = int(ch)\n        if i % 2 == 0:\n            d *= 2\n            if d > 9:\n                d -= 9\n        total += d\n    check = (10 - total % 10) % 10\n    return [check, check == int(s[11])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"US4V5PGS4IX8\"]', ['US4V5PGS4IX8'], [0, False]], ['regression [\"GBOV8F5J6090\"]', ['GBOV8F5J6090'], [7, False]], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed']], [['regression [\"JPFWKDL124I1\"]', ['JPFWKDL124I1'], [1, True]], ['regression [\"CHXVXSVIT016\"]', ['CHXVXSVIT016'], [1, False]], ['partial-repair [\"FRLWNIYHPT37\"]', ['FRLWNIYHPT37'], [5, False]], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed']], [['regression [\"XS0K4JDSXBN1\"]', ['XS0K4JDSXBN1'], [4, False]], ['regression [\"AUKWRNHD2XR3\"]', ['AUKWRNHD2XR3'], [8, False]], ['partial-repair [\"NL5BVKR8BB60\"]', ['NL5BVKR8BB60'], [3, False]], ['partial-repair [\"CA3CKMM2IAN8\"]', ['CA3CKMM2IAN8'], [0, False]], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed']], [['regression [\"US6754047769\"]', ['US6754047769'], [8, False]], ['regression [\"IE9141151847\"]', ['IE9141151847'], [0, False]], ['partial-repair [\"LU7763909076\"]', ['LU7763909076'], [8, False]], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed']], [['regression [\"KY3791880781\"]', ['KY3791880781'], [4, False]], ['regression [\"BM9170095145\"]', ['BM9170095145'], [7, False]], ['partial-repair [\"US0378331005\"]', ['US0378331005'], [5, True]], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed']]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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":"0d7f8131ac0e4f0fed99fe7cc3c783ee16963cb3edb5396acabb38e0125627f2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(s):\n    if len(s) != 12 or not s.isascii() or not s[:2].isalpha() or not s[:2].isupper():\n        return 'malformed'\n    if not s[2:11].isalnum() or s[2:11] != s[2:11].upper() or not s[11].isdigit():\n        return 'malformed'\n    digits = ''\n    for ch in s[:11]:\n        digits += ch if ch.isdigit() else str(ord(ch) - 55)\n    total = 0\n    for i, ch in enumerate(reversed(digits)):\n        d = int(ch)\n        if i % 2 == 0:\n            d *= 2\n            if d > 9:\n                d -= 9\n        total += d\n    check = (10 - total % 10) % 10\n    return [check, check == int(s[11])]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression [\"US4V5PGS4IX8\"]', ['US4V5PGS4IX8'], [0, False]], ['regression [\"GBOV8F5J6090\"]', ['GBOV8F5J6090'], [7, False]], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed']], [['regression [\"JPFWKDL124I1\"]', ['JPFWKDL124I1'], [1, True]], ['regression [\"CHXVXSVIT016\"]', ['CHXVXSVIT016'], [1, False]], ['partial-repair [\"FRLWNIYHPT37\"]', ['FRLWNIYHPT37'], [5, False]], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed']], [['regression [\"XS0K4JDSXBN1\"]', ['XS0K4JDSXBN1'], [4, False]], ['regression [\"AUKWRNHD2XR3\"]', ['AUKWRNHD2XR3'], [8, False]], ['partial-repair [\"NL5BVKR8BB60\"]', ['NL5BVKR8BB60'], [3, False]], ['partial-repair [\"CA3CKMM2IAN8\"]', ['CA3CKMM2IAN8'], [0, False]], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed'], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed']], [['regression [\"US6754047769\"]', ['US6754047769'], [8, False]], ['regression [\"IE9141151847\"]', ['IE9141151847'], [0, False]], ['partial-repair [\"LU7763909076\"]', ['LU7763909076'], [8, False]], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed'], ['control [\"1S0378331005\"]', ['1S0378331005'], 'malformed'], ['control [\"U10378331005\"]', ['U10378331005'], 'malformed']], [['regression [\"KY3791880781\"]', ['KY3791880781'], [4, False]], ['regression [\"BM9170095145\"]', ['BM9170095145'], [7, False]], ['partial-repair [\"US0378331005\"]', ['US0378331005'], [5, True]], ['control [\"US000000000A\"]', ['US000000000A'], 'malformed'], ['control [\"US037833100\"]', ['US037833100'], 'malformed'], ['control [\"us0378331005\"]', ['us0378331005'], 'malformed'], ['control [\"US03783310a5\"]', ['US03783310a5'], 'malformed'], ['control [\"12Q037833100\"]', ['12Q037833100'], 'malformed']]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, 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 of the named scheme under the stated contract; not a certified validator. 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":"w2-check_digit_algorithms-isin-check-letter-value","generated_at":"2026-09-29T14:48:37.899161+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Securities settlement systems reject ISINs whose check digit does not match before routing trades.","repair":"Expand each letter to ord(ch) - 55 so A becomes \"10\" and Z becomes \"35\".","root_cause":"Letters are expanded with ord(ch) - 64 (A=1), not the ISIN value A=10 .. Z=35.","sha256":"aecbdc0f6704027c138712cf02a71f53a769a68c403710efcde1e5192e918631","title":"ISIN letters expand from one instead of ten · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.637,"exit_code":1,"observations":[{"actual":[2,false],"check":"regression [\"US4V5PGS4IX8\"]","expected":[0,false],"passed":false},{"actual":[1,false],"check":"regression [\"GBOV8F5J6090\"]","expected":[7,false],"passed":false},{"actual":"malformed","check":"control [\"US037833100\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"us0378331005\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"US03783310a5\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"12Q037833100\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"1S0378331005\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"U10378331005\"]","expected":"malformed","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"US4V5PGS4IX8\\\"]\", \"actual\": [2, false], \"expected\": [0, false], \"passed\": false}, {\"check\": \"regression [\\\"GBOV8F5J6090\\\"]\", \"actual\": [1, false], \"expected\": [7, false], \"passed\": false}, {\"check\": \"control [\\\"US037833100\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"us0378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"US03783310a5\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"12Q037833100\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"1S0378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"U10378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.538,"exit_code":1,"observations":[{"actual":[9,false],"check":"regression [\"US4V5PGS4IX8\"]","expected":[0,false],"passed":false},{"actual":[1,false],"check":"regression [\"GBOV8F5J6090\"]","expected":[7,false],"passed":false},{"actual":"malformed","check":"control [\"US037833100\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"us0378331005\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"US03783310a5\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"12Q037833100\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"1S0378331005\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"U10378331005\"]","expected":"malformed","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"US4V5PGS4IX8\\\"]\", \"actual\": [9, false], \"expected\": [0, false], \"passed\": false}, {\"check\": \"regression [\\\"GBOV8F5J6090\\\"]\", \"actual\": [1, false], \"expected\": [7, false], \"passed\": false}, {\"check\": \"control [\\\"US037833100\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"us0378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"US03783310a5\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"12Q037833100\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"1S0378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"U10378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.389,"exit_code":0,"observations":[{"actual":[0,false],"check":"regression [\"US4V5PGS4IX8\"]","expected":[0,false],"passed":true},{"actual":[7,false],"check":"regression [\"GBOV8F5J6090\"]","expected":[7,false],"passed":true},{"actual":"malformed","check":"control [\"US037833100\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"us0378331005\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"US03783310a5\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"12Q037833100\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"1S0378331005\"]","expected":"malformed","passed":true},{"actual":"malformed","check":"control [\"U10378331005\"]","expected":"malformed","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression [\\\"US4V5PGS4IX8\\\"]\", \"actual\": [0, false], \"expected\": [0, false], \"passed\": true}, {\"check\": \"regression [\\\"GBOV8F5J6090\\\"]\", \"actual\": [7, false], \"expected\": [7, false], \"passed\": true}, {\"check\": \"control [\\\"US037833100\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"us0378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"US03783310a5\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"12Q037833100\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"1S0378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}, {\"check\": \"control [\\\"U10378331005\\\"]\", \"actual\": \"malformed\", \"expected\": \"malformed\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}