{"abstract":"An exact fit plans one more strip than needed.","category":"Knitting and sewing pattern grading","checks":8,"contract":"Usable strip length = fabric_width - 2*selvage. Joining n strips with diagonal seams loses strip_width per join (n-1 joins). Need perimeter + tail. n is the smallest count with n*usable - (n-1)*strip_width >= need. Return [n, fabric cut length n*strip_width, surplus]; usable <= strip_width -> \"error: fabric too narrow\".","evaluation_group":"w2-knitting_and_sewing_pattern_grading-binding-strips","failed_approach":"Looking one strip ahead stops one strip early.","family":"w2-knitting_and_sewing_pattern_grading-binding-strips-strip-count-loop","id":"FA-97611","implementations":{"attempt":{"sha256":"ce20016f683336fd795a80209c29bee454eb333ec8674ecac84b1eb6794706c8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(perimeter, strip_width, fabric_width, selvage, tail):\n    usable = fabric_width - 2 * selvage\n    if usable <= strip_width:\n        return 'error: fabric too narrow'\n    need = perimeter + tail\n    def length(n):\n        return n * usable - (n - 1) * strip_width\n    n = 1\n    while length(n + 1) < need:\n        n += 1\n    return [n, n * strip_width, length(n) - need]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['regression: strip count loop', [280, 6.5, 110, 2, 25], [3, 19.5, 0.0]],\n  ['repair check: strip count loop', [200, 6.5, 110, 1, 0], [2, 13.0, 9.5]],\n  ['generated control 1', [150, 4, 150, 2, 20], [2, 8, 118]],\n  ['generated control 2', [200, 6.5, 150, 2, 20], [2, 13.0, 65.5]],\n  ['generated control 3', [350, 6.5, 140, 1, 20], [3, 19.5, 31.0]]],\n [['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]],\n  ['regression: strip count loop', [420, 5, 150, 0, 20], [3, 15, 0]],\n  ['repair check: strip count loop', [280, 6.5, 110, 1, 20], [3, 19.5, 11.0]],\n  ['generated control 1', [280, 5, 110, 2, 25], [3, 15, 3]],\n  ['generated control 2', [420, 6.5, 140, 1, 30], [4, 26.0, 82.5]],\n  ['generated control 3', [420, 5, 110, 1, 30], [5, 25, 70]]],\n [['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['regression: strip count loop', [420, 5, 150, 0, 20], [3, 15, 0]],\n  ['repair check: strip count loop', [350, 5, 110, 2, 20], [4, 20, 39]],\n  ['generated control 1', [350, 5, 150, 0, 20], [3, 15, 70]],\n  ['generated control 2', [200, 6.5, 107, 2, 0], [3, 19.5, 96.0]],\n  ['generated control 3', [420, 6, 150, 0, 20], [4, 24, 142]]],\n [['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['regression: strip count loop', [280, 5, 107, 1, 25], [3, 15, 0]],\n  ['repair check: strip count loop', [150, 6, 150, 0, 20], [2, 12, 124]],\n  ['generated control 1', [200, 6.5, 110, 0, 20], [3, 19.5, 97.0]],\n  ['generated control 2', [150, 4, 107, 2, 25], [2, 8, 27]],\n  ['generated control 3', [600, 4, 150, 0, 0], [5, 20, 134]]],\n [['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]],\n  ['regression: strip count loop', [420, 4, 110, 1, 0], [4, 16, 0]],\n  ['repair check: strip count loop', [600, 5, 110, 1, 0], [6, 30, 23]],\n  ['generated control 1', [200, 6, 140, 1, 25], [2, 12, 45]],\n  ['generated control 2', [200, 6, 150, 1, 25], [2, 12, 65]],\n  ['generated control 3', [420, 5, 110, 2, 30], [5, 25, 60]]]]\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":"cd352e53bde2484f9bd893bfdb43266527a4646319f52639ca6bfb04726c881c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(perimeter, strip_width, fabric_width, selvage, tail):\n    usable = fabric_width - 2 * selvage\n    if usable <= strip_width:\n        return 'error: fabric too narrow'\n    need = perimeter + tail\n    def length(n):\n        return n * usable - (n - 1) * strip_width\n    n = 1\n    while length(n) <= need:\n        n += 1\n    return [n, n * strip_width, length(n) - need]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['regression: strip count loop', [280, 6.5, 110, 2, 25], [3, 19.5, 0.0]],\n  ['repair check: strip count loop', [200, 6.5, 110, 1, 0], [2, 13.0, 9.5]],\n  ['generated control 1', [150, 4, 150, 2, 20], [2, 8, 118]],\n  ['generated control 2', [200, 6.5, 150, 2, 20], [2, 13.0, 65.5]],\n  ['generated control 3', [350, 6.5, 140, 1, 20], [3, 19.5, 31.0]]],\n [['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]],\n  ['regression: strip count loop', [420, 5, 150, 0, 20], [3, 15, 0]],\n  ['repair check: strip count loop', [280, 6.5, 110, 1, 20], [3, 19.5, 11.0]],\n  ['generated control 1', [280, 5, 110, 2, 25], [3, 15, 3]],\n  ['generated control 2', [420, 6.5, 140, 1, 30], [4, 26.0, 82.5]],\n  ['generated control 3', [420, 5, 110, 1, 30], [5, 25, 70]]],\n [['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['regression: strip count loop', [420, 5, 150, 0, 20], [3, 15, 0]],\n  ['repair check: strip count loop', [350, 5, 110, 2, 20], [4, 20, 39]],\n  ['generated control 1', [350, 5, 150, 0, 20], [3, 15, 70]],\n  ['generated control 2', [200, 6.5, 107, 2, 0], [3, 19.5, 96.0]],\n  ['generated control 3', [420, 6, 150, 0, 20], [4, 24, 142]]],\n [['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['regression: strip count loop', [280, 5, 107, 1, 25], [3, 15, 0]],\n  ['repair check: strip count loop', [150, 6, 150, 0, 20], [2, 12, 124]],\n  ['generated control 1', [200, 6.5, 110, 0, 20], [3, 19.5, 97.0]],\n  ['generated control 2', [150, 4, 107, 2, 25], [2, 8, 27]],\n  ['generated control 3', [600, 4, 150, 0, 0], [5, 20, 134]]],\n [['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]],\n  ['regression: strip count loop', [420, 4, 110, 1, 0], [4, 16, 0]],\n  ['repair check: strip count loop', [600, 5, 110, 1, 0], [6, 30, 23]],\n  ['generated control 1', [200, 6, 140, 1, 25], [2, 12, 45]],\n  ['generated control 2', [200, 6, 150, 1, 25], [2, 12, 65]],\n  ['generated control 3', [420, 5, 110, 2, 30], [5, 25, 60]]]]\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":"627e3fb67df22414b8504d6e98d3ce6b81a9b2c797bb0d260b380445f8e55068","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(perimeter, strip_width, fabric_width, selvage, tail):\n    usable = fabric_width - 2 * selvage\n    if usable <= strip_width:\n        return 'error: fabric too narrow'\n    need = perimeter + tail\n    def length(n):\n        return n * usable - (n - 1) * strip_width\n    n = 1\n    while length(n) < need:\n        n += 1\n    return [n, n * strip_width, length(n) - need]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['regression: strip count loop', [280, 6.5, 110, 2, 25], [3, 19.5, 0.0]],\n  ['repair check: strip count loop', [200, 6.5, 110, 1, 0], [2, 13.0, 9.5]],\n  ['generated control 1', [150, 4, 150, 2, 20], [2, 8, 118]],\n  ['generated control 2', [200, 6.5, 150, 2, 20], [2, 13.0, 65.5]],\n  ['generated control 3', [350, 6.5, 140, 1, 20], [3, 19.5, 31.0]]],\n [['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]],\n  ['regression: strip count loop', [420, 5, 150, 0, 20], [3, 15, 0]],\n  ['repair check: strip count loop', [280, 6.5, 110, 1, 20], [3, 19.5, 11.0]],\n  ['generated control 1', [280, 5, 110, 2, 25], [3, 15, 3]],\n  ['generated control 2', [420, 6.5, 140, 1, 30], [4, 26.0, 82.5]],\n  ['generated control 3', [420, 5, 110, 1, 30], [5, 25, 70]]],\n [['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['regression: strip count loop', [420, 5, 150, 0, 20], [3, 15, 0]],\n  ['repair check: strip count loop', [350, 5, 110, 2, 20], [4, 20, 39]],\n  ['generated control 1', [350, 5, 150, 0, 20], [3, 15, 70]],\n  ['generated control 2', [200, 6.5, 107, 2, 0], [3, 19.5, 96.0]],\n  ['generated control 3', [420, 6, 150, 0, 20], [4, 24, 142]]],\n [['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]], ['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['regression: strip count loop', [280, 5, 107, 1, 25], [3, 15, 0]],\n  ['repair check: strip count loop', [150, 6, 150, 0, 20], [2, 12, 124]],\n  ['generated control 1', [200, 6.5, 110, 0, 20], [3, 19.5, 97.0]],\n  ['generated control 2', [150, 4, 107, 2, 25], [2, 8, 27]],\n  ['generated control 3', [600, 4, 150, 0, 0], [5, 20, 134]]],\n [['two strips', [196, 6, 110, 2, 0], [2, 12, 10]],\n  ['narrow fabric', [100, 6, 6, 0, 0], 'error: fabric too narrow'],\n  ['baby quilt', [280, 6, 110, 1, 25], [3, 18, 7]],\n  ['regression: strip count loop', [420, 4, 110, 1, 0], [4, 16, 0]],\n  ['repair check: strip count loop', [600, 5, 110, 1, 0], [6, 30, 23]],\n  ['generated control 1', [200, 6, 140, 1, 25], [2, 12, 45]],\n  ['generated control 2', [200, 6, 150, 1, 25], [2, 12, 65]],\n  ['generated control 3', [420, 5, 110, 2, 30], [5, 25, 60]]]]\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-binding-strips-strip-count-loop","generated_at":"2026-09-29T14:52:33.867297+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Quilters cut width-of-fabric strips and join them diagonally to bind the quilt edge.","repair":"Stop as soon as the length meets the need.","root_cause":"The loop continues on equality.","sha256":"4e5c902c4ea8870ccf37998cf6f5c7d1841752c0ee5e459e6b36794c626bd618","title":"Quilt binding strip planner: strip count loop · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.345,"exit_code":1,"observations":[{"actual":[2,12,-95],"check":"baby quilt","expected":[3,18,7],"passed":false},{"actual":[1,6,-90],"check":"two strips","expected":[2,12,10],"passed":false},{"actual":"error: fabric too narrow","check":"narrow fabric","expected":"error: fabric too narrow","passed":true},{"actual":[2,13.0,-99.5],"check":"regression: strip count loop","expected":[3,19.5,0.0],"passed":false},{"actual":[1,6.5,-92.0],"check":"repair check: strip count loop","expected":[2,13.0,9.5],"passed":false},{"actual":[1,4,-24],"check":"generated control 1","expected":[2,8,118],"passed":false},{"actual":[1,6.5,-74.0],"check":"generated control 2","expected":[2,13.0,65.5],"passed":false},{"actual":[2,13.0,-100.5],"check":"generated control 3","expected":[3,19.5,31.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"baby quilt\", \"actual\": [2, 12, -95], \"expected\": [3, 18, 7], \"passed\": false}, {\"check\": \"two strips\", \"actual\": [1, 6, -90], \"expected\": [2, 12, 10], \"passed\": false}, {\"check\": \"narrow fabric\", \"actual\": \"error: fabric too narrow\", \"expected\": \"error: fabric too narrow\", \"passed\": true}, {\"check\": \"regression: strip count loop\", \"actual\": [2, 13.0, -99.5], \"expected\": [3, 19.5, 0.0], \"passed\": false}, {\"check\": \"repair check: strip count loop\", \"actual\": [1, 6.5, -92.0], \"expected\": [2, 13.0, 9.5], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [1, 4, -24], \"expected\": [2, 8, 118], \"passed\": false}, {\"check\": \"generated control 2\", \"actual\": [1, 6.5, -74.0], \"expected\": [2, 13.0, 65.5], \"passed\": false}, {\"check\": \"generated control 3\", \"actual\": [2, 13.0, -100.5], \"expected\": [3, 19.5, 31.0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.208,"exit_code":1,"observations":[{"actual":[3,18,7],"check":"baby quilt","expected":[3,18,7],"passed":true},{"actual":[2,12,10],"check":"two strips","expected":[2,12,10],"passed":true},{"actual":"error: fabric too narrow","check":"narrow fabric","expected":"error: fabric too narrow","passed":true},{"actual":[4,26.0,99.5],"check":"regression: strip count loop","expected":[3,19.5,0.0],"passed":false},{"actual":[2,13.0,9.5],"check":"repair check: strip count loop","expected":[2,13.0,9.5],"passed":true},{"actual":[2,8,118],"check":"generated control 1","expected":[2,8,118],"passed":true},{"actual":[2,13.0,65.5],"check":"generated control 2","expected":[2,13.0,65.5],"passed":true},{"actual":[3,19.5,31.0],"check":"generated control 3","expected":[3,19.5,31.0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"baby quilt\", \"actual\": [3, 18, 7], \"expected\": [3, 18, 7], \"passed\": true}, {\"check\": \"two strips\", \"actual\": [2, 12, 10], \"expected\": [2, 12, 10], \"passed\": true}, {\"check\": \"narrow fabric\", \"actual\": \"error: fabric too narrow\", \"expected\": \"error: fabric too narrow\", \"passed\": true}, {\"check\": \"regression: strip count loop\", \"actual\": [4, 26.0, 99.5], \"expected\": [3, 19.5, 0.0], \"passed\": false}, {\"check\": \"repair check: strip count loop\", \"actual\": [2, 13.0, 9.5], \"expected\": [2, 13.0, 9.5], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [2, 8, 118], \"expected\": [2, 8, 118], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [2, 13.0, 65.5], \"expected\": [2, 13.0, 65.5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [3, 19.5, 31.0], \"expected\": [3, 19.5, 31.0], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.719,"exit_code":0,"observations":[{"actual":[3,18,7],"check":"baby quilt","expected":[3,18,7],"passed":true},{"actual":[2,12,10],"check":"two strips","expected":[2,12,10],"passed":true},{"actual":"error: fabric too narrow","check":"narrow fabric","expected":"error: fabric too narrow","passed":true},{"actual":[3,19.5,0.0],"check":"regression: strip count loop","expected":[3,19.5,0.0],"passed":true},{"actual":[2,13.0,9.5],"check":"repair check: strip count loop","expected":[2,13.0,9.5],"passed":true},{"actual":[2,8,118],"check":"generated control 1","expected":[2,8,118],"passed":true},{"actual":[2,13.0,65.5],"check":"generated control 2","expected":[2,13.0,65.5],"passed":true},{"actual":[3,19.5,31.0],"check":"generated control 3","expected":[3,19.5,31.0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"baby quilt\", \"actual\": [3, 18, 7], \"expected\": [3, 18, 7], \"passed\": true}, {\"check\": \"two strips\", \"actual\": [2, 12, 10], \"expected\": [2, 12, 10], \"passed\": true}, {\"check\": \"narrow fabric\", \"actual\": \"error: fabric too narrow\", \"expected\": \"error: fabric too narrow\", \"passed\": true}, {\"check\": \"regression: strip count loop\", \"actual\": [3, 19.5, 0.0], \"expected\": [3, 19.5, 0.0], \"passed\": true}, {\"check\": \"repair check: strip count loop\", \"actual\": [2, 13.0, 9.5], \"expected\": [2, 13.0, 9.5], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [2, 8, 118], \"expected\": [2, 8, 118], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [2, 13.0, 65.5], \"expected\": [2, 13.0, 65.5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [3, 19.5, 31.0], \"expected\": [3, 19.5, 31.0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}