{"abstract":"Floats exactly at the allowed length are flagged.","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).","evaluation_group":"w2-knitting_and_sewing_pattern_grading-colorwork-floats","failed_approach":"Allowing one extra stitch misses real problems.","family":"w2-knitting_and_sewing_pattern_grading-colorwork-floats-float-limit","id":"FA-97656","implementations":{"attempt":{"sha256":"b800ff2bca26084ddaa6ae1df6975fbcf59086a5f96f17ec0acb224c202f776f","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 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 + 1:\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: float limit', ['AAAAABAABAAAB', 3, True], [['B', 0, 5]]],\n  ['repair check: float limit', ['BAAAAABAAAA', 3, True], [['B', 1, 5], ['B', 7, 4]]],\n  ['generated control 1', ['BAAAAABAAAAA', 5, True], []], ['generated control 2', ['ABBBAAA', 4, False], []],\n  ['generated control 3', ['BAAAAAAABBBAA', 5, False], [['B', 1, 7]]]],\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: float limit', ['BAAAAAABBBAAAAA', 3, True], [['B', 1, 6], ['B', 10, 5]]],\n  ['repair check: float limit', ['AAAAABBABAAAAAAB', 5, False], [['B', 9, 6]]],\n  ['generated control 1', ['AAAAAACCAACAABA', 4, False], [['B', 0, 13], ['C', 0, 6]]],\n  ['generated control 2', ['AAAAAAA', 4, True], []],\n  ['generated control 3', ['BBABAAAABAAA', 3, True], [['B', 4, 4]]]],\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: float limit', ['BAAAAAAABBBAA', 3, False], [['B', 1, 7]]],\n  ['repair check: float limit', ['BAAABAAAA', 3, False], [['B', 5, 4]]],\n  ['generated control 1', ['ABAAABABBA', 3, False], []],\n  ['generated control 2', ['CBCCCABAACCBBCA', 5, True], []],\n  ['generated control 3', ['BAAAABBAAA', 4, 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: float limit', ['BAAAAAAABBBAAAAA', 3, True], [['B', 1, 7], ['B', 11, 5]]],\n  ['repair check: float limit', ['BAAAABBBAAA', 3, False], [['B', 1, 4]]],\n  ['generated control 1', ['AAAAABAA', 3, True], [['B', 6, 7]]],\n  ['generated control 2', ['BAAAAABAAA', 3, False], [['B', 1, 5]]],\n  ['generated control 3', ['AAABAAAAABABAAB', 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: float limit', ['BAAABBAA', 3, True], []],\n  ['repair check: float limit', ['AABAAAABAAAAA', 3, True], [['B', 3, 4], ['B', 8, 7]]],\n  ['generated control 1', ['AAAAAAA', 5, True], []], ['generated control 2', ['AABABAB', 3, False], []],\n  ['generated control 3', ['BAAABAABBAAABAB', 5, True], []]]]\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":"80f878b54f34e699c880782d3690367606e7eb19ebdd2a79f1df4e700bd3abfb","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 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: float limit', ['AAAAABAABAAAB', 3, True], [['B', 0, 5]]],\n  ['repair check: float limit', ['BAAAAABAAAA', 3, True], [['B', 1, 5], ['B', 7, 4]]],\n  ['generated control 1', ['BAAAAABAAAAA', 5, True], []], ['generated control 2', ['ABBBAAA', 4, False], []],\n  ['generated control 3', ['BAAAAAAABBBAA', 5, False], [['B', 1, 7]]]],\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: float limit', ['BAAAAAABBBAAAAA', 3, True], [['B', 1, 6], ['B', 10, 5]]],\n  ['repair check: float limit', ['AAAAABBABAAAAAAB', 5, False], [['B', 9, 6]]],\n  ['generated control 1', ['AAAAAACCAACAABA', 4, False], [['B', 0, 13], ['C', 0, 6]]],\n  ['generated control 2', ['AAAAAAA', 4, True], []],\n  ['generated control 3', ['BBABAAAABAAA', 3, True], [['B', 4, 4]]]],\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: float limit', ['BAAAAAAABBBAA', 3, False], [['B', 1, 7]]],\n  ['repair check: float limit', ['BAAABAAAA', 3, False], [['B', 5, 4]]],\n  ['generated control 1', ['ABAAABABBA', 3, False], []],\n  ['generated control 2', ['CBCCCABAACCBBCA', 5, True], []],\n  ['generated control 3', ['BAAAABBAAA', 4, 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: float limit', ['BAAAAAAABBBAAAAA', 3, True], [['B', 1, 7], ['B', 11, 5]]],\n  ['repair check: float limit', ['BAAAABBBAAA', 3, False], [['B', 1, 4]]],\n  ['generated control 1', ['AAAAABAA', 3, True], [['B', 6, 7]]],\n  ['generated control 2', ['BAAAAABAAA', 3, False], [['B', 1, 5]]],\n  ['generated control 3', ['AAABAAAAABABAAB', 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: float limit', ['BAAABBAA', 3, True], []],\n  ['repair check: float limit', ['AABAAAABAAAAA', 3, True], [['B', 3, 4], ['B', 8, 7]]],\n  ['generated control 1', ['AAAAAAA', 5, True], []], ['generated control 2', ['AABABAB', 3, False], []],\n  ['generated control 3', ['BAAABAABBAAABAB', 5, True], []]]]\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":"b4f205be45ae65e9be1e609848b9f88d5f812c2680e8164b9c1d9db12a24c381","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 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: float limit', ['AAAAABAABAAAB', 3, True], [['B', 0, 5]]],\n  ['repair check: float limit', ['BAAAAABAAAA', 3, True], [['B', 1, 5], ['B', 7, 4]]],\n  ['generated control 1', ['BAAAAABAAAAA', 5, True], []], ['generated control 2', ['ABBBAAA', 4, False], []],\n  ['generated control 3', ['BAAAAAAABBBAA', 5, False], [['B', 1, 7]]]],\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: float limit', ['BAAAAAABBBAAAAA', 3, True], [['B', 1, 6], ['B', 10, 5]]],\n  ['repair check: float limit', ['AAAAABBABAAAAAAB', 5, False], [['B', 9, 6]]],\n  ['generated control 1', ['AAAAAACCAACAABA', 4, False], [['B', 0, 13], ['C', 0, 6]]],\n  ['generated control 2', ['AAAAAAA', 4, True], []],\n  ['generated control 3', ['BBABAAAABAAA', 3, True], [['B', 4, 4]]]],\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: float limit', ['BAAAAAAABBBAA', 3, False], [['B', 1, 7]]],\n  ['repair check: float limit', ['BAAABAAAA', 3, False], [['B', 5, 4]]],\n  ['generated control 1', ['ABAAABABBA', 3, False], []],\n  ['generated control 2', ['CBCCCABAACCBBCA', 5, True], []],\n  ['generated control 3', ['BAAAABBAAA', 4, 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: float limit', ['BAAAAAAABBBAAAAA', 3, True], [['B', 1, 7], ['B', 11, 5]]],\n  ['repair check: float limit', ['BAAAABBBAAA', 3, False], [['B', 1, 4]]],\n  ['generated control 1', ['AAAAABAA', 3, True], [['B', 6, 7]]],\n  ['generated control 2', ['BAAAAABAAA', 3, False], [['B', 1, 5]]],\n  ['generated control 3', ['AAABAAAAABABAAB', 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: float limit', ['BAAABBAA', 3, True], []],\n  ['repair check: float limit', ['AABAAAABAAAAA', 3, True], [['B', 3, 4], ['B', 8, 7]]],\n  ['generated control 1', ['AAAAAAA', 5, True], []], ['generated control 2', ['AABABAB', 3, False], []],\n  ['generated control 3', ['BAAABAABBAAABAB', 5, True], []]]]\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-float-limit","generated_at":"2026-09-29T14:52:34.363796+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.","repair":"Flag floats strictly longer than max_float.","root_cause":"The limit is treated as exclusive.","sha256":"b5e23466c2688af5ff1b9ac34a4a0a3aa4ed247bffcb0b51dc5be81ec35f0997","title":"Stranded colorwork float checker: float limit · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.056,"exit_code":1,"observations":[{"actual":[],"check":"flat long float","expected":[["B",1,6]],"passed":false},{"actual":[],"check":"wrap in round","expected":[["B",2,5],["A",7,5]],"passed":false},{"actual":[],"check":"exact limit","expected":[],"passed":true},{"actual":[["B",0,5]],"check":"regression: float limit","expected":[["B",0,5]],"passed":true},{"actual":[["B",1,5]],"check":"repair check: float limit","expected":[["B",1,5],["B",7,4]],"passed":false},{"actual":[],"check":"generated control 1","expected":[],"passed":true},{"actual":[],"check":"generated control 2","expected":[],"passed":true},{"actual":[["B",1,7]],"check":"generated control 3","expected":[["B",1,7]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"flat long float\", \"actual\": [], \"expected\": [[\"B\", 1, 6]], \"passed\": false}, {\"check\": \"wrap in round\", \"actual\": [], \"expected\": [[\"B\", 2, 5], [\"A\", 7, 5]], \"passed\": false}, {\"check\": \"exact limit\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"regression: float limit\", \"actual\": [[\"B\", 0, 5]], \"expected\": [[\"B\", 0, 5]], \"passed\": true}, {\"check\": \"repair check: float limit\", \"actual\": [[\"B\", 1, 5]], \"expected\": [[\"B\", 1, 5], [\"B\", 7, 4]], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [[\"B\", 1, 7]], \"expected\": [[\"B\", 1, 7]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.153,"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":[["B",1,4]],"check":"exact limit","expected":[],"passed":false},{"actual":[["B",0,5],["B",9,3]],"check":"regression: float limit","expected":[["B",0,5]],"passed":false},{"actual":[["B",1,5],["B",7,4]],"check":"repair check: float limit","expected":[["B",1,5],["B",7,4]],"passed":true},{"actual":[["B",1,5],["B",7,5]],"check":"generated control 1","expected":[],"passed":false},{"actual":[],"check":"generated control 2","expected":[],"passed":true},{"actual":[["B",1,7]],"check":"generated control 3","expected":[["B",1,7]],"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\": [[\"B\", 1, 4]], \"expected\": [], \"passed\": false}, {\"check\": \"regression: float limit\", \"actual\": [[\"B\", 0, 5], [\"B\", 9, 3]], \"expected\": [[\"B\", 0, 5]], \"passed\": false}, {\"check\": \"repair check: float limit\", \"actual\": [[\"B\", 1, 5], [\"B\", 7, 4]], \"expected\": [[\"B\", 1, 5], [\"B\", 7, 4]], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [[\"B\", 1, 5], [\"B\", 7, 5]], \"expected\": [], \"passed\": false}, {\"check\": \"generated control 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [[\"B\", 1, 7]], \"expected\": [[\"B\", 1, 7]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.098,"exit_code":0,"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":[["B",0,5]],"check":"regression: float limit","expected":[["B",0,5]],"passed":true},{"actual":[["B",1,5],["B",7,4]],"check":"repair check: float limit","expected":[["B",1,5],["B",7,4]],"passed":true},{"actual":[],"check":"generated control 1","expected":[],"passed":true},{"actual":[],"check":"generated control 2","expected":[],"passed":true},{"actual":[["B",1,7]],"check":"generated control 3","expected":[["B",1,7]],"passed":true}],"passed":true,"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: float limit\", \"actual\": [[\"B\", 0, 5]], \"expected\": [[\"B\", 0, 5]], \"passed\": true}, {\"check\": \"repair check: float limit\", \"actual\": [[\"B\", 1, 5], [\"B\", 7, 4]], \"expected\": [[\"B\", 1, 5], [\"B\", 7, 4]], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [[\"B\", 1, 7]], \"expected\": [[\"B\", 1, 7]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}