FA-8341 / Viewport layout / Open access
Anchored overlay placement: Flip decisions ignore the overlay height · case 01
Flip decisions ignore the overlay height.
ROOT CAUSE
The flip fit operation uses `below <= vh` where the contract requires `below + height <= vh`.
VERIFIED REPAIR
Implement the flip fit operation as `below + height <= vh`.
Unsuccessful approach: Using width for vertical fit fails for nonsquare overlays.
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 + gap
y = below if below <= 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, 85] | [10, 62] | Failed |
| shape | [10, 70] | [10, 37] | Failed |
| 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 / 79f037f17d91396e9a91a7a0a551bd2b59d1faa5674e19442d688e548023a997
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 = bottom + gap
y = below if below + width <= 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, 70] | [10, 37] | Failed |
| 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 / cdc5c97321f068e9aee4d504a706bf8dead4e41991d3a7087c4260734972a16b
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.539588+00:00.
Case digest / 6d6becdcd7896306cf1512e77ba61c6c4f5763999f31a308b36d52b614a68caa