{"abstract":"Conversions in westerly variation go the wrong way.","category":"Tide and marine navigation tables","checks":7,"contract":"Input [value, frm, to, var, dev] with frm/to in C (compass), M (magnetic), T (true); var and dev like \"3.5W\"/\"2E\" (east positive). M=C+dev, T=M+var; converting downward subtracts. Return [value mod 360 rounded 1, total compass error dev+var as \"x.xE\"/\"x.xW\" or \"0\"].","contract_signature":"x","evaluation_group":"w2-tide_and_marine_navigation_tables-compass_conversion","failed_approach":"Taking the sign from a leading minus sign ignores the E/W suffix.","family":"w2-tide_and_marine_navigation_tables-compass_conversion-west-sign","id":"FA-69271","implementations":{"attempt":{"sha256":"316dedb62c33aa0f58dc36b1d6423602b28a4686ae07496f347c9c97547eb2dc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    val,frm,to,var,dev=x\n    def sg(s):\n        v=float(s[:-1])\n        return v if s[0]!='-' else -v\n    lvl={'C':0,'M':1,'T':2}\n    corr=[sg(dev),sg(var)]\n    a,b=lvl[frm],lvl[to]\n    if b>a: val+=sum(corr[a:b])\n    else: val-=sum(corr[b:a])\n    e=sum(corr)\n    err='0' if e==0 else '%.1f%s'%(abs(e),'E' if e>0 else 'W')\n    return [round(val%360,1),err]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]', [100, 'C', 'T', '4W', '2E'], [98.0, '2.0W']), ('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E']), ('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]', [5, 'M', 'T', '7W', '1W'], [358.0, '8.0W']), ('compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]', [200, 'M', 'C', '0.5E', '1.5W'], [201.5, '1.0W']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W'])], [('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]', [5, 'M', 'T', '7W', '1W'], [358.0, '8.0W']), ('compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]', [200, 'M', 'C', '0.5E', '1.5W'], [201.5, '1.0W']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W']), ('compass variation and deviation [90, \"T\", \"T\", \"3E\", \"3W\"]', [90, 'T', 'T', '3E', '3W'], [90, '0']), ('compass variation and deviation [270.5, \"C\", \"T\", \"12.5E\", \"3.5E\"]', [270.5, 'C', 'T', '12.5E', '3.5E'], [286.5, '16.0E'])], [('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W']), ('compass variation and deviation [90, \"T\", \"T\", \"3E\", \"3W\"]', [90, 'T', 'T', '3E', '3W'], [90, '0']), ('compass variation and deviation [270.5, \"C\", \"T\", \"12.5E\", \"3.5E\"]', [270.5, 'C', 'T', '12.5E', '3.5E'], [286.5, '16.0E']), ('compass variation and deviation [1, \"T\", \"C\", \"2E\", \"3E\"]', [1, 'T', 'C', '2E', '3E'], [356.0, '5.0E']), ('compass variation and deviation [45, \"C\", \"T\", \"3E\", \"3W\"]', [45, 'C', 'T', '3E', '3W'], [45.0, '0']), ('compass variation and deviation [180, \"M\", \"T\", \"0E\", \"2W\"]', [180, 'M', 'T', '0E', '2W'], [180.0, '2.0W'])], [('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [1, \"T\", \"C\", \"2E\", \"3E\"]', [1, 'T', 'C', '2E', '3E'], [356.0, '5.0E']), ('compass variation and deviation [45, \"C\", \"T\", \"3E\", \"3W\"]', [45, 'C', 'T', '3E', '3W'], [45.0, '0']), ('compass variation and deviation [180, \"M\", \"T\", \"0E\", \"2W\"]', [180, 'M', 'T', '0E', '2W'], [180.0, '2.0W']), ('compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]', [100, 'C', 'T', '4W', '2E'], [98.0, '2.0W']), ('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E'])], [('compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]', [5, 'M', 'T', '7W', '1W'], [358.0, '8.0W']), ('compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]', [100, 'C', 'T', '4W', '2E'], [98.0, '2.0W']), ('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E']), ('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]', [200, 'M', 'C', '0.5E', '1.5W'], [201.5, '1.0W']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W'])]]\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":"b68e866fba7980dd79ff30aaf0582427ae9125c318466892d5d9ee9cc4a3c990","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(x):\n    val,frm,to,var,dev=x\n    def sg(s):\n        v=float(s[:-1])\n        return v if s[-1]=='W' else -v\n    lvl={'C':0,'M':1,'T':2}\n    corr=[sg(dev),sg(var)]\n    a,b=lvl[frm],lvl[to]\n    if b>a: val+=sum(corr[a:b])\n    else: val-=sum(corr[b:a])\n    e=sum(corr)\n    err='0' if e==0 else '%.1f%s'%(abs(e),'E' if e>0 else 'W')\n    return [round(val%360,1),err]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]', [100, 'C', 'T', '4W', '2E'], [98.0, '2.0W']), ('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E']), ('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]', [5, 'M', 'T', '7W', '1W'], [358.0, '8.0W']), ('compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]', [200, 'M', 'C', '0.5E', '1.5W'], [201.5, '1.0W']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W'])], [('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]', [5, 'M', 'T', '7W', '1W'], [358.0, '8.0W']), ('compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]', [200, 'M', 'C', '0.5E', '1.5W'], [201.5, '1.0W']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W']), ('compass variation and deviation [90, \"T\", \"T\", \"3E\", \"3W\"]', [90, 'T', 'T', '3E', '3W'], [90, '0']), ('compass variation and deviation [270.5, \"C\", \"T\", \"12.5E\", \"3.5E\"]', [270.5, 'C', 'T', '12.5E', '3.5E'], [286.5, '16.0E'])], [('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W']), ('compass variation and deviation [90, \"T\", \"T\", \"3E\", \"3W\"]', [90, 'T', 'T', '3E', '3W'], [90, '0']), ('compass variation and deviation [270.5, \"C\", \"T\", \"12.5E\", \"3.5E\"]', [270.5, 'C', 'T', '12.5E', '3.5E'], [286.5, '16.0E']), ('compass variation and deviation [1, \"T\", \"C\", \"2E\", \"3E\"]', [1, 'T', 'C', '2E', '3E'], [356.0, '5.0E']), ('compass variation and deviation [45, \"C\", \"T\", \"3E\", \"3W\"]', [45, 'C', 'T', '3E', '3W'], [45.0, '0']), ('compass variation and deviation [180, \"M\", \"T\", \"0E\", \"2W\"]', [180, 'M', 'T', '0E', '2W'], [180.0, '2.0W'])], [('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [1, \"T\", \"C\", \"2E\", \"3E\"]', [1, 'T', 'C', '2E', '3E'], [356.0, '5.0E']), ('compass variation and deviation [45, \"C\", \"T\", \"3E\", \"3W\"]', [45, 'C', 'T', '3E', '3W'], [45.0, '0']), ('compass variation and deviation [180, \"M\", \"T\", \"0E\", \"2W\"]', [180, 'M', 'T', '0E', '2W'], [180.0, '2.0W']), ('compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]', [100, 'C', 'T', '4W', '2E'], [98.0, '2.0W']), ('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E'])], [('compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]', [5, 'M', 'T', '7W', '1W'], [358.0, '8.0W']), ('compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]', [100, 'C', 'T', '4W', '2E'], [98.0, '2.0W']), ('compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]', [100, 'T', 'C', '4W', '2E'], [102.0, '2.0W']), ('compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]', [355, 'C', 'M', '3W', '6E'], [1.0, '3.0E']), ('compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]', [5, 'T', 'M', '7W', '1W'], [12.0, '8.0W']), ('compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]', [200, 'M', 'C', '0.5E', '1.5W'], [201.5, '1.0W']), ('compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]', [200, 'C', 'M', '0.5E', '1.5W'], [198.5, '1.0W'])]]\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":"A deterministic toy model with stipulated rules and constants; not certified hydrographic software or a substitute for official tide tables. 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-tide_and_marine_navigation_tables-compass_conversion-west-sign","generated_at":"2026-09-29T14:48:10.037061+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Tide tables and passage plans turn published predictions into go/no-go decisions about depth, clearance and timing.","root_cause":"The sign helper makes W positive.","sha256":"a2a4ca298799fb89c29e1db2ea43793c27d2b2e33c8858c085e94c4ecb847a04","title":"Compass variation and deviation: Westerly corrections are treated as easterly · 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.62,"exit_code":1,"observations":[{"actual":[106.0,"6.0E"],"check":"compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]","expected":[98.0,"2.0W"],"passed":false},{"actual":[94.0,"6.0E"],"check":"compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]","expected":[102.0,"2.0W"],"passed":false},{"actual":[1.0,"9.0E"],"check":"compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]","expected":[1.0,"3.0E"],"passed":false},{"actual":[358.0,"8.0E"],"check":"compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]","expected":[12.0,"8.0W"],"passed":false},{"actual":[12.0,"8.0E"],"check":"compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]","expected":[358.0,"8.0W"],"passed":false},{"actual":[198.5,"2.0E"],"check":"compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]","expected":[201.5,"1.0W"],"passed":false},{"actual":[201.5,"2.0E"],"check":"compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]","expected":[198.5,"1.0W"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"compass variation and deviation [100, \\\"C\\\", \\\"T\\\", \\\"4W\\\", \\\"2E\\\"]\", \"actual\": [106.0, \"6.0E\"], \"expected\": [98.0, \"2.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [100, \\\"T\\\", \\\"C\\\", \\\"4W\\\", \\\"2E\\\"]\", \"actual\": [94.0, \"6.0E\"], \"expected\": [102.0, \"2.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [355, \\\"C\\\", \\\"M\\\", \\\"3W\\\", \\\"6E\\\"]\", \"actual\": [1.0, \"9.0E\"], \"expected\": [1.0, \"3.0E\"], \"passed\": false}, {\"check\": \"compass variation and deviation [5, \\\"T\\\", \\\"M\\\", \\\"7W\\\", \\\"1W\\\"]\", \"actual\": [358.0, \"8.0E\"], \"expected\": [12.0, \"8.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [5, \\\"M\\\", \\\"T\\\", \\\"7W\\\", \\\"1W\\\"]\", \"actual\": [12.0, \"8.0E\"], \"expected\": [358.0, \"8.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [200, \\\"M\\\", \\\"C\\\", \\\"0.5E\\\", \\\"1.5W\\\"]\", \"actual\": [198.5, \"2.0E\"], \"expected\": [201.5, \"1.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [200, \\\"C\\\", \\\"M\\\", \\\"0.5E\\\", \\\"1.5W\\\"]\", \"actual\": [201.5, \"2.0E\"], \"expected\": [198.5, \"1.0W\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":37.042,"exit_code":1,"observations":[{"actual":[102.0,"2.0E"],"check":"compass variation and deviation [100, \"C\", \"T\", \"4W\", \"2E\"]","expected":[98.0,"2.0W"],"passed":false},{"actual":[98.0,"2.0E"],"check":"compass variation and deviation [100, \"T\", \"C\", \"4W\", \"2E\"]","expected":[102.0,"2.0W"],"passed":false},{"actual":[349.0,"3.0W"],"check":"compass variation and deviation [355, \"C\", \"M\", \"3W\", \"6E\"]","expected":[1.0,"3.0E"],"passed":false},{"actual":[358.0,"8.0E"],"check":"compass variation and deviation [5, \"T\", \"M\", \"7W\", \"1W\"]","expected":[12.0,"8.0W"],"passed":false},{"actual":[12.0,"8.0E"],"check":"compass variation and deviation [5, \"M\", \"T\", \"7W\", \"1W\"]","expected":[358.0,"8.0W"],"passed":false},{"actual":[198.5,"1.0E"],"check":"compass variation and deviation [200, \"M\", \"C\", \"0.5E\", \"1.5W\"]","expected":[201.5,"1.0W"],"passed":false},{"actual":[201.5,"1.0E"],"check":"compass variation and deviation [200, \"C\", \"M\", \"0.5E\", \"1.5W\"]","expected":[198.5,"1.0W"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"compass variation and deviation [100, \\\"C\\\", \\\"T\\\", \\\"4W\\\", \\\"2E\\\"]\", \"actual\": [102.0, \"2.0E\"], \"expected\": [98.0, \"2.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [100, \\\"T\\\", \\\"C\\\", \\\"4W\\\", \\\"2E\\\"]\", \"actual\": [98.0, \"2.0E\"], \"expected\": [102.0, \"2.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [355, \\\"C\\\", \\\"M\\\", \\\"3W\\\", \\\"6E\\\"]\", \"actual\": [349.0, \"3.0W\"], \"expected\": [1.0, \"3.0E\"], \"passed\": false}, {\"check\": \"compass variation and deviation [5, \\\"T\\\", \\\"M\\\", \\\"7W\\\", \\\"1W\\\"]\", \"actual\": [358.0, \"8.0E\"], \"expected\": [12.0, \"8.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [5, \\\"M\\\", \\\"T\\\", \\\"7W\\\", \\\"1W\\\"]\", \"actual\": [12.0, \"8.0E\"], \"expected\": [358.0, \"8.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [200, \\\"M\\\", \\\"C\\\", \\\"0.5E\\\", \\\"1.5W\\\"]\", \"actual\": [198.5, \"1.0E\"], \"expected\": [201.5, \"1.0W\"], \"passed\": false}, {\"check\": \"compass variation and deviation [200, \\\"C\\\", \\\"M\\\", \\\"0.5E\\\", \\\"1.5W\\\"]\", \"actual\": [201.5, \"1.0E\"], \"expected\": [198.5, \"1.0W\"], \"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."}}