{"abstract":"Shortway offset transition returns a wrong result when the offset error is computed current minus target.","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":"The absolute difference is wrong whenever the target offset is numerically behind the current offset.","family":"w2-traffic_signal_timing_plans-offset-transition-error-direction","id":"FA-68056","implementations":{"attempt":{"sha256":"3cfae46ad674409527019a369960c00864edadf418f93b932f9f1ee601878a1b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    C = x['cycle']\n    e = abs(x['target_offset'] - x['current_offset'])\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 = min(step, amt)\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': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 80, 'current_offset': 13, 'target_offset': 43, 'lengthen_pct': 10, 'shorten_pct': 20}, [88, 88, 88, 86]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 90, 'current_offset': 57, 'target_offset': 57, 'lengthen_pct': 25, 'shorten_pct': 17}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 120, 'current_offset': 50, 'target_offset': 46, 'lengthen_pct': 10, 'shorten_pct': 17}, [116]), ({'cycle': 110, 'current_offset': 65, 'target_offset': 65, 'lengthen_pct': 25, 'shorten_pct': 20}, []), ({'cycle': 90, 'current_offset': 3, 'target_offset': 3, 'lengthen_pct': 20, 'shorten_pct': 20}, [])], [({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 90, 'current_offset': 60, 'target_offset': 15, 'lengthen_pct': 20, 'shorten_pct': 13}, [108, 108, 99]), ({'cycle': 150, 'current_offset': 87, 'target_offset': 6, 'lengthen_pct': 20, 'shorten_pct': 17}, [180, 180, 159]), ({'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': 150, 'current_offset': 116, 'target_offset': 41, 'lengthen_pct': 25, 'shorten_pct': 17}, [187, 187, 151]), ({'cycle': 60, 'current_offset': 49, 'target_offset': 49, 'lengthen_pct': 10, 'shorten_pct': 10}, []), ({'cycle': 60, 'current_offset': 29, 'target_offset': 36, 'lengthen_pct': 25, 'shorten_pct': 17}, [67])], [({'cycle': 140, 'current_offset': 36, 'target_offset': 36, 'lengthen_pct': 10, 'shorten_pct': 10}, []), ({'cycle': 100, 'current_offset': 57, 'target_offset': 57, 'lengthen_pct': 25, 'shorten_pct': 20}, []), ({'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': 140, 'current_offset': 17, 'target_offset': 133, 'lengthen_pct': 10, 'shorten_pct': 17}, [117, 139]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 140, 'current_offset': 98, 'target_offset': 45, 'lengthen_pct': 17, 'shorten_pct': 13}, [122, 122, 123]), ({'cycle': 140, 'current_offset': 87, 'target_offset': 17, 'lengthen_pct': 10, 'shorten_pct': 17}, [117, 117, 117, 139])], [({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 110, 'current_offset': 75, 'target_offset': 20, 'lengthen_pct': 10, 'shorten_pct': 10}, [121, 121, 121, 121, 121]), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 150, 'current_offset': 79, 'target_offset': 79, 'lengthen_pct': 17, 'shorten_pct': 20}, []), ({'cycle': 150, 'current_offset': 127, 'target_offset': 28, 'lengthen_pct': 10, 'shorten_pct': 13}, [165, 165, 165, 156]), ({'cycle': 130, 'current_offset': 28, 'target_offset': 93, 'lengthen_pct': 20, 'shorten_pct': 17}, [156, 156, 143]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 150, 'current_offset': 107, 'target_offset': 141, 'lengthen_pct': 17, 'shorten_pct': 20}, [175, 159])], [({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 100, 'current_offset': 71, 'target_offset': 71, 'lengthen_pct': 10, 'shorten_pct': 10}, []), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 150, 'current_offset': 86, 'target_offset': 11, 'lengthen_pct': 20, 'shorten_pct': 20}, [180, 180, 165]), ({'cycle': 110, 'current_offset': 1, 'target_offset': 55, 'lengthen_pct': 25, 'shorten_pct': 13}, [137, 137]), ({'cycle': 90, 'current_offset': 46, 'target_offset': 8, 'lengthen_pct': 20, 'shorten_pct': 13}, [108, 108, 106]), ({'cycle': 90, 'current_offset': 88, 'target_offset': 43, 'lengthen_pct': 17, 'shorten_pct': 10}, [105, 105, 105])]]\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":"20e45c3cee7bf7535402e4c6cc9ad1ba940582beded2b54a81404088461fffcd","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['current_offset'] - x['target_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 = min(step, amt)\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': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 80, 'current_offset': 13, 'target_offset': 43, 'lengthen_pct': 10, 'shorten_pct': 20}, [88, 88, 88, 86]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 90, 'current_offset': 57, 'target_offset': 57, 'lengthen_pct': 25, 'shorten_pct': 17}, []), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 120, 'current_offset': 50, 'target_offset': 46, 'lengthen_pct': 10, 'shorten_pct': 17}, [116]), ({'cycle': 110, 'current_offset': 65, 'target_offset': 65, 'lengthen_pct': 25, 'shorten_pct': 20}, []), ({'cycle': 90, 'current_offset': 3, 'target_offset': 3, 'lengthen_pct': 20, 'shorten_pct': 20}, [])], [({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 90, 'current_offset': 60, 'target_offset': 15, 'lengthen_pct': 20, 'shorten_pct': 13}, [108, 108, 99]), ({'cycle': 150, 'current_offset': 87, 'target_offset': 6, 'lengthen_pct': 20, 'shorten_pct': 17}, [180, 180, 159]), ({'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': 150, 'current_offset': 116, 'target_offset': 41, 'lengthen_pct': 25, 'shorten_pct': 17}, [187, 187, 151]), ({'cycle': 60, 'current_offset': 49, 'target_offset': 49, 'lengthen_pct': 10, 'shorten_pct': 10}, []), ({'cycle': 60, 'current_offset': 29, 'target_offset': 36, 'lengthen_pct': 25, 'shorten_pct': 17}, [67])], [({'cycle': 140, 'current_offset': 36, 'target_offset': 36, 'lengthen_pct': 10, 'shorten_pct': 10}, []), ({'cycle': 100, 'current_offset': 57, 'target_offset': 57, 'lengthen_pct': 25, 'shorten_pct': 20}, []), ({'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': 140, 'current_offset': 17, 'target_offset': 133, 'lengthen_pct': 10, 'shorten_pct': 17}, [117, 139]), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 140, 'current_offset': 98, 'target_offset': 45, 'lengthen_pct': 17, 'shorten_pct': 13}, [122, 122, 123]), ({'cycle': 140, 'current_offset': 87, 'target_offset': 17, 'lengthen_pct': 10, 'shorten_pct': 17}, [117, 117, 117, 139])], [({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 110, 'current_offset': 75, 'target_offset': 20, 'lengthen_pct': 10, 'shorten_pct': 10}, [121, 121, 121, 121, 121]), ({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 150, 'current_offset': 79, 'target_offset': 79, 'lengthen_pct': 17, 'shorten_pct': 20}, []), ({'cycle': 150, 'current_offset': 127, 'target_offset': 28, 'lengthen_pct': 10, 'shorten_pct': 13}, [165, 165, 165, 156]), ({'cycle': 130, 'current_offset': 28, 'target_offset': 93, 'lengthen_pct': 20, 'shorten_pct': 17}, [156, 156, 143]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 150, 'current_offset': 107, 'target_offset': 141, 'lengthen_pct': 17, 'shorten_pct': 20}, [175, 159])], [({'cycle': 120, 'current_offset': 90, 'target_offset': 20, 'lengthen_pct': 17, 'shorten_pct': 13}, [140, 140, 130]), ({'cycle': 90, 'current_offset': 30, 'target_offset': 30, 'lengthen_pct': 20, 'shorten_pct': 17}, []), ({'cycle': 100, 'current_offset': 71, 'target_offset': 71, 'lengthen_pct': 10, 'shorten_pct': 10}, []), ({'cycle': 100, 'current_offset': 10, 'target_offset': 50, 'lengthen_pct': 20, 'shorten_pct': 20}, [120, 120]), ({'cycle': 150, 'current_offset': 86, 'target_offset': 11, 'lengthen_pct': 20, 'shorten_pct': 20}, [180, 180, 165]), ({'cycle': 110, 'current_offset': 1, 'target_offset': 55, 'lengthen_pct': 25, 'shorten_pct': 13}, [137, 137]), ({'cycle': 90, 'current_offset': 46, 'target_offset': 8, 'lengthen_pct': 20, 'shorten_pct': 13}, [108, 108, 106]), ({'cycle': 90, 'current_offset': 88, 'target_offset': 43, 'lengthen_pct': 17, 'shorten_pct': 10}, [105, 105, 105])]]\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-error-direction","generated_at":"2026-09-29T14:47:58.544102+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":"The error sign is reversed, so lengthening moves the controller further from the target offset.","sha256":"d5fbcfa216cfbd529a93ecfc9372a131457f180c10336b83b5354d03f1a510f6","title":"Shortway offset transition: the offset error is computed current minus target · 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":41.371,"exit_code":1,"observations":[{"actual":[120,120],"check":"timing oracle 0","expected":[120,120],"passed":true},{"actual":[88,88,88,86],"check":"timing oracle 1","expected":[88,88,88,86],"passed":true},{"actual":[],"check":"timing oracle 2","expected":[],"passed":true},{"actual":[],"check":"timing oracle 3","expected":[],"passed":true},{"actual":[140,140,140,130],"check":"timing oracle 4","expected":[140,140,130],"passed":false},{"actual":[124],"check":"timing oracle 5","expected":[116],"passed":false},{"actual":[],"check":"timing oracle 6","expected":[],"passed":true},{"actual":[],"check":"timing oracle 7","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [120, 120], \"expected\": [120, 120], \"passed\": true}, {\"check\": \"timing oracle 1\", \"actual\": [88, 88, 88, 86], \"expected\": [88, 88, 88, 86], \"passed\": true}, {\"check\": \"timing oracle 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [140, 140, 140, 130], \"expected\": [140, 140, 130], \"passed\": false}, {\"check\": \"timing oracle 5\", \"actual\": [124], \"expected\": [116], \"passed\": false}, {\"check\": \"timing oracle 6\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.471,"exit_code":1,"observations":[{"actual":[80,80],"check":"timing oracle 0","expected":[120,120],"passed":false},{"actual":[64,66],"check":"timing oracle 1","expected":[88,88,88,86],"passed":false},{"actual":[],"check":"timing oracle 2","expected":[],"passed":true},{"actual":[],"check":"timing oracle 3","expected":[],"passed":true},{"actual":[140,140,140,130],"check":"timing oracle 4","expected":[140,140,130],"passed":false},{"actual":[124],"check":"timing oracle 5","expected":[116],"passed":false},{"actual":[],"check":"timing oracle 6","expected":[],"passed":true},{"actual":[],"check":"timing oracle 7","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"timing oracle 0\", \"actual\": [80, 80], \"expected\": [120, 120], \"passed\": false}, {\"check\": \"timing oracle 1\", \"actual\": [64, 66], \"expected\": [88, 88, 88, 86], \"passed\": false}, {\"check\": \"timing oracle 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 3\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 4\", \"actual\": [140, 140, 140, 130], \"expected\": [140, 140, 130], \"passed\": false}, {\"check\": \"timing oracle 5\", \"actual\": [124], \"expected\": [116], \"passed\": false}, {\"check\": \"timing oracle 6\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"timing oracle 7\", \"actual\": [], \"expected\": [], \"passed\": true}], \"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."}}