{"abstract":"In the round, a float crossing the beginning of round is reported as two short floats.","category":"Knitting and sewing pattern grading","checks":8,"contract":"row is a string of color letters. For each color, a float is a maximal run of other colors [start, length]. In the round, a float touching both the end and the start (with at least two runs) wraps and merges into the last run (its start is kept). Report [color, start, length] for floats longer than max_float, sorted by (start, color).","contract_signature":"row, max_float, in_round","evaluation_group":"w2-knitting_and_sewing_pattern_grading-colorwork-floats","failed_approach":"Merging without checking the last run reaches the end joins unrelated floats.","family":"w2-knitting_and_sewing_pattern_grading-colorwork-floats-round-wrap-merge","id":"FA-97661","implementations":{"attempt":{"sha256":"b2b0ccbb5b1d7d94ae4da880f25ff8f4d713b8c8c724d1134fe2081e960ac490","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(row, max_float, in_round):\n    n = len(row)\n    out = []\n    for color in sorted(set(row)):\n        runs = []\n        i = 0\n        while i < n:\n            if row[i] != color:\n                j = i\n                while j < n and row[j] != color:\n                    j += 1\n                runs.append([i, j - i])\n                i = j\n            else:\n                i += 1\n        if in_round and len(runs) >= 2 and runs[0][0] == 0:\n            first = runs.pop(0)\n            runs[-1][1] += first[1]\n        for start, length in runs:\n            if length > max_float:\n                out.append([color, start, length])\n    return sorted(out, key=lambda x: (x[1], x[0]))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []],\n  ['regression: round wrap merge', ['AAACAAAACAA', 4, True], [['C', 9, 5]]],\n  ['repair check: round wrap merge', ['BAAAAAABBBAAAAA', 3, True], [['B', 1, 6], ['B', 10, 5]]],\n  ['generated control 1', ['ABAAABBAAABAA', 4, True], []],\n  ['generated control 2', ['BAAAABBBAAA', 4, False], []],\n  ['generated control 3', ['BAAABBAA', 5, False], []]],\n [['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []], ['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['regression: round wrap merge', ['AAAAAAABBAAAA', 5, True], [['B', 9, 11]]],\n  ['repair check: round wrap merge', ['ABAAAAAAAB', 3, True], [['B', 2, 7]]],\n  ['generated control 1', ['BAAAAAABBAAA', 4, True], [['B', 1, 6]]],\n  ['generated control 2', ['BAAAAAABBBAAA', 5, True], [['B', 1, 6]]],\n  ['generated control 3', ['BAAAAABBAAA', 5, False], []]],\n [['exact limit', ['BAAAAB', 4, False], []], ['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['regression: round wrap merge', ['AAAAABAAABAAAAA', 3, True], [['B', 10, 10]]],\n  ['repair check: round wrap merge', ['BAAAABBBAAAAA', 3, True], [['B', 1, 4], ['B', 8, 5]]],\n  ['generated control 1', ['BAAAAAAABAAAAA', 3, False], [['B', 1, 7], ['B', 9, 5]]],\n  ['generated control 2', ['BAAAAABAA', 4, True], [['B', 1, 5]]],\n  ['generated control 3', ['BAAAABBAA', 5, True], []]],\n [['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []],\n  ['regression: round wrap merge', ['AAABABBAAAABAA', 4, True], [['B', 12, 5]]],\n  ['repair check: round wrap merge', ['BAAAABBBAAAA', 3, True], [['B', 1, 4], ['B', 8, 4]]],\n  ['generated control 1', ['ABAAAABABBAAB', 3, False], [['B', 2, 4]]],\n  ['generated control 2', ['AABABAAAAAAAAB', 4, False], [['B', 5, 8]]],\n  ['generated control 3', ['BAAAABBAAA', 3, True], [['B', 1, 4]]]],\n [['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []], ['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['regression: round wrap merge', ['AAABAAAAAA', 5, True], [['B', 4, 9]]],\n  ['repair check: round wrap merge', ['BAAAABBBAAAA', 3, True], [['B', 1, 4], ['B', 8, 4]]],\n  ['generated control 1', ['BAAABBAA', 4, False], []],\n  ['generated control 2', ['AAAABABAAAAABAA', 5, True], [['B', 13, 6]]],\n  ['generated control 3', ['AAAAAAAAAABA', 5, True], [['B', 11, 11]]]]]\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":"b788ef1103122653c61a8816ecd3d3850a142f9c21a7bd9a8a60893973f1e9be","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(row, max_float, in_round):\n    n = len(row)\n    out = []\n    for color in sorted(set(row)):\n        runs = []\n        i = 0\n        while i < n:\n            if row[i] != color:\n                j = i\n                while j < n and row[j] != color:\n                    j += 1\n                runs.append([i, j - i])\n                i = j\n            else:\n                i += 1\n        if not in_round and len(runs) >= 2 and runs[0][0] == 0 and runs[-1][0] + runs[-1][1] == n:\n            first = runs.pop(0)\n            runs[-1][1] += first[1]\n        for start, length in runs:\n            if length > max_float:\n                out.append([color, start, length])\n    return sorted(out, key=lambda x: (x[1], x[0]))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []],\n  ['regression: round wrap merge', ['AAACAAAACAA', 4, True], [['C', 9, 5]]],\n  ['repair check: round wrap merge', ['BAAAAAABBBAAAAA', 3, True], [['B', 1, 6], ['B', 10, 5]]],\n  ['generated control 1', ['ABAAABBAAABAA', 4, True], []],\n  ['generated control 2', ['BAAAABBBAAA', 4, False], []],\n  ['generated control 3', ['BAAABBAA', 5, False], []]],\n [['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []], ['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['regression: round wrap merge', ['AAAAAAABBAAAA', 5, True], [['B', 9, 11]]],\n  ['repair check: round wrap merge', ['ABAAAAAAAB', 3, True], [['B', 2, 7]]],\n  ['generated control 1', ['BAAAAAABBAAA', 4, True], [['B', 1, 6]]],\n  ['generated control 2', ['BAAAAAABBBAAA', 5, True], [['B', 1, 6]]],\n  ['generated control 3', ['BAAAAABBAAA', 5, False], []]],\n [['exact limit', ['BAAAAB', 4, False], []], ['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['regression: round wrap merge', ['AAAAABAAABAAAAA', 3, True], [['B', 10, 10]]],\n  ['repair check: round wrap merge', ['BAAAABBBAAAAA', 3, True], [['B', 1, 4], ['B', 8, 5]]],\n  ['generated control 1', ['BAAAAAAABAAAAA', 3, False], [['B', 1, 7], ['B', 9, 5]]],\n  ['generated control 2', ['BAAAAABAA', 4, True], [['B', 1, 5]]],\n  ['generated control 3', ['BAAAABBAA', 5, True], []]],\n [['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []],\n  ['regression: round wrap merge', ['AAABABBAAAABAA', 4, True], [['B', 12, 5]]],\n  ['repair check: round wrap merge', ['BAAAABBBAAAA', 3, True], [['B', 1, 4], ['B', 8, 4]]],\n  ['generated control 1', ['ABAAAABABBAAB', 3, False], [['B', 2, 4]]],\n  ['generated control 2', ['AABABAAAAAAAAB', 4, False], [['B', 5, 8]]],\n  ['generated control 3', ['BAAAABBAAA', 3, True], [['B', 1, 4]]]],\n [['wrap in round', ['BBAAAAABBB', 4, True], [['B', 2, 5], ['A', 7, 5]]],\n  ['exact limit', ['BAAAAB', 4, False], []], ['flat long float', ['BAAAAAABBA', 5, False], [['B', 1, 6]]],\n  ['regression: round wrap merge', ['AAABAAAAAA', 5, True], [['B', 4, 9]]],\n  ['repair check: round wrap merge', ['BAAAABBBAAAA', 3, True], [['B', 1, 4], ['B', 8, 4]]],\n  ['generated control 1', ['BAAABBAA', 4, False], []],\n  ['generated control 2', ['AAAABABAAAAABAA', 5, True], [['B', 13, 6]]],\n  ['generated control 3', ['AAAAAAAAAABA', 5, True], [['B', 11, 11]]]]]\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 contract stated in full here; it is a bounded teaching model, not an authoritative reference or standards implementation. 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-knitting_and_sewing_pattern_grading-colorwork-floats-round-wrap-merge","generated_at":"2026-09-29T14:52:34.372739+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Stranded knitting charts are checked for long floats that need catching.","root_cause":"Wrap-around merging is applied to flat rows instead of rounds.","sha256":"ab29b001996f70dd54cf5a3fa5fa9d5cd2f3da94f51bb2d8424f588a533f7950","title":"Stranded colorwork float checker: round wrap merge · 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":45.196,"exit_code":1,"observations":[{"actual":[["B",1,6]],"check":"flat long float","expected":[["B",1,6]],"passed":true},{"actual":[["B",2,5],["A",7,5]],"check":"wrap in round","expected":[["B",2,5],["A",7,5]],"passed":true},{"actual":[],"check":"exact limit","expected":[],"passed":true},{"actual":[["C",9,5]],"check":"regression: round wrap merge","expected":[["C",9,5]],"passed":true},{"actual":[["B",1,6],["A",7,4],["B",10,5]],"check":"repair check: round wrap merge","expected":[["B",1,6],["B",10,5]],"passed":false},{"actual":[],"check":"generated control 1","expected":[],"passed":true},{"actual":[],"check":"generated control 2","expected":[],"passed":true},{"actual":[],"check":"generated control 3","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"flat long float\", \"actual\": [[\"B\", 1, 6]], \"expected\": [[\"B\", 1, 6]], \"passed\": true}, {\"check\": \"wrap in round\", \"actual\": [[\"B\", 2, 5], [\"A\", 7, 5]], \"expected\": [[\"B\", 2, 5], [\"A\", 7, 5]], \"passed\": true}, {\"check\": \"exact limit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"regression: round wrap merge\", \"actual\": [[\"C\", 9, 5]], \"expected\": [[\"C\", 9, 5]], \"passed\": true}, {\"check\": \"repair check: round wrap merge\", \"actual\": [[\"B\", 1, 6], [\"A\", 7, 4], [\"B\", 10, 5]], \"expected\": [[\"B\", 1, 6], [\"B\", 10, 5]], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.749,"exit_code":1,"observations":[{"actual":[["B",1,6]],"check":"flat long float","expected":[["B",1,6]],"passed":true},{"actual":[["B",2,5]],"check":"wrap in round","expected":[["B",2,5],["A",7,5]],"passed":false},{"actual":[],"check":"exact limit","expected":[],"passed":true},{"actual":[],"check":"regression: round wrap merge","expected":[["C",9,5]],"passed":false},{"actual":[["B",1,6],["B",10,5]],"check":"repair check: round wrap merge","expected":[["B",1,6],["B",10,5]],"passed":true},{"actual":[],"check":"generated control 1","expected":[],"passed":true},{"actual":[],"check":"generated control 2","expected":[],"passed":true},{"actual":[],"check":"generated control 3","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"flat long float\", \"actual\": [[\"B\", 1, 6]], \"expected\": [[\"B\", 1, 6]], \"passed\": true}, {\"check\": \"wrap in round\", \"actual\": [[\"B\", 2, 5]], \"expected\": [[\"B\", 2, 5], [\"A\", 7, 5]], \"passed\": false}, {\"check\": \"exact limit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"regression: round wrap merge\", \"actual\": [], \"expected\": [[\"C\", 9, 5]], \"passed\": false}, {\"check\": \"repair check: round wrap merge\", \"actual\": [[\"B\", 1, 6], [\"B\", 10, 5]], \"expected\": [[\"B\", 1, 6], [\"B\", 10, 5]], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 3\", \"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."}}