FAILURE MAP
← Case archive

FA-3771 / Tokenization / Open access

Whitespace removal shifts token source offsets · case 01

Whitespace removal shifts token source offsets.

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

ROOT CAUSE

The implementation applies an operation whose text or grammar semantics violate this contract: Return start/end offsets of ASCII word runs in the original text.

THE FAILURE

The implementation applies an operation whose text or grammar semantics violate this contract: Return start/end offsets of ASCII word runs in the original text.

Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.

Case contract

Return start/end offsets of ASCII word runs in the original text.

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 [[m.start(),m.end()] for m in re.finditer('[A-Za-z]+',x.replace(' ',''))]
    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('  ab cd'), [[2, 4], [5, 7]])
check('boundary 2', solve('a  b'), [[0, 1], [3, 4]])
check('boundary 3', solve(''), [])
check('boundary 4', solve('\nx'), [[1, 2]])
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 1[[0, 4]][[2, 4], [5, 7]]Failed
boundary 2[[0, 2]][[0, 1], [3, 4]]Failed
boundary 3[][]Passed
boundary 4[[1, 2]][[1, 2]]Passed

SHA-256 / 0058c8ea64b2b40ba3417a9ffbad1ab7678c2625978d62b502c4b9c4b4afe1ce

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 [[m.start(),m.end()] for m in re.finditer('[A-Za-z]+',x.strip())]
    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('  ab cd'), [[2, 4], [5, 7]])
check('boundary 2', solve('a  b'), [[0, 1], [3, 4]])
check('boundary 3', solve(''), [])
check('boundary 4', solve('\nx'), [[1, 2]])
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 1[[0, 2], [3, 5]][[2, 4], [5, 7]]Failed
boundary 2[[0, 1], [3, 4]][[0, 1], [3, 4]]Passed
boundary 3[][]Passed
boundary 4[[0, 1]][[1, 2]]Failed

SHA-256 / 0d7684a42af3f1aa78c57919013c7c06d84cbb93d399bce03d56231778110de7

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:30.443548+00:00.

Case digest / 42ad0f5751b4221f35ceaf9c7ed2fbbc3ae87daa377af35327b92d81f8e7303d