{"abstract":"Tiny icons are blown up to the full thumbnail size.","category":"Image orientation metadata","checks":8,"contract":"Input [stored_w, stored_h, tag, box_w, box_h]. Compute the displayed thumbnail size: tags 5..8 swap the displayed dimensions (other values, including invalid tags, do not). Scale = min(box_w/dw, box_h/dh, 1) exactly (never upscale); each side is rounded half up and is at least 1 pixel.","contract_signature":"x","evaluation_group":"w2-image-orientation-metadata-thumbnail-fit","failed_approach":"Allowing 2x for high-density screens still upscales against the contract.","family":"w2-image-orientation-metadata-thumbnail-fit-no-upscale","id":"FA-78981","implementations":{"attempt":{"sha256":"537b5f94bd639a01dd64aa9df210296686ae01ff4eeb67de0d34f6b26aa2343a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    w, h, tag, bw, bh = x\n    if tag in (5, 6, 7, 8):\n        w, h = h, w\n    s = min(Fraction(bw, w), Fraction(bh, h), Fraction(2))\n    tw = max(1, math.floor(w * s + Fraction(1, 2)))\n    th = max(1, math.floor(h * s + Fraction(1, 2)))\n    return [tw, th]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[25, 2, 6, 76, 343], [2, 25]], [[25, 2, 8, 231, 201], [2, 25]], [[5, 2, 2, 10, 2], [5, 2]], [[5, 4158, 8, 2, 2], [2, 1]], [[5, 1, 8, 10, 2], [1, 2]], [[2916, 3374, 8, 22, 164], [22, 19]], [[5, 27, 8, 10, 2], [10, 2]], [[3, 1, 6, 10, 10], [1, 3]]], [[[5, 2, 1, 19, 25], [5, 2]], [[5, 1, 1, 10, 26], [5, 1]], [[25, 7, 2, 2, 145], [2, 1]], [[15, 2, 0, 2, 2], [2, 1]], [[4728, 23, 5, 14, 18], [1, 18]], [[5, 4382, 0, 2, 337], [1, 337]], [[25, 7, 6, 2, 2], [1, 2]], [[17, 50, 7, 72, 27], [50, 17]]], [[[15, 1, 8, 10, 42], [1, 15]], [[15, 1, 6, 70, 32], [1, 15]], [[12, 1369, 3, 1, 30], [1, 30]], [[15, 1, 1, 11, 291], [11, 1]], [[2, 1, 3, 2, 2], [2, 1]], [[15, 1, 3, 2, 10], [2, 1]], [[1669, 12, 4, 2, 2], [2, 1]], [[25, 7, 7, 10, 345], [7, 25]]], [[[25, 1, 2, 288, 10], [25, 1]], [[5, 12, 9, 132, 13], [5, 12]], [[1283, 2, 6, 10, 2], [1, 2]], [[5, 2, 8, 2, 10], [2, 5]], [[25, 1230, 1, 10, 10], [1, 10]], [[3, 5, 2, 2, 22], [2, 3]], [[1584, 7, 0, 266, 9], [266, 1]], [[25, 1, 6, 10, 150], [1, 25]]], [[[5, 1, 0, 10, 2], [5, 1]], [[25, 7, 0, 65, 41], [25, 7]], [[3907, 2, 8, 28, 202], [1, 202]], [[25, 2, 4, 54, 2], [25, 2]], [[23, 49, 7, 23, 20], [23, 11]], [[3018, 47, 4, 2, 10], [2, 1]], [[15, 1, 2, 14, 14], [14, 1]], [[25, 2, 5, 103, 284], [2, 25]]]]\nlabels = [\"regression: upscale clamp\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\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":"eeb072df10b73779257173a9353fc7671ff01a4322f27ae0c7ae58213210a6eb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    w, h, tag, bw, bh = x\n    if tag in (5, 6, 7, 8):\n        w, h = h, w\n    s = min(Fraction(bw, w), Fraction(bh, h))\n    tw = max(1, math.floor(w * s + Fraction(1, 2)))\n    th = max(1, math.floor(h * s + Fraction(1, 2)))\n    return [tw, th]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[25, 2, 6, 76, 343], [2, 25]], [[25, 2, 8, 231, 201], [2, 25]], [[5, 2, 2, 10, 2], [5, 2]], [[5, 4158, 8, 2, 2], [2, 1]], [[5, 1, 8, 10, 2], [1, 2]], [[2916, 3374, 8, 22, 164], [22, 19]], [[5, 27, 8, 10, 2], [10, 2]], [[3, 1, 6, 10, 10], [1, 3]]], [[[5, 2, 1, 19, 25], [5, 2]], [[5, 1, 1, 10, 26], [5, 1]], [[25, 7, 2, 2, 145], [2, 1]], [[15, 2, 0, 2, 2], [2, 1]], [[4728, 23, 5, 14, 18], [1, 18]], [[5, 4382, 0, 2, 337], [1, 337]], [[25, 7, 6, 2, 2], [1, 2]], [[17, 50, 7, 72, 27], [50, 17]]], [[[15, 1, 8, 10, 42], [1, 15]], [[15, 1, 6, 70, 32], [1, 15]], [[12, 1369, 3, 1, 30], [1, 30]], [[15, 1, 1, 11, 291], [11, 1]], [[2, 1, 3, 2, 2], [2, 1]], [[15, 1, 3, 2, 10], [2, 1]], [[1669, 12, 4, 2, 2], [2, 1]], [[25, 7, 7, 10, 345], [7, 25]]], [[[25, 1, 2, 288, 10], [25, 1]], [[5, 12, 9, 132, 13], [5, 12]], [[1283, 2, 6, 10, 2], [1, 2]], [[5, 2, 8, 2, 10], [2, 5]], [[25, 1230, 1, 10, 10], [1, 10]], [[3, 5, 2, 2, 22], [2, 3]], [[1584, 7, 0, 266, 9], [266, 1]], [[25, 1, 6, 10, 150], [1, 25]]], [[[5, 1, 0, 10, 2], [5, 1]], [[25, 7, 0, 65, 41], [25, 7]], [[3907, 2, 8, 28, 202], [1, 202]], [[25, 2, 4, 54, 2], [25, 2]], [[23, 49, 7, 23, 20], [23, 11]], [[3018, 47, 4, 2, 10], [2, 1]], [[15, 1, 2, 14, 14], [14, 1]], [[25, 2, 5, 103, 284], [2, 25]]]]\nlabels = [\"regression: upscale clamp\", \"repair trap\", \"combined fault\", \"control\", \"control\", \"boundary\", \"boundary\", \"control\"]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"%s %d\" % (labels[i % len(labels)], i), solve(args), expected)\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":"A deterministic bounded teaching model with a stipulated contract; it makes no claim of conformance to any published specification. 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":"w2-image-orientation-metadata-thumbnail-fit-no-upscale","generated_at":"2026-09-29T14:49:40.481549+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Camera, phone and scanner images carry an orientation hint separately from the stored pixels; galleries, thumbnailers, editors and upload pipelines must interpret it consistently or photos appear sideways, mirrored or doubly rotated.","root_cause":"The scale factor is not clamped at 1.","sha256":"9ca037b29748c3698679447729391f0186c7be6e17c6aeb6520d174c1e9f5688","title":"Thumbnailer enlarges images smaller than the box · 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.627,"exit_code":1,"observations":[{"actual":[4,50],"check":"regression: upscale clamp 0","expected":[2,25],"passed":false},{"actual":[4,50],"check":"repair trap 1","expected":[2,25],"passed":false},{"actual":[5,2],"check":"combined fault 2","expected":[5,2],"passed":true},{"actual":[2,1],"check":"control 3","expected":[2,1],"passed":true},{"actual":[1,2],"check":"control 4","expected":[1,2],"passed":true},{"actual":[22,19],"check":"boundary 5","expected":[22,19],"passed":true},{"actual":[10,2],"check":"boundary 6","expected":[10,2],"passed":true},{"actual":[2,6],"check":"control 7","expected":[1,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: upscale clamp 0\", \"actual\": [4, 50], \"expected\": [2, 25], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [4, 50], \"expected\": [2, 25], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [5, 2], \"expected\": [5, 2], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [2, 1], \"expected\": [2, 1], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [22, 19], \"expected\": [22, 19], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [10, 2], \"expected\": [10, 2], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [2, 6], \"expected\": [1, 3], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.486,"exit_code":1,"observations":[{"actual":[27,343],"check":"regression: upscale clamp 0","expected":[2,25],"passed":false},{"actual":[16,201],"check":"repair trap 1","expected":[2,25],"passed":false},{"actual":[5,2],"check":"combined fault 2","expected":[5,2],"passed":true},{"actual":[2,1],"check":"control 3","expected":[2,1],"passed":true},{"actual":[1,2],"check":"control 4","expected":[1,2],"passed":true},{"actual":[22,19],"check":"boundary 5","expected":[22,19],"passed":true},{"actual":[10,2],"check":"boundary 6","expected":[10,2],"passed":true},{"actual":[3,10],"check":"control 7","expected":[1,3],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: upscale clamp 0\", \"actual\": [27, 343], \"expected\": [2, 25], \"passed\": false}, {\"check\": \"repair trap 1\", \"actual\": [16, 201], \"expected\": [2, 25], \"passed\": false}, {\"check\": \"combined fault 2\", \"actual\": [5, 2], \"expected\": [5, 2], \"passed\": true}, {\"check\": \"control 3\", \"actual\": [2, 1], \"expected\": [2, 1], \"passed\": true}, {\"check\": \"control 4\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"boundary 5\", \"actual\": [22, 19], \"expected\": [22, 19], \"passed\": true}, {\"check\": \"boundary 6\", \"actual\": [10, 2], \"expected\": [10, 2], \"passed\": true}, {\"check\": \"control 7\", \"actual\": [3, 10], \"expected\": [1, 3], \"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."}}