{"abstract":"The drive always prefers the most counterclockwise wrap, however far away.","category":"Solar tracker geometry","checks":7,"contract":"The azimuth drive has a continuous mechanical range [min_az, max_az] (may exceed 360 span). target_az is 0..359. Candidates are target + 360k inside the range; pick the smallest |move| from cur_az, ties to the candidate nearest the range centre, then the smaller. If none is in range, go to the limit with the smaller angular distance (mod 360) to the target, ties to min_az, status 'limit'. Return [position, move, status].","evaluation_group":"w2-solar_tracker_geometry-azimuth-cable-wrap","failed_approach":"Taking the distance modulo 360 makes every wrap look equally near.","family":"w2-solar_tracker_geometry-azimuth-cable-wrap-shortest-move-metric","id":"FA-93436","implementations":{"attempt":{"sha256":"498640a7047ea36dff8e7e83cc52b976a32ee17793f723d263ce54666fae23c0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(cur_az, target_az, min_az, max_az):\n    cands = []\n    k0 = math.floor((min_az - target_az) / 360)\n    for k in range(k0, k0 + 4):\n        c = target_az + 360 * k\n        if min_az <= c <= max_az:\n            cands.append(c)\n    center = (min_az + max_az) / 2\n    if not cands:\n        def ang(a):\n            d = (a - target_az) % 360\n            return min(d, 360 - d)\n        lim = min_az if ang(min_az) <= ang(max_az) else max_az\n        return [lim, lim - cur_az, 'limit']\n    best = min(cands, key=lambda c: (abs(c - cur_az) % 360, abs(c - center), c))\n    return [best, best - cur_az, 'ok']\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [450, 90, -90, 450], [450, 0, 'ok']],\n  ['regression: shortest move metric (partial repair)', [225, 225, -270, 270], [225, 0, 'ok']],\n  ['control 1', [180, 0, -90, 450], [0, -180, 'ok']],\n  ['control 2', [180, 315, 0, 360], [315, 135, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [180, 90, -270, 270], [90, -90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [225, 180, -270, 270], [180, -45, 'ok']],\n  ['control 1', [45, 225, -90, 450], [225, 180, 'ok']],\n  ['control 2', [180, 180, -90, 450], [180, 0, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [360, 90, -90, 450], [450, 90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [360, 0, -90, 450], [360, 0, 'ok']],\n  ['control 1', [0, 45, -90, 450], [45, 45, 'ok']],\n  ['control 2', [360, 45, 0, 360], [45, -315, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [90, 180, -270, 270], [180, 90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [180, 180, -270, 270], [180, 0, 'ok']],\n  ['control 1', [315, 135, 45, 315], [135, -180, 'ok']],\n  ['control 2', [45, 135, 45, 315], [135, 90, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [135, 90, -270, 270], [90, -45, 'ok']],\n  ['regression: shortest move metric (partial repair)', [-270, 90, -270, 270], [-270, 0, 'ok']],\n  ['control 1', [45, 315, 0, 180], [0, -45, 'limit']],\n  ['control 2', [315, 180, 0, 360], [180, -135, 'ok']]]]\nfor label, args, expected in fixtures[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":"db5f41b6c84c44c0f51b856aa68a96c73717b148329a69964d178cdb066ec8a1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(cur_az, target_az, min_az, max_az):\n    cands = []\n    k0 = math.floor((min_az - target_az) / 360)\n    for k in range(k0, k0 + 4):\n        c = target_az + 360 * k\n        if min_az <= c <= max_az:\n            cands.append(c)\n    center = (min_az + max_az) / 2\n    if not cands:\n        def ang(a):\n            d = (a - target_az) % 360\n            return min(d, 360 - d)\n        lim = min_az if ang(min_az) <= ang(max_az) else max_az\n        return [lim, lim - cur_az, 'limit']\n    best = min(cands, key=lambda c: (c - cur_az, abs(c - center), c))\n    return [best, best - cur_az, 'ok']\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [450, 90, -90, 450], [450, 0, 'ok']],\n  ['regression: shortest move metric (partial repair)', [225, 225, -270, 270], [225, 0, 'ok']],\n  ['control 1', [180, 0, -90, 450], [0, -180, 'ok']],\n  ['control 2', [180, 315, 0, 360], [315, 135, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [180, 90, -270, 270], [90, -90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [225, 180, -270, 270], [180, -45, 'ok']],\n  ['control 1', [45, 225, -90, 450], [225, 180, 'ok']],\n  ['control 2', [180, 180, -90, 450], [180, 0, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [360, 90, -90, 450], [450, 90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [360, 0, -90, 450], [360, 0, 'ok']],\n  ['control 1', [0, 45, -90, 450], [45, 45, 'ok']],\n  ['control 2', [360, 45, 0, 360], [45, -315, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [90, 180, -270, 270], [180, 90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [180, 180, -270, 270], [180, 0, 'ok']],\n  ['control 1', [315, 135, 45, 315], [135, -180, 'ok']],\n  ['control 2', [45, 135, 45, 315], [135, 90, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [135, 90, -270, 270], [90, -45, 'ok']],\n  ['regression: shortest move metric (partial repair)', [-270, 90, -270, 270], [-270, 0, 'ok']],\n  ['control 1', [45, 315, 0, 180], [0, -45, 'limit']],\n  ['control 2', [315, 180, 0, 360], [180, -135, 'ok']]]]\nfor label, args, expected in fixtures[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":"7ababaa0c0eedbea61893211caf1ae9e0a36e1fada79c9f0d6f06d6d344772ca","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(cur_az, target_az, min_az, max_az):\n    cands = []\n    k0 = math.floor((min_az - target_az) / 360)\n    for k in range(k0, k0 + 4):\n        c = target_az + 360 * k\n        if min_az <= c <= max_az:\n            cands.append(c)\n    center = (min_az + max_az) / 2\n    if not cands:\n        def ang(a):\n            d = (a - target_az) % 360\n            return min(d, 360 - d)\n        lim = min_az if ang(min_az) <= ang(max_az) else max_az\n        return [lim, lim - cur_az, 'limit']\n    best = min(cands, key=lambda c: (abs(c - cur_az), abs(c - center), c))\n    return [best, best - cur_az, 'ok']\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [450, 90, -90, 450], [450, 0, 'ok']],\n  ['regression: shortest move metric (partial repair)', [225, 225, -270, 270], [225, 0, 'ok']],\n  ['control 1', [180, 0, -90, 450], [0, -180, 'ok']],\n  ['control 2', [180, 315, 0, 360], [315, 135, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [180, 90, -270, 270], [90, -90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [225, 180, -270, 270], [180, -45, 'ok']],\n  ['control 1', [45, 225, -90, 450], [225, 180, 'ok']],\n  ['control 2', [180, 180, -90, 450], [180, 0, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [360, 90, -90, 450], [450, 90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [360, 0, -90, 450], [360, 0, 'ok']],\n  ['control 1', [0, 45, -90, 450], [45, 45, 'ok']],\n  ['control 2', [360, 45, 0, 360], [45, -315, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [90, 180, -270, 270], [180, 90, 'ok']],\n  ['regression: shortest move metric (partial repair)', [180, 180, -270, 270], [180, 0, 'ok']],\n  ['control 1', [315, 135, 45, 315], [135, -180, 'ok']],\n  ['control 2', [45, 135, 45, 315], [135, 90, 'ok']]],\n [['boundary: target exactly at max stop', [0, 270, -270, 270], [-90, -90, 'ok']],\n  ['normal: short way through north', [350, 10, -270, 270], [10, -340, 'ok']],\n  ['boundary: target outside narrow range', [180, 0, 90, 270], [90, -90, 'limit']],\n  ['regression: shortest move metric', [135, 90, -270, 270], [90, -45, 'ok']],\n  ['regression: shortest move metric (partial repair)', [-270, 90, -270, 270], [-270, 0, 'ok']],\n  ['control 1', [45, 315, 0, 180], [0, -45, 'limit']],\n  ['control 2', [315, 180, 0, 360], [180, -135, 'ok']]]]\nfor label, args, expected in fixtures[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":"Deterministic stipulated toy contract for teaching; no claim of conformance with any standard, vendor protocol or production controller. 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-solar_tracker_geometry-azimuth-cable-wrap-shortest-move-metric","generated_at":"2026-09-29T14:51:55.071746+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Single-axis and dual-axis solar trackers turn a sun direction into actuator commands; a sign, frame or limit mistake points a whole plant away from the sun or into a mechanical stop.","repair":"Rank candidates by |c - cur_az|.","root_cause":"The move is ranked by signed distance instead of magnitude.","sha256":"11cc61afb1f1a50c3f3509b7ac2d65f16c9b354da487f00be87e694c38a316c3","title":"Dual-axis azimuth cable-wrap slew: shortest move metric · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.833,"exit_code":1,"observations":[{"actual":[-90,-90,"ok"],"check":"boundary: target exactly at max stop","expected":[-90,-90,"ok"],"passed":true},{"actual":[10,-340,"ok"],"check":"normal: short way through north","expected":[10,-340,"ok"],"passed":true},{"actual":[90,-90,"limit"],"check":"boundary: target outside narrow range","expected":[90,-90,"limit"],"passed":true},{"actual":[90,-360,"ok"],"check":"regression: shortest move metric","expected":[450,0,"ok"],"passed":false},{"actual":[-135,-360,"ok"],"check":"regression: shortest move metric (partial repair)","expected":[225,0,"ok"],"passed":false},{"actual":[0,-180,"ok"],"check":"control 1","expected":[0,-180,"ok"],"passed":true},{"actual":[315,135,"ok"],"check":"control 2","expected":[315,135,"ok"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: target exactly at max stop\", \"actual\": [-90, -90, \"ok\"], \"expected\": [-90, -90, \"ok\"], \"passed\": true}, {\"check\": \"normal: short way through north\", \"actual\": [10, -340, \"ok\"], \"expected\": [10, -340, \"ok\"], \"passed\": true}, {\"check\": \"boundary: target outside narrow range\", \"actual\": [90, -90, \"limit\"], \"expected\": [90, -90, \"limit\"], \"passed\": true}, {\"check\": \"regression: shortest move metric\", \"actual\": [90, -360, \"ok\"], \"expected\": [450, 0, \"ok\"], \"passed\": false}, {\"check\": \"regression: shortest move metric (partial repair)\", \"actual\": [-135, -360, \"ok\"], \"expected\": [225, 0, \"ok\"], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [0, -180, \"ok\"], \"expected\": [0, -180, \"ok\"], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [315, 135, \"ok\"], \"expected\": [315, 135, \"ok\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.349,"exit_code":1,"observations":[{"actual":[-90,-90,"ok"],"check":"boundary: target exactly at max stop","expected":[-90,-90,"ok"],"passed":true},{"actual":[10,-340,"ok"],"check":"normal: short way through north","expected":[10,-340,"ok"],"passed":true},{"actual":[90,-90,"limit"],"check":"boundary: target outside narrow range","expected":[90,-90,"limit"],"passed":true},{"actual":[90,-360,"ok"],"check":"regression: shortest move metric","expected":[450,0,"ok"],"passed":false},{"actual":[-135,-360,"ok"],"check":"regression: shortest move metric (partial repair)","expected":[225,0,"ok"],"passed":false},{"actual":[0,-180,"ok"],"check":"control 1","expected":[0,-180,"ok"],"passed":true},{"actual":[315,135,"ok"],"check":"control 2","expected":[315,135,"ok"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: target exactly at max stop\", \"actual\": [-90, -90, \"ok\"], \"expected\": [-90, -90, \"ok\"], \"passed\": true}, {\"check\": \"normal: short way through north\", \"actual\": [10, -340, \"ok\"], \"expected\": [10, -340, \"ok\"], \"passed\": true}, {\"check\": \"boundary: target outside narrow range\", \"actual\": [90, -90, \"limit\"], \"expected\": [90, -90, \"limit\"], \"passed\": true}, {\"check\": \"regression: shortest move metric\", \"actual\": [90, -360, \"ok\"], \"expected\": [450, 0, \"ok\"], \"passed\": false}, {\"check\": \"regression: shortest move metric (partial repair)\", \"actual\": [-135, -360, \"ok\"], \"expected\": [225, 0, \"ok\"], \"passed\": false}, {\"check\": \"control 1\", \"actual\": [0, -180, \"ok\"], \"expected\": [0, -180, \"ok\"], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [315, 135, \"ok\"], \"expected\": [315, 135, \"ok\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.753,"exit_code":0,"observations":[{"actual":[-90,-90,"ok"],"check":"boundary: target exactly at max stop","expected":[-90,-90,"ok"],"passed":true},{"actual":[10,-340,"ok"],"check":"normal: short way through north","expected":[10,-340,"ok"],"passed":true},{"actual":[90,-90,"limit"],"check":"boundary: target outside narrow range","expected":[90,-90,"limit"],"passed":true},{"actual":[450,0,"ok"],"check":"regression: shortest move metric","expected":[450,0,"ok"],"passed":true},{"actual":[225,0,"ok"],"check":"regression: shortest move metric (partial repair)","expected":[225,0,"ok"],"passed":true},{"actual":[0,-180,"ok"],"check":"control 1","expected":[0,-180,"ok"],"passed":true},{"actual":[315,135,"ok"],"check":"control 2","expected":[315,135,"ok"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary: target exactly at max stop\", \"actual\": [-90, -90, \"ok\"], \"expected\": [-90, -90, \"ok\"], \"passed\": true}, {\"check\": \"normal: short way through north\", \"actual\": [10, -340, \"ok\"], \"expected\": [10, -340, \"ok\"], \"passed\": true}, {\"check\": \"boundary: target outside narrow range\", \"actual\": [90, -90, \"limit\"], \"expected\": [90, -90, \"limit\"], \"passed\": true}, {\"check\": \"regression: shortest move metric\", \"actual\": [450, 0, \"ok\"], \"expected\": [450, 0, \"ok\"], \"passed\": true}, {\"check\": \"regression: shortest move metric (partial repair)\", \"actual\": [225, 0, \"ok\"], \"expected\": [225, 0, \"ok\"], \"passed\": true}, {\"check\": \"control 1\", \"actual\": [0, -180, \"ok\"], \"expected\": [0, -180, \"ok\"], \"passed\": true}, {\"check\": \"control 2\", \"actual\": [315, 135, \"ok\"], \"expected\": [315, 135, \"ok\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}