{"abstract":"Undecodable bytes cannot be re-encoded losslessly.","category":"Encodings","checks":4,"contract":"Decode UTF-8 with surrogateescape and return code point ordinals.","evaluation_group":"model-267501a61b2ac15b","failed_approach":"The attempted repair handles the primary example but still violates a separate boundary of the same contract.","family":"xp-surrogateescape-roundtrip","id":"FA-2966","implementations":{"attempt":{"sha256":"81b0d3393a71c7c6e052382c2149db1aab04484ffb66e83e6e317c3f7e87a5b9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return list(bytes.fromhex(x))\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve('ff'), [56575])\ncheck('boundary 2', solve('c3a9'), [233])\ncheck('boundary 3', solve('41'), [65])\ncheck('boundary 4', solve('80'), [56448])\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":"41a8ecddc73cc2698ff59cf00c46ced2438c08d1d13edca6ddd57958b7785f11","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return list(map(ord,bytes.fromhex(x).decode('utf-8','replace')))\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve('ff'), [56575])\ncheck('boundary 2', solve('c3a9'), [233])\ncheck('boundary 3', solve('41'), [65])\ncheck('boundary 4', solve('80'), [56448])\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":"e400ab45108715c7a0f1a8bb2e9be6b5f909142fd134469203ef97105c30442d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return list(map(ord,bytes.fromhex(x).decode('utf-8','surrogateescape')))\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve('ff'), [56575])\ncheck('boundary 2', solve('c3a9'), [233])\ncheck('boundary 3', solve('41'), [65])\ncheck('boundary 4', solve('80'), [56448])\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":" 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":"xp-surrogateescape-roundtrip","generated_at":"2026-09-29T14:37:19.569613+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.","repair":"Implement the complete stated contract, including the boundary fixtures: Decode UTF-8 with surrogateescape and return code point ordinals.","root_cause":"The implementation applies an operation whose text or grammar semantics violate this contract: Decode UTF-8 with surrogateescape and return code point ordinals.","sha256":"9fcd50dd527e3423ab136a24464e10c7ae0c27e3d4aa09bc99355e5da36ad4fb","title":"Undecodable bytes cannot be re-encoded losslessly · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":49.896,"exit_code":1,"observations":[{"actual":[255],"check":"boundary 1","expected":[56575],"passed":false},{"actual":[195,169],"check":"boundary 2","expected":[233],"passed":false},{"actual":[65],"check":"boundary 3","expected":[65],"passed":true},{"actual":[128],"check":"boundary 4","expected":[56448],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": [255], \"expected\": [56575], \"passed\": false}, {\"check\": \"boundary 2\", \"actual\": [195, 169], \"expected\": [233], \"passed\": false}, {\"check\": \"boundary 3\", \"actual\": [65], \"expected\": [65], \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": [128], \"expected\": [56448], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":120.168,"exit_code":1,"observations":[{"actual":[65533],"check":"boundary 1","expected":[56575],"passed":false},{"actual":[233],"check":"boundary 2","expected":[233],"passed":true},{"actual":[65],"check":"boundary 3","expected":[65],"passed":true},{"actual":[65533],"check":"boundary 4","expected":[56448],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": [65533], \"expected\": [56575], \"passed\": false}, {\"check\": \"boundary 2\", \"actual\": [233], \"expected\": [233], \"passed\": true}, {\"check\": \"boundary 3\", \"actual\": [65], \"expected\": [65], \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": [65533], \"expected\": [56448], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":55.074,"exit_code":0,"observations":[{"actual":[56575],"check":"boundary 1","expected":[56575],"passed":true},{"actual":[233],"check":"boundary 2","expected":[233],"passed":true},{"actual":[65],"check":"boundary 3","expected":[65],"passed":true},{"actual":[56448],"check":"boundary 4","expected":[56448],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": [56575], \"expected\": [56575], \"passed\": true}, {\"check\": \"boundary 2\", \"actual\": [233], \"expected\": [233], \"passed\": true}, {\"check\": \"boundary 3\", \"actual\": [65], \"expected\": [65], \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": [56448], \"expected\": [56448], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}