FAILURE MAP
← Case archive

FA-48491 / Delimited text / Open access

Column-major cell indexing uses row-major strides · case 01

A structured table violates the declared record or column contract.

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

ROOT CAUSE

Column-major cell indexing uses row-major strides.

VERIFIED REPAIR

Preserve the named invariant at the faulty decision: cells[col*height+row]

Unsuccessful approach: The alternate implementation still violates the same declared invariant: column-major cell indexing uses row-major strides.

Case contract

Decode W|width followed by pipe-separated column-major cells in the second line. Width is a positive ASCII decimal; field count must be divisible by width. The second line empty denotes one empty cell. Return row-major rows, each exactly width cells. This bounded block requires exactly two physical lines.

Why this case matters

Delimited interchange needs explicit framing, schema and field semantics at ingestion and emission boundaries.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
    if value == '@END': return 3 + 4*N
    if isinstance(value, str): return value.replace('@', 'cell' * N)
    if isinstance(value, list): return [_vary(x) for x in value]
    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
    return value
N = 1
observations = []
def solve(data):
    if len(data)!=2 or not data[0].startswith('W|'): return None
    token=data[0][2:]
    if not token.isascii() or not token.isdecimal() or int(token)<1: return None
    width=int(token); cells=data[1].split('|')
    if len(cells)%width: return None
    height=len(cells)//width
    return [[cells[row*width+col] for col in range(width)] for row in range(height)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rectangle', solve(_vary(['W|3', 'a|d|b|e|@|f'])), _vary([['a', 'b', '@'], ['d', 'e', 'f']]))
check('one row', solve(_vary(['W|3', 'a|@|c'])), _vary([['a', '@', 'c']]))
check('one column', solve(_vary(['W|1', '@|b'])), _vary([['@'], ['b']]))
check('empty cell', solve(_vary(['W|1', ''])), _vary([['']]))
check('nondivisible', solve(_vary(['W|2', 'a|b|c'])), _vary(None))
check('zero width', solve(_vary(['W|0', 'a'])), _vary(None))
check('extra line', solve(_vary(['W|1', '@', 'x'])), _vary(None))
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
rectangle[['a', 'd', 'b'], ['e', 'cell', 'f']][['a', 'b', 'cell'], ['d', 'e', 'f']]Failed
one row[['a', 'cell', 'c']][['a', 'cell', 'c']]Passed
one column[['cell'], ['b']][['cell'], ['b']]Passed
empty cell[['']][['']]Passed
nondivisibleNoneNonePassed
zero widthNoneNonePassed
extra lineNoneNonePassed

SHA-256 / c0343c3fc40b79f75fb1a9353128a536a085822f9a413f6311b944ef1ffcaf61

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
    if value == '@END': return 3 + 4*N
    if isinstance(value, str): return value.replace('@', 'cell' * N)
    if isinstance(value, list): return [_vary(x) for x in value]
    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
    return value
N = 1
observations = []
def solve(data):
    if len(data)!=2 or not data[0].startswith('W|'): return None
    token=data[0][2:]
    if not token.isascii() or not token.isdecimal() or int(token)<1: return None
    width=int(token); cells=data[1].split('|')
    if len(cells)%width: return None
    height=len(cells)//width
    return [[cells[(row*width+col)%len(cells)] for col in range(width)] for row in range(height)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rectangle', solve(_vary(['W|3', 'a|d|b|e|@|f'])), _vary([['a', 'b', '@'], ['d', 'e', 'f']]))
check('one row', solve(_vary(['W|3', 'a|@|c'])), _vary([['a', '@', 'c']]))
check('one column', solve(_vary(['W|1', '@|b'])), _vary([['@'], ['b']]))
check('empty cell', solve(_vary(['W|1', ''])), _vary([['']]))
check('nondivisible', solve(_vary(['W|2', 'a|b|c'])), _vary(None))
check('zero width', solve(_vary(['W|0', 'a'])), _vary(None))
check('extra line', solve(_vary(['W|1', '@', 'x'])), _vary(None))
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
rectangle[['a', 'd', 'b'], ['e', 'cell', 'f']][['a', 'b', 'cell'], ['d', 'e', 'f']]Failed
one row[['a', 'cell', 'c']][['a', 'cell', 'c']]Passed
one column[['cell'], ['b']][['cell'], ['b']]Passed
empty cell[['']][['']]Passed
nondivisibleNoneNonePassed
zero widthNoneNonePassed
extra lineNoneNonePassed

SHA-256 / ae8f04f5d9bcc7df853d54fc1c34b163a2b888be58f58c6fcb46ec0916340464

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
def _vary(value):
    if value == '@END': return 3 + 4*N
    if isinstance(value, str): return value.replace('@', 'cell' * N)
    if isinstance(value, list): return [_vary(x) for x in value]
    if isinstance(value, dict): return {_vary(k): _vary(v) for k,v in value.items()}
    return value
N = 1
observations = []
def solve(data):
    if len(data)!=2 or not data[0].startswith('W|'): return None
    token=data[0][2:]
    if not token.isascii() or not token.isdecimal() or int(token)<1: return None
    width=int(token); cells=data[1].split('|')
    if len(cells)%width: return None
    height=len(cells)//width
    return [[cells[col*height+row] for col in range(width)] for row in range(height)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('rectangle', solve(_vary(['W|3', 'a|d|b|e|@|f'])), _vary([['a', 'b', '@'], ['d', 'e', 'f']]))
check('one row', solve(_vary(['W|3', 'a|@|c'])), _vary([['a', '@', 'c']]))
check('one column', solve(_vary(['W|1', '@|b'])), _vary([['@'], ['b']]))
check('empty cell', solve(_vary(['W|1', ''])), _vary([['']]))
check('nondivisible', solve(_vary(['W|2', 'a|b|c'])), _vary(None))
check('zero width', solve(_vary(['W|0', 'a'])), _vary(None))
check('extra line', solve(_vary(['W|1', '@', 'x'])), _vary(None))
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
rectangle[['a', 'b', 'cell'], ['d', 'e', 'f']][['a', 'b', 'cell'], ['d', 'e', 'f']]Passed
one row[['a', 'cell', 'c']][['a', 'cell', 'c']]Passed
one column[['cell'], ['b']][['cell'], ['b']]Passed
empty cell[['']][['']]Passed
nondivisibleNoneNonePassed
zero widthNoneNonePassed
extra lineNoneNonePassed

SHA-256 / 15023d186266faa60d14375cdfb7eac7a3cbacd31385c729f9f12f10e5c6e2d1

Verification & scope

Deterministic bounded in-memory model. No claim of complete CSV or external format conformance. 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:44:51.250971+00:00.

Case digest / 3bdedfc9062a194d06409da7956f4b4f140aeec955a160c954aa8a5bc2814a2d