FA-8311 / Viewport layout / Open access
Virtualized row visibility: A row ending exactly at the viewport top remains visible · case 01
A row ending exactly at the viewport top remains visible.
ROOT CAUSE
The bottom boundary operation uses `positions[i+1] >= offset` where the contract requires `positions[i+1] > offset`.
VERIFIED REPAIR
Implement the bottom boundary operation as `positions[i+1] > offset`.
Unsuccessful approach: Testing row starts instead omits partially visible top rows.
Case contract
Rows overlap a half-open viewport using cumulative measured heights; overscan expands both sides and clamps to valid row indices.
Why this case matters
A deterministic model of virtualized row visibility; this isolates one interface invariant without requiring a browser.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(heights, offset, viewport, overscan):
positions = [0]
for height in heights: positions.append(positions[-1] + height)
visible = [i for i in range(len(heights)) if positions[i+1] >= offset and positions[i] < offset + viewport]
if not visible: return []
lo = max(0, visible[0] - overscan)
hi = min(len(heights), visible[-1] + 1 + overscan)
return list(range(lo, hi))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
check('repeat outside', solve([10,10], 30, 5, 1), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable | [1] | [1] | Passed |
| top edge | [0, 1] | [1] | Failed |
| partial top | [0, 1] | [0, 1] | Passed |
| partial bottom | [0, 1] | [0, 1] | Passed |
| overscan | [0, 1, 2, 3] | [1, 2, 3] | Failed |
| outside | [] | [] | Passed |
| parameterized measured heights | [0, 1, 2, 3] | [1, 2, 3] | Failed |
| repeat outside | [] | [] | Passed |
SHA-256 / e63c9a45797ddc12a0d5ac297abc3e544c415b5afc9969c11db38162e1d9a55e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(heights, offset, viewport, overscan):
positions = [0]
for height in heights: positions.append(positions[-1] + height)
visible = [i for i in range(len(heights)) if positions[i] >= offset and positions[i] < offset + viewport]
if not visible: return []
lo = max(0, visible[0] - overscan)
hi = min(len(heights), visible[-1] + 1 + overscan)
return list(range(lo, hi))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
check('repeat outside', solve([10,10], 30, 5, 1), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable | [] | [1] | Failed |
| top edge | [1] | [1] | Passed |
| partial top | [1] | [0, 1] | Failed |
| partial bottom | [0, 1] | [0, 1] | Passed |
| overscan | [1, 2, 3] | [1, 2, 3] | Passed |
| outside | [] | [] | Passed |
| parameterized measured heights | [1, 2, 3] | [1, 2, 3] | Passed |
| repeat outside | [] | [] | Passed |
SHA-256 / bd5a7e1b63d69cbb2fba14e5a90be8fe73b15773e2d605835c3211452e4244d6
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(heights, offset, viewport, overscan):
positions = [0]
for height in heights: positions.append(positions[-1] + height)
visible = [i for i in range(len(heights)) if positions[i+1] > offset and positions[i] < offset + viewport]
if not visible: return []
lo = max(0, visible[0] - overscan)
hi = min(len(heights), visible[-1] + 1 + overscan)
return list(range(lo, hi))
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('variable', solve([10,30,5], 15, 10, 0), [1])
check('top edge', solve([10,10,10], 10, 10, 0), [1])
check('partial top', solve([10,10,10], 5, 10, 0), [0, 1])
check('partial bottom', solve([10,10,10], 0, 15, 0), [0, 1])
check('overscan', solve([10]*6, 20, 10, 1), [1, 2, 3])
check('outside', solve([10,10], 30, 5, 1), [])
check('parameterized measured heights', solve([N]*6, 2*N, N, 1), [1,2,3])
for repetition in range(N):
check('repeat outside', solve([10,10], 30, 5, 1), [])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variable | [1] | [1] | Passed |
| top edge | [1] | [1] | Passed |
| partial top | [0, 1] | [0, 1] | Passed |
| partial bottom | [0, 1] | [0, 1] | Passed |
| overscan | [1, 2, 3] | [1, 2, 3] | Passed |
| outside | [] | [] | Passed |
| parameterized measured heights | [1, 2, 3] | [1, 2, 3] | Passed |
| repeat outside | [] | [] | Passed |
SHA-256 / b59c63c5c1cded2bd086606c7f9aa1fe3e210398e552938109049d71079e41c0
Verification & scope
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:38:20.206011+00:00.
Case digest / ccee79026bb7d9280a429853e56d6e0da91e2750c278ceea4a1d5d67cf6d5654