{"abstract":"A buyer flagged as both first-time and additional-dwelling gets relief plus a surcharge on relief slices.","category":"Tax bracket computation","checks":7,"contract":"solve(price, ftb, additional, nonresident): stipulated property transfer tax in whole pounds. Normal slices: 0% to 250000, 5% to 925000, 10% to 1500000, 12% above. First-time-buyer slices (0% to 425000, 5% to 625000) apply only when ftb is true, the purchase is not an additional dwelling, and price <= 625000; otherwise normal slices. Surcharges add percentage points to every slice including 0% slices: +3 for an additional dwelling when price >= 40000, +2 for a non-resident buyer; they stack. Return the tax rounded down to whole pounds.","evaluation_group":"w2-tax_bracket_computation-property-transfer-slices","failed_approach":"Dropping the surcharge for first-time buyers instead of denying relief under-taxes the purchase.","family":"w2-tax_bracket_computation-property-transfer-slices-ftb-with-additional","id":"FA-62611","implementations":{"attempt":{"sha256":"4ea0bdf3f43833f03967d0fe3ed70a4cbd8b7df13ed227ca6a74606f26998eee","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(price, ftb, additional, nonresident):\n    normal = [(250000, 0), (925000, 5), (1500000, 10), (None, 12)]\n    first = [(425000, 0), (625000, 5)]\n    use_ftb = ftb and not additional and price <= 625000\n    bands = first if use_ftb else normal\n    sur = (3 if additional and not ftb and price >= 40000 else 0) + (2 if nonresident else 0)\n    tax, lower = 0, 0\n    for upper, rate in bands:\n        top = price if upper is None else min(price, upper)\n        if top > lower: tax += (top - lower) * (rate + sur)\n        if upper is None or price <= upper: break\n        lower = upper\n    return tax // 100\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression ftb-with-additional 1', (400000, True, True, False), 19500),\n  ('regression ftb-with-additional 2', (625000, True, True, False), 37500),\n  ('partial repair guard 2', (625001, True, True, False), 37500),\n  ('control: normal', (300000, False, False, False), 2500),\n  ('control: first-time buyer', (500000, True, False, False), 3750),\n  ('control: ftb at cap', (625000, True, False, False), 10000),\n  ('control: ftb over cap', (625001, True, False, False), 18750)],\n [('regression ftb-with-additional 1', (349659, True, True, False), 15472),\n  ('regression ftb-with-additional 2', (625000, True, True, True), 50000),\n  ('partial repair guard 1', (919321, True, True, False), 61045),\n  ('partial repair guard 2', (925000, True, True, False), 61500),\n  ('control: ftb over cap', (625001, True, False, False), 18750),\n  ('control: additional dwelling', (300000, False, True, False), 11500),\n  ('control: additional nonresident', (300000, False, True, True), 17500),\n  ('control: below surcharge floor', (39999, False, True, False), 0)],\n [('regression ftb-with-additional 1', (539991, True, True, False), 30699),\n  ('regression ftb-with-additional 2', (488087, True, True, False), 26546),\n  ('partial repair guard 1', (628677, True, True, True), 50367),\n  ('partial repair guard 2', (250001, True, True, False), 7500),\n  ('control: below surcharge floor', (39999, False, True, False), 0),\n  ('control: nonresident cheap', (39999, False, False, True), 799),\n  ('control: ftb additional', (400000, True, True, False), 19500),\n  ('control: expensive', (2000000, False, False, False), 151250)],\n [('regression ftb-with-additional 1', (402343, True, True, False), 19687),\n  ('regression ftb-with-additional 2', (523207, True, True, False), 29356),\n  ('partial repair guard 1', (625000, True, True, False), 37500),\n  ('partial repair guard 2', (40000, True, True, False), 1200),\n  ('control: expensive', (2000000, False, False, False), 151250),\n  ('control: odd pounds', (250013, False, False, False), 0), ('control: normal', (300000, False, False, False), 2500),\n  ('control: first-time buyer', (500000, True, False, False), 3750)],\n [('regression ftb-with-additional 1', (459827, True, True, False), 24286),\n  ('regression ftb-with-additional 2', (443484, True, True, True), 31848),\n  ('partial repair guard 1', (625001, True, True, True), 50000),\n  ('partial repair guard 2', (745541, True, True, True), 62054),\n  ('control: first-time buyer', (500000, True, False, False), 3750),\n  ('control: ftb at cap', (625000, True, False, False), 10000),\n  ('control: ftb over cap', (625001, True, False, False), 18750),\n  ('control: additional dwelling', (300000, False, True, False), 11500)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, 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":"8eeebf60f8a90d83a1e57ffe1b03a5b3afabceb24b4ba78238d849a9425271de","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(price, ftb, additional, nonresident):\n    normal = [(250000, 0), (925000, 5), (1500000, 10), (None, 12)]\n    first = [(425000, 0), (625000, 5)]\n    use_ftb = ftb and price <= 625000\n    bands = first if use_ftb else normal\n    sur = (3 if additional and price >= 40000 else 0) + (2 if nonresident else 0)\n    tax, lower = 0, 0\n    for upper, rate in bands:\n        top = price if upper is None else min(price, upper)\n        if top > lower: tax += (top - lower) * (rate + sur)\n        if upper is None or price <= upper: break\n        lower = upper\n    return tax // 100\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression ftb-with-additional 1', (400000, True, True, False), 19500),\n  ('regression ftb-with-additional 2', (625000, True, True, False), 37500),\n  ('partial repair guard 2', (625001, True, True, False), 37500),\n  ('control: normal', (300000, False, False, False), 2500),\n  ('control: first-time buyer', (500000, True, False, False), 3750),\n  ('control: ftb at cap', (625000, True, False, False), 10000),\n  ('control: ftb over cap', (625001, True, False, False), 18750)],\n [('regression ftb-with-additional 1', (349659, True, True, False), 15472),\n  ('regression ftb-with-additional 2', (625000, True, True, True), 50000),\n  ('partial repair guard 1', (919321, True, True, False), 61045),\n  ('partial repair guard 2', (925000, True, True, False), 61500),\n  ('control: ftb over cap', (625001, True, False, False), 18750),\n  ('control: additional dwelling', (300000, False, True, False), 11500),\n  ('control: additional nonresident', (300000, False, True, True), 17500),\n  ('control: below surcharge floor', (39999, False, True, False), 0)],\n [('regression ftb-with-additional 1', (539991, True, True, False), 30699),\n  ('regression ftb-with-additional 2', (488087, True, True, False), 26546),\n  ('partial repair guard 1', (628677, True, True, True), 50367),\n  ('partial repair guard 2', (250001, True, True, False), 7500),\n  ('control: below surcharge floor', (39999, False, True, False), 0),\n  ('control: nonresident cheap', (39999, False, False, True), 799),\n  ('control: ftb additional', (400000, True, True, False), 19500),\n  ('control: expensive', (2000000, False, False, False), 151250)],\n [('regression ftb-with-additional 1', (402343, True, True, False), 19687),\n  ('regression ftb-with-additional 2', (523207, True, True, False), 29356),\n  ('partial repair guard 1', (625000, True, True, False), 37500),\n  ('partial repair guard 2', (40000, True, True, False), 1200),\n  ('control: expensive', (2000000, False, False, False), 151250),\n  ('control: odd pounds', (250013, False, False, False), 0), ('control: normal', (300000, False, False, False), 2500),\n  ('control: first-time buyer', (500000, True, False, False), 3750)],\n [('regression ftb-with-additional 1', (459827, True, True, False), 24286),\n  ('regression ftb-with-additional 2', (443484, True, True, True), 31848),\n  ('partial repair guard 1', (625001, True, True, True), 50000),\n  ('partial repair guard 2', (745541, True, True, True), 62054),\n  ('control: first-time buyer', (500000, True, False, False), 3750),\n  ('control: ftb at cap', (625000, True, False, False), 10000),\n  ('control: ftb over cap', (625001, True, False, False), 18750),\n  ('control: additional dwelling', (300000, False, True, False), 11500)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, 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"},"fixed":{"sha256":"883b2ebc60c8b8316af4a71939c0d9722b75ac7885f002c423ddf5266b3e5e72","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(price, ftb, additional, nonresident):\n    normal = [(250000, 0), (925000, 5), (1500000, 10), (None, 12)]\n    first = [(425000, 0), (625000, 5)]\n    use_ftb = ftb and not additional and price <= 625000\n    bands = first if use_ftb else normal\n    sur = (3 if additional and price >= 40000 else 0) + (2 if nonresident else 0)\n    tax, lower = 0, 0\n    for upper, rate in bands:\n        top = price if upper is None else min(price, upper)\n        if top > lower: tax += (top - lower) * (rate + sur)\n        if upper is None or price <= upper: break\n        lower = upper\n    return tax // 100\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncases = [[('regression ftb-with-additional 1', (400000, True, True, False), 19500),\n  ('regression ftb-with-additional 2', (625000, True, True, False), 37500),\n  ('partial repair guard 2', (625001, True, True, False), 37500),\n  ('control: normal', (300000, False, False, False), 2500),\n  ('control: first-time buyer', (500000, True, False, False), 3750),\n  ('control: ftb at cap', (625000, True, False, False), 10000),\n  ('control: ftb over cap', (625001, True, False, False), 18750)],\n [('regression ftb-with-additional 1', (349659, True, True, False), 15472),\n  ('regression ftb-with-additional 2', (625000, True, True, True), 50000),\n  ('partial repair guard 1', (919321, True, True, False), 61045),\n  ('partial repair guard 2', (925000, True, True, False), 61500),\n  ('control: ftb over cap', (625001, True, False, False), 18750),\n  ('control: additional dwelling', (300000, False, True, False), 11500),\n  ('control: additional nonresident', (300000, False, True, True), 17500),\n  ('control: below surcharge floor', (39999, False, True, False), 0)],\n [('regression ftb-with-additional 1', (539991, True, True, False), 30699),\n  ('regression ftb-with-additional 2', (488087, True, True, False), 26546),\n  ('partial repair guard 1', (628677, True, True, True), 50367),\n  ('partial repair guard 2', (250001, True, True, False), 7500),\n  ('control: below surcharge floor', (39999, False, True, False), 0),\n  ('control: nonresident cheap', (39999, False, False, True), 799),\n  ('control: ftb additional', (400000, True, True, False), 19500),\n  ('control: expensive', (2000000, False, False, False), 151250)],\n [('regression ftb-with-additional 1', (402343, True, True, False), 19687),\n  ('regression ftb-with-additional 2', (523207, True, True, False), 29356),\n  ('partial repair guard 1', (625000, True, True, False), 37500),\n  ('partial repair guard 2', (40000, True, True, False), 1200),\n  ('control: expensive', (2000000, False, False, False), 151250),\n  ('control: odd pounds', (250013, False, False, False), 0), ('control: normal', (300000, False, False, False), 2500),\n  ('control: first-time buyer', (500000, True, False, False), 3750)],\n [('regression ftb-with-additional 1', (459827, True, True, False), 24286),\n  ('regression ftb-with-additional 2', (443484, True, True, True), 31848),\n  ('partial repair guard 1', (625001, True, True, True), 50000),\n  ('partial repair guard 2', (745541, True, True, True), 62054),\n  ('control: first-time buyer', (500000, True, False, False), 3750),\n  ('control: ftb at cap', (625000, True, False, False), 10000),\n  ('control: ftb over cap', (625001, True, False, False), 18750),\n  ('control: additional dwelling', (300000, False, True, False), 11500)]]\nfor label, args, expected in cases[N - 1]:\n    check(label, 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 toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. 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-tax_bracket_computation-property-transfer-slices-ftb-with-additional","generated_at":"2026-09-29T14:47:06.236013+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Tax computations hinge on which slice, threshold, ordering and rounding rule applies at each step; a misplaced boundary silently misstates liabilities.","repair":"Deny first-time-buyer relief whenever the purchase is an additional dwelling.","root_cause":"Relief eligibility does not exclude additional dwellings.","sha256":"1467d0b828f3c8f9ca0367da8dae79c3ab44f92441bd1db48c1e4d754ab37b87","title":"First-time-buyer relief is granted on an additional dwelling · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.014,"exit_code":1,"observations":[{"actual":7500,"check":"regression ftb-with-additional 1","expected":19500,"passed":false},{"actual":18750,"check":"regression ftb-with-additional 2","expected":37500,"passed":false},{"actual":18750,"check":"partial repair guard 2","expected":37500,"passed":false},{"actual":2500,"check":"control: normal","expected":2500,"passed":true},{"actual":3750,"check":"control: first-time buyer","expected":3750,"passed":true},{"actual":10000,"check":"control: ftb at cap","expected":10000,"passed":true},{"actual":18750,"check":"control: ftb over cap","expected":18750,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression ftb-with-additional 1\", \"actual\": 7500, \"expected\": 19500, \"passed\": false}, {\"check\": \"regression ftb-with-additional 2\", \"actual\": 18750, \"expected\": 37500, \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": 18750, \"expected\": 37500, \"passed\": false}, {\"check\": \"control: normal\", \"actual\": 2500, \"expected\": 2500, \"passed\": true}, {\"check\": \"control: first-time buyer\", \"actual\": 3750, \"expected\": 3750, \"passed\": true}, {\"check\": \"control: ftb at cap\", \"actual\": 10000, \"expected\": 10000, \"passed\": true}, {\"check\": \"control: ftb over cap\", \"actual\": 18750, \"expected\": 18750, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.061,"exit_code":1,"observations":[{"actual":12000,"check":"regression ftb-with-additional 1","expected":19500,"passed":false},{"actual":28750,"check":"regression ftb-with-additional 2","expected":37500,"passed":false},{"actual":37500,"check":"partial repair guard 2","expected":37500,"passed":true},{"actual":2500,"check":"control: normal","expected":2500,"passed":true},{"actual":3750,"check":"control: first-time buyer","expected":3750,"passed":true},{"actual":10000,"check":"control: ftb at cap","expected":10000,"passed":true},{"actual":18750,"check":"control: ftb over cap","expected":18750,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression ftb-with-additional 1\", \"actual\": 12000, \"expected\": 19500, \"passed\": false}, {\"check\": \"regression ftb-with-additional 2\", \"actual\": 28750, \"expected\": 37500, \"passed\": false}, {\"check\": \"partial repair guard 2\", \"actual\": 37500, \"expected\": 37500, \"passed\": true}, {\"check\": \"control: normal\", \"actual\": 2500, \"expected\": 2500, \"passed\": true}, {\"check\": \"control: first-time buyer\", \"actual\": 3750, \"expected\": 3750, \"passed\": true}, {\"check\": \"control: ftb at cap\", \"actual\": 10000, \"expected\": 10000, \"passed\": true}, {\"check\": \"control: ftb over cap\", \"actual\": 18750, \"expected\": 18750, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.147,"exit_code":0,"observations":[{"actual":19500,"check":"regression ftb-with-additional 1","expected":19500,"passed":true},{"actual":37500,"check":"regression ftb-with-additional 2","expected":37500,"passed":true},{"actual":37500,"check":"partial repair guard 2","expected":37500,"passed":true},{"actual":2500,"check":"control: normal","expected":2500,"passed":true},{"actual":3750,"check":"control: first-time buyer","expected":3750,"passed":true},{"actual":10000,"check":"control: ftb at cap","expected":10000,"passed":true},{"actual":18750,"check":"control: ftb over cap","expected":18750,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression ftb-with-additional 1\", \"actual\": 19500, \"expected\": 19500, \"passed\": true}, {\"check\": \"regression ftb-with-additional 2\", \"actual\": 37500, \"expected\": 37500, \"passed\": true}, {\"check\": \"partial repair guard 2\", \"actual\": 37500, \"expected\": 37500, \"passed\": true}, {\"check\": \"control: normal\", \"actual\": 2500, \"expected\": 2500, \"passed\": true}, {\"check\": \"control: first-time buyer\", \"actual\": 3750, \"expected\": 3750, \"passed\": true}, {\"check\": \"control: ftb at cap\", \"actual\": 10000, \"expected\": 10000, \"passed\": true}, {\"check\": \"control: ftb over cap\", \"actual\": 18750, \"expected\": 18750, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}