{"abstract":"Overlay width is omitted from right-edge collision handling.","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.","contract_signature":"anchor, size, viewport, gap","evaluation_group":"xi-anchored-overlay","failed_approach":"Dropping the lower clamp permits negative coordinates.","family":"xi-anchored-overlay-horizontal-clamp","id":"FA-8351","implementations":{"attempt":{"sha256":"99afa830b58dec4f6f2834e36342a4bfc857d93ff47d7567701b486f3f5c1fb3","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 = 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":"78f91d40def46fb80754b585d5a9a5967d47512618061bad36f47c5f32188081","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))\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-horizontal-clamp","generated_at":"2026-09-29T14:38:20.660512+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.","root_cause":"The horizontal clamp operation uses `max(0, min(x, vw))` where the contract requires `max(0, min(x, vw - width))`.","sha256":"2a3c147aa4dd524cd95c3fbf1c533f2a5460c71dbfe46cc63283c65a53ea5dcd","title":"Anchored overlay placement: Overlay width is omitted from right-edge collision handling · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":40.898,"exit_code":1,"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":[-5,33],"check":"left clamp","expected":[0,33],"passed":false},{"actual":[-50,0],"check":"oversize","expected":[0,0],"passed":false},{"actual":[2,6],"check":"parameterized geometry","expected":[2,6],"passed":true},{"actual":[-50,0],"check":"repeat oversize","expected":[0,0],"passed":false}],"passed":false,"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\": [-5, 33], \"expected\": [0, 33], \"passed\": false}, {\"check\": \"oversize\", \"actual\": [-50, 0], \"expected\": [0, 0], \"passed\": false}, {\"check\": \"parameterized geometry\", \"actual\": [2, 6], \"expected\": [2, 6], \"passed\": true}, {\"check\": \"repeat oversize\", \"actual\": [-50, 0], \"expected\": [0, 0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.964,"exit_code":1,"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":[90,33],"check":"right clamp","expected":[75,33],"passed":false},{"actual":[0,33],"check":"left clamp","expected":[0,33],"passed":true},{"actual":[10,0],"check":"oversize","expected":[0,0],"passed":false},{"actual":[2,6],"check":"parameterized geometry","expected":[2,6],"passed":true},{"actual":[10,0],"check":"repeat oversize","expected":[0,0],"passed":false}],"passed":false,"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\": [90, 33], \"expected\": [75, 33], \"passed\": false}, {\"check\": \"left clamp\", \"actual\": [0, 33], \"expected\": [0, 33], \"passed\": true}, {\"check\": \"oversize\", \"actual\": [10, 0], \"expected\": [0, 0], \"passed\": false}, {\"check\": \"parameterized geometry\", \"actual\": [2, 6], \"expected\": [2, 6], \"passed\": true}, {\"check\": \"repeat oversize\", \"actual\": [10, 0], \"expected\": [0, 0], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}