{"abstract":"The table anchor survival result violates the stipulated table viewport anchor restoration contract.","category":"Table interactions","checks":9,"contract":"Restore a table viewport by stable row and column anchors after structural changes. A removed row chooses its next surviving former successor or final row, resets its inset, clamps surviving insets to new sizes, and clamps vertical scroll to the viewport extent.","evaluation_group":"s3-table-interactions-table-anchor","failed_approach":"The attempted repair 'if anchor in new_ids[:1]:' still loses a required part of the table contract.","family":"s3-table-interactions-table-anchor-anchor-survival","id":"FA-37541","implementations":{"attempt":{"sha256":"9fa21b8efc6537d8a9f0428fc733fa5a4958057b169cf5660ac6189b1787ba7b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(before, after, anchor, inset, old_scroll, viewport, old_columns, new_columns, column_anchor, column_inset):\n    old_ids=[x['id'] for x in before]; new_ids=[x['id'] for x in after]\n    if anchor in new_ids[:1]: chosen=anchor\n    else:\n        following=old_ids[old_ids.index(anchor)+1:] if anchor in old_ids else []\n        chosen=next((x for x in following if x in new_ids),new_ids[-1] if new_ids else None)\n    idx=new_ids.index(chosen) if chosen is not None else 0\n    prefix=sum(x['height'] for x in after[:idx])\n    local=min(max(inset,0),max(0,after[idx]['height']-1)) if chosen==anchor and after else 0\n    y=min(max(prefix+local,0),max(0,sum(x['height'] for x in after)-viewport))\n    cols=[x['id'] for x in new_columns]\n    ci=cols.index(column_anchor) if column_anchor in cols else 0\n    x=sum(c['width'] for c in new_columns[:ci])+(max(0,min(column_inset,new_columns[ci]['width']-1)) if column_anchor in cols else 0)\n    return {'row':chosen,'scroll_y':y,'column':cols[ci] if cols else None,'scroll_x':x}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':1+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 10, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 2:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':2+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 11, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 3:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':3+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 12, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 4:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':4+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 13, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 5:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':5+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 14, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"4afe04a82fe879e084d662d27302fcd4e53b442b4fbf0aa53de2ce5e9e8ec97b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(before, after, anchor, inset, old_scroll, viewport, old_columns, new_columns, column_anchor, column_inset):\n    old_ids=[x['id'] for x in before]; new_ids=[x['id'] for x in after]\n    if False: chosen=anchor\n    else:\n        following=old_ids[old_ids.index(anchor)+1:] if anchor in old_ids else []\n        chosen=next((x for x in following if x in new_ids),new_ids[-1] if new_ids else None)\n    idx=new_ids.index(chosen) if chosen is not None else 0\n    prefix=sum(x['height'] for x in after[:idx])\n    local=min(max(inset,0),max(0,after[idx]['height']-1)) if chosen==anchor and after else 0\n    y=min(max(prefix+local,0),max(0,sum(x['height'] for x in after)-viewport))\n    cols=[x['id'] for x in new_columns]\n    ci=cols.index(column_anchor) if column_anchor in cols else 0\n    x=sum(c['width'] for c in new_columns[:ci])+(max(0,min(column_inset,new_columns[ci]['width']-1)) if column_anchor in cols else 0)\n    return {'row':chosen,'scroll_y':y,'column':cols[ci] if cols else None,'scroll_x':x}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':1+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 10, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 2:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':2+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 11, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 3:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':3+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 12, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 4:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':4+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 13, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 5:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':5+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 14, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"7c66f1720ede9c567f28c7dc345ba1b41dc121e846bd4f344ec87753ec654ad0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(before, after, anchor, inset, old_scroll, viewport, old_columns, new_columns, column_anchor, column_inset):\n    old_ids=[x['id'] for x in before]; new_ids=[x['id'] for x in after]\n    if anchor in new_ids: chosen=anchor\n    else:\n        following=old_ids[old_ids.index(anchor)+1:] if anchor in old_ids else []\n        chosen=next((x for x in following if x in new_ids),new_ids[-1] if new_ids else None)\n    idx=new_ids.index(chosen) if chosen is not None else 0\n    prefix=sum(x['height'] for x in after[:idx])\n    local=min(max(inset,0),max(0,after[idx]['height']-1)) if chosen==anchor and after else 0\n    y=min(max(prefix+local,0),max(0,sum(x['height'] for x in after)-viewport))\n    cols=[x['id'] for x in new_columns]\n    ci=cols.index(column_anchor) if column_anchor in cols else 0\n    x=sum(c['width'] for c in new_columns[:ci])+(max(0,min(column_inset,new_columns[ci]['width']-1)) if column_anchor in cols else 0)\n    return {'row':chosen,'scroll_y':y,'column':cols[ci] if cols else None,'scroll_x':x}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nif N == 1:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':1+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 10, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 2:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':2+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 11, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 3:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':3+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 12, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 4:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':4+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 13, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nif N == 5:\n    check('insert before anchored row', solve([{'id':'a','height':5},{'id':'b','height':8}], [{'id':'x','height':5+2},{'id':'a','height':5},{'id':'b','height':8}], 'b', 2, 7, 4, [{'id':'a','width':5},{'id':'b','width':8}], [{'id':'x','width':3},{'id':'a','width':5},{'id':'b','width':8}], 'b', 2), {'row': 'b', 'scroll_y': 14, 'column': 'b', 'scroll_x': 10})\n    check('removed anchor successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'c','height':9}], 'b', 3, 8, 4, [], [], 'gone', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('removed last anchor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8}], 'c', 3, 16, 4, [], [], 'gone', 0), {'row': 'b', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('shrunk anchored cell', solve([{'id':'a','height':20}], [{'id':'a','height':5}], 'a', 18, 18, 2, [{'id':'a','width':20}], [{'id':'a','width':5}], 'a', 18), {'row': 'a', 'scroll_y': 3, 'column': 'a', 'scroll_x': 4})\n    check('bottom clamp', solve([{'id':'a','height':5},{'id':'b','height':10}], [{'id':'a','height':5},{'id':'b','height':4}], 'b', 3, 8, 7, [], [], '', 0), {'row': 'b', 'scroll_y': 2, 'column': None, 'scroll_x': 0})\n    check('surviving middle', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], [{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'b', 'scroll_y': 7, 'column': None, 'scroll_x': 0})\n    check('first successor', solve([{'id':'a','height':5},{'id':'b','height':8},{'id':'c','height':9},{'id':'d','height':10}], [{'id':'a','height':5},{'id':'c','height':9},{'id':'d','height':10}], 'b', 2, 7, 4, [], [], '', 0), {'row': 'c', 'scroll_y': 5, 'column': None, 'scroll_x': 0})\n    check('interior shrink', solve([{'id':'a','height':20},{'id':'b','height':30}], [{'id':'a','height':5},{'id':'b','height':30}], 'a', 18, 18, 2, [], [], '', 0), {'row': 'a', 'scroll_y': 4, 'column': None, 'scroll_x': 0})\n    check('empty table', solve([{'id':'a','height':5}], [], 'a', 2, 2, 4, [], [], '', 0), {'row': None, 'scroll_y': 0, 'column': None, 'scroll_x': 0})\n\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Source and replacement axes have unique IDs and positive dimensions; viewport extent is 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-table-interactions-table-anchor-anchor-survival","generated_at":"2026-09-29T14:43:02.159104+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline table UI model isolates table viewport anchor restoration, including adversarial row/column relationships.","repair":"Apply the complete anchor survival rule: if anchor in new_ids:.","root_cause":"The anchor survival decision uses 'if False:' instead of 'if anchor in new_ids:'.","sha256":"211252f7f6ddcc0c2903738eab4f338da56bfe105419f3611f5c458fb9090984","title":"Table viewport anchor restoration: anchor survival · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.669,"exit_code":1,"observations":[{"actual":{"column":"b","row":"b","scroll_x":10,"scroll_y":10},"check":"insert before anchored row","expected":{"column":"b","row":"b","scroll_x":10,"scroll_y":10},"passed":true},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"check":"removed anchor successor","expected":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":5},"check":"removed last anchor","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":"a","row":"a","scroll_x":4,"scroll_y":3},"check":"shrunk anchored cell","expected":{"column":"a","row":"a","scroll_x":4,"scroll_y":3},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":2},"check":"bottom clamp","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":2},"passed":true},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":13},"check":"surviving middle","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":7},"passed":false},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"check":"first successor","expected":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":null,"row":"a","scroll_x":0,"scroll_y":4},"check":"interior shrink","expected":{"column":null,"row":"a","scroll_x":0,"scroll_y":4},"passed":true},{"actual":{"column":null,"row":null,"scroll_x":0,"scroll_y":0},"check":"empty table","expected":{"column":null,"row":null,"scroll_x":0,"scroll_y":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"insert before anchored row\", \"actual\": {\"row\": \"b\", \"scroll_y\": 10, \"column\": \"b\", \"scroll_x\": 10}, \"expected\": {\"row\": \"b\", \"scroll_y\": 10, \"column\": \"b\", \"scroll_x\": 10}, \"passed\": true}, {\"check\": \"removed anchor successor\", \"actual\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"removed last anchor\", \"actual\": {\"row\": \"b\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"shrunk anchored cell\", \"actual\": {\"row\": \"a\", \"scroll_y\": 3, \"column\": \"a\", \"scroll_x\": 4}, \"expected\": {\"row\": \"a\", \"scroll_y\": 3, \"column\": \"a\", \"scroll_x\": 4}, \"passed\": true}, {\"check\": \"bottom clamp\", \"actual\": {\"row\": \"b\", \"scroll_y\": 2, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 2, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"surviving middle\", \"actual\": {\"row\": \"c\", \"scroll_y\": 13, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 7, \"column\": null, \"scroll_x\": 0}, \"passed\": false}, {\"check\": \"first successor\", \"actual\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"interior shrink\", \"actual\": {\"row\": \"a\", \"scroll_y\": 4, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"a\", \"scroll_y\": 4, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"empty table\", \"actual\": {\"row\": null, \"scroll_y\": 0, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": null, \"scroll_y\": 0, \"column\": null, \"scroll_x\": 0}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.479,"exit_code":1,"observations":[{"actual":{"column":"b","row":"b","scroll_x":10,"scroll_y":10},"check":"insert before anchored row","expected":{"column":"b","row":"b","scroll_x":10,"scroll_y":10},"passed":true},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"check":"removed anchor successor","expected":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":5},"check":"removed last anchor","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":"a","row":"a","scroll_x":4,"scroll_y":3},"check":"shrunk anchored cell","expected":{"column":"a","row":"a","scroll_x":4,"scroll_y":3},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":2},"check":"bottom clamp","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":2},"passed":true},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":13},"check":"surviving middle","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":7},"passed":false},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"check":"first successor","expected":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":5},"check":"interior shrink","expected":{"column":null,"row":"a","scroll_x":0,"scroll_y":4},"passed":false},{"actual":{"column":null,"row":null,"scroll_x":0,"scroll_y":0},"check":"empty table","expected":{"column":null,"row":null,"scroll_x":0,"scroll_y":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"insert before anchored row\", \"actual\": {\"row\": \"b\", \"scroll_y\": 10, \"column\": \"b\", \"scroll_x\": 10}, \"expected\": {\"row\": \"b\", \"scroll_y\": 10, \"column\": \"b\", \"scroll_x\": 10}, \"passed\": true}, {\"check\": \"removed anchor successor\", \"actual\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"removed last anchor\", \"actual\": {\"row\": \"b\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"shrunk anchored cell\", \"actual\": {\"row\": \"a\", \"scroll_y\": 3, \"column\": \"a\", \"scroll_x\": 4}, \"expected\": {\"row\": \"a\", \"scroll_y\": 3, \"column\": \"a\", \"scroll_x\": 4}, \"passed\": true}, {\"check\": \"bottom clamp\", \"actual\": {\"row\": \"b\", \"scroll_y\": 2, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 2, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"surviving middle\", \"actual\": {\"row\": \"c\", \"scroll_y\": 13, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 7, \"column\": null, \"scroll_x\": 0}, \"passed\": false}, {\"check\": \"first successor\", \"actual\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"interior shrink\", \"actual\": {\"row\": \"b\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"a\", \"scroll_y\": 4, \"column\": null, \"scroll_x\": 0}, \"passed\": false}, {\"check\": \"empty table\", \"actual\": {\"row\": null, \"scroll_y\": 0, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": null, \"scroll_y\": 0, \"column\": null, \"scroll_x\": 0}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.86,"exit_code":0,"observations":[{"actual":{"column":"b","row":"b","scroll_x":10,"scroll_y":10},"check":"insert before anchored row","expected":{"column":"b","row":"b","scroll_x":10,"scroll_y":10},"passed":true},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"check":"removed anchor successor","expected":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":5},"check":"removed last anchor","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":"a","row":"a","scroll_x":4,"scroll_y":3},"check":"shrunk anchored cell","expected":{"column":"a","row":"a","scroll_x":4,"scroll_y":3},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":2},"check":"bottom clamp","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":2},"passed":true},{"actual":{"column":null,"row":"b","scroll_x":0,"scroll_y":7},"check":"surviving middle","expected":{"column":null,"row":"b","scroll_x":0,"scroll_y":7},"passed":true},{"actual":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"check":"first successor","expected":{"column":null,"row":"c","scroll_x":0,"scroll_y":5},"passed":true},{"actual":{"column":null,"row":"a","scroll_x":0,"scroll_y":4},"check":"interior shrink","expected":{"column":null,"row":"a","scroll_x":0,"scroll_y":4},"passed":true},{"actual":{"column":null,"row":null,"scroll_x":0,"scroll_y":0},"check":"empty table","expected":{"column":null,"row":null,"scroll_x":0,"scroll_y":0},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"insert before anchored row\", \"actual\": {\"row\": \"b\", \"scroll_y\": 10, \"column\": \"b\", \"scroll_x\": 10}, \"expected\": {\"row\": \"b\", \"scroll_y\": 10, \"column\": \"b\", \"scroll_x\": 10}, \"passed\": true}, {\"check\": \"removed anchor successor\", \"actual\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"removed last anchor\", \"actual\": {\"row\": \"b\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"shrunk anchored cell\", \"actual\": {\"row\": \"a\", \"scroll_y\": 3, \"column\": \"a\", \"scroll_x\": 4}, \"expected\": {\"row\": \"a\", \"scroll_y\": 3, \"column\": \"a\", \"scroll_x\": 4}, \"passed\": true}, {\"check\": \"bottom clamp\", \"actual\": {\"row\": \"b\", \"scroll_y\": 2, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 2, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"surviving middle\", \"actual\": {\"row\": \"b\", \"scroll_y\": 7, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"b\", \"scroll_y\": 7, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"first successor\", \"actual\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"c\", \"scroll_y\": 5, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"interior shrink\", \"actual\": {\"row\": \"a\", \"scroll_y\": 4, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": \"a\", \"scroll_y\": 4, \"column\": null, \"scroll_x\": 0}, \"passed\": true}, {\"check\": \"empty table\", \"actual\": {\"row\": null, \"scroll_y\": 0, \"column\": null, \"scroll_x\": 0}, \"expected\": {\"row\": null, \"scroll_y\": 0, \"column\": null, \"scroll_x\": 0}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}