FAILURE MAP
← Case archive

FA-37986 / Table interactions / Open access

Table column auto-fit measurement: auto fit change event · case 01

The table auto fit change event result violates the stipulated table column auto-fit measurement contract.

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

ROOT CAUSE

The auto fit change event decision uses 'True' instead of 'result!=current'.

VERIFIED REPAIR

Apply the complete auto fit change event rule: result!=current.

Unsuccessful approach: The attempted repair 'result>current' still loses a required part of the table contract.

Case contract

Auto-fit measures only this column’s visible measured cells, includes indentation and cell icons, optionally measures header text plus both controls, takes the widest content, adds two-sided padding and reserved icons, clamps bounds, and reports changes in either direction.

Why this case matters

An offline table UI model isolates table column auto-fit measurement, including adversarial row/column relationships.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(column, cells, header, padding, minimum, maximum, include_header, icons, current):
    eligible=[c for c in cells if c['column']==column and not c.get('hidden') and c.get('measured',True)]
    widths=[c['text_width']+c.get('indent',0)+c.get('icon_width',0) for c in eligible]
    if include_header: widths.append(header['text_width']+header.get('sort_width',0)+header.get('menu_width',0))
    content=max(widths,default=0)
    result=max(minimum,min(maximum,content+2*padding+icons))
    return {'width':result,'changed':True,'samples':len(eligible),'header_used':include_header,'clipped':content+2*padding+icons>maximum}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':1+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 21, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 2:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':2+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 22, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 3:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':3+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 23, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 4:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':4+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 24, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 5:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':5+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 25, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

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
varied cell decorations{'changed': True, 'clipped': False, 'header_used': True, 'samples': 2, 'width': 21}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 2, 'width': 21}Passed
hidden and unmeasured{'changed': True, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 6}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 6}Failed
header wider{'changed': True, 'clipped': False, 'header_used': True, 'samples': 1, 'width': 15}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 1, 'width': 15}Passed
header excluded{'changed': True, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 4}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 4}Failed
empty with header{'changed': True, 'clipped': False, 'header_used': True, 'samples': 0, 'width': 14}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 0, 'width': 14}Passed
clipped sample{'changed': True, 'clipped': True, 'header_used': False, 'samples': 1, 'width': 20}{'changed': False, 'clipped': True, 'header_used': False, 'samples': 1, 'width': 20}Failed
empty without header{'changed': True, 'clipped': False, 'header_used': False, 'samples': 0, 'width': 5}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 0, 'width': 5}Failed

SHA-256 / 706f2f3f0626629db5870a4de912c62cdc0c40a5ca09b07bfa78ccd0c9cd529b

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(column, cells, header, padding, minimum, maximum, include_header, icons, current):
    eligible=[c for c in cells if c['column']==column and not c.get('hidden') and c.get('measured',True)]
    widths=[c['text_width']+c.get('indent',0)+c.get('icon_width',0) for c in eligible]
    if include_header: widths.append(header['text_width']+header.get('sort_width',0)+header.get('menu_width',0))
    content=max(widths,default=0)
    result=max(minimum,min(maximum,content+2*padding+icons))
    return {'width':result,'changed':result>current,'samples':len(eligible),'header_used':include_header,'clipped':content+2*padding+icons>maximum}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':1+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 21, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 2:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':2+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 22, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 3:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':3+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 23, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 4:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':4+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 24, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 5:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':5+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 25, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

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
varied cell decorations{'changed': False, 'clipped': False, 'header_used': True, 'samples': 2, 'width': 21}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 2, 'width': 21}Failed
hidden and unmeasured{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 6}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 6}Passed
header wider{'changed': True, 'clipped': False, 'header_used': True, 'samples': 1, 'width': 15}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 1, 'width': 15}Passed
header excluded{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 4}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 4}Passed
empty with header{'changed': True, 'clipped': False, 'header_used': True, 'samples': 0, 'width': 14}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 0, 'width': 14}Passed
clipped sample{'changed': False, 'clipped': True, 'header_used': False, 'samples': 1, 'width': 20}{'changed': False, 'clipped': True, 'header_used': False, 'samples': 1, 'width': 20}Passed
empty without header{'changed': False, 'clipped': False, 'header_used': False, 'samples': 0, 'width': 5}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 0, 'width': 5}Passed

SHA-256 / 71f237172ac2f9da76fcf9497116f80e328ec040bd084e6b67882a361d9dc3e6

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(column, cells, header, padding, minimum, maximum, include_header, icons, current):
    eligible=[c for c in cells if c['column']==column and not c.get('hidden') and c.get('measured',True)]
    widths=[c['text_width']+c.get('indent',0)+c.get('icon_width',0) for c in eligible]
    if include_header: widths.append(header['text_width']+header.get('sort_width',0)+header.get('menu_width',0))
    content=max(widths,default=0)
    result=max(minimum,min(maximum,content+2*padding+icons))
    return {'width':result,'changed':result!=current,'samples':len(eligible),'header_used':include_header,'clipped':content+2*padding+icons>maximum}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':1+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 21, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 2:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':2+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 22, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 3:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':3+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 23, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 4:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':4+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 24, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

if N == 5:
    check('varied cell decorations', solve('amount', [{'column':'amount','text_width':5+8,'indent':3,'icon_width':4},{'column':'amount','text_width':7},{'column':'other','text_width':90}], {'text_width':5,'sort_width':3,'menu_width':2}, 2, 1, 100, True, 1, 30), {'width': 25, 'changed': True, 'samples': 2, 'header_used': True, 'clipped': False})
    check('hidden and unmeasured', solve('a', [{'column':'a','text_width':90,'hidden':True},{'column':'a','text_width':80,'measured':False},{'column':'a','text_width':4,'offscreen':True}], {'text_width':2}, 1, 1, 100, False, 0, 6), {'width': 6, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('header wider', solve('a', [{'column':'a','text_width':2}], {'text_width':8,'sort_width':3,'menu_width':2}, 1, 1, 100, True, 0, 1), {'width': 15, 'changed': True, 'samples': 1, 'header_used': True, 'clipped': False})
    check('header excluded', solve('a', [{'column':'a','text_width':2}], {'text_width':30}, 1, 1, 100, False, 0, 4), {'width': 4, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': False})
    check('empty with header', solve('a', [], {'text_width':10}, 2, 1, 100, True, 0, 1), {'width': 14, 'changed': True, 'samples': 0, 'header_used': True, 'clipped': False})
    check('clipped sample', solve('a', [{'column':'a','text_width':50}], {'text_width':2}, 2, 5, 20, False, 1, 20), {'width': 20, 'changed': False, 'samples': 1, 'header_used': False, 'clipped': True})
    check('empty without header', solve('a', [], {'text_width':10}, 0, 5, 20, False, 0, 5), {'width': 5, 'changed': False, 'samples': 0, 'header_used': False, 'clipped': False})

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
varied cell decorations{'changed': True, 'clipped': False, 'header_used': True, 'samples': 2, 'width': 21}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 2, 'width': 21}Passed
hidden and unmeasured{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 6}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 6}Passed
header wider{'changed': True, 'clipped': False, 'header_used': True, 'samples': 1, 'width': 15}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 1, 'width': 15}Passed
header excluded{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 4}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 1, 'width': 4}Passed
empty with header{'changed': True, 'clipped': False, 'header_used': True, 'samples': 0, 'width': 14}{'changed': True, 'clipped': False, 'header_used': True, 'samples': 0, 'width': 14}Passed
clipped sample{'changed': False, 'clipped': True, 'header_used': False, 'samples': 1, 'width': 20}{'changed': False, 'clipped': True, 'header_used': False, 'samples': 1, 'width': 20}Passed
empty without header{'changed': False, 'clipped': False, 'header_used': False, 'samples': 0, 'width': 5}{'changed': False, 'clipped': False, 'header_used': False, 'samples': 0, 'width': 5}Passed

SHA-256 / db6fff2ef3683eba1c65be3774ffa033e6ff18a7152bc71b7806940d95ba4b6c

Verification & scope

Measurements, padding, and reserved decorations are nonnegative finite widths; minimum does not exceed maximum. Deterministic offline table UI model; no browser, DOM, framework, or standards conformance is claimed. 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:43:06.627587+00:00.

Case digest / ef5bae17ca7b03503b0d32f7ac955cf99ba7a1f733beb1a88799bc67166f4564