{"abstract":"Flipped overlays overlap the anchor instead of ending above it.","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 lower anchor edge still overlaps its body.","family":"xi-anchored-overlay-flip-coordinate","id":"FA-8346","implementations":{"attempt":{"sha256":"938f66ad755a0470a4c7b3815236b1035a640c163d7a182acc1b9b12a4b47390","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 bottom - 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":"5d0410009020a7912ff58d862bc11deb185a1fcb6330b79404e5e995dc5d5bdf","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\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-flip-coordinate","generated_at":"2026-09-29T14:38:20.619923+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 flip coordinate operation as `top - gap - height`.","root_cause":"The flip coordinate operation uses `top - gap` where the contract requires `top - gap - height`.","sha256":"43aebacd37ddddf70a98f7df7f879113c371706352c41e71aeaa7287cf347c99","title":"Anchored overlay placement: Flipped overlays overlap the anchor instead of ending above it · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.211,"exit_code":1,"observations":[{"actual":[10,43],"check":"below","expected":[10,43],"passed":true},{"actual":[10,72],"check":"flip","expected":[10,62],"passed":false},{"actual":[10,47],"check":"shape","expected":[10,37],"passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"below\", \"actual\": [10, 43], \"expected\": [10, 43], \"passed\": true}, {\"check\": \"flip\", \"actual\": [10, 72], \"expected\": [10, 62], \"passed\": false}, {\"check\": \"shape\", \"actual\": [10, 47], \"expected\": [10, 37], \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":38.091,"exit_code":1,"observations":[{"actual":[10,43],"check":"below","expected":[10,43],"passed":true},{"actual":[10,77],"check":"flip","expected":[10,62],"passed":false},{"actual":[10,67],"check":"shape","expected":[10,37],"passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"below\", \"actual\": [10, 43], \"expected\": [10, 43], \"passed\": true}, {\"check\": \"flip\", \"actual\": [10, 77], \"expected\": [10, 62], \"passed\": false}, {\"check\": \"shape\", \"actual\": [10, 67], \"expected\": [10, 37], \"passed\": false}, {\"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\": false}\n"},"fixed":{"elapsed_ms":41.03,"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"}