FAILURE MAP
← Case archive

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

Top-down sock fit calculator: negative ease direction · case 01

Socks come out 10% larger than the foot and sag.

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

ROOT CAUSE

Negative ease is added instead of removed.

VERIFIED REPAIR

Multiply by (1 - ease/100).

Unsuccessful approach: Dividing by 10 applies ten times the ease.

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 // 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: negative ease direction', [20, '28', 12.5, 3],
   {'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}],
  ['repair check: negative ease direction', [24, '28', 12.5, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [25.5, '30', 12.5, 1],
   {'cast_on': 67, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}],
  ['generated control 2', [24, '28', 5, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 3', [22, '28', 10, 4], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}]],
 [['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: negative ease direction', [21.5, '36', 5, 2],
   {'cast_on': 74, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}],
  ['repair check: negative ease direction', [24, '30', 10, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 1', [20, '30', 0, 1], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 2', [23, '32', 12.5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['generated control 3', [25.5, '36', 0, 2],
   {'cast_on': 92, 'flap_rows': 46, 'heel_sts': 46, 'pickup': 24}]],
 [['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: negative ease direction', [24, '30', 10, 2],
   {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['repair check: negative ease direction', [20, '28', 12.5, 4],
   {'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}],
  ['generated control 1', [23, '28', 0, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 2', [23, '28', 12.5, 2],
   {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 3', [20, '30', 5, 4], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}]],
 [['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: negative ease direction', [24, '28', 5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['repair check: negative ease direction', [23, '30', 12.5, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [24, '30', 0, 4], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [24, '30', 12.5, 2],
   {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 3', [23, '28', 0, 3], {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}]],
 [['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: negative ease direction', [20, '30', 10, 1],
   {'cast_on': 54, 'flap_rows': 27, 'heel_sts': 27, 'pickup': 14}],
  ['repair check: negative ease direction', [22, '30', 10, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [23, '36', 5, 1], {'cast_on': 79, 'flap_rows': 39, 'heel_sts': 39, 'pickup': 20}],
  ['generated control 2', [23, '28', 10, 3], {'cast_on': 57, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 3', [21.5, '32', 5, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}]]]
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': 76, 'flap_rows': 38, 'heel_sts': 38, 'pickup': 20}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Failed
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': 104, 'flap_rows': 52, 'heel_sts': 52, 'pickup': 27}{'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}Failed
regression: negative ease direction{'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}{'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}Failed
repair check: negative ease direction{'cast_on': 75, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}{'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}Failed
generated control 1{'cast_on': 86, 'flap_rows': 43, 'heel_sts': 43, 'pickup': 22}{'cast_on': 67, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}Failed
generated control 2{'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Failed
generated control 3{'cast_on': 68, 'flap_rows': 34, 'heel_sts': 34, 'pickup': 18}{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}Failed

SHA-256 / 2d3afaaced0968a94e4c5e24eaad9689e0100b3c37ac82207d63b1e9bbc2e53f

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)) / 10) * 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: negative ease direction', [20, '28', 12.5, 3],
   {'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}],
  ['repair check: negative ease direction', [24, '28', 12.5, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [25.5, '30', 12.5, 1],
   {'cast_on': 67, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}],
  ['generated control 2', [24, '28', 5, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 3', [22, '28', 10, 4], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}]],
 [['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: negative ease direction', [21.5, '36', 5, 2],
   {'cast_on': 74, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}],
  ['repair check: negative ease direction', [24, '30', 10, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 1', [20, '30', 0, 1], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 2', [23, '32', 12.5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['generated control 3', [25.5, '36', 0, 2],
   {'cast_on': 92, 'flap_rows': 46, 'heel_sts': 46, 'pickup': 24}]],
 [['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: negative ease direction', [24, '30', 10, 2],
   {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['repair check: negative ease direction', [20, '28', 12.5, 4],
   {'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}],
  ['generated control 1', [23, '28', 0, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 2', [23, '28', 12.5, 2],
   {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 3', [20, '30', 5, 4], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}]],
 [['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: negative ease direction', [24, '28', 5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['repair check: negative ease direction', [23, '30', 12.5, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [24, '30', 0, 4], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [24, '30', 12.5, 2],
   {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 3', [23, '28', 0, 3], {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}]],
 [['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: negative ease direction', [20, '30', 10, 1],
   {'cast_on': 54, 'flap_rows': 27, 'heel_sts': 27, 'pickup': 14}],
  ['repair check: negative ease direction', [22, '30', 10, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [23, '36', 5, 1], {'cast_on': 79, 'flap_rows': 39, 'heel_sts': 39, 'pickup': 20}],
  ['generated control 2', [23, '28', 10, 3], {'cast_on': 57, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 3', [21.5, '32', 5, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}]]]
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': 0, 'flap_rows': 0, 'heel_sts': 0, 'pickup': 1}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Failed
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': -24, 'flap_rows': -12, 'heel_sts': -12, 'pickup': -5}{'cast_on': 80, 'flap_rows': 40, 'heel_sts': 40, 'pickup': 21}Failed
regression: negative ease direction{'cast_on': -15, 'flap_rows': -8, 'heel_sts': -8, 'pickup': -3}{'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}Failed
repair check: negative ease direction{'cast_on': -18, 'flap_rows': -9, 'heel_sts': -9, 'pickup': -4}{'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}Failed
generated control 1{'cast_on': -19, 'flap_rows': -10, 'heel_sts': -10, 'pickup': -4}{'cast_on': 67, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}Failed
generated control 2{'cast_on': 32, 'flap_rows': 16, 'heel_sts': 16, 'pickup': 9}{'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}Failed
generated control 3{'cast_on': 0, 'flap_rows': 0, 'heel_sts': 0, 'pickup': 1}{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}Failed

SHA-256 / e7ccd8dfe8ff4991eacf656d16e7245b227b0877ca87aa84d1f18cfb2f232a24

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: negative ease direction', [20, '28', 12.5, 3],
   {'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}],
  ['repair check: negative ease direction', [24, '28', 12.5, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [25.5, '30', 12.5, 1],
   {'cast_on': 67, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}],
  ['generated control 2', [24, '28', 5, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 3', [22, '28', 10, 4], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}]],
 [['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: negative ease direction', [21.5, '36', 5, 2],
   {'cast_on': 74, 'flap_rows': 37, 'heel_sts': 37, 'pickup': 19}],
  ['repair check: negative ease direction', [24, '30', 10, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 1', [20, '30', 0, 1], {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 2', [23, '32', 12.5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['generated control 3', [25.5, '36', 0, 2],
   {'cast_on': 92, 'flap_rows': 46, 'heel_sts': 46, 'pickup': 24}]],
 [['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: negative ease direction', [24, '30', 10, 2],
   {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['repair check: negative ease direction', [20, '28', 12.5, 4],
   {'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}],
  ['generated control 1', [23, '28', 0, 4], {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 2', [23, '28', 12.5, 2],
   {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 3', [20, '30', 5, 4], {'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}]],
 [['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: negative ease direction', [24, '28', 5, 3],
   {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}],
  ['repair check: negative ease direction', [23, '30', 12.5, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [24, '30', 0, 4], {'cast_on': 72, 'flap_rows': 36, 'heel_sts': 36, 'pickup': 19}],
  ['generated control 2', [24, '30', 12.5, 2],
   {'cast_on': 64, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}],
  ['generated control 3', [23, '28', 0, 3], {'cast_on': 63, 'flap_rows': 31, 'heel_sts': 31, 'pickup': 16}]],
 [['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: negative ease direction', [20, '30', 10, 1],
   {'cast_on': 54, 'flap_rows': 27, 'heel_sts': 27, 'pickup': 14}],
  ['repair check: negative ease direction', [22, '30', 10, 3],
   {'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}],
  ['generated control 1', [23, '36', 5, 1], {'cast_on': 79, 'flap_rows': 39, 'heel_sts': 39, 'pickup': 20}],
  ['generated control 2', [23, '28', 10, 3], {'cast_on': 57, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}],
  ['generated control 3', [21.5, '32', 5, 1],
   {'cast_on': 65, 'flap_rows': 32, 'heel_sts': 32, 'pickup': 17}]]]
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: negative ease direction{'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}{'cast_on': 48, 'flap_rows': 24, 'heel_sts': 24, 'pickup': 13}Passed
repair check: negative ease direction{'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}{'cast_on': 60, 'flap_rows': 30, 'heel_sts': 30, 'pickup': 16}Passed
generated control 1{'cast_on': 67, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}{'cast_on': 67, 'flap_rows': 33, 'heel_sts': 33, 'pickup': 17}Passed
generated control 2{'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 3{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}{'cast_on': 56, 'flap_rows': 28, 'heel_sts': 28, 'pickup': 15}Passed

SHA-256 / 21499b6bbf28d661a15adf4d403d1ce3ba458e3581831522f8dd996a925ecdba

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

Case digest / 960e90e9a707b7d0d37f6682cfc020c1c30c5349319cf3a8c02b46870af14abf