FA-8321 / Viewport layout / Open access
Virtualized row visibility: Overscan fails to include rows before the viewport · case 01
Overscan fails to include rows before the viewport.
ROOT CAUSE
The before overscan operation uses `visible[0]` where the contract requires `max(0, visible[0] - overscan)`.
VERIFIED REPAIR
Implement the before overscan operation as `max(0, visible[0] - overscan)`.
Unsuccessful approach: Adding overscan skips visible rows instead of expanding coverage.
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 = visible[0]
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 | [2, 3] | [1, 2, 3] | Failed |
| outside | [] | [] | Passed |
| parameterized measured heights | [2, 3] | [1, 2, 3] | Failed |
| repeat outside | [] | [] | Passed |
SHA-256 / 923deb19d9d377d8f76c3a0be695cf16848caf6a7c9ce04f12a4be9cf14adac6
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+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 | [3] | [1, 2, 3] | Failed |
| outside | [] | [] | Passed |
| parameterized measured heights | [3] | [1, 2, 3] | Failed |
| repeat outside | [] | [] | Passed |
SHA-256 / 4183e00cf3735a479780cf0441223097fb89e90fb98478f4c1e83a660f210cc3
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.287135+00:00.
Case digest / af77bd106a56e047b65860b4af5b228493ef88e69b36dee8d0b0e6b99049f2d7