FAILURE MAP
← Case archive

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

Sewing pattern grade rule stepper: quarter panel split · case 01

Each quarter panel receives half the circumference.

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

ROOT CAUSE

The circumference is split in two instead of across four quarter panels.

THE FAILURE

The circumference is split in two instead of across four quarter panels.

Unsuccessful approach: Quartering only the grade change reports the per-panel increment, not the panel measurement.

Case contract

Sizes 6..22 in steps of 2 (others -> "error: size"). Grading one size step between sizes s and s+2 changes the circumference by `small` cm if the lower size s < brk, else `large`. Going down subtracts the same step amounts. Return [circumference, per quarter-panel = circumference/4], both half-up to 0.1.

Why this case matters

Sewing pattern grading applies different increments above a size break and distributes them across front and back pieces.

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(base_size, target_size, base_cm, small, large, brk):
    SIZES = [6, 8, 10, 12, 14, 16, 18, 20, 22]
    if base_size not in SIZES or target_size not in SIZES:
        return 'error: size'
    i, j = SIZES.index(base_size), SIZES.index(target_size)
    m = Fraction(str(base_cm))
    step = 1 if j > i else -1
    k = i
    while k != j:
        lo = min(k, k + step)
        inc = small if SIZES[lo] < brk else large
        m += step * inc
        k += step
    q = m / 2
    return [math.floor(m * 10 + Fraction(1, 2)) / 10, math.floor(q * 10 + Fraction(1, 2)) / 10]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['regression: quarter panel split', [10, 10, '100', 4, 6, 14], [100.0, 25.0]],
  ['repair check: quarter panel split', [8, 16, '100', 5, 7, 16], [120.0, 30.0]],
  ['generated control 1', [14, 24, '88', 4, 6, 18], 'error: size'],
  ['generated control 2', [8, 22, '100', 5, 6, 18], [137.0, 34.3]],
  ['generated control 3', [10, 10, '88', 4, 6, 14], [88.0, 22.0]]],
 [['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['unknown size', [12, 24, '92', 5, 6, 16], 'error: size'],
  ['regression: quarter panel split', [10, 12, '100', 4, 7, 16], [104.0, 26.0]],
  ['repair check: quarter panel split', [16, 6, '100', 4, 6, 12], [76.0, 19.0]],
  ['generated control 1', [20, 24, '92.5', 5, 7, 16], 'error: size'],
  ['generated control 2', [22, 20, '96', 5, 7, 12], [89.0, 22.3]],
  ['generated control 3', [18, 22, '88', 4, 7, 16], [102.0, 25.5]]],
 [['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['unknown size', [12, 24, '92', 5, 6, 16], 'error: size'],
  ['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['regression: quarter panel split', [18, 22, '100', 5, 7, 18], [114.0, 28.5]],
  ['repair check: quarter panel split', [14, 22, '92.5', 5, 6, 18], [114.5, 28.6]],
  ['generated control 1', [10, 12, '96', 5, 6, 12], [101.0, 25.3]],
  ['generated control 2', [14, 16, '96', 4, 7, 12], [103.0, 25.8]],
  ['generated control 3', [10, 6, '100', 5, 6, 14], [90.0, 22.5]]],
 [['unknown size', [12, 24, '92', 5, 6, 16], 'error: size'],
  ['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['regression: quarter panel split', [6, 8, '88', 4, 6, 18], [92.0, 23.0]],
  ['repair check: quarter panel split', [22, 16, '100', 5, 6, 12], [82.0, 20.5]],
  ['generated control 1', [14, 16, '96', 5, 7, 18], [101.0, 25.3]],
  ['generated control 2', [6, 6, '88', 4, 7, 18], [88.0, 22.0]],
  ['generated control 3', [14, 22, '88', 4, 6, 16], [110.0, 27.5]]],
 [['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['regression: quarter panel split', [20, 10, '100', 4, 7, 18], [77.0, 19.3]],
  ['repair check: quarter panel split', [12, 10, '92.5', 4, 6, 18], [88.5, 22.1]],
  ['generated control 1', [22, 14, '88', 5, 7, 14], [60.0, 15.0]],
  ['generated control 2', [6, 22, '88', 4, 7, 18], [126.0, 31.5]],
  ['generated control 3', [22, 16, '88', 5, 6, 16], [70.0, 17.5]]]]
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
same size[92.5, 46.3][92.5, 23.1]Failed
across the break[113.0, 56.5][113.0, 28.3]Failed
down across the break[93.0, 46.5][93.0, 23.3]Failed
regression: quarter panel split[100.0, 50.0][100.0, 25.0]Failed
repair check: quarter panel split[120.0, 60.0][120.0, 30.0]Failed
generated control 1error: sizeerror: sizePassed
generated control 2[137.0, 68.5][137.0, 34.3]Failed
generated control 3[88.0, 44.0][88.0, 22.0]Failed

SHA-256 / a361e479eae55ff5c6cade62330038415341959f544798a87b6ecece361e977d

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(base_size, target_size, base_cm, small, large, brk):
    SIZES = [6, 8, 10, 12, 14, 16, 18, 20, 22]
    if base_size not in SIZES or target_size not in SIZES:
        return 'error: size'
    i, j = SIZES.index(base_size), SIZES.index(target_size)
    m = Fraction(str(base_cm))
    step = 1 if j > i else -1
    k = i
    while k != j:
        lo = min(k, k + step)
        inc = small if SIZES[lo] < brk else large
        m += step * inc
        k += step
    q = (m - Fraction(str(base_cm))) / 4
    return [math.floor(m * 10 + Fraction(1, 2)) / 10, math.floor(q * 10 + Fraction(1, 2)) / 10]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['regression: quarter panel split', [10, 10, '100', 4, 6, 14], [100.0, 25.0]],
  ['repair check: quarter panel split', [8, 16, '100', 5, 7, 16], [120.0, 30.0]],
  ['generated control 1', [14, 24, '88', 4, 6, 18], 'error: size'],
  ['generated control 2', [8, 22, '100', 5, 6, 18], [137.0, 34.3]],
  ['generated control 3', [10, 10, '88', 4, 6, 14], [88.0, 22.0]]],
 [['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['unknown size', [12, 24, '92', 5, 6, 16], 'error: size'],
  ['regression: quarter panel split', [10, 12, '100', 4, 7, 16], [104.0, 26.0]],
  ['repair check: quarter panel split', [16, 6, '100', 4, 6, 12], [76.0, 19.0]],
  ['generated control 1', [20, 24, '92.5', 5, 7, 16], 'error: size'],
  ['generated control 2', [22, 20, '96', 5, 7, 12], [89.0, 22.3]],
  ['generated control 3', [18, 22, '88', 4, 7, 16], [102.0, 25.5]]],
 [['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['unknown size', [12, 24, '92', 5, 6, 16], 'error: size'],
  ['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['regression: quarter panel split', [18, 22, '100', 5, 7, 18], [114.0, 28.5]],
  ['repair check: quarter panel split', [14, 22, '92.5', 5, 6, 18], [114.5, 28.6]],
  ['generated control 1', [10, 12, '96', 5, 6, 12], [101.0, 25.3]],
  ['generated control 2', [14, 16, '96', 4, 7, 12], [103.0, 25.8]],
  ['generated control 3', [10, 6, '100', 5, 6, 14], [90.0, 22.5]]],
 [['unknown size', [12, 24, '92', 5, 6, 16], 'error: size'],
  ['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['regression: quarter panel split', [6, 8, '88', 4, 6, 18], [92.0, 23.0]],
  ['repair check: quarter panel split', [22, 16, '100', 5, 6, 12], [82.0, 20.5]],
  ['generated control 1', [14, 16, '96', 5, 7, 18], [101.0, 25.3]],
  ['generated control 2', [6, 6, '88', 4, 7, 18], [88.0, 22.0]],
  ['generated control 3', [14, 22, '88', 4, 6, 16], [110.0, 27.5]]],
 [['same size', [12, 12, '92.5', 5, 6, 16], [92.5, 23.1]],
  ['across the break', [14, 20, '96', 5, 6, 16], [113.0, 28.3]],
  ['down across the break', [20, 14, '110', 5, 6, 16], [93.0, 23.3]],
  ['regression: quarter panel split', [20, 10, '100', 4, 7, 18], [77.0, 19.3]],
  ['repair check: quarter panel split', [12, 10, '92.5', 4, 6, 18], [88.5, 22.1]],
  ['generated control 1', [22, 14, '88', 5, 7, 14], [60.0, 15.0]],
  ['generated control 2', [6, 22, '88', 4, 7, 18], [126.0, 31.5]],
  ['generated control 3', [22, 16, '88', 5, 6, 16], [70.0, 17.5]]]]
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
same size[92.5, 0.0][92.5, 23.1]Failed
across the break[113.0, 4.3][113.0, 28.3]Failed
down across the break[93.0, -4.2][93.0, 23.3]Failed
regression: quarter panel split[100.0, 0.0][100.0, 25.0]Failed
repair check: quarter panel split[120.0, 5.0][120.0, 30.0]Failed
generated control 1error: sizeerror: sizePassed
generated control 2[137.0, 9.3][137.0, 34.3]Failed
generated control 3[88.0, 0.0][88.0, 22.0]Failed

SHA-256 / 9dac154599c24037b0edf5ecf15683cc3d6b0430de004d9b6785e211d389d748

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

Case digest / 6af58960e0dee2d5ac76ac8bfbfd5e6f64be1c9852535a729b4ec19aab70f5e7