{"abstract":"Tick distances crossing a band boundary are off by one per boundary crossed.","category":"Betting odds conversion","checks":8,"contract":"Signed tick distance from price a to price b on the ladder [(101, 200, 1), (200, 300, 2), (300, 400, 5), (400, 600, 10), (600, 1000, 20), (1000, 2000, 50), (2000, 3000, 100), (3000, 5000, 200), (5000, 10000, 500), (10000, 100001, 1000)] (hundredths). Prices must be within 1.01..1000 (\"invalid\") and exactly on a tick (\"off ladder\"). Tick index counts all ticks of lower bands ((hi - lo) / step each) plus (v - lo) / step within the band. Return index(b) - index(a).","evaluation_group":"w2-odds-conversion-exchange-tick-distance","failed_approach":"Subtracting one per band drops a real tick at each boundary.","family":"w2-odds-conversion-exchange-tick-distance-band-fencepost","id":"FA-84611","implementations":{"attempt":{"sha256":"a2a92a5e5850bec19f17ce7013054f6940b4035a5e1ae5478716589b420a22ad","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(a, b):\n    BANDS = [(101, 200, 1), (200, 300, 2), (300, 400, 5), (400, 600, 10), (600, 1000, 20), (1000, 2000, 50), (2000, 3000, 100), (3000, 5000, 200), (5000, 10000, 500), (10000, 100001, 1000)]\n    def index(v):\n        n = 0\n        for lo, hi, step in BANDS:\n            if v >= hi:\n                n += (hi - lo) // step - 1\n            else:\n                if (v - lo) % step:\n                    return None\n                return n + (v - lo) // step\n        return None\n    out = []\n    for p in (a, b):\n        c = Fraction(p) * 100\n        if c.denominator != 1 or c < 101 or c > 100000:\n            return 'invalid'\n        i = index(int(c))\n        if i is None:\n            return 'off ladder'\n        out.append(i)\n    return out[1] - out[0]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('2.38', '850.00'), 216),\n  ('variant scenario 1', ('6.00', '2.16'), -82),\n  ('variant scenario 2', ('3.01', '5.00'), 'off ladder')],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('4.50', '1.60'), -115),\n  ('variant scenario 1', ('3.76', '2.22'), 'off ladder'),\n  ('variant scenario 2', ('6.00', '9.60'), 18)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('530.00', '5.10'), -122),\n  ('variant scenario 1', ('5.40', '3.30'), -28),\n  ('variant scenario 2', ('3.70', '7.40'), 33)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('5.40', '13.50'), 33),\n  ('variant scenario 1', ('7.41', '2.64'), 'off ladder'),\n  ('variant scenario 2', ('5.00', '2.76'), -42)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('1.46', '7.20'), 150),\n  ('variant scenario 1', ('2.66', '5.80'), 55),\n  ('variant scenario 2', ('5.21', '2.00'), 'off ladder')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(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":"add53df892d850e952bc9cd4a9e6e9533df9d9336ccbccdfb6825edc676cd85a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(a, b):\n    BANDS = [(101, 200, 1), (200, 300, 2), (300, 400, 5), (400, 600, 10), (600, 1000, 20), (1000, 2000, 50), (2000, 3000, 100), (3000, 5000, 200), (5000, 10000, 500), (10000, 100001, 1000)]\n    def index(v):\n        n = 0\n        for lo, hi, step in BANDS:\n            if v >= hi:\n                n += (hi - lo) // step + 1\n            else:\n                if (v - lo) % step:\n                    return None\n                return n + (v - lo) // step\n        return None\n    out = []\n    for p in (a, b):\n        c = Fraction(p) * 100\n        if c.denominator != 1 or c < 101 or c > 100000:\n            return 'invalid'\n        i = index(int(c))\n        if i is None:\n            return 'off ladder'\n        out.append(i)\n    return out[1] - out[0]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('2.38', '850.00'), 216),\n  ('variant scenario 1', ('6.00', '2.16'), -82),\n  ('variant scenario 2', ('3.01', '5.00'), 'off ladder')],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('4.50', '1.60'), -115),\n  ('variant scenario 1', ('3.76', '2.22'), 'off ladder'),\n  ('variant scenario 2', ('6.00', '9.60'), 18)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('530.00', '5.10'), -122),\n  ('variant scenario 1', ('5.40', '3.30'), -28),\n  ('variant scenario 2', ('3.70', '7.40'), 33)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('5.40', '13.50'), 33),\n  ('variant scenario 1', ('7.41', '2.64'), 'off ladder'),\n  ('variant scenario 2', ('5.00', '2.76'), -42)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('1.46', '7.20'), 150),\n  ('variant scenario 1', ('2.66', '5.80'), 55),\n  ('variant scenario 2', ('5.21', '2.00'), 'off ladder')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(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":"80ab2129001cde7b41b38fcb787020afa994eed853e12d0685d79fd06abfc81b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(a, b):\n    BANDS = [(101, 200, 1), (200, 300, 2), (300, 400, 5), (400, 600, 10), (600, 1000, 20), (1000, 2000, 50), (2000, 3000, 100), (3000, 5000, 200), (5000, 10000, 500), (10000, 100001, 1000)]\n    def index(v):\n        n = 0\n        for lo, hi, step in BANDS:\n            if v >= hi:\n                n += (hi - lo) // step\n            else:\n                if (v - lo) % step:\n                    return None\n                return n + (v - lo) // step\n        return None\n    out = []\n    for p in (a, b):\n        c = Fraction(p) * 100\n        if c.denominator != 1 or c < 101 or c > 100000:\n            return 'invalid'\n        i = index(int(c))\n        if i is None:\n            return 'off ladder'\n        out.append(i)\n    return out[1] - out[0]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('2.38', '850.00'), 216),\n  ('variant scenario 1', ('6.00', '2.16'), -82),\n  ('variant scenario 2', ('3.01', '5.00'), 'off ladder')],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('4.50', '1.60'), -115),\n  ('variant scenario 1', ('3.76', '2.22'), 'off ladder'),\n  ('variant scenario 2', ('6.00', '9.60'), 18)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('530.00', '5.10'), -122),\n  ('variant scenario 1', ('5.40', '3.30'), -28),\n  ('variant scenario 2', ('3.70', '7.40'), 33)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('5.40', '13.50'), 33),\n  ('variant scenario 1', ('7.41', '2.64'), 'off ladder'),\n  ('variant scenario 2', ('5.00', '2.76'), -42)],\n [('control within band', ('1.50', '1.60'), 10),\n  ('boundary crossing two', ('1.98', '2.04'), 4),\n  ('control downward move', ('3.10', '2.90'), -7),\n  ('boundary off ladder', ('2.01', '2.50'), 'off ladder'),\n  ('control full ladder', ('1.01', '1000'), 349),\n  ('regression: band fencepost', ('1.46', '7.20'), 150),\n  ('variant scenario 1', ('2.66', '5.80'), 55),\n  ('variant scenario 2', ('5.21', '2.00'), 'off ladder')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(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":"Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any operator, exchange or regulator rule set. 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-odds-conversion-exchange-tick-distance-band-fencepost","generated_at":"2026-09-29T14:50:32.571492+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Trading bots express stop-loss and offset orders as tick counts across ladder bands.","repair":"Count (hi - lo) / step ticks per completed band.","root_cause":"Each completed band contributes (hi - lo) / step + 1 ticks, double-counting the shared boundary price.","sha256":"0b0c2445d1911ac792bd49bcb6464d4f62ae779fe843184932a4e61a66a1818b","title":"Band boundary tick counted twice or dropped · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.528,"exit_code":1,"observations":[{"actual":10,"check":"control within band","expected":10,"passed":true},{"actual":3,"check":"boundary crossing two","expected":4,"passed":false},{"actual":-6,"check":"control downward move","expected":-7,"passed":false},{"actual":"off ladder","check":"boundary off ladder","expected":"off ladder","passed":true},{"actual":340,"check":"control full ladder","expected":349,"passed":false},{"actual":208,"check":"regression: band fencepost","expected":216,"passed":false},{"actual":-79,"check":"variant scenario 1","expected":-82,"passed":false},{"actual":"off ladder","check":"variant scenario 2","expected":"off ladder","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control within band\", \"actual\": 10, \"expected\": 10, \"passed\": true}, {\"check\": \"boundary crossing two\", \"actual\": 3, \"expected\": 4, \"passed\": false}, {\"check\": \"control downward move\", \"actual\": -6, \"expected\": -7, \"passed\": false}, {\"check\": \"boundary off ladder\", \"actual\": \"off ladder\", \"expected\": \"off ladder\", \"passed\": true}, {\"check\": \"control full ladder\", \"actual\": 340, \"expected\": 349, \"passed\": false}, {\"check\": \"regression: band fencepost\", \"actual\": 208, \"expected\": 216, \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": -79, \"expected\": -82, \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": \"off ladder\", \"expected\": \"off ladder\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.388,"exit_code":1,"observations":[{"actual":10,"check":"control within band","expected":10,"passed":true},{"actual":5,"check":"boundary crossing two","expected":4,"passed":false},{"actual":-8,"check":"control downward move","expected":-7,"passed":false},{"actual":"off ladder","check":"boundary off ladder","expected":"off ladder","passed":true},{"actual":358,"check":"control full ladder","expected":349,"passed":false},{"actual":224,"check":"regression: band fencepost","expected":216,"passed":false},{"actual":-85,"check":"variant scenario 1","expected":-82,"passed":false},{"actual":"off ladder","check":"variant scenario 2","expected":"off ladder","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control within band\", \"actual\": 10, \"expected\": 10, \"passed\": true}, {\"check\": \"boundary crossing two\", \"actual\": 5, \"expected\": 4, \"passed\": false}, {\"check\": \"control downward move\", \"actual\": -8, \"expected\": -7, \"passed\": false}, {\"check\": \"boundary off ladder\", \"actual\": \"off ladder\", \"expected\": \"off ladder\", \"passed\": true}, {\"check\": \"control full ladder\", \"actual\": 358, \"expected\": 349, \"passed\": false}, {\"check\": \"regression: band fencepost\", \"actual\": 224, \"expected\": 216, \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": -85, \"expected\": -82, \"passed\": false}, {\"check\": \"variant scenario 2\", \"actual\": \"off ladder\", \"expected\": \"off ladder\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":47.651,"exit_code":0,"observations":[{"actual":10,"check":"control within band","expected":10,"passed":true},{"actual":4,"check":"boundary crossing two","expected":4,"passed":true},{"actual":-7,"check":"control downward move","expected":-7,"passed":true},{"actual":"off ladder","check":"boundary off ladder","expected":"off ladder","passed":true},{"actual":349,"check":"control full ladder","expected":349,"passed":true},{"actual":216,"check":"regression: band fencepost","expected":216,"passed":true},{"actual":-82,"check":"variant scenario 1","expected":-82,"passed":true},{"actual":"off ladder","check":"variant scenario 2","expected":"off ladder","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control within band\", \"actual\": 10, \"expected\": 10, \"passed\": true}, {\"check\": \"boundary crossing two\", \"actual\": 4, \"expected\": 4, \"passed\": true}, {\"check\": \"control downward move\", \"actual\": -7, \"expected\": -7, \"passed\": true}, {\"check\": \"boundary off ladder\", \"actual\": \"off ladder\", \"expected\": \"off ladder\", \"passed\": true}, {\"check\": \"control full ladder\", \"actual\": 349, \"expected\": 349, \"passed\": true}, {\"check\": \"regression: band fencepost\", \"actual\": 216, \"expected\": 216, \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": -82, \"expected\": -82, \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"off ladder\", \"expected\": \"off ladder\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}