{"abstract":"An overlay aligns to the wrong horizontal anchor edge.","category":"Viewport layout","checks":8,"contract":"Place below with a gap when fully fitting; otherwise above; align left edges and clamp both axes so oversized overlays start at zero.","evaluation_group":"xi-anchored-overlay","failed_approach":"Using the vertical coordinate mixes axes.","family":"xi-anchored-overlay-anchor-edge","id":"FA-8331","implementations":{"attempt":{"sha256":"45ad16d553a79fc9e8a07d0c7c3355c2abd972dfe2d72d1dd4e743478574bb37","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(anchor, size, viewport, gap):\n    left, top, right, bottom = anchor\n    width, height = size\n    vw, vh = viewport\n    x = top\n    below = bottom + gap\n    y = below if below + height <= vh else top - gap - height\n    x = max(0, min(x, vw - width))\n    y = max(0, min(y, vh - height))\n    return (x, y)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))\ncheck('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))\ncheck('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))\ncheck('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))\ncheck('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))\ncheck('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))\ncheck('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))\nfor repetition in range(N):\n    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"b9bd9e7c8dae87b295acdbf8e97bd785a7951b49f2ea1e426dee449773e95ba6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(anchor, size, viewport, gap):\n    left, top, right, bottom = anchor\n    width, height = size\n    vw, vh = viewport\n    x = right\n    below = bottom + gap\n    y = below if below + height <= vh else top - gap - height\n    x = max(0, min(x, vw - width))\n    y = max(0, min(y, vh - height))\n    return (x, y)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))\ncheck('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))\ncheck('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))\ncheck('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))\ncheck('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))\ncheck('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))\ncheck('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))\nfor repetition in range(N):\n    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"288d4f8f633e276f215cf70d913a72ca4dc5433399134f4174321ba1924cfd62","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(anchor, size, viewport, gap):\n    left, top, right, bottom = anchor\n    width, height = size\n    vw, vh = viewport\n    x = left\n    below = bottom + gap\n    y = below if below + height <= vh else top - gap - height\n    x = max(0, min(x, vw - width))\n    y = max(0, min(y, vh - height))\n    return (x, y)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('below', solve((10,20,30,40), (25,10), (100,100), 3), (10, 43))\ncheck('flip', solve((10,80,30,90), (25,15), (100,100), 3), (10, 62))\ncheck('shape', solve((10,70,30,80), (5,30), (100,100), 3), (10, 37))\ncheck('right clamp', solve((90,20,95,30), (25,10), (100,100), 3), (75, 33))\ncheck('left clamp', solve((-5,20,10,30), (25,10), (100,100), 3), (0, 33))\ncheck('oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))\ncheck('parameterized geometry', solve((2*N,3*N,4*N,5*N), (2*N,N), (20*N,20*N), N), (2*N,6*N))\nfor repetition in range(N):\n    check('repeat oversize', solve((10,10,20,20), (150,150), (100,100), 3), (0, 0))\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":" 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"xi-anchored-overlay-anchor-edge","generated_at":"2026-09-29T14:38:20.454461+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic model of anchored overlay placement; this isolates one interface invariant without requiring a browser.","repair":"Implement the anchor edge operation as `x = left`.","root_cause":"The anchor edge operation uses `x = right` where the contract requires `x = left`.","sha256":"db623eb99db4bd80c2aad9ca15e87fb738f268f4172ece8b60ce2de4cb41f485","title":"Anchored overlay placement: An overlay aligns to the wrong horizontal anchor edge · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.527,"exit_code":1,"observations":[{"actual":[20,43],"check":"below","expected":[10,43],"passed":false},{"actual":[75,62],"check":"flip","expected":[10,62],"passed":false},{"actual":[70,37],"check":"shape","expected":[10,37],"passed":false},{"actual":[20,33],"check":"right clamp","expected":[75,33],"passed":false},{"actual":[20,33],"check":"left clamp","expected":[0,33],"passed":false},{"actual":[0,0],"check":"oversize","expected":[0,0],"passed":true},{"actual":[3,6],"check":"parameterized geometry","expected":[2,6],"passed":false},{"actual":[0,0],"check":"repeat oversize","expected":[0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"below\", \"actual\": [20, 43], \"expected\": [10, 43], \"passed\": false}, {\"check\": \"flip\", \"actual\": [75, 62], \"expected\": [10, 62], \"passed\": false}, {\"check\": \"shape\", \"actual\": [70, 37], \"expected\": [10, 37], \"passed\": false}, {\"check\": \"right clamp\", \"actual\": [20, 33], \"expected\": [75, 33], \"passed\": false}, {\"check\": \"left clamp\", \"actual\": [20, 33], \"expected\": [0, 33], \"passed\": false}, {\"check\": \"oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"parameterized geometry\", \"actual\": [3, 6], \"expected\": [2, 6], \"passed\": false}, {\"check\": \"repeat oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.731,"exit_code":1,"observations":[{"actual":[30,43],"check":"below","expected":[10,43],"passed":false},{"actual":[30,62],"check":"flip","expected":[10,62],"passed":false},{"actual":[30,37],"check":"shape","expected":[10,37],"passed":false},{"actual":[75,33],"check":"right clamp","expected":[75,33],"passed":true},{"actual":[10,33],"check":"left clamp","expected":[0,33],"passed":false},{"actual":[0,0],"check":"oversize","expected":[0,0],"passed":true},{"actual":[4,6],"check":"parameterized geometry","expected":[2,6],"passed":false},{"actual":[0,0],"check":"repeat oversize","expected":[0,0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"below\", \"actual\": [30, 43], \"expected\": [10, 43], \"passed\": false}, {\"check\": \"flip\", \"actual\": [30, 62], \"expected\": [10, 62], \"passed\": false}, {\"check\": \"shape\", \"actual\": [30, 37], \"expected\": [10, 37], \"passed\": false}, {\"check\": \"right clamp\", \"actual\": [75, 33], \"expected\": [75, 33], \"passed\": true}, {\"check\": \"left clamp\", \"actual\": [10, 33], \"expected\": [0, 33], \"passed\": false}, {\"check\": \"oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"parameterized geometry\", \"actual\": [4, 6], \"expected\": [2, 6], \"passed\": false}, {\"check\": \"repeat oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.171,"exit_code":0,"observations":[{"actual":[10,43],"check":"below","expected":[10,43],"passed":true},{"actual":[10,62],"check":"flip","expected":[10,62],"passed":true},{"actual":[10,37],"check":"shape","expected":[10,37],"passed":true},{"actual":[75,33],"check":"right clamp","expected":[75,33],"passed":true},{"actual":[0,33],"check":"left clamp","expected":[0,33],"passed":true},{"actual":[0,0],"check":"oversize","expected":[0,0],"passed":true},{"actual":[2,6],"check":"parameterized geometry","expected":[2,6],"passed":true},{"actual":[0,0],"check":"repeat oversize","expected":[0,0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"below\", \"actual\": [10, 43], \"expected\": [10, 43], \"passed\": true}, {\"check\": \"flip\", \"actual\": [10, 62], \"expected\": [10, 62], \"passed\": true}, {\"check\": \"shape\", \"actual\": [10, 37], \"expected\": [10, 37], \"passed\": true}, {\"check\": \"right clamp\", \"actual\": [75, 33], \"expected\": [75, 33], \"passed\": true}, {\"check\": \"left clamp\", \"actual\": [0, 33], \"expected\": [0, 33], \"passed\": true}, {\"check\": \"oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"parameterized geometry\", \"actual\": [2, 6], \"expected\": [2, 6], \"passed\": true}, {\"check\": \"repeat oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}