FA-36976 / Table interactions / Open access
Grouped table header runs: group leading leaf · case 01
The table group leading leaf result violates the stipulated grouped table header runs contract.
ROOT CAUSE
The group leading leaf decision uses "'first':r['leaves'][-1]" instead of "'first':r['leaves'][0]".
VERIFIED REPAIR
Apply the complete group leading leaf rule: 'first':r['leaves'][0].
Unsuccessful approach: The attempted repair "'first':r['leaves'][1] if len(r['leaves'])>1 else None" 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=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'][-1], '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': 'b', '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}] | Failed |
| 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': 'c', '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}] | 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 / a811a4b52c14460d8bb594a2d388abb7d7a8b41ecce8d57be1fee36b52a8932e
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'], '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'][1] if len(r['leaves'])>1 else None, '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': 'b', 'group': 'G', 'last': 'b', 'leaf_ids': ['a', 'b'], 'pane': 'center', 'resizable': True, 'span': 2, 'width': 5}, {'blank': False, 'first': None, '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}] | Failed |
| pin splits group | [{'blank': False, 'first': None, 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'left', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': 'c', '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}] | Failed |
| hidden leaves | [{'blank': False, 'first': None, '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}] | Failed |
| blank versus empty | [{'blank': True, 'first': None, 'group': None, 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': None, '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}] | Failed |
| separated groups | [{'blank': False, 'first': None, 'group': 'G', 'last': 'a', 'leaf_ids': ['a'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 2}, {'blank': False, 'first': None, 'group': 'H', 'last': 'b', 'leaf_ids': ['b'], 'pane': 'center', 'resizable': False, 'span': 1, 'width': 3}, {'blank': False, 'first': None, '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}] | Failed |
| empty header | [] | [] | Passed |
SHA-256 / 8a36b1b6952dc85dde475a156215d26086fdaef3a12ba340c0e2e5c1238b7485
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.699866+00:00.
Case digest / 6d129b85e28883432e66c0907944762217a6b4b74fd05806908ece5b9c59958d