FA-3656 / Binary formats / Open access
Varint continuation bits contribute to the value · case 01
Varint continuation bits contribute to the value.
ROOT CAUSE
The implementation applies an operation whose text or grammar semantics violate this contract: Decode exactly one complete unsigned little-endian base-128 varint, rejecting missing terminator or trailing bytes.
VERIFIED REPAIR
Implement the complete stated contract, including the boundary fixtures: Decode exactly one complete unsigned little-endian base-128 varint, rejecting missing terminator or trailing bytes.
Unsuccessful approach: The attempted repair handles the primary example but still violates a separate boundary of the same contract.
Case contract
Decode exactly one complete unsigned little-endian base-128 varint, rejecting missing terminator or trailing bytes.
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 sum(v<<(7*i) for i,v in enumerate(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([129, 1]), 129)
check('boundary 2', solve([128]), None)
check('boundary 3', solve([1, 0]), None)
check('boundary 4', solve([0]), 0)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary 1 | 257 | 129 | Failed |
| boundary 2 | 128 | None | Failed |
| boundary 3 | 1 | None | Failed |
| boundary 4 | 0 | 0 | Passed |
SHA-256 / e9124b187154bb3e965a1bef3af532e1a4efabd56e298edb7a27c890874803bd
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 sum((v&127)<<(7*i) for i,v in enumerate(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([129, 1]), 129)
check('boundary 2', solve([128]), None)
check('boundary 3', solve([1, 0]), None)
check('boundary 4', solve([0]), 0)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary 1 | 129 | 129 | Passed |
| boundary 2 | 0 | None | Failed |
| boundary 3 | 1 | None | Failed |
| boundary 4 | 0 | 0 | Passed |
SHA-256 / 76005923506954296201d27af9efc298a3405e66819d156364c5c7380d1151eb
3 / The verified repair
Exit 0"""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 None if not x or x[-1]&128 or any(not v&128 for v in x[:-1]) else sum((v&127)<<(7*i) for i,v in enumerate(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([129, 1]), 129)
check('boundary 2', solve([128]), None)
check('boundary 3', solve([1, 0]), None)
check('boundary 4', solve([0]), 0)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| boundary 1 | 129 | 129 | Passed |
| boundary 2 | None | None | Passed |
| boundary 3 | None | None | Passed |
| boundary 4 | 0 | 0 | Passed |
SHA-256 / 72335ada86c5ad89047c37a43e533efcc58d541e2c009566e8f9ab86c8385d2e
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:29.116002+00:00.
Case digest / 953cb1801292d967f19f8fa96b5fbb29f475697fc1e968e2dcf8f05567f05e1d