{"abstract":"Feet land a coxa length short of the commanded position.","category":"Inverse kinematics solvers","checks":7,"contract":"Input [coxa,femur,tibia,x,y,z,fmin,fmax]: foot target in the leg root frame (z up). Coxa yaw is atan2(y,x); the femur/tibia pair works in the vertical plane at horizontal distance hypot(x,y)-coxa. With D the distance from the femur pivot to the foot, D>femur+tibia or D<|femur-tibia| or D==0 is \"unreachable\". Femur pitch is atan2(z,h) plus the triangle angle at the femur pivot (knee up); tibia angle is the interior knee angle minus 180 (0 = straight). Femur pitch outside [fmin,fmax] returns \"limit\". Degrees rounded to 4.","contract_signature":"x","evaluation_group":"w2-inverse_kinematics_solvers-hexapod-leg","failed_approach":"Subtracting the coxa from x alone only works for feet straight ahead.","family":"w2-inverse_kinematics_solvers-hexapod-leg-coxa-length-offset","id":"FA-88146","implementations":{"attempt":{"sha256":"e83734c64841ac1869b5bf02a6485e63bfa313cc8ed17fed889bb174a187cdc3","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    cx,fe,ti,px,py,pz,fmin,fmax=x\n    ca=math.atan2(py,px)\n    h=px-cx\n    D=math.hypot(h,pz)\n    if D>fe+ti or D<abs(fe-ti) or D==0: return 'unreachable'\n    a1=math.atan2(pz,h)\n    a2=math.acos(max(-1.0,min(1.0,(fe*fe+D*D-ti*ti)/(2*fe*D))))\n    fa=math.degrees(a1+a2)\n    ta=math.degrees(math.acos(max(-1.0,min(1.0,(fe*fe+ti*ti-D*D)/(2*fe*ti)))))-180.0\n    if fa<fmin or fa>fmax: return 'limit'\n    return [round(math.degrees(ca),4),round(fa,4),round(ta,4)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['nominal stance', [[3, 6, 8, 10, 2, -6, -90, 90]], [11.3099, 18.0529, -97.294]], ['foot straight out', [[3, 6, 8, 12, 0, -3, -90, 90]], [0.0, 38.5667, -95.9792]], ['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['foot out of reach', [[3, 6, 8, 18, 0, -2, -90, 90]], 'unreachable'], ['foot inside coxa reach', [[3, 6, 8, 16, 0, 0, -90, 90]], [0.0, 25.3317, -44.0486]], ['high foot', [[3, 6, 8, 9, 3, 4, -90, 90]], 'limit']], [['foot straight out', [[3, 6, 8, 12, 0, -3, -90, 90]], [0.0, 38.5667, -95.9792]], ['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot inside coxa reach', [[3, 6, 8, 16, 0, 0, -90, 90]], [0.0, 25.3317, -44.0486]], ['high foot', [[3, 6, 8, 9, 3, 4, -90, 90]], 'limit'], ['femur limit exceeded', [[3, 6, 8, 5, 0, 6, -90, 30]], 'limit'], ['deep foot', [[3, 6, 8, 5, 5, -9, -90, 90]], [45.0, -11.6013, -91.4483]], ['tight femur limits', [[3, 6, 8, 10, 2, -6, -10, 10]], 'limit']], [['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['deep foot', [[3, 6, 8, 5, 5, -9, -90, 90]], [45.0, -11.6013, -91.4483]], ['tight femur limits', [[3, 6, 8, 10, 2, -6, -10, 10]], 'limit'], ['long tibia near', [[2, 4, 9, 6, 1, -8, -90, 90]], [9.4623, 14.4416, -103.1099]], ['diagonal foot', [[2.5, 5, 6, -6, 6, -3, -90, 90]], [135.0, 33.0338, -105.6409]], ['hole too close', [[3, 6, 12, 4, 0, -1, -90, 90]], 'unreachable']], [['nominal stance', [[3, 6, 8, 10, 2, -6, -90, 90]], [11.3099, 18.0529, -97.294]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['deep foot', [[3, 6, 8, 5, 5, -9, -90, 90]], [45.0, -11.6013, -91.4483]], ['diagonal foot', [[2.5, 5, 6, -6, 6, -3, -90, 90]], [135.0, 33.0338, -105.6409]], ['hole too close', [[3, 6, 12, 4, 0, -1, -90, 90]], 'unreachable'], ['foot far below', [[3, 6, 8, 15, 0, -10, -90, 90]], 'unreachable'], ['femur at lower bound', [[3, 6, 8, 11, 0, -8, -60, 90]], [0.0, -2.44, -73.0422]]], [['nominal stance', [[3, 6, 8, 10, 2, -6, -90, 90]], [11.3099, 18.0529, -97.294]], ['foot straight out', [[3, 6, 8, 12, 0, -3, -90, 90]], [0.0, 38.5667, -95.9792]], ['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['foot inside coxa reach', [[3, 6, 8, 16, 0, 0, -90, 90]], [0.0, 25.3317, -44.0486]], ['long tibia near', [[2, 4, 9, 6, 1, -8, -90, 90]], [9.4623, 14.4416, -103.1099]], ['femur at lower bound', [[3, 6, 8, 11, 0, -8, -60, 90]], [0.0, -2.44, -73.0422]]]]\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":"13232cd02d3f3b180ba0f2fcbdc85f5ec256390f7e2451cbd8b1b4cdbbbb2c7f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    cx,fe,ti,px,py,pz,fmin,fmax=x\n    ca=math.atan2(py,px)\n    h=math.hypot(px,py)\n    D=math.hypot(h,pz)\n    if D>fe+ti or D<abs(fe-ti) or D==0: return 'unreachable'\n    a1=math.atan2(pz,h)\n    a2=math.acos(max(-1.0,min(1.0,(fe*fe+D*D-ti*ti)/(2*fe*D))))\n    fa=math.degrees(a1+a2)\n    ta=math.degrees(math.acos(max(-1.0,min(1.0,(fe*fe+ti*ti-D*D)/(2*fe*ti)))))-180.0\n    if fa<fmin or fa>fmax: return 'limit'\n    return [round(math.degrees(ca),4),round(fa,4),round(ta,4)]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['nominal stance', [[3, 6, 8, 10, 2, -6, -90, 90]], [11.3099, 18.0529, -97.294]], ['foot straight out', [[3, 6, 8, 12, 0, -3, -90, 90]], [0.0, 38.5667, -95.9792]], ['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['foot out of reach', [[3, 6, 8, 18, 0, -2, -90, 90]], 'unreachable'], ['foot inside coxa reach', [[3, 6, 8, 16, 0, 0, -90, 90]], [0.0, 25.3317, -44.0486]], ['high foot', [[3, 6, 8, 9, 3, 4, -90, 90]], 'limit']], [['foot straight out', [[3, 6, 8, 12, 0, -3, -90, 90]], [0.0, 38.5667, -95.9792]], ['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot inside coxa reach', [[3, 6, 8, 16, 0, 0, -90, 90]], [0.0, 25.3317, -44.0486]], ['high foot', [[3, 6, 8, 9, 3, 4, -90, 90]], 'limit'], ['femur limit exceeded', [[3, 6, 8, 5, 0, 6, -90, 30]], 'limit'], ['deep foot', [[3, 6, 8, 5, 5, -9, -90, 90]], [45.0, -11.6013, -91.4483]], ['tight femur limits', [[3, 6, 8, 10, 2, -6, -10, 10]], 'limit']], [['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['deep foot', [[3, 6, 8, 5, 5, -9, -90, 90]], [45.0, -11.6013, -91.4483]], ['tight femur limits', [[3, 6, 8, 10, 2, -6, -10, 10]], 'limit'], ['long tibia near', [[2, 4, 9, 6, 1, -8, -90, 90]], [9.4623, 14.4416, -103.1099]], ['diagonal foot', [[2.5, 5, 6, -6, 6, -3, -90, 90]], [135.0, 33.0338, -105.6409]], ['hole too close', [[3, 6, 12, 4, 0, -1, -90, 90]], 'unreachable']], [['nominal stance', [[3, 6, 8, 10, 2, -6, -90, 90]], [11.3099, 18.0529, -97.294]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['deep foot', [[3, 6, 8, 5, 5, -9, -90, 90]], [45.0, -11.6013, -91.4483]], ['diagonal foot', [[2.5, 5, 6, -6, 6, -3, -90, 90]], [135.0, 33.0338, -105.6409]], ['hole too close', [[3, 6, 12, 4, 0, -1, -90, 90]], 'unreachable'], ['foot far below', [[3, 6, 8, 15, 0, -10, -90, 90]], 'unreachable'], ['femur at lower bound', [[3, 6, 8, 11, 0, -8, -60, 90]], [0.0, -2.44, -73.0422]]], [['nominal stance', [[3, 6, 8, 10, 2, -6, -90, 90]], [11.3099, 18.0529, -97.294]], ['foot straight out', [[3, 6, 8, 12, 0, -3, -90, 90]], [0.0, 38.5667, -95.9792]], ['foot to the side', [[2, 5, 7, 1, 9, -4, -90, 90]], [83.6598, 29.4436, -96.745]], ['foot behind', [[2, 5, 7, -8, -3, -5, -90, 90]], [-159.444, 20.4684, -95.0617]], ['foot inside coxa reach', [[3, 6, 8, 16, 0, 0, -90, 90]], [0.0, 25.3317, -44.0486]], ['long tibia near', [[2, 4, 9, 6, 1, -8, -90, 90]], [9.4623, 14.4416, -103.1099]], ['femur at lower bound', [[3, 6, 8, 11, 0, -8, -60, 90]], [0.0, -2.44, -73.0422]]]]\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 planar or low-dimensional teaching model with a stipulated convention; not a general robotics library. 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-inverse_kinematics_solvers-hexapod-leg-coxa-length-offset","generated_at":"2026-09-29T14:51:05.549989+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Inverse kinematics code turns task-space goals into joint commands; a wrong branch, sign, limit or update order sends a real arm to the wrong pose.","root_cause":"The horizontal distance to the femur pivot is taken as hypot(x,y) without subtracting the coxa length.","sha256":"4f7a8d1f1e8caa96dc096600e2ea0642cfe917e448db01d6a41ab39936ec7c68","title":"Hexapod plane distance ignores the coxa link · 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":42.597,"exit_code":1,"observations":[{"actual":[11.3099,18.3872,-98.9893],"check":"nominal stance","expected":[11.3099,18.0529,-97.294],"passed":false},{"actual":[0.0,38.5667,-95.9792],"check":"foot straight out","expected":[0.0,38.5667,-95.9792],"passed":true},{"actual":[83.6598,-4.2615,-144.5168],"check":"foot to the side","expected":[83.6598,29.4436,-96.745],"passed":false},{"actual":"limit","check":"foot behind","expected":[-159.444,20.4684,-95.0617],"passed":false},{"actual":"unreachable","check":"foot out of reach","expected":"unreachable","passed":true},{"actual":[0.0,25.3317,-44.0486],"check":"foot inside coxa reach","expected":[0.0,25.3317,-44.0486],"passed":true},{"actual":"limit","check":"high foot","expected":"limit","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nominal stance\", \"actual\": [11.3099, 18.3872, -98.9893], \"expected\": [11.3099, 18.0529, -97.294], \"passed\": false}, {\"check\": \"foot straight out\", \"actual\": [0.0, 38.5667, -95.9792], \"expected\": [0.0, 38.5667, -95.9792], \"passed\": true}, {\"check\": \"foot to the side\", \"actual\": [83.6598, -4.2615, -144.5168], \"expected\": [83.6598, 29.4436, -96.745], \"passed\": false}, {\"check\": \"foot behind\", \"actual\": \"limit\", \"expected\": [-159.444, 20.4684, -95.0617], \"passed\": false}, {\"check\": \"foot out of reach\", \"actual\": \"unreachable\", \"expected\": \"unreachable\", \"passed\": true}, {\"check\": \"foot inside coxa reach\", \"actual\": [0.0, 25.3317, -44.0486], \"expected\": [0.0, 25.3317, -44.0486], \"passed\": true}, {\"check\": \"high foot\", \"actual\": \"limit\", \"expected\": \"limit\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.32,"exit_code":1,"observations":[{"actual":[11.3099,7.4551,-65.3757],"check":"nominal stance","expected":[11.3099,18.0529,-97.294],"passed":false},{"actual":[0.0,18.5972,-56.4899],"check":"foot straight out","expected":[0.0,38.5667,-95.9792],"passed":false},{"actual":[83.6598,17.7923,-69.949],"check":"foot to the side","expected":[83.6598,29.4436,-96.745],"passed":false},{"actual":[-159.444,11.2882,-69.949],"check":"foot behind","expected":[-159.444,20.4684,-95.0617],"passed":false},{"actual":"unreachable","check":"foot out of reach","expected":"unreachable","passed":true},{"actual":"unreachable","check":"foot inside coxa reach","expected":[0.0,25.3317,-44.0486],"passed":false},{"actual":[18.4349,73.7133,-86.4167],"check":"high foot","expected":"limit","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nominal stance\", \"actual\": [11.3099, 7.4551, -65.3757], \"expected\": [11.3099, 18.0529, -97.294], \"passed\": false}, {\"check\": \"foot straight out\", \"actual\": [0.0, 18.5972, -56.4899], \"expected\": [0.0, 38.5667, -95.9792], \"passed\": false}, {\"check\": \"foot to the side\", \"actual\": [83.6598, 17.7923, -69.949], \"expected\": [83.6598, 29.4436, -96.745], \"passed\": false}, {\"check\": \"foot behind\", \"actual\": [-159.444, 11.2882, -69.949], \"expected\": [-159.444, 20.4684, -95.0617], \"passed\": false}, {\"check\": \"foot out of reach\", \"actual\": \"unreachable\", \"expected\": \"unreachable\", \"passed\": true}, {\"check\": \"foot inside coxa reach\", \"actual\": \"unreachable\", \"expected\": [0.0, 25.3317, -44.0486], \"passed\": false}, {\"check\": \"high foot\", \"actual\": [18.4349, 73.7133, -86.4167], \"expected\": \"limit\", \"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."}}