FAILURE MAP
← Case archive

FA-97831 / Knitting and sewing pattern grading / Open access

Top-down sock fit calculator: heel flap share · case 01

Heel flaps are a third of the sock.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The heel uses a third instead of half the stitches.

VERIFIED REPAIR

Heel flap on half the stitches.

Unsuccessful approach: Rounding half up is harmless for even casts but breaks odd multiples.

Case contract

Leg stitches = foot_circ*(1 - neg_ease/100)*gauge/10 rounded to the nearest multiple of `multiple` (half-up). Heel flap = half the stitches; flap rows = heel stitches; gusset pick-up per side = flap rows/2 + 1. Return {cast_on, heel_sts, flap_rows, pickup}.

Why this case matters

Sock patterns size with negative ease and derive heel flap and gusset counts.

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(foot_circ, sts_per_10cm, neg_ease_pct, multiple):
    raw = Fraction(str(foot_circ)) * (1 - Fraction(str(neg_ease_pct)) / 100) * Fraction(sts_per_10cm) / 10
    cast = multiple * math.floor(raw / multiple + Fraction(1, 2))
    heel = cast // 3
    flap = heel
    pickup = flap // 2 + 1
    return {'cast_on': cast, 'heel_sts': heel, 'flap_rows': flap, 'pickup': pickup}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['regression: heel flap share', [21.5, '28', 12.5, 1],
   {'cast_on': 53, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}],
  ['repair check: heel flap share', [24, '36', 0, 3],
   {'cast_on': 87, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}],
  ['generated control 1', [23, '30', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 2', [20, '36', 5, 2], {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 3', [23, '36', 0, 1], {'cast_on': 83, 'flap_rows': 41, 'heel_sts': 41, 'pickup': 21}]],
 [['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['regression: heel flap share', [23, '36', 10, 1],
   {'cast_on': 75, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}],
  ['repair check: heel flap share', [24, '28', 5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['generated control 1', [25.5, '28', 0, 2], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [22, '32', 0, 2], {'cast_on': 70, 'flap_rows': 35, 'heel_sts': 35, 'pickup': 18}],
  ['generated control 3', [21.5, '32', 5, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}]],
 [['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['regression: heel flap share', [20, '36', 0, 4],
   {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['repair check: heel flap share', [21.5, '30', 0, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 1', [25.5, '28', 5, 2], {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 2', [23, '28', 5, 3], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 3', [22, '36', 5, 4], {'cast_on': 76, 'flap_rows': 38, 'heel_sts': 38, 'pickup': 20}]],
 [['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['regression: heel flap share', [22, '32', 0, 4],
   {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['repair check: heel flap share', [20, '30', 5, 1],
   {'cast_on': 57, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 1', [21.5, '28', 0, 2], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 2', [21.5, '36', 12.5, 4],
   {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 3', [24, '32', 12.5, 3],
   {'cast_on': 66, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}]],
 [['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['regression: heel flap share', [22, '32', 10, 1],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['repair check: heel flap share', [21.5, '36', 12.5, 3],
   {'cast_on': 69, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 1', [24, '30', 0, 2], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [22, '30', 10, 4], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 3', [22, '36', 5, 1], {'cast_on': 75, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}]]]
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 fixtureActualExpectedOutcome
standard sock{'cast_on': 64, 'flap_rows': 21, 'heel_sts': 21, 'pickup': 11}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Failed
no ease{'cast_on': 56, 'flap_rows': 18, 'heel_sts': 18, 'pickup': 10}{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}Failed
wide foot{'cast_on': 80, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}{'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}Failed
regression: heel flap share{'cast_on': 53, 'flap_rows': 17, 'heel_sts': 17, 'pickup': 9}{'cast_on': 53, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}Failed
repair check: heel flap share{'cast_on': 87, 'flap_rows': 29, 'heel_sts': 29, 'pickup': 15}{'cast_on': 87, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}Failed
generated control 1{'cast_on': 64, 'flap_rows': 21, 'heel_sts': 21, 'pickup': 11}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Failed
generated control 2{'cast_on': 68, 'flap_rows': 22, 'heel_sts': 22, 'pickup': 12}{'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}Failed
generated control 3{'cast_on': 83, 'flap_rows': 27, 'heel_sts': 27, 'pickup': 14}{'cast_on': 83, 'flap_rows': 41, 'heel_sts': 41, 'pickup': 21}Failed

SHA-256 / 4396958fbfb6bd0be63913b57a0ffabb8d2a103fb4c9f04709f087738b932202

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(foot_circ, sts_per_10cm, neg_ease_pct, multiple):
    raw = Fraction(str(foot_circ)) * (1 - Fraction(str(neg_ease_pct)) / 100) * Fraction(sts_per_10cm) / 10
    cast = multiple * math.floor(raw / multiple + Fraction(1, 2))
    heel = (cast + 1) // 2
    flap = heel
    pickup = flap // 2 + 1
    return {'cast_on': cast, 'heel_sts': heel, 'flap_rows': flap, 'pickup': pickup}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['regression: heel flap share', [21.5, '28', 12.5, 1],
   {'cast_on': 53, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}],
  ['repair check: heel flap share', [24, '36', 0, 3],
   {'cast_on': 87, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}],
  ['generated control 1', [23, '30', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 2', [20, '36', 5, 2], {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 3', [23, '36', 0, 1], {'cast_on': 83, 'flap_rows': 41, 'heel_sts': 41, 'pickup': 21}]],
 [['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['regression: heel flap share', [23, '36', 10, 1],
   {'cast_on': 75, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}],
  ['repair check: heel flap share', [24, '28', 5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['generated control 1', [25.5, '28', 0, 2], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [22, '32', 0, 2], {'cast_on': 70, 'flap_rows': 35, 'heel_sts': 35, 'pickup': 18}],
  ['generated control 3', [21.5, '32', 5, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}]],
 [['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['regression: heel flap share', [20, '36', 0, 4],
   {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['repair check: heel flap share', [21.5, '30', 0, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 1', [25.5, '28', 5, 2], {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 2', [23, '28', 5, 3], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 3', [22, '36', 5, 4], {'cast_on': 76, 'flap_rows': 38, 'heel_sts': 38, 'pickup': 20}]],
 [['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['regression: heel flap share', [22, '32', 0, 4],
   {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['repair check: heel flap share', [20, '30', 5, 1],
   {'cast_on': 57, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 1', [21.5, '28', 0, 2], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 2', [21.5, '36', 12.5, 4],
   {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 3', [24, '32', 12.5, 3],
   {'cast_on': 66, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}]],
 [['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['regression: heel flap share', [22, '32', 10, 1],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['repair check: heel flap share', [21.5, '36', 12.5, 3],
   {'cast_on': 69, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 1', [24, '30', 0, 2], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [22, '30', 10, 4], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 3', [22, '36', 5, 1], {'cast_on': 75, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}]]]
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 fixtureActualExpectedOutcome
standard sock{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Passed
no ease{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}Passed
wide foot{'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}{'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}Passed
regression: heel flap share{'cast_on': 53, 'flap_rows': 27, 'heel_sts': 27, 'pickup': 14}{'cast_on': 53, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}Failed
repair check: heel flap share{'cast_on': 87, 'flap_rows': 44, 'heel_sts': 44, 'pickup': 23}{'cast_on': 87, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}Failed
generated control 1{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Passed
generated control 2{'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}{'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}Passed
generated control 3{'cast_on': 83, 'flap_rows': 42, 'heel_sts': 42, 'pickup': 22}{'cast_on': 83, 'flap_rows': 41, 'heel_sts': 41, 'pickup': 21}Failed

SHA-256 / 83b0f26439a56743f9a1c83d1ebdb79e5d021d94715e2a62bd17e3bef11a3ad3

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(foot_circ, sts_per_10cm, neg_ease_pct, multiple):
    raw = Fraction(str(foot_circ)) * (1 - Fraction(str(neg_ease_pct)) / 100) * Fraction(sts_per_10cm) / 10
    cast = multiple * math.floor(raw / multiple + Fraction(1, 2))
    heel = cast // 2
    flap = heel
    pickup = flap // 2 + 1
    return {'cast_on': cast, 'heel_sts': heel, 'flap_rows': flap, 'pickup': pickup}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['regression: heel flap share', [21.5, '28', 12.5, 1],
   {'cast_on': 53, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}],
  ['repair check: heel flap share', [24, '36', 0, 3],
   {'cast_on': 87, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}],
  ['generated control 1', [23, '30', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 2', [20, '36', 5, 2], {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 3', [23, '36', 0, 1], {'cast_on': 83, 'flap_rows': 41, 'heel_sts': 41, 'pickup': 21}]],
 [['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['regression: heel flap share', [23, '36', 10, 1],
   {'cast_on': 75, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}],
  ['repair check: heel flap share', [24, '28', 5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['generated control 1', [25.5, '28', 0, 2], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [22, '32', 0, 2], {'cast_on': 70, 'flap_rows': 35, 'heel_sts': 35, 'pickup': 18}],
  ['generated control 3', [21.5, '32', 5, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}]],
 [['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['regression: heel flap share', [20, '36', 0, 4],
   {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['repair check: heel flap share', [21.5, '30', 0, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 1', [25.5, '28', 5, 2], {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 2', [23, '28', 5, 3], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 3', [22, '36', 5, 4], {'cast_on': 76, 'flap_rows': 38, 'heel_sts': 38, 'pickup': 20}]],
 [['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['regression: heel flap share', [22, '32', 0, 4],
   {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['repair check: heel flap share', [20, '30', 5, 1],
   {'cast_on': 57, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 1', [21.5, '28', 0, 2], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 2', [21.5, '36', 12.5, 4],
   {'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 3', [24, '32', 12.5, 3],
   {'cast_on': 66, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}]],
 [['no ease', [20, '28', 0, 2], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['wide foot', [25.5, '36', 12.5, 4], {'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}],
  ['standard sock', [22, '32', 10, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['regression: heel flap share', [22, '32', 10, 1],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['repair check: heel flap share', [21.5, '36', 12.5, 3],
   {'cast_on': 69, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}],
  ['generated control 1', [24, '30', 0, 2], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [22, '30', 10, 4], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 3', [22, '36', 5, 1], {'cast_on': 75, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}]]]
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 fixtureActualExpectedOutcome
standard sock{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Passed
no ease{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}Passed
wide foot{'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}{'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}Passed
regression: heel flap share{'cast_on': 53, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}{'cast_on': 53, 'flap_rows': 26, 'heel_sts': 26, 'pickup': 14}Passed
repair check: heel flap share{'cast_on': 87, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}{'cast_on': 87, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}Passed
generated control 1{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Passed
generated control 2{'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}{'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}Passed
generated control 3{'cast_on': 83, 'flap_rows': 41, 'heel_sts': 41, 'pickup': 21}{'cast_on': 83, 'flap_rows': 41, 'heel_sts': 41, 'pickup': 21}Passed

SHA-256 / 5be07a6a7d9ae857db990e149563546784f0f357f4e1998aa0787043a84dc0d6

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:36.009383+00:00.

Case digest / 7a0f9ccb6947021689afd0848c98806034e4c10e01308ae89d3b94f5e8fb3a67