{"abstract":"An overlay touches its anchor instead of respecting separation.","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":"Measuring from anchor top overlays anchor content.","family":"xi-anchored-overlay-gap","id":"FA-8336","implementations":{"attempt":{"sha256":"59b7291ae093a23f903bd51cd1b7623d6566e1783ed0e9b1ad5fffd66358806f","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 = top + 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":"04f888f023d5901fa62ed92a4f1f86446a1ae88f11e9339ac81f203e717ce6ee","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\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-gap","generated_at":"2026-09-29T14:38:20.536594+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 gap operation as `below = bottom + gap`.","root_cause":"The gap operation uses `below = bottom` where the contract requires `below = bottom + gap`.","sha256":"3ccf572df14721ecf49af38249fe39b9eadc82eb38d9e03cf51177778cee9f4a","title":"Anchored overlay placement: An overlay touches its anchor instead of respecting separation · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.948,"exit_code":1,"observations":[{"actual":[10,23],"check":"below","expected":[10,43],"passed":false},{"actual":[10,83],"check":"flip","expected":[10,62],"passed":false},{"actual":[10,37],"check":"shape","expected":[10,37],"passed":true},{"actual":[75,23],"check":"right clamp","expected":[75,33],"passed":false},{"actual":[0,23],"check":"left clamp","expected":[0,33],"passed":false},{"actual":[0,0],"check":"oversize","expected":[0,0],"passed":true},{"actual":[2,4],"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\": [10, 23], \"expected\": [10, 43], \"passed\": false}, {\"check\": \"flip\", \"actual\": [10, 83], \"expected\": [10, 62], \"passed\": false}, {\"check\": \"shape\", \"actual\": [10, 37], \"expected\": [10, 37], \"passed\": true}, {\"check\": \"right clamp\", \"actual\": [75, 23], \"expected\": [75, 33], \"passed\": false}, {\"check\": \"left clamp\", \"actual\": [0, 23], \"expected\": [0, 33], \"passed\": false}, {\"check\": \"oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"parameterized geometry\", \"actual\": [2, 4], \"expected\": [2, 6], \"passed\": false}, {\"check\": \"repeat oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.425,"exit_code":1,"observations":[{"actual":[10,40],"check":"below","expected":[10,43],"passed":false},{"actual":[10,62],"check":"flip","expected":[10,62],"passed":true},{"actual":[10,37],"check":"shape","expected":[10,37],"passed":true},{"actual":[75,30],"check":"right clamp","expected":[75,33],"passed":false},{"actual":[0,30],"check":"left clamp","expected":[0,33],"passed":false},{"actual":[0,0],"check":"oversize","expected":[0,0],"passed":true},{"actual":[2,5],"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\": [10, 40], \"expected\": [10, 43], \"passed\": false}, {\"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, 30], \"expected\": [75, 33], \"passed\": false}, {\"check\": \"left clamp\", \"actual\": [0, 30], \"expected\": [0, 33], \"passed\": false}, {\"check\": \"oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"parameterized geometry\", \"actual\": [2, 5], \"expected\": [2, 6], \"passed\": false}, {\"check\": \"repeat oversize\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.079,"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"}