FA-8336 / Viewport layout / Open access
Anchored overlay placement: An overlay touches its anchor instead of respecting separation · case 01
An overlay touches its anchor instead of respecting separation.
ROOT CAUSE
The gap operation uses `below = bottom` where the contract requires `below = bottom + gap`.
VERIFIED REPAIR
Implement the gap operation as `below = bottom + gap`.
Unsuccessful approach: Measuring from anchor top overlays anchor content.
Case contract
Place below with a gap when fully fitting; otherwise above; align left edges and clamp both axes so oversized overlays start at zero.
Why this case matters
A deterministic model of anchored overlay placement; 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(anchor, size, viewport, gap):
left, top, right, bottom = anchor
width, height = size
vw, vh = viewport
x = left
below = bottom
y = below if below + height <= vh else top - gap - height
x = max(0, min(x, vw - width))
y = max(0, min(y, vh - height))
return (x, y)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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 |
|---|---|---|---|
| below | [10, 40] | [10, 43] | Failed |
| flip | [10, 62] | [10, 62] | Passed |
| shape | [10, 37] | [10, 37] | Passed |
| right clamp | [75, 30] | [75, 33] | Failed |
| left clamp | [0, 30] | [0, 33] | Failed |
| oversize | [0, 0] | [0, 0] | Passed |
| parameterized geometry | [2, 5] | [2, 6] | Failed |
| repeat oversize | [0, 0] | [0, 0] | Passed |
SHA-256 / 04f888f023d5901fa62ed92a4f1f86446a1ae88f11e9339ac81f203e717ce6ee
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(anchor, size, viewport, gap):
left, top, right, bottom = anchor
width, height = size
vw, vh = viewport
x = left
below = top + gap
y = below if below + height <= vh else top - gap - height
x = max(0, min(x, vw - width))
y = max(0, min(y, vh - height))
return (x, y)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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 |
|---|---|---|---|
| below | [10, 23] | [10, 43] | Failed |
| flip | [10, 83] | [10, 62] | Failed |
| shape | [10, 37] | [10, 37] | Passed |
| right clamp | [75, 23] | [75, 33] | Failed |
| left clamp | [0, 23] | [0, 33] | Failed |
| oversize | [0, 0] | [0, 0] | Passed |
| parameterized geometry | [2, 4] | [2, 6] | Failed |
| repeat oversize | [0, 0] | [0, 0] | Passed |
SHA-256 / 59b7291ae093a23f903bd51cd1b7623d6566e1783ed0e9b1ad5fffd66358806f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(anchor, size, viewport, gap):
left, top, right, bottom = anchor
width, height = size
vw, vh = viewport
x = left
below = bottom + gap
y = below if below + height <= vh else top - gap - height
x = max(0, min(x, vw - width))
y = max(0, min(y, vh - height))
return (x, y)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))
check('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))
check('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))
check('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))
check('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))
check('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
check('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))
for repetition in range(N):
check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))
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 |
|---|---|---|---|
| below | [10, 43] | [10, 43] | Passed |
| flip | [10, 62] | [10, 62] | Passed |
| shape | [10, 37] | [10, 37] | Passed |
| right clamp | [75, 33] | [75, 33] | Passed |
| left clamp | [0, 33] | [0, 33] | Passed |
| oversize | [0, 0] | [0, 0] | Passed |
| parameterized geometry | [2, 6] | [2, 6] | Passed |
| repeat oversize | [0, 0] | [0, 0] | Passed |
SHA-256 / 288d4f8f633e276f215cf70d913a72ca4dc5433399134f4174321ba1924cfd62
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.536594+00:00.
Case digest / 3ccf572df14721ecf49af38249fe39b9eadc82eb38d9e03cf51177778cee9f4a