{"abstract":"Shortway offset transition returns a wrong result when the adjustment is spread evenly instead of front-loaded.","category":"Traffic signal timing plans","checks":8,"contract":"Input {cycle, current_offset, target_offset, lengthen_pct, shorten_pct}. The needed correction e = (target - current) mod cycle can be made by lengthening cycles by a total of e or shortening them by cycle - e. Per-cycle limits are floor(cycle*pct/100). Choose the direction needing fewer cycles (ties lengthen) and front-load the maximum adjustment each cycle. Return the list of transition cycle lengths ([] when already in step).","contract_signature":"x","evaluation_group":"w2-traffic_signal_timing_plans-offset-transition","failed_approach":"Spreading the correction evenly reaches the offset but not with the stipulated maximum-first profile.","family":"w2-traffic_signal_timing_plans-offset-transition-front-load","id":"FA-68076","implementations":{"attempt":{"sha256":"795280116818fcc602a377f0ebfa2b12db50c1e3c3b10e20fcbae67e233dbdd6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['cycle']\n    e = (x['target_offset'] - x['current_offset']) % C\n    if e == 0:\n        return []\n    L = C * x['lengthen_pct'] // 100\n    S = C * x['shorten_pct'] // 100\n    nl = -(-e // L)\n    ns = -(-(C - e) // S)\n    if nl <= ns:\n        amt, step, sign = e, L, 1\n    else:\n        amt, step, sign = C - e, S, -1\n    out = []\n    while amt > 0:\n        d = -(-amt // -(-amt // step))\n        out.append(C + sign * d)\n        amt -= d\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 90, 'current_offset': 10, 'target_offset': 82, 'lengthen_pct': 17, 'shorten_pct': 20}, [72]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 90, 'current_offset': 7, 'target_offset': 6, 'lengthen_pct': 25, 'shorten_pct': 20}, [89]), ({'cycle': 80, 'current_offset': 27, 'target_offset': 75, 'lengthen_pct': 20, 'shorten_pct': 17}, [96, 96, 96]), ({'cycle': 130, 'current_offset': 59, 'target_offset': 25, 'lengthen_pct': 17, 'shorten_pct': 10}, [117, 117, 122]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 130, 'current_offset': 77, 'target_offset': 32, 'lengthen_pct': 20, 'shorten_pct': 20}, [104, 111])], [({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 90, 'current_offset': 56, 'target_offset': 74, 'lengthen_pct': 10, 'shorten_pct': 20}, [99, 99]), ({'cycle': 150, 'current_offset': 42, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 10}, [135, 143]), ({'cycle': 70, 'current_offset': 20, 'target_offset': 48, 'lengthen_pct': 17, 'shorten_pct': 13}, [81, 81, 76]), ({'cycle': 140, 'current_offset': 32, 'target_offset': 8, 'lengthen_pct': 25, 'shorten_pct': 13}, [122, 134]), ({'cycle': 60, 'current_offset': 31, 'target_offset': 31, 'lengthen_pct': 25, 'shorten_pct': 20}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130])], [({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 60, 'current_offset': 4, 'target_offset': 57, 'lengthen_pct': 10, 'shorten_pct': 13}, [53]), ({'cycle': 60, 'current_offset': 12, 'target_offset': 14, 'lengthen_pct': 25, 'shorten_pct': 10}, [62]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 100, 'current_offset': 12, 'target_offset': 12, 'lengthen_pct': 17, 'shorten_pct': 20}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 70, 'current_offset': 55, 'target_offset': 56, 'lengthen_pct': 20, 'shorten_pct': 17}, [71]), ({'cycle': 70, 'current_offset': 17, 'target_offset': 4, 'lengthen_pct': 25, 'shorten_pct': 13}, [61, 66])], [({'cycle': 70, 'current_offset': 65, 'target_offset': 12, 'lengthen_pct': 25, 'shorten_pct': 10}, [87]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 100, 'current_offset': 90, 'target_offset': 89, 'lengthen_pct': 17, 'shorten_pct': 20}, [99]), ({'cycle': 110, 'current_offset': 51, 'target_offset': 51, 'lengthen_pct': 20, 'shorten_pct': 13}, []), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 60, 'current_offset': 47, 'target_offset': 39, 'lengthen_pct': 10, 'shorten_pct': 13}, [53, 59]), ({'cycle': 90, 'current_offset': 25, 'target_offset': 13, 'lengthen_pct': 17, 'shorten_pct': 10}, [81, 87])], [({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 90, 'current_offset': 54, 'target_offset': 43, 'lengthen_pct': 10, 'shorten_pct': 13}, [79]), ({'cycle': 130, 'current_offset': 41, 'target_offset': 22, 'lengthen_pct': 20, 'shorten_pct': 17}, [111]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 140, 'current_offset': 46, 'target_offset': 86, 'lengthen_pct': 25, 'shorten_pct': 13}, [175, 145]), ({'cycle': 120, 'current_offset': 55, 'target_offset': 69, 'lengthen_pct': 20, 'shorten_pct': 17}, [134]), ({'cycle': 100, 'current_offset': 74, 'target_offset': 84, 'lengthen_pct': 10, 'shorten_pct': 17}, [110]), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('timing oracle' + ' %d' % 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":"a3c1c581b3b36f0b709d2c93a9302dc349b0d7161756227abf4846173d9ef1be","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['cycle']\n    e = (x['target_offset'] - x['current_offset']) % C\n    if e == 0:\n        return []\n    L = C * x['lengthen_pct'] // 100\n    S = C * x['shorten_pct'] // 100\n    nl = -(-e // L)\n    ns = -(-(C - e) // S)\n    if nl <= ns:\n        amt, step, sign = e, L, 1\n    else:\n        amt, step, sign = C - e, S, -1\n    out = []\n    while amt > 0:\n        d = step\n        out.append(C + sign * d)\n        amt -= d\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[({'cycle': 90, 'current_offset': 10, 'target_offset': 82, 'lengthen_pct': 17, 'shorten_pct': 20}, [72]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 90, 'current_offset': 7, 'target_offset': 6, 'lengthen_pct': 25, 'shorten_pct': 20}, [89]), ({'cycle': 80, 'current_offset': 27, 'target_offset': 75, 'lengthen_pct': 20, 'shorten_pct': 17}, [96, 96, 96]), ({'cycle': 130, 'current_offset': 59, 'target_offset': 25, 'lengthen_pct': 17, 'shorten_pct': 10}, [117, 117, 122]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 130, 'current_offset': 77, 'target_offset': 32, 'lengthen_pct': 20, 'shorten_pct': 20}, [104, 111])], [({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 90, 'current_offset': 56, 'target_offset': 74, 'lengthen_pct': 10, 'shorten_pct': 20}, [99, 99]), ({'cycle': 150, 'current_offset': 42, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 10}, [135, 143]), ({'cycle': 70, 'current_offset': 20, 'target_offset': 48, 'lengthen_pct': 17, 'shorten_pct': 13}, [81, 81, 76]), ({'cycle': 140, 'current_offset': 32, 'target_offset': 8, 'lengthen_pct': 25, 'shorten_pct': 13}, [122, 134]), ({'cycle': 60, 'current_offset': 31, 'target_offset': 31, 'lengthen_pct': 25, 'shorten_pct': 20}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130])], [({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 60, 'current_offset': 4, 'target_offset': 57, 'lengthen_pct': 10, 'shorten_pct': 13}, [53]), ({'cycle': 60, 'current_offset': 12, 'target_offset': 14, 'lengthen_pct': 25, 'shorten_pct': 10}, [62]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 100, 'current_offset': 12, 'target_offset': 12, 'lengthen_pct': 17, 'shorten_pct': 20}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 70, 'current_offset': 55, 'target_offset': 56, 'lengthen_pct': 20, 'shorten_pct': 17}, [71]), ({'cycle': 70, 'current_offset': 17, 'target_offset': 4, 'lengthen_pct': 25, 'shorten_pct': 13}, [61, 66])], [({'cycle': 70, 'current_offset': 65, 'target_offset': 12, 'lengthen_pct': 25, 'shorten_pct': 10}, [87]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 100, 'current_offset': 90, 'target_offset': 89, 'lengthen_pct': 17, 'shorten_pct': 20}, [99]), ({'cycle': 110, 'current_offset': 51, 'target_offset': 51, 'lengthen_pct': 20, 'shorten_pct': 13}, []), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 60, 'current_offset': 47, 'target_offset': 39, 'lengthen_pct': 10, 'shorten_pct': 13}, [53, 59]), ({'cycle': 90, 'current_offset': 25, 'target_offset': 13, 'lengthen_pct': 17, 'shorten_pct': 10}, [81, 87])], [({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 90, 'current_offset': 54, 'target_offset': 43, 'lengthen_pct': 10, 'shorten_pct': 13}, [79]), ({'cycle': 130, 'current_offset': 41, 'target_offset': 22, 'lengthen_pct': 20, 'shorten_pct': 17}, [111]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 140, 'current_offset': 46, 'target_offset': 86, 'lengthen_pct': 25, 'shorten_pct': 13}, [175, 145]), ({'cycle': 120, 'current_offset': 55, 'target_offset': 69, 'lengthen_pct': 20, 'shorten_pct': 17}, [134]), ({'cycle': 100, 'current_offset': 74, 'target_offset': 84, 'lengthen_pct': 10, 'shorten_pct': 17}, [110]), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130])]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check('timing oracle' + ' %d' % 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 toy model with a stipulated contract; it makes no claim of conformance to any agency manual or standard. 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-traffic_signal_timing_plans-offset-transition-front-load","generated_at":"2026-09-29T14:47:58.891355+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Signal timing arithmetic is exact and integer or rational; a wrong rule silently produces unsafe or inefficient timing plans.","root_cause":"Every transition cycle applies the full step, overshooting the target offset on the last cycle.","sha256":"ae18610e27e09e8b2fbacd494d370de6d1d5397f20cb94a9a554a757ddb7eff7","title":"Shortway offset transition: the adjustment is spread evenly instead of front-loaded · 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.423,"exit_code":1,"observations":[{"actual":[72],"check":"timing oracle 0","expected":[72],"passed":true},{"actual":[120,120],"check":"timing oracle 1","expected":[120,120],"passed":true},{"actual":[137,137,136],"check":"timing oracle 2","expected":[140,140,130],"passed":false},{"actual":[89],"check":"timing oracle 3","expected":[89],"passed":true},{"actual":[96,96,96],"check":"timing oracle 4","expected":[96,96,96],"passed":true},{"actual":[118,119,119],"check":"timing oracle 5","expected":[117,117,122],"passed":false},{"actual":[],"check":"timing oracle 6","expected":[],"passed":true},{"actual":[107,108],"check":"timing oracle 7","expected":[104,111],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [72], \"expected\": [72], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [120, 120], \"expected\": [120, 120], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [137, 137, 136], \"expected\": [140, 140, 130], \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": [89], \"expected\": [89], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [96, 96, 96], \"expected\": [96, 96, 96], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [118, 119, 119], \"expected\": [117, 117, 122], \"passed\": false}, {\"check\": \"timing oracle 6\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [107, 108], \"expected\": [104, 111], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.579,"exit_code":1,"observations":[{"actual":[72],"check":"timing oracle 0","expected":[72],"passed":true},{"actual":[120,120],"check":"timing oracle 1","expected":[120,120],"passed":true},{"actual":[140,140,140],"check":"timing oracle 2","expected":[140,140,130],"passed":false},{"actual":[72],"check":"timing oracle 3","expected":[89],"passed":false},{"actual":[96,96,96],"check":"timing oracle 4","expected":[96,96,96],"passed":true},{"actual":[117,117,117],"check":"timing oracle 5","expected":[117,117,122],"passed":false},{"actual":[],"check":"timing oracle 6","expected":[],"passed":true},{"actual":[104,104],"check":"timing oracle 7","expected":[104,111],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [72], \"expected\": [72], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [120, 120], \"expected\": [120, 120], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [140, 140, 140], \"expected\": [140, 140, 130], \"passed\": false}, {\"check\": \"timing oracle 3\", \"actual\": [72], \"expected\": [89], \"passed\": false}, {\"check\": \"timing oracle 4\", \"actual\": [96, 96, 96], \"expected\": [96, 96, 96], \"passed\": true}, {\"check\": \"timing oracle 5\", \"actual\": [117, 117, 117], \"expected\": [117, 117, 122], \"passed\": false}, {\"check\": \"timing oracle 6\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [104, 104], \"expected\": [104, 111], \"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."}}