FAILURE MAP
← Case archive

FA-3511 / Lexical grammars / Open access

A Unicode escape has variable hexadecimal width · case 01

A Unicode escape has variable hexadecimal width.

Verified by executionVariant 1 · 4 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The recognizer uses '\\\\u[0-9A-Fa-f]+', which admits or omits a token shape forbidden by the stated grammar.

THE FAILURE

The recognizer uses '\\\\u[0-9A-Fa-f]+', which admits or omits a token shape forbidden by the stated grammar.

Unsuccessful approach: The candidate grammar '\\\\[uU][0-9A-Fa-f]{4}' still disagrees with the explicit boundary fixtures.

Case contract

Accept literal backslash-u followed by exactly four hex digits.

Why this case matters

A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return bool(re.fullmatch('\\\\u[0-9A-Fa-f]+',x))
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('\\u123'), False)
check('boundary 2', solve('\\U1234'), False)
check('boundary 3', solve('\\u00e9'), True)
check('boundary 4', solve('\\uABCD'), True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1TrueFalseFailed
boundary 2FalseFalsePassed
boundary 3TrueTruePassed
boundary 4TrueTruePassed

SHA-256 / 0aaba2fc7253d717d5becaee0d9b8549232f637ddb0126c7ca62591244d225c1

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct
from urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit
from email.header import decode_header, make_header
from email.utils import getaddresses
from xml.etree import ElementTree as ET
import shlex, string, textwrap

N = 1
observations = []
def solve(x):
    try:
        return bool(re.fullmatch('\\\\[uU][0-9A-Fa-f]{4}',x))
    except Exception as exc:
        return {"error": type(exc).__name__}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary 1', solve('\\u123'), False)
check('boundary 2', solve('\\U1234'), False)
check('boundary 3', solve('\\u00e9'), True)
check('boundary 4', solve('\\uABCD'), True)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boundary 1FalseFalsePassed
boundary 2TrueFalseFailed
boundary 3TrueTruePassed
boundary 4TrueTruePassed

SHA-256 / 426fa1cb2510c68b17eeb45219c3cac9ca2d8342d83dcf66cb921be3856e4d37

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:37:26.930229+00:00.

Case digest / dcad0b99c6391ad1a7637aa06fac02cbe8d44ed3bce7520c96355df2f4a34aed