FA-97696 / Knitting and sewing pattern grading / Open access
Full and small bust adjustment: cup banding · case 01
A 4 cm difference is called a B cup instead of an A cup.
ROOT CAUSE
The cup index rounds to nearest instead of flooring.
VERIFIED REPAIR
Floor the difference into 2.5 cm cup bands.
Unsuccessful approach: Ceiling moves every partial band up a cup.
Case contract
d = full - high bust (cm); negative -> "error: measurements". Cup index = floor(d/2.5) capped at the last of AA, A, B, C, D, DD, E. delta = index - index(drafted_cup). kind "none", "FBA" (delta > 0) or "SBA". Total adjustment 2.5 cm per cup, per side = total/2; if per side > 4 cm append " (redraft)". Return [cup, kind, per_side float].
Why this case matters
Sewists compare their cup size to the pattern draft cup and perform full or small bust adjustments.
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(high_bust, full_bust, drafted_cup):
CUPS = ['AA', 'A', 'B', 'C', 'D', 'DD', 'E']
d = Fraction(str(full_bust)) - Fraction(str(high_bust))
if d < 0:
return 'error: measurements'
idx = min(math.floor(d / Fraction(5, 2) + Fraction(1, 2)), len(CUPS) - 1)
cup = CUPS[idx]
delta = idx - CUPS.index(drafted_cup)
total = Fraction(5, 2) * abs(delta)
per = total / 2
kind = 'none' if delta == 0 else 'FBA' if delta > 0 else 'SBA'
if per > 4:
kind += ' (redraft)'
return [cup, kind, float(per)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['regression: cup banding', [92.5, 96.5, 'A'], ['A', 'none', 0.0]],
['repair check: cup banding', [92.5, 96.5, 'D'], ['A', 'SBA', 3.75]],
['generated control 1', [96, 106, 'D'], ['D', 'none', 0.0]],
['generated control 2', [96, 103.5, 'D'], ['C', 'SBA', 1.25]],
['generated control 3', [84, 89, 'C'], ['B', 'SBA', 1.25]]],
[['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['negative difference', [90, 89, 'B'], 'error: measurements'],
['regression: cup banding', [96, 105, 'B'], ['C', 'FBA', 1.25]],
['repair check: cup banding', [92.5, 93.5, 'A'], ['AA', 'SBA', 1.25]],
['generated control 1', [92.5, 112.5, 'D'], ['E', 'FBA', 2.5]],
['generated control 2', [80, 81, 'D'], ['AA', 'SBA (redraft)', 5.0]],
['generated control 3', [88, 89, 'C'], ['AA', 'SBA', 3.75]]],
[['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['negative difference', [90, 89, 'B'], 'error: measurements'],
['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['regression: cup banding', [88, 97, 'A'], ['C', 'FBA', 2.5]],
['repair check: cup banding', [84, 88, 'A'], ['A', 'none', 0.0]],
['generated control 1', [96, 106, 'D'], ['D', 'none', 0.0]],
['generated control 2', [92.5, 112.5, 'C'], ['E', 'FBA', 3.75]],
['generated control 3', [96, 103.5, 'B'], ['C', 'FBA', 1.25]]],
[['negative difference', [90, 89, 'B'], 'error: measurements'],
['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['regression: cup banding', [84, 88, 'B'], ['A', 'SBA', 1.25]],
['repair check: cup banding', [88, 89, 'B'], ['AA', 'SBA', 2.5]],
['generated control 1', [92.5, 95.0, 'D'], ['A', 'SBA', 3.75]],
['generated control 2', [92.5, 102.5, 'D'], ['D', 'none', 0.0]],
['generated control 3', [92.5, 110.0, 'B'], ['E', 'FBA (redraft)', 5.0]]],
[['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['regression: cup banding', [96, 105, 'B'], ['C', 'FBA', 1.25]],
['repair check: cup banding', [84, 85, 'A'], ['AA', 'SBA', 1.25]],
['generated control 1', [92.5, 100.0, 'A'], ['C', 'FBA', 2.5]],
['generated control 2', [80, 80, 'A'], ['AA', 'SBA', 1.25]],
['generated control 3', [84, 84, 'B'], ['AA', 'SBA', 2.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| matches draft | ['B', 'none', 0.0] | ['B', 'none', 0.0] | Passed |
| big FBA | ['E', 'FBA (redraft)', 5.0] | ['E', 'FBA (redraft)', 5.0] | Passed |
| small bust | ['A', 'SBA', 2.5] | ['AA', 'SBA', 3.75] | Failed |
| regression: cup banding | ['B', 'FBA', 1.25] | ['A', 'none', 0.0] | Failed |
| repair check: cup banding | ['B', 'SBA', 2.5] | ['A', 'SBA', 3.75] | Failed |
| generated control 1 | ['D', 'none', 0.0] | ['D', 'none', 0.0] | Passed |
| generated control 2 | ['C', 'SBA', 1.25] | ['C', 'SBA', 1.25] | Passed |
| generated control 3 | ['B', 'SBA', 1.25] | ['B', 'SBA', 1.25] | Passed |
SHA-256 / 7eb7051e3c557e5d20bff8f9e4e661b34fb0aeb08beb005f505f6f01977c6c2e
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(high_bust, full_bust, drafted_cup):
CUPS = ['AA', 'A', 'B', 'C', 'D', 'DD', 'E']
d = Fraction(str(full_bust)) - Fraction(str(high_bust))
if d < 0:
return 'error: measurements'
idx = min(math.ceil(d / Fraction(5, 2)), len(CUPS) - 1)
cup = CUPS[idx]
delta = idx - CUPS.index(drafted_cup)
total = Fraction(5, 2) * abs(delta)
per = total / 2
kind = 'none' if delta == 0 else 'FBA' if delta > 0 else 'SBA'
if per > 4:
kind += ' (redraft)'
return [cup, kind, float(per)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['regression: cup banding', [92.5, 96.5, 'A'], ['A', 'none', 0.0]],
['repair check: cup banding', [92.5, 96.5, 'D'], ['A', 'SBA', 3.75]],
['generated control 1', [96, 106, 'D'], ['D', 'none', 0.0]],
['generated control 2', [96, 103.5, 'D'], ['C', 'SBA', 1.25]],
['generated control 3', [84, 89, 'C'], ['B', 'SBA', 1.25]]],
[['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['negative difference', [90, 89, 'B'], 'error: measurements'],
['regression: cup banding', [96, 105, 'B'], ['C', 'FBA', 1.25]],
['repair check: cup banding', [92.5, 93.5, 'A'], ['AA', 'SBA', 1.25]],
['generated control 1', [92.5, 112.5, 'D'], ['E', 'FBA', 2.5]],
['generated control 2', [80, 81, 'D'], ['AA', 'SBA (redraft)', 5.0]],
['generated control 3', [88, 89, 'C'], ['AA', 'SBA', 3.75]]],
[['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['negative difference', [90, 89, 'B'], 'error: measurements'],
['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['regression: cup banding', [88, 97, 'A'], ['C', 'FBA', 2.5]],
['repair check: cup banding', [84, 88, 'A'], ['A', 'none', 0.0]],
['generated control 1', [96, 106, 'D'], ['D', 'none', 0.0]],
['generated control 2', [92.5, 112.5, 'C'], ['E', 'FBA', 3.75]],
['generated control 3', [96, 103.5, 'B'], ['C', 'FBA', 1.25]]],
[['negative difference', [90, 89, 'B'], 'error: measurements'],
['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['regression: cup banding', [84, 88, 'B'], ['A', 'SBA', 1.25]],
['repair check: cup banding', [88, 89, 'B'], ['AA', 'SBA', 2.5]],
['generated control 1', [92.5, 95.0, 'D'], ['A', 'SBA', 3.75]],
['generated control 2', [92.5, 102.5, 'D'], ['D', 'none', 0.0]],
['generated control 3', [92.5, 110.0, 'B'], ['E', 'FBA (redraft)', 5.0]]],
[['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['regression: cup banding', [96, 105, 'B'], ['C', 'FBA', 1.25]],
['repair check: cup banding', [84, 85, 'A'], ['AA', 'SBA', 1.25]],
['generated control 1', [92.5, 100.0, 'A'], ['C', 'FBA', 2.5]],
['generated control 2', [80, 80, 'A'], ['AA', 'SBA', 1.25]],
['generated control 3', [84, 84, 'B'], ['AA', 'SBA', 2.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| matches draft | ['B', 'none', 0.0] | ['B', 'none', 0.0] | Passed |
| big FBA | ['E', 'FBA (redraft)', 5.0] | ['E', 'FBA (redraft)', 5.0] | Passed |
| small bust | ['A', 'SBA', 2.5] | ['AA', 'SBA', 3.75] | Failed |
| regression: cup banding | ['B', 'FBA', 1.25] | ['A', 'none', 0.0] | Failed |
| repair check: cup banding | ['B', 'SBA', 2.5] | ['A', 'SBA', 3.75] | Failed |
| generated control 1 | ['D', 'none', 0.0] | ['D', 'none', 0.0] | Passed |
| generated control 2 | ['C', 'SBA', 1.25] | ['C', 'SBA', 1.25] | Passed |
| generated control 3 | ['B', 'SBA', 1.25] | ['B', 'SBA', 1.25] | Passed |
SHA-256 / 9bfebd87c57eaaf9f44d7ccca3990419f822a2ef99b9391571afcb34b5d5e1d1
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(high_bust, full_bust, drafted_cup):
CUPS = ['AA', 'A', 'B', 'C', 'D', 'DD', 'E']
d = Fraction(str(full_bust)) - Fraction(str(high_bust))
if d < 0:
return 'error: measurements'
idx = min(math.floor(d / Fraction(5, 2)), len(CUPS) - 1)
cup = CUPS[idx]
delta = idx - CUPS.index(drafted_cup)
total = Fraction(5, 2) * abs(delta)
per = total / 2
kind = 'none' if delta == 0 else 'FBA' if delta > 0 else 'SBA'
if per > 4:
kind += ' (redraft)'
return [cup, kind, float(per)]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['regression: cup banding', [92.5, 96.5, 'A'], ['A', 'none', 0.0]],
['repair check: cup banding', [92.5, 96.5, 'D'], ['A', 'SBA', 3.75]],
['generated control 1', [96, 106, 'D'], ['D', 'none', 0.0]],
['generated control 2', [96, 103.5, 'D'], ['C', 'SBA', 1.25]],
['generated control 3', [84, 89, 'C'], ['B', 'SBA', 1.25]]],
[['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['negative difference', [90, 89, 'B'], 'error: measurements'],
['regression: cup banding', [96, 105, 'B'], ['C', 'FBA', 1.25]],
['repair check: cup banding', [92.5, 93.5, 'A'], ['AA', 'SBA', 1.25]],
['generated control 1', [92.5, 112.5, 'D'], ['E', 'FBA', 2.5]],
['generated control 2', [80, 81, 'D'], ['AA', 'SBA (redraft)', 5.0]],
['generated control 3', [88, 89, 'C'], ['AA', 'SBA', 3.75]]],
[['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['negative difference', [90, 89, 'B'], 'error: measurements'],
['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['regression: cup banding', [88, 97, 'A'], ['C', 'FBA', 2.5]],
['repair check: cup banding', [84, 88, 'A'], ['A', 'none', 0.0]],
['generated control 1', [96, 106, 'D'], ['D', 'none', 0.0]],
['generated control 2', [92.5, 112.5, 'C'], ['E', 'FBA', 3.75]],
['generated control 3', [96, 103.5, 'B'], ['C', 'FBA', 1.25]]],
[['negative difference', [90, 89, 'B'], 'error: measurements'],
['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['regression: cup banding', [84, 88, 'B'], ['A', 'SBA', 1.25]],
['repair check: cup banding', [88, 89, 'B'], ['AA', 'SBA', 2.5]],
['generated control 1', [92.5, 95.0, 'D'], ['A', 'SBA', 3.75]],
['generated control 2', [92.5, 102.5, 'D'], ['D', 'none', 0.0]],
['generated control 3', [92.5, 110.0, 'B'], ['E', 'FBA (redraft)', 5.0]]],
[['matches draft', [88, 93, 'B'], ['B', 'none', 0.0]],
['big FBA', [84, 101, 'B'], ['E', 'FBA (redraft)', 5.0]],
['small bust', [92.5, 94, 'C'], ['AA', 'SBA', 3.75]],
['regression: cup banding', [96, 105, 'B'], ['C', 'FBA', 1.25]],
['repair check: cup banding', [84, 85, 'A'], ['AA', 'SBA', 1.25]],
['generated control 1', [92.5, 100.0, 'A'], ['C', 'FBA', 2.5]],
['generated control 2', [80, 80, 'A'], ['AA', 'SBA', 1.25]],
['generated control 3', [84, 84, 'B'], ['AA', 'SBA', 2.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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| matches draft | ['B', 'none', 0.0] | ['B', 'none', 0.0] | Passed |
| big FBA | ['E', 'FBA (redraft)', 5.0] | ['E', 'FBA (redraft)', 5.0] | Passed |
| small bust | ['AA', 'SBA', 3.75] | ['AA', 'SBA', 3.75] | Passed |
| regression: cup banding | ['A', 'none', 0.0] | ['A', 'none', 0.0] | Passed |
| repair check: cup banding | ['A', 'SBA', 3.75] | ['A', 'SBA', 3.75] | Passed |
| generated control 1 | ['D', 'none', 0.0] | ['D', 'none', 0.0] | Passed |
| generated control 2 | ['C', 'SBA', 1.25] | ['C', 'SBA', 1.25] | Passed |
| generated control 3 | ['B', 'SBA', 1.25] | ['B', 'SBA', 1.25] | Passed |
SHA-256 / 718986fb7abf4c66a52de37092b21e419008904c837e827e10a5968eedc16b0d
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:34.678977+00:00.
Case digest / 79e074fb206e0ea908b3391e0df50c81b5f78d43dfa802695e432a15a2d1029e