FA-97401 / Knitting and sewing pattern grading / Open access
Sleeve taper decrease schedule: zero-count slower rate · case 01
Evenly divisible schedules print "every 11 rows 0 times".
ROOT CAUSE
The slower rate is emitted even when its count is zero.
THE FAILURE
The slower rate is emitted even when its count is zero.
Unsuccessful approach: Special-casing a single fast decrease still prints zero counts elsewhere.
Case contract
Top-down sleeve from upper_sts to cuff_sts, decreasing 2 stitches per decrease row within rows rows. Errors: cuff wider ("error: cuff wider than upper arm"), odd difference ("error: odd difference"), rows fewer than decrease rows ("error: not enough rows"). pairs = difference/2; a = rows // pairs; y = rows - a*pairs decreases every a+1 rows, x = pairs-y every a rows. Return [[a, x], [a+1, y]] omitting a zero count; [] for no decreases.
Why this case matters
Pattern writers turn a stitch-count change over a length into "decrease every N rows X times".
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(cuff_sts, upper_sts, rows):
diff = upper_sts - cuff_sts
if diff < 0:
return 'error: cuff wider than upper arm'
if diff % 2:
return 'error: odd difference'
pairs = diff // 2
if pairs == 0:
return []
a = rows // pairs
if a == 0:
return 'error: not enough rows'
y = rows - a * pairs
x = pairs - y
plan = []
if x:
plan.append([a, x])
if y >= 0:
plan.append([a + 1, y])
return plan
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['even schedule', [48, 64, 80], [[10, 8]]], ['two rates', [44, 60, 90], [[11, 6], [12, 2]]],
['odd difference', [48, 53, 60], 'error: odd difference'],
['regression: zero-count slower rate', [60, 76, 72], [[9, 8]]],
['repair check: zero-count slower rate', [60, 62, 90], [[90, 1]]],
['generated control 1', [45, 75, 100], [[6, 5], [7, 10]]], ['generated control 2', [48, 68, 40], [[4, 10]]],
['generated control 3', [40, 60, 72], [[7, 8], [8, 2]]]],
[['two rates', [44, 60, 90], [[11, 6], [12, 2]]], ['odd difference', [48, 53, 60], 'error: odd difference'],
['too few rows', [40, 70, 10], 'error: not enough rows'],
['regression: zero-count slower rate', [45, 75, 60], [[4, 15]]],
['repair check: zero-count slower rate', [56, 58, 10], [[10, 1]]],
['generated control 1', [44, 56, 40], [[6, 2], [7, 4]]],
['generated control 2', [51, 81, 100], [[6, 5], [7, 10]]],
['generated control 3', [56, 64, 10], [[2, 2], [3, 2]]]],
[['odd difference', [48, 53, 60], 'error: odd difference'],
['too few rows', [40, 70, 10], 'error: not enough rows'],
['cuff wider', [60, 50, 60], 'error: cuff wider than upper arm'],
['regression: zero-count slower rate', [50, 52, 60], [[60, 1]]],
['repair check: zero-count slower rate', [50, 52, 100], [[100, 1]]],
['generated control 1', [45, 65, 5], 'error: not enough rows'],
['generated control 2', [50, 70, 72], [[7, 8], [8, 2]]],
['generated control 3', [60, 68, 100], [[25, 4]]]],
[['too few rows', [40, 70, 10], 'error: not enough rows'],
['cuff wider', [60, 50, 60], 'error: cuff wider than upper arm'],
['even schedule', [48, 64, 80], [[10, 8]]], ['regression: zero-count slower rate', [50, 70, 10], [[1, 10]]],
['repair check: zero-count slower rate', [56, 58, 5], [[5, 1]]],
['generated control 1', [40, 56, 5], 'error: not enough rows'],
['generated control 2', [44, 46, 10], [[10, 1]]],
['generated control 3', [48, 55, 10], 'error: odd difference']],
[['cuff wider', [60, 50, 60], 'error: cuff wider than upper arm'],
['even schedule', [48, 64, 80], [[10, 8]]], ['two rates', [44, 60, 90], [[11, 6], [12, 2]]],
['regression: zero-count slower rate', [48, 56, 72], [[18, 4]]],
['repair check: zero-count slower rate', [44, 46, 60], [[60, 1]]],
['generated control 1', [48, 72, 90], [[7, 6], [8, 6]]], ['generated control 2', [44, 64, 60], [[6, 10]]],
['generated control 3', [44, 68, 40], [[3, 8], [4, 4]]]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| even schedule | [[10, 8], [11, 0]] | [[10, 8]] | Failed |
| two rates | [[11, 6], [12, 2]] | [[11, 6], [12, 2]] | Passed |
| odd difference | error: odd difference | error: odd difference | Passed |
| regression: zero-count slower rate | [[9, 8], [10, 0]] | [[9, 8]] | Failed |
| repair check: zero-count slower rate | [[90, 1], [91, 0]] | [[90, 1]] | Failed |
| generated control 1 | [[6, 5], [7, 10]] | [[6, 5], [7, 10]] | Passed |
| generated control 2 | [[4, 10], [5, 0]] | [[4, 10]] | Failed |
| generated control 3 | [[7, 8], [8, 2]] | [[7, 8], [8, 2]] | Passed |
SHA-256 / e2461f3d48c8f4bab6d26f777120820f963bc859da77fbd288447b738cadff2c
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(cuff_sts, upper_sts, rows):
diff = upper_sts - cuff_sts
if diff < 0:
return 'error: cuff wider than upper arm'
if diff % 2:
return 'error: odd difference'
pairs = diff // 2
if pairs == 0:
return []
a = rows // pairs
if a == 0:
return 'error: not enough rows'
y = rows - a * pairs
x = pairs - y
plan = []
if x:
plan.append([a, x])
if y or x == 1:
plan.append([a + 1, y])
return plan
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['even schedule', [48, 64, 80], [[10, 8]]], ['two rates', [44, 60, 90], [[11, 6], [12, 2]]],
['odd difference', [48, 53, 60], 'error: odd difference'],
['regression: zero-count slower rate', [60, 76, 72], [[9, 8]]],
['repair check: zero-count slower rate', [60, 62, 90], [[90, 1]]],
['generated control 1', [45, 75, 100], [[6, 5], [7, 10]]], ['generated control 2', [48, 68, 40], [[4, 10]]],
['generated control 3', [40, 60, 72], [[7, 8], [8, 2]]]],
[['two rates', [44, 60, 90], [[11, 6], [12, 2]]], ['odd difference', [48, 53, 60], 'error: odd difference'],
['too few rows', [40, 70, 10], 'error: not enough rows'],
['regression: zero-count slower rate', [45, 75, 60], [[4, 15]]],
['repair check: zero-count slower rate', [56, 58, 10], [[10, 1]]],
['generated control 1', [44, 56, 40], [[6, 2], [7, 4]]],
['generated control 2', [51, 81, 100], [[6, 5], [7, 10]]],
['generated control 3', [56, 64, 10], [[2, 2], [3, 2]]]],
[['odd difference', [48, 53, 60], 'error: odd difference'],
['too few rows', [40, 70, 10], 'error: not enough rows'],
['cuff wider', [60, 50, 60], 'error: cuff wider than upper arm'],
['regression: zero-count slower rate', [50, 52, 60], [[60, 1]]],
['repair check: zero-count slower rate', [50, 52, 100], [[100, 1]]],
['generated control 1', [45, 65, 5], 'error: not enough rows'],
['generated control 2', [50, 70, 72], [[7, 8], [8, 2]]],
['generated control 3', [60, 68, 100], [[25, 4]]]],
[['too few rows', [40, 70, 10], 'error: not enough rows'],
['cuff wider', [60, 50, 60], 'error: cuff wider than upper arm'],
['even schedule', [48, 64, 80], [[10, 8]]], ['regression: zero-count slower rate', [50, 70, 10], [[1, 10]]],
['repair check: zero-count slower rate', [56, 58, 5], [[5, 1]]],
['generated control 1', [40, 56, 5], 'error: not enough rows'],
['generated control 2', [44, 46, 10], [[10, 1]]],
['generated control 3', [48, 55, 10], 'error: odd difference']],
[['cuff wider', [60, 50, 60], 'error: cuff wider than upper arm'],
['even schedule', [48, 64, 80], [[10, 8]]], ['two rates', [44, 60, 90], [[11, 6], [12, 2]]],
['regression: zero-count slower rate', [48, 56, 72], [[18, 4]]],
['repair check: zero-count slower rate', [44, 46, 60], [[60, 1]]],
['generated control 1', [48, 72, 90], [[7, 6], [8, 6]]], ['generated control 2', [44, 64, 60], [[6, 10]]],
['generated control 3', [44, 68, 40], [[3, 8], [4, 4]]]]]
for label, args, expected in fixtures[N - 1]:
check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| even schedule | [[10, 8]] | [[10, 8]] | Passed |
| two rates | [[11, 6], [12, 2]] | [[11, 6], [12, 2]] | Passed |
| odd difference | error: odd difference | error: odd difference | Passed |
| regression: zero-count slower rate | [[9, 8]] | [[9, 8]] | Passed |
| repair check: zero-count slower rate | [[90, 1], [91, 0]] | [[90, 1]] | Failed |
| generated control 1 | [[6, 5], [7, 10]] | [[6, 5], [7, 10]] | Passed |
| generated control 2 | [[4, 10]] | [[4, 10]] | Passed |
| generated control 3 | [[7, 8], [8, 2]] | [[7, 8], [8, 2]] | Passed |
SHA-256 / 976896d59137da3a36bb26e86c6831f4e43d475c4ebe3d66bd6ffa15e4f70eec
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:52:31.831119+00:00.
Case digest / d9f0ab8b4cc91a509e5f84294d26be58d91ac9d8be5ce9a5d3bc385d6d8e8c32