FA-38046 / Table interactions / Open access
Table pane cell hit testing: header coordinate subtraction · case 01
The table header coordinate subtraction result violates the stipulated table pane cell hit testing contract.
ROOT CAUSE
The header coordinate subtraction decision uses 'y+scroll_y' instead of 'y-header+scroll_y'.
VERIFIED REPAIR
Apply the complete header coordinate subtraction rule: y-header+scroll_y.
Unsuccessful approach: The attempted repair 'y-header' still loses a required part of the table contract.
Case contract
Hit testing subtracts header height, adds body scroll, applies half-open row/column extents, partitions left/right/center panes with left precedence, transforms right pinned and center-scrolled coordinates independently, and rejects coordinates outside the table viewport.
Why this case matters
An offline table UI model isolates table pane cell hit testing, 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(rows, columns, x, y, header, scroll_y, scroll_x, width, left_ids, right_ids):
if y<header: return {'region':'header','row':None,'column':None}
body_y=y+scroll_y
r=None; cursor=0
for row in rows:
if cursor<=body_y<cursor+row['height']: r=row['id']; break
cursor+=row['height']
left=[c for c in columns if c['id'] in left_ids]
right=[c for c in columns if c['id'] in right_ids and c['id'] not in left_ids]
center=[c for c in columns if c['id'] not in left_ids and c['id'] not in right_ids]
lw=sum(c['width'] for c in left); rw=sum(c['width'] for c in right)
if not 0<=x<width: return {'region':'outside','row':r,'column':None}
if x<lw: pane=left; local=x; region='left'
elif x>=width-rw: pane=right; local=x-(width-rw); region='right'
else: pane=center; local=x-lw+scroll_x; region='center'
col=None; cursor=0
for c in pane:
if cursor<=local<cursor+c['width']: col=c['id']; break
cursor+=c['width']
return {'region':region,'row':r,'column':col}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':1+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 2:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':2+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 3:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':3+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 4:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':4+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 5:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':5+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
check('variant measured row boundary', solve([{'id':'r0','height':N+2},{'id':'r1','height':10}], [{'id':'x','width':4}], 1, 7, 2, 0, 0, 4, [], []), {'region':'center','row':'r1' if N<=3 else 'r0','column':'x'})
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 |
|---|---|---|---|
| center scroll | {'column': 'c', 'region': 'center', 'row': 'r1'} | {'column': 'c', 'region': 'center', 'row': 'r1'} | Passed |
| exact row column edges | {'column': 'c', 'region': 'center', 'row': 'r1'} | {'column': 'c', 'region': 'center', 'row': 'r1'} | Passed |
| right pinned cell | {'column': 'd', 'region': 'right', 'row': 'r0'} | {'column': 'd', 'region': 'right', 'row': 'r0'} | Passed |
| left boundary | {'column': 'b', 'region': 'center', 'row': 'r0'} | {'column': 'b', 'region': 'center', 'row': 'r0'} | Passed |
| overlapping pin assignment | {'column': 'd', 'region': 'right', 'row': 'r0'} | {'column': 'd', 'region': 'right', 'row': 'r0'} | Passed |
| outside right edge | {'column': None, 'region': 'outside', 'row': 'r0'} | {'column': None, 'region': 'outside', 'row': 'r0'} | Passed |
| negative x | {'column': None, 'region': 'outside', 'row': 'r0'} | {'column': None, 'region': 'outside', 'row': 'r0'} | Passed |
| header offset crossing | {'column': 'a', 'region': 'left', 'row': 'r1'} | {'column': 'a', 'region': 'left', 'row': 'r0'} | Failed |
| overlap pin edge | {'column': 'c', 'region': 'center', 'row': 'r'} | {'column': 'c', 'region': 'center', 'row': 'r'} | Passed |
| center blank area | {'column': None, 'region': 'center', 'row': 'r'} | {'column': None, 'region': 'center', 'row': 'r'} | Passed |
| left pane interior | {'column': 'a', 'region': 'left', 'row': 'r'} | {'column': 'a', 'region': 'left', 'row': 'r'} | Passed |
| center local origin | {'column': 'b', 'region': 'center', 'row': 'r'} | {'column': 'b', 'region': 'center', 'row': 'r'} | Passed |
| header region | {'column': None, 'region': 'header', 'row': None} | {'column': None, 'region': 'header', 'row': None} | Passed |
| variant measured row boundary | {'column': 'x', 'region': 'center', 'row': 'r1'} | {'column': 'x', 'region': 'center', 'row': 'r1'} | Passed |
SHA-256 / 8d39446a20d75dda4e4a851dcddb0076c60382c0101feb0bdc3e15cd2b46e647
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, columns, x, y, header, scroll_y, scroll_x, width, left_ids, right_ids):
if y<header: return {'region':'header','row':None,'column':None}
body_y=y-header
r=None; cursor=0
for row in rows:
if cursor<=body_y<cursor+row['height']: r=row['id']; break
cursor+=row['height']
left=[c for c in columns if c['id'] in left_ids]
right=[c for c in columns if c['id'] in right_ids and c['id'] not in left_ids]
center=[c for c in columns if c['id'] not in left_ids and c['id'] not in right_ids]
lw=sum(c['width'] for c in left); rw=sum(c['width'] for c in right)
if not 0<=x<width: return {'region':'outside','row':r,'column':None}
if x<lw: pane=left; local=x; region='left'
elif x>=width-rw: pane=right; local=x-(width-rw); region='right'
else: pane=center; local=x-lw+scroll_x; region='center'
col=None; cursor=0
for c in pane:
if cursor<=local<cursor+c['width']: col=c['id']; break
cursor+=c['width']
return {'region':region,'row':r,'column':col}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':1+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 2:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':2+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 3:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':3+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 4:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':4+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 5:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':5+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
check('variant measured row boundary', solve([{'id':'r0','height':N+2},{'id':'r1','height':10}], [{'id':'x','width':4}], 1, 7, 2, 0, 0, 4, [], []), {'region':'center','row':'r1' if N<=3 else 'r0','column':'x'})
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 |
|---|---|---|---|
| center scroll | {'column': 'c', 'region': 'center', 'row': 'r0'} | {'column': 'c', 'region': 'center', 'row': 'r1'} | Failed |
| exact row column edges | {'column': 'c', 'region': 'center', 'row': 'r1'} | {'column': 'c', 'region': 'center', 'row': 'r1'} | Passed |
| right pinned cell | {'column': 'd', 'region': 'right', 'row': 'r0'} | {'column': 'd', 'region': 'right', 'row': 'r0'} | Passed |
| left boundary | {'column': 'b', 'region': 'center', 'row': 'r0'} | {'column': 'b', 'region': 'center', 'row': 'r0'} | Passed |
| overlapping pin assignment | {'column': 'd', 'region': 'right', 'row': 'r0'} | {'column': 'd', 'region': 'right', 'row': 'r0'} | Passed |
| outside right edge | {'column': None, 'region': 'outside', 'row': 'r0'} | {'column': None, 'region': 'outside', 'row': 'r0'} | Passed |
| negative x | {'column': None, 'region': 'outside', 'row': 'r0'} | {'column': None, 'region': 'outside', 'row': 'r0'} | Passed |
| header offset crossing | {'column': 'a', 'region': 'left', 'row': 'r0'} | {'column': 'a', 'region': 'left', 'row': 'r0'} | Passed |
| overlap pin edge | {'column': 'c', 'region': 'center', 'row': 'r'} | {'column': 'c', 'region': 'center', 'row': 'r'} | Passed |
| center blank area | {'column': None, 'region': 'center', 'row': 'r'} | {'column': None, 'region': 'center', 'row': 'r'} | Passed |
| left pane interior | {'column': 'a', 'region': 'left', 'row': 'r'} | {'column': 'a', 'region': 'left', 'row': 'r'} | Passed |
| center local origin | {'column': 'b', 'region': 'center', 'row': 'r'} | {'column': 'b', 'region': 'center', 'row': 'r'} | Passed |
| header region | {'column': None, 'region': 'header', 'row': None} | {'column': None, 'region': 'header', 'row': None} | Passed |
| variant measured row boundary | {'column': 'x', 'region': 'center', 'row': 'r1'} | {'column': 'x', 'region': 'center', 'row': 'r1'} | Passed |
SHA-256 / 9197cb2395543ec3b9fd25c376da2ee267e2bf7243df8c91001d26b92c4ef93c
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(rows, columns, x, y, header, scroll_y, scroll_x, width, left_ids, right_ids):
if y<header: return {'region':'header','row':None,'column':None}
body_y=y-header+scroll_y
r=None; cursor=0
for row in rows:
if cursor<=body_y<cursor+row['height']: r=row['id']; break
cursor+=row['height']
left=[c for c in columns if c['id'] in left_ids]
right=[c for c in columns if c['id'] in right_ids and c['id'] not in left_ids]
center=[c for c in columns if c['id'] not in left_ids and c['id'] not in right_ids]
lw=sum(c['width'] for c in left); rw=sum(c['width'] for c in right)
if not 0<=x<width: return {'region':'outside','row':r,'column':None}
if x<lw: pane=left; local=x; region='left'
elif x>=width-rw: pane=right; local=x-(width-rw); region='right'
else: pane=center; local=x-lw+scroll_x; region='center'
col=None; cursor=0
for c in pane:
if cursor<=local<cursor+c['width']: col=c['id']; break
cursor+=c['width']
return {'region':region,'row':r,'column':col}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':1+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 2:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':2+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 3:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':3+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 4:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':4+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
if N == 5:
check('center scroll', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 5, 3, 2, 4, 4, 18, ['a'], ['d']), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('exact row column edges', solve([{'id':'r0','height':5},{'id':'r1','height':7}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 8, 7, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r1', 'column': 'c'})
check('right pinned cell', solve([{'id':'r0','height':5+5}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':4},{'id':'d','width':3}], 13, 2, 2, 0, 2, 15, ['a'], ['c','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('left boundary', solve([{'id':'r0','height':5}], [{'id':'a','width':3},{'id':'b','width':5}], 3, 2, 2, 0, 0, 8, ['a'], []), {'region': 'center', 'row': 'r0', 'column': 'b'})
check('overlapping pin assignment', solve([{'id':'r0','height':5}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 10, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'right', 'row': 'r0', 'column': 'd'})
check('outside right edge', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], 3, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('negative x', solve([{'id':'r0','height':5}], [{'id':'a','width':3}], -1, 3, 2, 0, 0, 3, [], []), {'region': 'outside', 'row': 'r0', 'column': None})
check('header offset crossing', solve([{'id':'r0','height':5},{'id':'r1','height':5}], [{'id':'a','width':3}], 1, 5, 2, 0, 0, 3, ['a'], []), {'region': 'left', 'row': 'r0', 'column': 'a'})
check('overlap pin edge', solve([{'id':'r','height':8}], [{'id':'a','width':2},{'id':'b','width':3},{'id':'c','width':4},{'id':'d','width':5}], 6, 3, 2, 0, 0, 14, ['a','b'], ['b','d']), {'region': 'center', 'row': 'r', 'column': 'c'})
check('center blank area', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6},{'id':'d','width':4}], 15, 3, 2, 0, 0, 30, ['a'], ['d']), {'region': 'center', 'row': 'r', 'column': None})
check('left pane interior', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5}], 1, 3, 2, 0, 0, 8, ['a'], []), {'region': 'left', 'row': 'r', 'column': 'a'})
check('center local origin', solve([{'id':'r','height':8}], [{'id':'a','width':3},{'id':'b','width':5},{'id':'c','width':6}], 6, 3, 2, 0, 0, 14, ['a'], []), {'region': 'center', 'row': 'r', 'column': 'b'})
check('header region', solve([], [], 1, 1, 2, 0, 0, 3, [], []), {'region': 'header', 'row': None, 'column': None})
check('variant measured row boundary', solve([{'id':'r0','height':N+2},{'id':'r1','height':10}], [{'id':'x','width':4}], 1, 7, 2, 0, 0, 4, [], []), {'region':'center','row':'r1' if N<=3 else 'r0','column':'x'})
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 |
|---|---|---|---|
| center scroll | {'column': 'c', 'region': 'center', 'row': 'r1'} | {'column': 'c', 'region': 'center', 'row': 'r1'} | Passed |
| exact row column edges | {'column': 'c', 'region': 'center', 'row': 'r1'} | {'column': 'c', 'region': 'center', 'row': 'r1'} | Passed |
| right pinned cell | {'column': 'd', 'region': 'right', 'row': 'r0'} | {'column': 'd', 'region': 'right', 'row': 'r0'} | Passed |
| left boundary | {'column': 'b', 'region': 'center', 'row': 'r0'} | {'column': 'b', 'region': 'center', 'row': 'r0'} | Passed |
| overlapping pin assignment | {'column': 'd', 'region': 'right', 'row': 'r0'} | {'column': 'd', 'region': 'right', 'row': 'r0'} | Passed |
| outside right edge | {'column': None, 'region': 'outside', 'row': 'r0'} | {'column': None, 'region': 'outside', 'row': 'r0'} | Passed |
| negative x | {'column': None, 'region': 'outside', 'row': 'r0'} | {'column': None, 'region': 'outside', 'row': 'r0'} | Passed |
| header offset crossing | {'column': 'a', 'region': 'left', 'row': 'r0'} | {'column': 'a', 'region': 'left', 'row': 'r0'} | Passed |
| overlap pin edge | {'column': 'c', 'region': 'center', 'row': 'r'} | {'column': 'c', 'region': 'center', 'row': 'r'} | Passed |
| center blank area | {'column': None, 'region': 'center', 'row': 'r'} | {'column': None, 'region': 'center', 'row': 'r'} | Passed |
| left pane interior | {'column': 'a', 'region': 'left', 'row': 'r'} | {'column': 'a', 'region': 'left', 'row': 'r'} | Passed |
| center local origin | {'column': 'b', 'region': 'center', 'row': 'r'} | {'column': 'b', 'region': 'center', 'row': 'r'} | Passed |
| header region | {'column': None, 'region': 'header', 'row': None} | {'column': None, 'region': 'header', 'row': None} | Passed |
| variant measured row boundary | {'column': 'x', 'region': 'center', 'row': 'r1'} | {'column': 'x', 'region': 'center', 'row': 'r1'} | Passed |
SHA-256 / 1ead7eea1f50c7224543b3e988874cb57ec646d20e2d8830bbf1719937ff7769
Verification & scope
Rows and columns have unique IDs and positive sizes; coordinates are finite and pane reservations fit the viewport. Deterministic offline table UI model; no browser, DOM, framework, or standards conformance is claimed. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:43:07.276496+00:00.
Case digest / df73cccdc18489e58fe7d821ee83c053f4d1d642daf66903f27c2173430df45f