{"abstract":"A round of 8 increases only adds 7 stitches.","category":"Knitting and sewing pattern grading","checks":8,"contract":"Distribute increases (m1) evenly over stitches. Flat rows use increases+1 segments with no increase at the edges; rounds use `increases` segments each followed by m1. Segment length is stitches // segments; the remainder adds one stitch to segments in order: rounds from the start, flat rows alternating from the outside in (first, last, second, second-last...). Segments must hold at least one stitch, else \"error: too many increases\". 0 increases -> \"k<n>\"; negative counts or no stitches -> \"error: counts\". Output \"k4, m1, k5, ...\".","contract_signature":"stitches, increases, flat","evaluation_group":"w2-knitting_and_sewing_pattern_grading-even-increases","failed_approach":"Dropping it only in the round leaves an edge increase on flat rows.","family":"w2-knitting_and_sewing_pattern_grading-even-increases-trailing-increase","id":"FA-97376","implementations":{"attempt":{"sha256":"66c8d062e71809850133b0530c359ede457db50e32a4f6686ddf525b8fe30232","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(stitches, increases, flat):\n    if stitches <= 0 or increases < 0:\n        return 'error: counts'\n    if increases == 0:\n        return 'k%d' % stitches\n    segs = increases + 1 if flat else increases\n    if segs > stitches:\n        return 'error: too many increases'\n    base, extra = divmod(stitches, segs)\n    lens = [base] * segs\n    if flat:\n        order = []\n        i, j = 0, segs - 1\n        while i <= j:\n            order.append(i)\n            if i != j:\n                order.append(j)\n            i += 1\n            j -= 1\n    else:\n        order = list(range(segs))\n    for idx in order[:extra]:\n        lens[idx] += 1\n    parts = []\n    for n in lens:\n        parts.append('k%d' % n)\n        parts.append('m1')\n    if not flat:\n        parts.pop()\n    return ', '.join(parts)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['round even split', [40, 8, False], 'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1'],\n  ['flat with remainder', [23, 3, True], 'k6, m1, k6, m1, k5, m1, k6'],\n  ['no increases', [17, 0, True], 'k17'],\n  ['regression: trailing increase', [40, 7, False], 'k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5, m1'],\n  ['repair check: trailing increase', [61, 10, False],\n   'k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1'],\n  ['generated control 1', [17, 0, False], 'k17'],\n  ['generated control 2', [10, 10, True], 'error: too many increases'],\n  ['generated control 3', [9, 9, False],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1']],\n [['flat with remainder', [23, 3, True], 'k6, m1, k6, m1, k5, m1, k6'],\n  ['no increases', [17, 0, True], 'k17'],\n  ['flat maximum', [10, 9, True],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['regression: trailing increase', [23, 5, False], 'k5, m1, k5, m1, k5, m1, k4, m1, k4, m1'],\n  ['repair check: trailing increase', [72, 3, False], 'k24, m1, k24, m1, k24, m1'],\n  ['generated control 1', [72, 8, True],\n   'k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8'],\n  ['generated control 2', [23, 7, False], 'k4, m1, k4, m1, k3, m1, k3, m1, k3, m1, k3, m1, k3, m1'],\n  ['generated control 3', [48, 10, False],\n   'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k4, m1, k4, m1']],\n [['no increases', [17, 0, True], 'k17'],\n  ['flat maximum', [10, 9, True],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['flat over maximum', [10, 10, True], 'error: too many increases'],\n  ['regression: trailing increase', [17, 16, False],\n   'k2, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, '\n   'k1, m1, k1, m1, k1, m1'],\n  ['repair check: trailing increase', [10, 1, True], 'k5, m1, k5'],\n  ['generated control 1', [9, 4, True], 'k2, m1, k2, m1, k1, m1, k2, m1, k2'],\n  ['generated control 2', [9, 2, False], 'k5, m1, k4, m1'],\n  ['generated control 3', [17, 10, True],\n   'k2, m1, k2, m1, k2, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k2, m1, k2, m1, k2']],\n [['flat maximum', [10, 9, True],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['flat over maximum', [10, 10, True], 'error: too many increases'],\n  ['round even split', [40, 8, False], 'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1'],\n  ['regression: trailing increase', [10, 10, False],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1'],\n  ['repair check: trailing increase', [72, 3, True], 'k18, m1, k18, m1, k18, m1, k18'],\n  ['generated control 1', [6, 8, True], 'error: too many increases'],\n  ['generated control 2', [61, 9, False],\n   'k7, m1, k7, m1, k7, m1, k7, m1, k7, m1, k7, m1, k7, m1, k6, m1, k6, m1'],\n  ['generated control 3', [9, 2, False], 'k5, m1, k4, m1']],\n [['flat over maximum', [10, 10, True], 'error: too many increases'],\n  ['round even split', [40, 8, False], 'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1'],\n  ['flat with remainder', [23, 3, True], 'k6, m1, k6, m1, k5, m1, k6'],\n  ['regression: trailing increase', [9, 9, False],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1'],\n  ['repair check: trailing increase', [48, 3, True], 'k12, m1, k12, m1, k12, m1, k12'],\n  ['generated control 1', [6, 4, True], 'k2, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['generated control 2', [40, 5, False], 'k8, m1, k8, m1, k8, m1, k8, m1, k8, m1'],\n  ['generated control 3', [9, 10, True], 'error: too many increases']]]\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":"d1f0ada01a46052e2ed52d704514954392f2008cc620a5449577b1941c806688","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(stitches, increases, flat):\n    if stitches <= 0 or increases < 0:\n        return 'error: counts'\n    if increases == 0:\n        return 'k%d' % stitches\n    segs = increases + 1 if flat else increases\n    if segs > stitches:\n        return 'error: too many increases'\n    base, extra = divmod(stitches, segs)\n    lens = [base] * segs\n    if flat:\n        order = []\n        i, j = 0, segs - 1\n        while i <= j:\n            order.append(i)\n            if i != j:\n                order.append(j)\n            i += 1\n            j -= 1\n    else:\n        order = list(range(segs))\n    for idx in order[:extra]:\n        lens[idx] += 1\n    parts = []\n    for n in lens:\n        parts.append('k%d' % n)\n        parts.append('m1')\n    parts.pop()\n    return ', '.join(parts)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['round even split', [40, 8, False], 'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1'],\n  ['flat with remainder', [23, 3, True], 'k6, m1, k6, m1, k5, m1, k6'],\n  ['no increases', [17, 0, True], 'k17'],\n  ['regression: trailing increase', [40, 7, False], 'k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5, m1'],\n  ['repair check: trailing increase', [61, 10, False],\n   'k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1'],\n  ['generated control 1', [17, 0, False], 'k17'],\n  ['generated control 2', [10, 10, True], 'error: too many increases'],\n  ['generated control 3', [9, 9, False],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1']],\n [['flat with remainder', [23, 3, True], 'k6, m1, k6, m1, k5, m1, k6'],\n  ['no increases', [17, 0, True], 'k17'],\n  ['flat maximum', [10, 9, True],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['regression: trailing increase', [23, 5, False], 'k5, m1, k5, m1, k5, m1, k4, m1, k4, m1'],\n  ['repair check: trailing increase', [72, 3, False], 'k24, m1, k24, m1, k24, m1'],\n  ['generated control 1', [72, 8, True],\n   'k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8, m1, k8'],\n  ['generated control 2', [23, 7, False], 'k4, m1, k4, m1, k3, m1, k3, m1, k3, m1, k3, m1, k3, m1'],\n  ['generated control 3', [48, 10, False],\n   'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k4, m1, k4, m1']],\n [['no increases', [17, 0, True], 'k17'],\n  ['flat maximum', [10, 9, True],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['flat over maximum', [10, 10, True], 'error: too many increases'],\n  ['regression: trailing increase', [17, 16, False],\n   'k2, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, '\n   'k1, m1, k1, m1, k1, m1'],\n  ['repair check: trailing increase', [10, 1, True], 'k5, m1, k5'],\n  ['generated control 1', [9, 4, True], 'k2, m1, k2, m1, k1, m1, k2, m1, k2'],\n  ['generated control 2', [9, 2, False], 'k5, m1, k4, m1'],\n  ['generated control 3', [17, 10, True],\n   'k2, m1, k2, m1, k2, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k2, m1, k2, m1, k2']],\n [['flat maximum', [10, 9, True],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['flat over maximum', [10, 10, True], 'error: too many increases'],\n  ['round even split', [40, 8, False], 'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1'],\n  ['regression: trailing increase', [10, 10, False],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1'],\n  ['repair check: trailing increase', [72, 3, True], 'k18, m1, k18, m1, k18, m1, k18'],\n  ['generated control 1', [6, 8, True], 'error: too many increases'],\n  ['generated control 2', [61, 9, False],\n   'k7, m1, k7, m1, k7, m1, k7, m1, k7, m1, k7, m1, k7, m1, k6, m1, k6, m1'],\n  ['generated control 3', [9, 2, False], 'k5, m1, k4, m1']],\n [['flat over maximum', [10, 10, True], 'error: too many increases'],\n  ['round even split', [40, 8, False], 'k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1'],\n  ['flat with remainder', [23, 3, True], 'k6, m1, k6, m1, k5, m1, k6'],\n  ['regression: trailing increase', [9, 9, False],\n   'k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1'],\n  ['repair check: trailing increase', [48, 3, True], 'k12, m1, k12, m1, k12, m1, k12'],\n  ['generated control 1', [6, 4, True], 'k2, m1, k1, m1, k1, m1, k1, m1, k1'],\n  ['generated control 2', [40, 5, False], 'k8, m1, k8, m1, k8, m1, k8, m1, k8, m1'],\n  ['generated control 3', [9, 10, True], 'error: too many increases']]]\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-even-increases-trailing-increase","generated_at":"2026-09-29T14:52:31.646439+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Yoke, cuff-to-body and hem transitions ask knitters to increase evenly across a row.","root_cause":"The final m1 is dropped for rounds as well as flat rows.","sha256":"85837965fd2233a3c6f4533f80ff1df2fcb42b5d5836c5ecb9373ab76f37fe6d","title":"Evenly spaced increase row: trailing increase · 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":43.046,"exit_code":1,"observations":[{"actual":"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5","check":"round even split","expected":"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1","passed":false},{"actual":"k6, m1, k6, m1, k5, m1, k6, m1","check":"flat with remainder","expected":"k6, m1, k6, m1, k5, m1, k6","passed":false},{"actual":"k17","check":"no increases","expected":"k17","passed":true},{"actual":"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5","check":"regression: trailing increase","expected":"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5, m1","passed":false},{"actual":"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6","check":"repair check: trailing increase","expected":"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1","passed":false},{"actual":"k17","check":"generated control 1","expected":"k17","passed":true},{"actual":"error: too many increases","check":"generated control 2","expected":"error: too many increases","passed":true},{"actual":"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1","check":"generated control 3","expected":"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"round even split\", \"actual\": \"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5\", \"expected\": \"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1\", \"passed\": false}, {\"check\": \"flat with remainder\", \"actual\": \"k6, m1, k6, m1, k5, m1, k6, m1\", \"expected\": \"k6, m1, k6, m1, k5, m1, k6\", \"passed\": false}, {\"check\": \"no increases\", \"actual\": \"k17\", \"expected\": \"k17\", \"passed\": true}, {\"check\": \"regression: trailing increase\", \"actual\": \"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5\", \"expected\": \"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5, m1\", \"passed\": false}, {\"check\": \"repair check: trailing increase\", \"actual\": \"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6\", \"expected\": \"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1\", \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": \"k17\", \"expected\": \"k17\", \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": \"error: too many increases\", \"expected\": \"error: too many increases\", \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": \"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1\", \"expected\": \"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.078,"exit_code":1,"observations":[{"actual":"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5","check":"round even split","expected":"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1","passed":false},{"actual":"k6, m1, k6, m1, k5, m1, k6","check":"flat with remainder","expected":"k6, m1, k6, m1, k5, m1, k6","passed":true},{"actual":"k17","check":"no increases","expected":"k17","passed":true},{"actual":"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5","check":"regression: trailing increase","expected":"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5, m1","passed":false},{"actual":"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6","check":"repair check: trailing increase","expected":"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1","passed":false},{"actual":"k17","check":"generated control 1","expected":"k17","passed":true},{"actual":"error: too many increases","check":"generated control 2","expected":"error: too many increases","passed":true},{"actual":"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1","check":"generated control 3","expected":"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"round even split\", \"actual\": \"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5\", \"expected\": \"k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1, k5, m1\", \"passed\": false}, {\"check\": \"flat with remainder\", \"actual\": \"k6, m1, k6, m1, k5, m1, k6\", \"expected\": \"k6, m1, k6, m1, k5, m1, k6\", \"passed\": true}, {\"check\": \"no increases\", \"actual\": \"k17\", \"expected\": \"k17\", \"passed\": true}, {\"check\": \"regression: trailing increase\", \"actual\": \"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5\", \"expected\": \"k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k5, m1, k5, m1\", \"passed\": false}, {\"check\": \"repair check: trailing increase\", \"actual\": \"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6\", \"expected\": \"k7, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1, k6, m1\", \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": \"k17\", \"expected\": \"k17\", \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": \"error: too many increases\", \"expected\": \"error: too many increases\", \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": \"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1\", \"expected\": \"k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1, k1, m1\", \"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."}}