FAILURE MAP
← Case archive

FA-37681 / Table interactions / Open access

Sparse loaded table row slots: inflight request suppression · case 01

The table inflight request suppression result violates the stipulated sparse loaded table row slots contract.

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

ROOT CAUSE

The inflight request suppression decision uses '' instead of " and (s['index']//size)*size not in loading".

VERIFIED REPAIR

Apply the complete inflight request suppression rule: and (s['index']//size)*size not in loading.

Unsuccessful approach: The attempted repair " and (s['index']//size)*size in loading" still loses a required part of the table contract.

Case contract

Sparse table slots retain absolute indices across unloaded pages, distinguish placeholder and stable row keys, clip loaded pages to declared total, decorate only placeholders with page loading/errors, and schedule each missing nonfailed noninflight page once.

Why this case matters

An offline table UI model isolates sparse loaded table row slots, 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(total, pages, size, loading, errors, selected, estimate):
    slots=[{'kind':'placeholder','index':i,'key':('placeholder',i),'height':estimate} for i in range(total)]
    for offset,items in pages:
        for j,row in enumerate(items):
            i=offset+j
            if not 0<=i<total: continue
            if i>=len(slots): continue
            slots[i]={'kind':'row','index':i,'key':('row',row['id']),'row':row,'selected':row['id'] in selected}
    for s in slots:
        page=(s['index']//size)*size
        if s['kind']=='placeholder': s['loading']=page in loading; s['error']=errors.get(page)
    return {'slots':slots,'requests':sorted({(s['index']//size)*size for s in slots if s['kind']=='placeholder' and (s['index']//size)*size not in errors})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':1}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 2:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':2}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 2}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 3:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':3}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 3}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 4:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':4}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 4}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 5:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':5}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 5}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
partial loaded pages{'requests': [2, 4], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': True}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': True}, {'index': 4, 'key': ['row', 'e'], 'kind': 'row', 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'error': None, 'height': 9, 'index': 5, 'key': ['placeholder', 5], 'kind': 'placeholder', 'loading': False}, {'error': 'failed', 'height': 9, 'index': 6, 'key': ['placeholder', 6], 'kind': 'placeholder', 'loading': False}]}{'requests': [4], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': True}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': True}, {'index': 4, 'key': ['row', 'e'], 'kind': 'row', 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'error': None, 'height': 9, 'index': 5, 'key': ['placeholder', 5], 'kind': 'placeholder', 'loading': False}, {'error': 'failed', 'height': 9, 'index': 6, 'key': ['placeholder', 6], 'kind': 'placeholder', 'loading': False}]}Failed
offset loaded rows{'requests': [0, 4], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': True}, {'index': 3, 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'selected': False}, {'error': None, 'height': 9, 'index': 4, 'key': ['placeholder', 4], 'kind': 'placeholder', 'loading': False}]}{'requests': [0, 4], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': True}, {'index': 3, 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'selected': False}, {'error': None, 'height': 9, 'index': 4, 'key': ['placeholder', 4], 'kind': 'placeholder', 'loading': False}]}Passed
outside total{'requests': [0], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': False}]}{'requests': [0], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': False}]}Passed
empty table{'requests': [], 'slots': []}{'requests': [], 'slots': []}Passed
all placeholders{'requests': [0, 2], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': False}]}{'requests': [0, 2], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': False}]}Passed
replacement page{'requests': [], 'slots': [{'index': 0, 'key': ['row', 'new'], 'kind': 'row', 'row': {'id': 'new'}, 'selected': True}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}]}{'requests': [], 'slots': [{'index': 0, 'key': ['row', 'new'], 'kind': 'row', 'row': {'id': 'new'}, 'selected': True}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}]}Passed

SHA-256 / a27e9afd2f2f12250b2e26b9b28e5d9561ab3673d33594980f5f6925f31f7f73

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(total, pages, size, loading, errors, selected, estimate):
    slots=[{'kind':'placeholder','index':i,'key':('placeholder',i),'height':estimate} for i in range(total)]
    for offset,items in pages:
        for j,row in enumerate(items):
            i=offset+j
            if not 0<=i<total: continue
            if i>=len(slots): continue
            slots[i]={'kind':'row','index':i,'key':('row',row['id']),'row':row,'selected':row['id'] in selected}
    for s in slots:
        page=(s['index']//size)*size
        if s['kind']=='placeholder': s['loading']=page in loading; s['error']=errors.get(page)
    return {'slots':slots,'requests':sorted({(s['index']//size)*size for s in slots if s['kind']=='placeholder' and (s['index']//size)*size in loading and (s['index']//size)*size not in errors})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':1}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 2:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':2}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 2}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 3:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':3}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 3}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 4:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':4}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 4}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 5:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':5}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 5}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
partial loaded pages{'requests': [2], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': True}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': True}, {'index': 4, 'key': ['row', 'e'], 'kind': 'row', 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'error': None, 'height': 9, 'index': 5, 'key': ['placeholder', 5], 'kind': 'placeholder', 'loading': False}, {'error': 'failed', 'height': 9, 'index': 6, 'key': ['placeholder', 6], 'kind': 'placeholder', 'loading': False}]}{'requests': [4], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': True}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': True}, {'index': 4, 'key': ['row', 'e'], 'kind': 'row', 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'error': None, 'height': 9, 'index': 5, 'key': ['placeholder', 5], 'kind': 'placeholder', 'loading': False}, {'error': 'failed', 'height': 9, 'index': 6, 'key': ['placeholder', 6], 'kind': 'placeholder', 'loading': False}]}Failed
offset loaded rows{'requests': [], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': True}, {'index': 3, 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'selected': False}, {'error': None, 'height': 9, 'index': 4, 'key': ['placeholder', 4], 'kind': 'placeholder', 'loading': False}]}{'requests': [0, 4], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': True}, {'index': 3, 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'selected': False}, {'error': None, 'height': 9, 'index': 4, 'key': ['placeholder', 4], 'kind': 'placeholder', 'loading': False}]}Failed
outside total{'requests': [], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': False}]}{'requests': [0], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': False}]}Failed
empty table{'requests': [], 'slots': []}{'requests': [], 'slots': []}Passed
all placeholders{'requests': [], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': False}]}{'requests': [0, 2], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': False}]}Failed
replacement page{'requests': [], 'slots': [{'index': 0, 'key': ['row', 'new'], 'kind': 'row', 'row': {'id': 'new'}, 'selected': True}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}]}{'requests': [], 'slots': [{'index': 0, 'key': ['row', 'new'], 'kind': 'row', 'row': {'id': 'new'}, 'selected': True}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}]}Passed

SHA-256 / b2b89d1f53710059ab979edee21d10addd6ce388460ae859b916a2385b47fea6

3 / The verified repair

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

N = 1
observations = []
def solve(total, pages, size, loading, errors, selected, estimate):
    slots=[{'kind':'placeholder','index':i,'key':('placeholder',i),'height':estimate} for i in range(total)]
    for offset,items in pages:
        for j,row in enumerate(items):
            i=offset+j
            if not 0<=i<total: continue
            if i>=len(slots): continue
            slots[i]={'kind':'row','index':i,'key':('row',row['id']),'row':row,'selected':row['id'] in selected}
    for s in slots:
        page=(s['index']//size)*size
        if s['kind']=='placeholder': s['loading']=page in loading; s['error']=errors.get(page)
    return {'slots':slots,'requests':sorted({(s['index']//size)*size for s in slots if s['kind']=='placeholder' and (s['index']//size)*size not in loading and (s['index']//size)*size not in errors})}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
if N == 1:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':1}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 2:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':2}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 2}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 3:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':3}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 3}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 4:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':4}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 4}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

if N == 5:
    check('partial loaded pages', solve(7, [(0,[{'id':'a'},{'id':'b'}]),(4,[{'id':'e','v':5}])], 2, [2], {6:'failed'}, ['e'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': True, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': True, 'error': None}, {'kind': 'row', 'index': 4, 'key': ('row', 'e'), 'row': {'id': 'e', 'v': 5}, 'selected': True}, {'kind': 'placeholder', 'index': 5, 'key': ('placeholder', 5), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 6, 'key': ('placeholder', 6), 'height': 9, 'loading': False, 'error': 'failed'}], 'requests': [4]})
    check('offset loaded rows', solve(5, [(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, ['c'], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': True}, {'kind': 'row', 'index': 3, 'key': ('row', 'd'), 'row': {'id': 'd'}, 'selected': False}, {'kind': 'placeholder', 'index': 4, 'key': ('placeholder', 4), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 4]})
    check('outside total', solve(3, [(-1,[{'id':'x'},{'id':'a'}]),(2,[{'id':'c'},{'id':'d'}])], 2, [], {}, [], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'a'), 'row': {'id': 'a'}, 'selected': False}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'row', 'index': 2, 'key': ('row', 'c'), 'row': {'id': 'c'}, 'selected': False}], 'requests': [0]})
    check('empty table', solve(0, [], 2, [], {}, [], 9), {'slots': [], 'requests': []})
    check('all placeholders', solve(4, [], 2, [], {}, [], 9), {'slots': [{'kind': 'placeholder', 'index': 0, 'key': ('placeholder', 0), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 1, 'key': ('placeholder', 1), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 2, 'key': ('placeholder', 2), 'height': 9, 'loading': False, 'error': None}, {'kind': 'placeholder', 'index': 3, 'key': ('placeholder', 3), 'height': 9, 'loading': False, 'error': None}], 'requests': [0, 2]})
    check('replacement page', solve(2, [(0,[{'id':'a'},{'id':'b'}]),(0,[{'id':'new'}])], 2, [0], {0:'stale'}, ['new'], 9), {'slots': [{'kind': 'row', 'index': 0, 'key': ('row', 'new'), 'row': {'id': 'new'}, 'selected': True}, {'kind': 'row', 'index': 1, 'key': ('row', 'b'), 'row': {'id': 'b'}, 'selected': False}], 'requests': []})

print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
partial loaded pages{'requests': [4], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': True}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': True}, {'index': 4, 'key': ['row', 'e'], 'kind': 'row', 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'error': None, 'height': 9, 'index': 5, 'key': ['placeholder', 5], 'kind': 'placeholder', 'loading': False}, {'error': 'failed', 'height': 9, 'index': 6, 'key': ['placeholder', 6], 'kind': 'placeholder', 'loading': False}]}{'requests': [4], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': True}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': True}, {'index': 4, 'key': ['row', 'e'], 'kind': 'row', 'row': {'id': 'e', 'v': 1}, 'selected': True}, {'error': None, 'height': 9, 'index': 5, 'key': ['placeholder', 5], 'kind': 'placeholder', 'loading': False}, {'error': 'failed', 'height': 9, 'index': 6, 'key': ['placeholder', 6], 'kind': 'placeholder', 'loading': False}]}Passed
offset loaded rows{'requests': [0, 4], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': True}, {'index': 3, 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'selected': False}, {'error': None, 'height': 9, 'index': 4, 'key': ['placeholder', 4], 'kind': 'placeholder', 'loading': False}]}{'requests': [0, 4], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': True}, {'index': 3, 'key': ['row', 'd'], 'kind': 'row', 'row': {'id': 'd'}, 'selected': False}, {'error': None, 'height': 9, 'index': 4, 'key': ['placeholder', 4], 'kind': 'placeholder', 'loading': False}]}Passed
outside total{'requests': [0], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': False}]}{'requests': [0], 'slots': [{'index': 0, 'key': ['row', 'a'], 'kind': 'row', 'row': {'id': 'a'}, 'selected': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'index': 2, 'key': ['row', 'c'], 'kind': 'row', 'row': {'id': 'c'}, 'selected': False}]}Passed
empty table{'requests': [], 'slots': []}{'requests': [], 'slots': []}Passed
all placeholders{'requests': [0, 2], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': False}]}{'requests': [0, 2], 'slots': [{'error': None, 'height': 9, 'index': 0, 'key': ['placeholder', 0], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 1, 'key': ['placeholder', 1], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 2, 'key': ['placeholder', 2], 'kind': 'placeholder', 'loading': False}, {'error': None, 'height': 9, 'index': 3, 'key': ['placeholder', 3], 'kind': 'placeholder', 'loading': False}]}Passed
replacement page{'requests': [], 'slots': [{'index': 0, 'key': ['row', 'new'], 'kind': 'row', 'row': {'id': 'new'}, 'selected': True}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}]}{'requests': [], 'slots': [{'index': 0, 'key': ['row', 'new'], 'kind': 'row', 'row': {'id': 'new'}, 'selected': True}, {'index': 1, 'key': ['row', 'b'], 'kind': 'row', 'row': {'id': 'b'}, 'selected': False}]}Passed

SHA-256 / dc8cb6c4ee073b0547ec45ff509a935c49897a8c671a07d16eac821595565ea8

Verification & scope

Total is a nonnegative integer and page size is positive; page offsets are integral and may clip outside the table. 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:03.588510+00:00.

Case digest / 5b83cb64a800c21998234dedb089c2da13a331a0d8738df464884eca7927b7b7