FAILURE MAP
← Case archive

FA-8331 / Viewport layout / Open access

Anchored overlay placement: An overlay aligns to the wrong horizontal anchor edge · case 01

An overlay aligns to the wrong horizontal anchor edge.

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

ROOT CAUSE

The anchor edge operation uses `x = right` where the contract requires `x = left`.

VERIFIED REPAIR

Implement the anchor edge operation as `x = left`.

Unsuccessful approach: Using the vertical coordinate mixes axes.

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 = right
    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 fixtureActualExpectedOutcome
below[30, 43][10, 43]Failed
flip[30, 62][10, 62]Failed
shape[30, 37][10, 37]Failed
right clamp[75, 33][75, 33]Passed
left clamp[10, 33][0, 33]Failed
oversize[0, 0][0, 0]Passed
parameterized geometry[4, 6][2, 6]Failed
repeat oversize[0, 0][0, 0]Passed

SHA-256 / b9bd9e7c8dae87b295acdbf8e97bd785a7951b49f2ea1e426dee449773e95ba6

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 = top
    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 fixtureActualExpectedOutcome
below[20, 43][10, 43]Failed
flip[75, 62][10, 62]Failed
shape[70, 37][10, 37]Failed
right clamp[20, 33][75, 33]Failed
left clamp[20, 33][0, 33]Failed
oversize[0, 0][0, 0]Passed
parameterized geometry[3, 6][2, 6]Failed
repeat oversize[0, 0][0, 0]Passed

SHA-256 / 45ad16d553a79fc9e8a07d0c7c3355c2abd972dfe2d72d1dd4e743478574bb37

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 fixtureActualExpectedOutcome
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.454461+00:00.

Case digest / db623eb99db4bd80c2aad9ca15e87fb738f268f4172ece8b60ce2de4cb41f485