{"abstract":"A 50 cm panel at 20 stitches per 10 cm asks for 1000 stitches.","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.","contract_signature":"width_cm, sts_per_10cm, repeat, edge, ease_cm","evaluation_group":"w2-knitting_and_sewing_pattern_grading-gauge-cast-on","failed_approach":"Dividing width by gauge inverts the relationship and gives centimetres per stitch.","family":"w2-knitting_and_sewing_pattern_grading-gauge-cast-on-gauge-per-10-cm","id":"FA-97346","implementations":{"attempt":{"sha256":"0e1d01a00cb470033e4e4c7eda69dee004350b61ae65a8fbf23f27ed8d4bc5e5","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: gauge per 10 cm', [40, '18', 1, 3, 7.5], [92, 47.8]],\n  ['repair check: gauge per 10 cm', [3, '22', 4, 0, 5], [16, 7.3]],\n  ['generated control 1', [8, '22', 12, 0, -5], [12, 5.5]],\n  ['generated control 2', [3, '16', 12, 0, -2], [12, 7.5]],\n  ['generated control 3', [45, '24', 2, 0, -5], [96, 40.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: gauge per 10 cm', [30, '27.5', 8, 1, 7.5], [106, 37.8]],\n  ['repair check: gauge per 10 cm', [52.5, '16', 8, 0, -5], [80, 50.0]],\n  ['generated control 1', [50, '22', 2, 0, -2], [106, 48.2]],\n  ['generated control 2', [30, '22', 6, 2, 5], [82, 35.5]],\n  ['generated control 3', [40, '20', 4, 0, -5], [72, 36.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: gauge per 10 cm', [3, '24', 4, 3, 0], [14, 3.3]],\n  ['repair check: gauge per 10 cm', [45, '27.5', 1, 2, 10], [155, 54.9]],\n  ['generated control 1', [40, '18', 6, 2, -5], [70, 36.7]],\n  ['generated control 2', [45, '24', 6, 0, 10], [132, 55.0]],\n  ['generated control 3', [52.5, '16', 1, 1, 7.5], [98, 60.0]]],\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: gauge per 10 cm', [52.5, '22', 6, 2, 7.5], [136, 60.0]],\n  ['repair check: gauge per 10 cm', [45, '16', 12, 3, -2], [78, 45.0]],\n  ['generated control 1', [50, '16', 4, 1, -5], [74, 45.0]],\n  ['generated control 2', [3, '18', 2, 1, -2], [4, 1.1]],\n  ['generated control 3', [30, '27.5', 4, 2, 5], [100, 34.9]]],\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: gauge per 10 cm', [3, '27.5', 4, 1, 10], [38, 13.1]],\n  ['repair check: gauge per 10 cm', [50, '20', 1, 2, 0], [104, 50.0]],\n  ['generated control 1', [45, '18', 4, 2, 7.5], [100, 53.3]],\n  ['generated control 2', [3, '22', 1, 0, 7.5], [23, 10.5]],\n  ['generated control 3', [8, '18', 2, 2, -5], [10, 3.3]]]]\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":"3175a975ebe170913596f1a0d2faba774b124c963bca97c2a0197824a2bf8869","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\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: gauge per 10 cm', [40, '18', 1, 3, 7.5], [92, 47.8]],\n  ['repair check: gauge per 10 cm', [3, '22', 4, 0, 5], [16, 7.3]],\n  ['generated control 1', [8, '22', 12, 0, -5], [12, 5.5]],\n  ['generated control 2', [3, '16', 12, 0, -2], [12, 7.5]],\n  ['generated control 3', [45, '24', 2, 0, -5], [96, 40.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: gauge per 10 cm', [30, '27.5', 8, 1, 7.5], [106, 37.8]],\n  ['repair check: gauge per 10 cm', [52.5, '16', 8, 0, -5], [80, 50.0]],\n  ['generated control 1', [50, '22', 2, 0, -2], [106, 48.2]],\n  ['generated control 2', [30, '22', 6, 2, 5], [82, 35.5]],\n  ['generated control 3', [40, '20', 4, 0, -5], [72, 36.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: gauge per 10 cm', [3, '24', 4, 3, 0], [14, 3.3]],\n  ['repair check: gauge per 10 cm', [45, '27.5', 1, 2, 10], [155, 54.9]],\n  ['generated control 1', [40, '18', 6, 2, -5], [70, 36.7]],\n  ['generated control 2', [45, '24', 6, 0, 10], [132, 55.0]],\n  ['generated control 3', [52.5, '16', 1, 1, 7.5], [98, 60.0]]],\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: gauge per 10 cm', [52.5, '22', 6, 2, 7.5], [136, 60.0]],\n  ['repair check: gauge per 10 cm', [45, '16', 12, 3, -2], [78, 45.0]],\n  ['generated control 1', [50, '16', 4, 1, -5], [74, 45.0]],\n  ['generated control 2', [3, '18', 2, 1, -2], [4, 1.1]],\n  ['generated control 3', [30, '27.5', 4, 2, 5], [100, 34.9]]],\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: gauge per 10 cm', [3, '27.5', 4, 1, 10], [38, 13.1]],\n  ['repair check: gauge per 10 cm', [50, '20', 1, 2, 0], [104, 50.0]],\n  ['generated control 1', [45, '18', 4, 2, 7.5], [100, 53.3]],\n  ['generated control 2', [3, '22', 1, 0, 7.5], [23, 10.5]],\n  ['generated control 3', [8, '18', 2, 2, -5], [10, 3.3]]]]\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-gauge-per-10-cm","generated_at":"2026-09-29T14:52:31.272752+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.","root_cause":"The per-10 cm gauge is used as a per-centimetre gauge.","sha256":"ece2cc4d0b6868c5c9157e6bcca2d2803f5acb9657138125a4d041e9d7cfc737","title":"Gauge-based cast-on calculator: gauge per 10 cm · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.389,"exit_code":1,"observations":[{"actual":[25,12.5],"check":"plain stockinette","expected":[100,50.0],"passed":false},{"actual":[26,10.9],"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":[32,14.4],"check":"regression: gauge per 10 cm","expected":[92,47.8],"passed":false},{"actual":[4,1.8],"check":"repair check: gauge per 10 cm","expected":[16,7.3],"passed":false},{"actual":[12,5.5],"check":"generated control 1","expected":[12,5.5],"passed":true},{"actual":[12,7.5],"check":"generated control 2","expected":[12,7.5],"passed":true},{"actual":[16,6.7],"check":"generated control 3","expected":[96,40.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain stockinette\", \"actual\": [25, 12.5], \"expected\": [100, 50.0], \"passed\": false}, {\"check\": \"rib with selvedges\", \"actual\": [26, 10.9], \"expected\": [114, 50.9], \"passed\": false}, {\"check\": \"narrow strap one repeat\", \"actual\": [12, 5.0], \"expected\": [12, 5.0], \"passed\": true}, {\"check\": \"regression: gauge per 10 cm\", \"actual\": [32, 14.4], \"expected\": [92, 47.8], \"passed\": false}, {\"check\": \"repair check: gauge per 10 cm\", \"actual\": [4, 1.8], \"expected\": [16, 7.3], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [12, 5.5], \"expected\": [12, 5.5], \"passed\": true}, {\"check\": \"generated control 2\", \"actual\": [12, 7.5], \"expected\": [12, 7.5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [16, 6.7], \"expected\": [96, 40.0], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":47.846,"exit_code":1,"observations":[{"actual":[1000,500.0],"check":"plain stockinette","expected":[100,50.0],"passed":false},{"actual":[1102,500.0],"check":"rib with selvedges","expected":[114,50.9],"passed":false},{"actual":[52,30.0],"check":"narrow strap one repeat","expected":[12,5.0],"passed":false},{"actual":[861,475.0],"check":"regression: gauge per 10 cm","expected":[92,47.8],"passed":false},{"actual":[176,80.0],"check":"repair check: gauge per 10 cm","expected":[16,7.3],"passed":false},{"actual":[72,32.7],"check":"generated control 1","expected":[12,5.5],"passed":false},{"actual":[12,7.5],"check":"generated control 2","expected":[12,7.5],"passed":true},{"actual":[960,400.0],"check":"generated control 3","expected":[96,40.0],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"plain stockinette\", \"actual\": [1000, 500.0], \"expected\": [100, 50.0], \"passed\": false}, {\"check\": \"rib with selvedges\", \"actual\": [1102, 500.0], \"expected\": [114, 50.9], \"passed\": false}, {\"check\": \"narrow strap one repeat\", \"actual\": [52, 30.0], \"expected\": [12, 5.0], \"passed\": false}, {\"check\": \"regression: gauge per 10 cm\", \"actual\": [861, 475.0], \"expected\": [92, 47.8], \"passed\": false}, {\"check\": \"repair check: gauge per 10 cm\", \"actual\": [176, 80.0], \"expected\": [16, 7.3], \"passed\": false}, {\"check\": \"generated control 1\", \"actual\": [72, 32.7], \"expected\": [12, 5.5], \"passed\": false}, {\"check\": \"generated control 2\", \"actual\": [12, 7.5], \"expected\": [12, 7.5], \"passed\": true}, {\"check\": \"generated control 3\", \"actual\": [960, 400.0], \"expected\": [96, 40.0], \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}