{"abstract":"A sweater with 10 cm positive ease comes out 10 cm narrower than the body.","category":"Knitting and sewing pattern grading","checks":8,"contract":"Target width = width + ease (ease may be negative). Raw stitches = target * gauge / 10 (gauge per 10 cm). Body stitches = nearest multiple of repeat, half-up in repeat units, at least one repeat. Cast on = body + 2*edge (selvedge each side). Actual body width = body*10/gauge, half-up to 0.1 cm. Non-positive target, gauge or repeat returns an error string.","evaluation_group":"w2-knitting_and_sewing_pattern_grading-gauge-cast-on","failed_approach":"Adding half the ease treats it as per-side ease for a piece that is already one full width.","family":"w2-knitting_and_sewing_pattern_grading-gauge-cast-on-ease-sign","id":"FA-97341","implementations":{"attempt":{"sha256":"72e75a1d288cdfdbd2a5d08aeda22546552a4e0fdd5c90daa1f8689a186e0cda","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(width_cm, sts_per_10cm, repeat, edge, ease_cm):\n    w = Fraction(str(width_cm)) + Fraction(str(ease_cm)) / 2\n    g = Fraction(str(sts_per_10cm))\n    if w <= 0 or g <= 0 or repeat < 1:\n        return 'error: bad measurements'\n    raw = w * g / 10\n    body = repeat * math.floor(raw / repeat + Fraction(1, 2))\n    body = max(repeat, body)\n    total = body + 2 * edge\n    actual = body * 10 / g\n    return [total, math.floor(actual * 10 + Fraction(1, 2)) / 10]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['regression: ease sign', [3, '18', 8, 1, 10], [26, 13.3]],\n  ['repair check: ease sign', [40, '27.5', 2, 3, 7.5], [136, 47.3]],\n  ['generated control 1', [3, '22', 6, 3, 7.5], [30, 10.9]],\n  ['generated control 2', [30, '27.5', 12, 3, 0], [90, 30.5]],\n  ['generated control 3', [52.5, '24', 2, 2, 7.5], [148, 60.0]]],\n [['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['regression: ease sign', [50, '27.5', 8, 2, -5], [124, 43.6]],\n  ['repair check: ease sign', [10, '24', 1, 3, 10], [54, 20.0]],\n  ['generated control 1', [30, '27.5', 12, 2, 0], [88, 30.5]],\n  ['generated control 2', [30, '22', 1, 3, 0], [72, 30.0]],\n  ['generated control 3', [45, '24', 1, 0, -5], [96, 40.0]]],\n [['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['regression: ease sign', [30, '20', 12, 0, 10], [84, 42.0]],\n  ['repair check: ease sign', [10, '22', 8, 3, -5], [14, 3.6]],\n  ['generated control 1', [3, '22', 6, 1, -2], [8, 2.7]],\n  ['generated control 2', [30, '20', 12, 3, 0], [66, 30.0]],\n  ['generated control 3', [50, '27.5', 2, 0, 0], [138, 50.2]]],\n [['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['regression: ease sign', [52.5, '24', 6, 3, 5], [144, 57.5]],\n  ['repair check: ease sign', [50, '16', 12, 0, 10], [96, 60.0]],\n  ['generated control 1', [10, '20', 12, 2, 5], [40, 18.0]],\n  ['generated control 2', [45, '27.5', 6, 2, 10], [154, 54.5]],\n  ['generated control 3', [40, '22', 4, 2, -5], [80, 34.5]]],\n [['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['regression: ease sign', [52.5, '20', 1, 3, -5], [101, 47.5]],\n  ['repair check: ease sign', [50, '20', 6, 3, 7.5], [120, 57.0]],\n  ['generated control 1', [50, '16', 4, 1, -2], [78, 47.5]],\n  ['generated control 2', [8, '24', 12, 3, -5], [18, 5.0]],\n  ['generated control 3', [8, '18', 8, 0, 10], [32, 17.8]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"cc9278efffe6a36f966d59a6e083e2fa598ece4782349d55494fd18363e5b50d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(width_cm, sts_per_10cm, repeat, edge, ease_cm):\n    w = Fraction(str(width_cm)) - Fraction(str(ease_cm))\n    g = Fraction(str(sts_per_10cm))\n    if w <= 0 or g <= 0 or repeat < 1:\n        return 'error: bad measurements'\n    raw = w * g / 10\n    body = repeat * math.floor(raw / repeat + Fraction(1, 2))\n    body = max(repeat, body)\n    total = body + 2 * edge\n    actual = body * 10 / g\n    return [total, math.floor(actual * 10 + Fraction(1, 2)) / 10]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['regression: ease sign', [3, '18', 8, 1, 10], [26, 13.3]],\n  ['repair check: ease sign', [40, '27.5', 2, 3, 7.5], [136, 47.3]],\n  ['generated control 1', [3, '22', 6, 3, 7.5], [30, 10.9]],\n  ['generated control 2', [30, '27.5', 12, 3, 0], [90, 30.5]],\n  ['generated control 3', [52.5, '24', 2, 2, 7.5], [148, 60.0]]],\n [['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['regression: ease sign', [50, '27.5', 8, 2, -5], [124, 43.6]],\n  ['repair check: ease sign', [10, '24', 1, 3, 10], [54, 20.0]],\n  ['generated control 1', [30, '27.5', 12, 2, 0], [88, 30.5]],\n  ['generated control 2', [30, '22', 1, 3, 0], [72, 30.0]],\n  ['generated control 3', [45, '24', 1, 0, -5], [96, 40.0]]],\n [['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['regression: ease sign', [30, '20', 12, 0, 10], [84, 42.0]],\n  ['repair check: ease sign', [10, '22', 8, 3, -5], [14, 3.6]],\n  ['generated control 1', [3, '22', 6, 1, -2], [8, 2.7]],\n  ['generated control 2', [30, '20', 12, 3, 0], [66, 30.0]],\n  ['generated control 3', [50, '27.5', 2, 0, 0], [138, 50.2]]],\n [['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['regression: ease sign', [52.5, '24', 6, 3, 5], [144, 57.5]],\n  ['repair check: ease sign', [50, '16', 12, 0, 10], [96, 60.0]],\n  ['generated control 1', [10, '20', 12, 2, 5], [40, 18.0]],\n  ['generated control 2', [45, '27.5', 6, 2, 10], [154, 54.5]],\n  ['generated control 3', [40, '22', 4, 2, -5], [80, 34.5]]],\n [['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['regression: ease sign', [52.5, '20', 1, 3, -5], [101, 47.5]],\n  ['repair check: ease sign', [50, '20', 6, 3, 7.5], [120, 57.0]],\n  ['generated control 1', [50, '16', 4, 1, -2], [78, 47.5]],\n  ['generated control 2', [8, '24', 12, 3, -5], [18, 5.0]],\n  ['generated control 3', [8, '18', 8, 0, 10], [32, 17.8]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"68ef6a3117055f401f3d944567da55ab04e7a4fd1db719b4eb1893be80df7422","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(width_cm, sts_per_10cm, repeat, edge, ease_cm):\n    w = Fraction(str(width_cm)) + Fraction(str(ease_cm))\n    g = Fraction(str(sts_per_10cm))\n    if w <= 0 or g <= 0 or repeat < 1:\n        return 'error: bad measurements'\n    raw = w * g / 10\n    body = repeat * math.floor(raw / repeat + Fraction(1, 2))\n    body = max(repeat, body)\n    total = body + 2 * edge\n    actual = body * 10 / g\n    return [total, math.floor(actual * 10 + Fraction(1, 2)) / 10]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['regression: ease sign', [3, '18', 8, 1, 10], [26, 13.3]],\n  ['repair check: ease sign', [40, '27.5', 2, 3, 7.5], [136, 47.3]],\n  ['generated control 1', [3, '22', 6, 3, 7.5], [30, 10.9]],\n  ['generated control 2', [30, '27.5', 12, 3, 0], [90, 30.5]],\n  ['generated control 3', [52.5, '24', 2, 2, 7.5], [148, 60.0]]],\n [['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['regression: ease sign', [50, '27.5', 8, 2, -5], [124, 43.6]],\n  ['repair check: ease sign', [10, '24', 1, 3, 10], [54, 20.0]],\n  ['generated control 1', [30, '27.5', 12, 2, 0], [88, 30.5]],\n  ['generated control 2', [30, '22', 1, 3, 0], [72, 30.0]],\n  ['generated control 3', [45, '24', 1, 0, -5], [96, 40.0]]],\n [['narrow strap one repeat', [3, '16', 8, 2, 0], [12, 5.0]],\n  ['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['regression: ease sign', [30, '20', 12, 0, 10], [84, 42.0]],\n  ['repair check: ease sign', [10, '22', 8, 3, -5], [14, 3.6]],\n  ['generated control 1', [3, '22', 6, 1, -2], [8, 2.7]],\n  ['generated control 2', [30, '20', 12, 3, 0], [66, 30.0]],\n  ['generated control 3', [50, '27.5', 2, 0, 0], [138, 50.2]]],\n [['negative ease', [40, '24', 2, 1, -5], [86, 35.0]],\n  ['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['regression: ease sign', [52.5, '24', 6, 3, 5], [144, 57.5]],\n  ['repair check: ease sign', [50, '16', 12, 0, 10], [96, 60.0]],\n  ['generated control 1', [10, '20', 12, 2, 5], [40, 18.0]],\n  ['generated control 2', [45, '27.5', 6, 2, 10], [154, 54.5]],\n  ['generated control 3', [40, '22', 4, 2, -5], [80, 34.5]]],\n [['invalid width', [3, '20', 2, 0, -5], 'error: bad measurements'],\n  ['plain stockinette', [50, '20', 1, 0, 0], [100, 50.0]],\n  ['rib with selvedges', [45, '22', 4, 1, 5], [114, 50.9]],\n  ['regression: ease sign', [52.5, '20', 1, 3, -5], [101, 47.5]],\n  ['repair check: ease sign', [50, '20', 6, 3, 7.5], [120, 57.0]],\n  ['generated control 1', [50, '16', 4, 1, -2], [78, 47.5]],\n  ['generated control 2', [8, '24', 12, 3, -5], [18, 5.0]],\n  ['generated control 3', [8, '18', 8, 0, 10], [32, 17.8]]]]\nfor label, args, expected in fixtures[N - 1]:\n    check(label, solve(*args), expected)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w2-knitting_and_sewing_pattern_grading-gauge-cast-on-ease-sign","generated_at":"2026-09-29T14:52:31.221644+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Knitting patterns and calculators convert a finished measurement and gauge into a stitch count that fits the stitch pattern repeat.","repair":"Add ease (positive or negative) to the body width.","root_cause":"Ease is subtracted from the body measurement instead of added.","sha256":"1f2ce96ed8877b48f763480098c7d915a2b7d1c9b759f9dbcc7e089389792aba","title":"Gauge-based cast-on calculator: ease sign · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":44.418,"exit_code":1,"observations":[{"actual":[100,50.0],"check":"plain stockinette","expected":[100,50.0],"passed":true},{"actual":[106,47.3],"check":"rib with selvedges","expected":[114,50.9],"passed":false},{"actual":[12,5.0],"check":"narrow strap one repeat","expected":[12,5.0],"passed":true},{"actual":[18,8.9],"check":"regression: ease sign","expected":[26,13.3],"passed":false},{"actual":[126,43.6],"check":"repair check: ease sign","expected":[136,47.3],"passed":false},{"actual":[18,5.5],"check":"generated control 1","expected":[30,10.9],"passed":false},{"actual":[90,30.5],"check":"generated control 2","expected":[90,30.5],"passed":true},{"actual":[140,56.7],"check":"generated control 3","expected":[148,60.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain stockinette\", \"actual\": [100, 50.0], \"expected\": [100, 50.0], \"passed\": true}, {\"check\": \"rib with selvedges\", \"actual\": [106, 47.3], \"expected\": [114, 50.9], \"passed\": false}, {\"check\": \"narrow strap one repeat\", \"actual\": [12, 5.0], \"expected\": [12, 5.0], \"passed\": true}, {\"check\": \"regression: ease sign\", \"actual\": [18, 8.9], \"expected\": [26, 13.3], \"passed\": false}, {\"check\": \"repair check: ease sign\", \"actual\": [126, 43.6], \"expected\": [136, 47.3], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [18, 5.5], \"expected\": [30, 10.9], \"passed\": false}, {\"check\": \"generated control 2\", \"actual\": [90, 30.5], \"expected\": [90, 30.5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [140, 56.7], \"expected\": [148, 60.0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.492,"exit_code":1,"observations":[{"actual":[100,50.0],"check":"plain stockinette","expected":[100,50.0],"passed":true},{"actual":[90,40.0],"check":"rib with selvedges","expected":[114,50.9],"passed":false},{"actual":[12,5.0],"check":"narrow strap one repeat","expected":[12,5.0],"passed":true},{"actual":"error: bad measurements","check":"regression: ease sign","expected":[26,13.3],"passed":false},{"actual":[96,32.7],"check":"repair check: ease sign","expected":[136,47.3],"passed":false},{"actual":"error: bad measurements","check":"generated control 1","expected":[30,10.9],"passed":false},{"actual":[90,30.5],"check":"generated control 2","expected":[90,30.5],"passed":true},{"actual":[112,45.0],"check":"generated control 3","expected":[148,60.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain stockinette\", \"actual\": [100, 50.0], \"expected\": [100, 50.0], \"passed\": true}, {\"check\": \"rib with selvedges\", \"actual\": [90, 40.0], \"expected\": [114, 50.9], \"passed\": false}, {\"check\": \"narrow strap one repeat\", \"actual\": [12, 5.0], \"expected\": [12, 5.0], \"passed\": true}, {\"check\": \"regression: ease sign\", \"actual\": \"error: bad measurements\", \"expected\": [26, 13.3], \"passed\": false}, {\"check\": \"repair check: ease sign\", \"actual\": [96, 32.7], \"expected\": [136, 47.3], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": \"error: bad measurements\", \"expected\": [30, 10.9], \"passed\": false}, {\"check\": \"generated control 2\", \"actual\": [90, 30.5], \"expected\": [90, 30.5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [112, 45.0], \"expected\": [148, 60.0], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.233,"exit_code":0,"observations":[{"actual":[100,50.0],"check":"plain stockinette","expected":[100,50.0],"passed":true},{"actual":[114,50.9],"check":"rib with selvedges","expected":[114,50.9],"passed":true},{"actual":[12,5.0],"check":"narrow strap one repeat","expected":[12,5.0],"passed":true},{"actual":[26,13.3],"check":"regression: ease sign","expected":[26,13.3],"passed":true},{"actual":[136,47.3],"check":"repair check: ease sign","expected":[136,47.3],"passed":true},{"actual":[30,10.9],"check":"generated control 1","expected":[30,10.9],"passed":true},{"actual":[90,30.5],"check":"generated control 2","expected":[90,30.5],"passed":true},{"actual":[148,60.0],"check":"generated control 3","expected":[148,60.0],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain stockinette\", \"actual\": [100, 50.0], \"expected\": [100, 50.0], \"passed\": true}, {\"check\": \"rib with selvedges\", \"actual\": [114, 50.9], \"expected\": [114, 50.9], \"passed\": true}, {\"check\": \"narrow strap one repeat\", \"actual\": [12, 5.0], \"expected\": [12, 5.0], \"passed\": true}, {\"check\": \"regression: ease sign\", \"actual\": [26, 13.3], \"expected\": [26, 13.3], \"passed\": true}, {\"check\": \"repair check: ease sign\", \"actual\": [136, 47.3], \"expected\": [136, 47.3], \"passed\": true}, {\"check\": \"generated control 1\", \"actual\": [30, 10.9], \"expected\": [30, 10.9], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [90, 30.5], \"expected\": [90, 30.5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [148, 60.0], \"expected\": [148, 60.0], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}