FA-36946 / Table interactions / Open access
Grouped table header runs: pane lookup · case 01
The table pane lookup result violates the stipulated grouped table header runs contract.
ROOT CAUSE
The pane lookup decision uses "'center'" instead of "pins.get(x['id'], 'center')".
VERIFIED REPAIR
Apply the complete pane lookup rule: pins.get(x['id'], 'center').
Unsuccessful approach: The attempted repair "pins.get(x['id'], 'left')" still loses a required part of the table contract.
Case contract
Construct contiguous visible leaf runs keyed by exact group and pane, retaining leaf order and width sums. A missing group is a blank placeholder; an empty group string is an actual named group. Group resize handles require at least two visible leaves.
Why this case matters
An offline table UI model isolates grouped table header runs, 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(leaves, hidden, pins):
v = [x for x in leaves if x['id'] not in hidden]
runs=[]
for x in v:
pane='center'
key=(x.get('group'),pane)
if runs and runs[-1]['key']==key:
runs[-1]['leaves'].append(x['id'])
runs[-1]['width']+=x['width']
else: runs.append({'key':key,'leaves':[x['id']],'width':x['width']})
return [{'group':r['key'][0], 'pane':r['key'][1], 'span':len(r['leaves']), 'width':r['width'], 'first':r['leaves'][0], 'last':r['leaves'][-1], 'leaf_ids':r['leaves'], 'blank':r['key'][0] is None, 'resizable':len(r['leaves'])>1} for r in runs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('contiguous group', solve([{'id':'a','group':'G','width':2*1},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 5, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 2:
check('contiguous group', solve([{'id':'a','group':'G','width':2*2},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 3:
check('contiguous group', solve([{'id':'a','group':'G','width':2*3},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 9, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 4:
check('contiguous group', solve([{'id':'a','group':'G','width':2*4},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 11, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 5:
check('contiguous group', solve([{'id':'a','group':'G','width':2*5},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 13, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
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 |
|---|---|---|---|
| contiguous group | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'b', 'leaf_ids': ['a', 'b'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 5}, {'blank': False, 'first': 'c', 'group': 'H', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'b', 'leaf_ids': ['a', 'b'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 5}, {'blank': False, 'first': 'c', 'group': 'H', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Passed |
| pin splits group | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'c', 'leaf_ids': ['a', 'b', 'c'], 'pane': 'center', 'resizable': True, 'span': 3, 'width': 9}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'G', 'last': 'c', 'leaf_ids': ['b', 'c'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 7}] | Failed |
| hidden leaves | [{'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Passed |
| blank versus empty | [{'blank': True, 'first': 'a', 'group': None, 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': '', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}] | [{'blank': True, 'first': 'a', 'group': None, 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': '', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}] | Passed |
| separated groups | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'H', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}, {'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'H', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}, {'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Passed |
| empty header | [] | [] | Passed |
SHA-256 / 27e4943ba1047ec57b71b760bf25e18fdfadcdf32883abc69f172c57ad324cdd
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(leaves, hidden, pins):
v = [x for x in leaves if x['id'] not in hidden]
runs=[]
for x in v:
pane=pins.get(x['id'], 'left')
key=(x.get('group'),pane)
if runs and runs[-1]['key']==key:
runs[-1]['leaves'].append(x['id'])
runs[-1]['width']+=x['width']
else: runs.append({'key':key,'leaves':[x['id']],'width':x['width']})
return [{'group':r['key'][0], 'pane':r['key'][1], 'span':len(r['leaves']), 'width':r['width'], 'first':r['leaves'][0], 'last':r['leaves'][-1], 'leaf_ids':r['leaves'], 'blank':r['key'][0] is None, 'resizable':len(r['leaves'])>1} for r in runs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('contiguous group', solve([{'id':'a','group':'G','width':2*1},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 5, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 2:
check('contiguous group', solve([{'id':'a','group':'G','width':2*2},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 3:
check('contiguous group', solve([{'id':'a','group':'G','width':2*3},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 9, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 4:
check('contiguous group', solve([{'id':'a','group':'G','width':2*4},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 11, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 5:
check('contiguous group', solve([{'id':'a','group':'G','width':2*5},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 13, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
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 |
|---|---|---|---|
| contiguous group | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'b', 'leaf_ids': ['a', 'b'], 'pane': 'left', 'resizable': True, 'span': 2, 'width': 5}, {'blank': False, 'first': 'c', 'group': 'H', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'b', 'leaf_ids': ['a', 'b'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 5}, {'blank': False, 'first': 'c', 'group': 'H', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Failed |
| pin splits group | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'c', 'leaf_ids': ['a', 'b', 'c'], 'pane': 'left', 'resizable': True, 'span': 3, 'width': 9}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'G', 'last': 'c', 'leaf_ids': ['b', 'c'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 7}] | Failed |
| hidden leaves | [{'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Failed |
| blank versus empty | [{'blank': True, 'first': 'a', 'group': None, 'last': 'a', 'leaf_ids': ['a'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': '', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 3}] | [{'blank': True, 'first': 'a', 'group': None, 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': '', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}] | Failed |
| separated groups | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'H', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 3}, {'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'H', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}, {'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Failed |
| empty header | [] | [] | Passed |
SHA-256 / 49d1c0ab9316b2f0481bf1497efb3676ecd1c1b8dfb9ddfe8766528dfebe96ab
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(leaves, hidden, pins):
v = [x for x in leaves if x['id'] not in hidden]
runs=[]
for x in v:
pane=pins.get(x['id'], 'center')
key=(x.get('group'),pane)
if runs and runs[-1]['key']==key:
runs[-1]['leaves'].append(x['id'])
runs[-1]['width']+=x['width']
else: runs.append({'key':key,'leaves':[x['id']],'width':x['width']})
return [{'group':r['key'][0], 'pane':r['key'][1], 'span':len(r['leaves']), 'width':r['width'], 'first':r['leaves'][0], 'last':r['leaves'][-1], 'leaf_ids':r['leaves'], 'blank':r['key'][0] is None, 'resizable':len(r['leaves'])>1} for r in runs]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('contiguous group', solve([{'id':'a','group':'G','width':2*1},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 5, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 2:
check('contiguous group', solve([{'id':'a','group':'G','width':2*2},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 3:
check('contiguous group', solve([{'id':'a','group':'G','width':2*3},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 9, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 4:
check('contiguous group', solve([{'id':'a','group':'G','width':2*4},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 11, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
if N == 5:
check('contiguous group', solve([{'id':'a','group':'G','width':2*5},{'id':'b','group':'G','width':3},{'id':'c','group':'H','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 2, 'width': 13, 'first': 'a', 'last': 'b', 'leaf_ids': ['a', 'b'], 'blank': False, 'resizable': True}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('pin splits group', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], [], {'a':'left'}), [{'group': 'G', 'pane': 'left', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 2, 'width': 7, 'first': 'b', 'last': 'c', 'leaf_ids': ['b', 'c'], 'blank': False, 'resizable': True}])
check('hidden leaves', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'G','width':3},{'id':'c','group':'G','width':4}], ['a','b'], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('blank versus empty', solve([{'id':'a','width':2},{'id':'b','group':'','width':3}], [], {}), [{'group': None, 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': True, 'resizable': False}, {'group': '', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}])
check('separated groups', solve([{'id':'a','group':'G','width':2},{'id':'b','group':'H','width':3},{'id':'c','group':'G','width':4}], [], {}), [{'group': 'G', 'pane': 'center', 'span': 1, 'width': 2, 'first': 'a', 'last': 'a', 'leaf_ids': ['a'], 'blank': False, 'resizable': False}, {'group': 'H', 'pane': 'center', 'span': 1, 'width': 3, 'first': 'b', 'last': 'b', 'leaf_ids': ['b'], 'blank': False, 'resizable': False}, {'group': 'G', 'pane': 'center', 'span': 1, 'width': 4, 'first': 'c', 'last': 'c', 'leaf_ids': ['c'], 'blank': False, 'resizable': False}])
check('empty header', solve([], [], {}), [])
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 |
|---|---|---|---|
| contiguous group | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'b', 'leaf_ids': ['a', 'b'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 5}, {'blank': False, 'first': 'c', 'group': 'H', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'b', 'leaf_ids': ['a', 'b'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 5}, {'blank': False, 'first': 'c', 'group': 'H', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Passed |
| pin splits group | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'G', 'last': 'c', 'leaf_ids': ['b', 'c'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 7}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'G', 'last': 'c', 'leaf_ids': ['b', 'c'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 7}] | Passed |
| hidden leaves | [{'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Passed |
| blank versus empty | [{'blank': True, 'first': 'a', 'group': None, 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': '', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}] | [{'blank': True, 'first': 'a', 'group': None, 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': '', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}] | Passed |
| separated groups | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'H', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}, {'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | [{'blank': False, 'first': 'a', 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'b', 'group': 'H', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}, {'blank': False, 'first': 'c', 'group': 'G', 'last': 'c', 'leaf_ids': ['c'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 4}] | Passed |
| empty header | [] | [] | Passed |
SHA-256 / d5b3e3a7785379ac0c1516e0082450072443a8ea3ec51f9a1675bd25b1923503
Verification & scope
Leaf IDs are unique, group labels are scalar, and widths are nonnegative. 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:42:56.347376+00:00.
Case digest / 1be69d52b6263966982067a40884416de0c43b0e80e41659802d4c3f47935df3