{"abstract":"Every line measures one space too wide.","category":"Typography line breaking","checks":8,"contract":"Input [words, width]. Glyph widths: i,l,j,.,, 4; t,f 6; m 15; w 14; M 16; W 18; other lowercase 10; other uppercase 13; space 5. Within a word, fi/fl/ff form ligatures (11/11/12) with no kerning into or out of them; case-sensitive kern pairs apply between adjacent glyphs; \"|\" is a non-joiner (invisible, blocks ligatures and kerning). No kerning across spaces. Greedy fill. Return [[text, width]].","evaluation_group":"w2-typography-line-breaking-kern-ligature-measure","failed_approach":"Subtracting two spaces undercounts lines.","family":"w2-typography-line-breaking-kern-ligature-measure-interword-space-count","id":"FA-80171","implementations":{"attempt":{"sha256":"4052ce24748137c132e7569ba2ec7c4ed234341e6bf4ec08f542cce7e04d5a44","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width = x\n    W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}\n    LIG = {'fi': 11, 'fl': 11, 'ff': 12}\n    KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}\n    SPACE = 5\n    def glyph(c):\n        return W.get(c, 13 if c.isupper() else 10)\n    def measure(w):\n        total, prev, i = 0, None, 0\n        while i < len(w):\n            if w[i] == '|':\n                prev = None\n                i += 1\n                continue\n            pair = w[i:i + 2]\n            if pair in LIG:\n                total += LIG[pair]\n                prev = None\n                i += 2\n                continue\n            g = w[i]\n            total += glyph(g)\n            if prev is not None:\n                total += KERN.get(prev + g, 0)\n            prev = g\n            i += 1\n        return total\n    def line_width(ws):\n        return sum(measure(t) for t in ws) + SPACE * max(len(ws) - 2, 0)\n    lines, cur = [], []\n    for w in words:\n        cand = cur + [w]\n        if not cur or line_width(cand) <= width:\n            cur = cand\n        else:\n            lines.append(cur)\n            cur = [w]\n    if cur:\n        lines.append(cur)\n    return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: interword space count', [['av', 'Av', 'Av'], 104], [['av Av Av', 75]]), ('regression: interword space count', [['office', 'wolf|like', 'fl.', 'y.', 'fl.'], 72], [['office', 46], ['wolflike', 62], ['fl. y. fl.', 52]]), ('regression: interword space count', [['staff.', 'Av', 'Av', 'Av', 'LT'], 91], [['staff. Av', 70], ['Av Av LT', 79]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('regression: interword space count', [['fly.', 'Yo'], 126], [['fly. Yo', 49]]), ('regression: interword space count', [['Av', 'av', 'fly.'], 95], [['Av av fly.', 75]])], [('regression: interword space count', [['flow', 'fly.', 'Wavy', 'Ta', 'fly.', 'Vat'], 120], [['flow fly. Wavy', 113], ['Ta fly. Vat', 81]]), ('regression: interword space count', [['staff.', 'LA|VALLE', 'Av', 'Yo'], 106], [['staff.', 42], ['LAVALLE', 88], ['Av Yo', 49]]), ('regression: interword space count', [['Av', 'LA', 'Tofu', 'y.'], 125], [['Av LA Tofu y.', 113]]), ('regression: interword space count', [['fi', 'fi', 'AVAIL', 'Tofu'], 58], [['fi fi', 27], ['AVAIL', 59], ['Tofu', 37]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['wolf|like', 'our', 'wolf|like', 'Yo', 'fly.', 'Tofu'], 41], [['wolflike', 62], ['our', 30], ['wolflike', 62], ['Yo', 21], ['fly.', 23], ['Tofu', 37]]), ('regression: interword space count', [['AT', 'staff.', 'raffle', 'fly.'], 77], [['AT staff.', 73], ['raffle fly.', 74]])], [('regression: interword space count', [['office', 'LT', 'VIA', 'Av', 'dry.'], 77], [['office LT', 74], ['VIA Av', 67], ['dry.', 32]]), ('regression: interword space count', [['Yo', 'AVAIL', 'flow'], 53], [['Yo', 21], ['AVAIL', 59], ['flow', 35]]), ('regression: interword space count', [['fi', 'Vat'], 42], [['fi', 11], ['Vat', 27]]), ('regression: interword space count', [['dry.', 'y.', 'Tofu', 'av', 'av', 'LA', 'Vat'], 46], [['dry.', 32], ['y.', 12], ['Tofu', 37], ['av av', 43], ['LA', 26], ['Vat', 27]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['Ta', 'fi', 'LA|VALLE', 'shelf|life', 'y.', 'Wavy'], 47], [['Ta fi', 37], ['LAVALLE', 88], ['shelflife', 64], ['y.', 12], ['Wavy', 45]]), ('regression: interword space count', [['LT', 'wolf|like'], 126], [['LT wolflike', 90]])], [('regression: interword space count', [['staff.', 'AVAIL', 'LA', 'LA|VALLE'], 42], [['staff.', 42], ['AVAIL', 59], ['LA', 26], ['LAVALLE', 88]]), ('regression: interword space count', [['Tofu', 'fi'], 74], [['Tofu fi', 53]]), ('regression: interword space count', [['LT', 'y.', 'flow', 'dry.'], 58], [['LT y.', 40], ['flow', 35], ['dry.', 32]]), ('regression: interword space count', [['fly.', 'Ta', 'fl.'], 68], [['fly. Ta', 49], ['fl.', 15]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: interword space count', [['Av', 'LA', 'Av', 'LA', 'Av', 'wolf|like'], 128], [['Av LA Av LA', 113], ['Av wolflike', 90]]), ('regression: interword space count', [['Tofu', 'Ta', 'staff.', 'LA|VALLE', 'Vat', 'fi', 'LT'], 88], [['Tofu Ta', 63], ['staff.', 42], ['LAVALLE', 88], ['Vat fi LT', 71]])], [('regression: interword space count', [['av', 'dry.', 'LA|VALLE', 'raffle', 'LA|VALLE', 'av'], 82], [['av dry.', 56], ['LAVALLE', 88], ['raffle', 46], ['LAVALLE', 88], ['av', 19]]), ('regression: interword space count', [['fi', 'dry.', 'fly.', 'flow', 'AT', 'Yo'], 68], [['fi dry.', 48], ['fly. flow', 63], ['AT Yo', 52]]), ('regression: interword space count', [['LT', 'Vat', 'office', 'LA', 'dry.', 'dry.', 'dry.'], 122], [['LT Vat office', 106], ['LA dry. dry.', 100], ['dry.', 32]]), ('regression: interword space count', [['LA', 'office', 'fl.', 'VIA', 'LA'], 96], [['LA office', 77], ['fl. VIA LA', 90]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['staff.', 'y.', 'dry.', 'wolf|like', 'Av'], 136], [['staff. y. dry.', 96], ['wolflike Av', 90]]), ('regression: interword space count', [['our', 'av', 'staff.', 'Av'], 56], [['our av', 54], ['staff.', 42], ['Av', 23]])]]\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":"1e4f97526e7e8af7569126ea7c7afe77fe06db4bf4ccfc5c416e54893cd794e7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width = x\n    W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}\n    LIG = {'fi': 11, 'fl': 11, 'ff': 12}\n    KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}\n    SPACE = 5\n    def glyph(c):\n        return W.get(c, 13 if c.isupper() else 10)\n    def measure(w):\n        total, prev, i = 0, None, 0\n        while i < len(w):\n            if w[i] == '|':\n                prev = None\n                i += 1\n                continue\n            pair = w[i:i + 2]\n            if pair in LIG:\n                total += LIG[pair]\n                prev = None\n                i += 2\n                continue\n            g = w[i]\n            total += glyph(g)\n            if prev is not None:\n                total += KERN.get(prev + g, 0)\n            prev = g\n            i += 1\n        return total\n    def line_width(ws):\n        return sum(measure(t) for t in ws) + SPACE * len(ws)\n    lines, cur = [], []\n    for w in words:\n        cand = cur + [w]\n        if not cur or line_width(cand) <= width:\n            cur = cand\n        else:\n            lines.append(cur)\n            cur = [w]\n    if cur:\n        lines.append(cur)\n    return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: interword space count', [['av', 'Av', 'Av'], 104], [['av Av Av', 75]]), ('regression: interword space count', [['office', 'wolf|like', 'fl.', 'y.', 'fl.'], 72], [['office', 46], ['wolflike', 62], ['fl. y. fl.', 52]]), ('regression: interword space count', [['staff.', 'Av', 'Av', 'Av', 'LT'], 91], [['staff. Av', 70], ['Av Av LT', 79]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('regression: interword space count', [['fly.', 'Yo'], 126], [['fly. Yo', 49]]), ('regression: interword space count', [['Av', 'av', 'fly.'], 95], [['Av av fly.', 75]])], [('regression: interword space count', [['flow', 'fly.', 'Wavy', 'Ta', 'fly.', 'Vat'], 120], [['flow fly. Wavy', 113], ['Ta fly. Vat', 81]]), ('regression: interword space count', [['staff.', 'LA|VALLE', 'Av', 'Yo'], 106], [['staff.', 42], ['LAVALLE', 88], ['Av Yo', 49]]), ('regression: interword space count', [['Av', 'LA', 'Tofu', 'y.'], 125], [['Av LA Tofu y.', 113]]), ('regression: interword space count', [['fi', 'fi', 'AVAIL', 'Tofu'], 58], [['fi fi', 27], ['AVAIL', 59], ['Tofu', 37]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['wolf|like', 'our', 'wolf|like', 'Yo', 'fly.', 'Tofu'], 41], [['wolflike', 62], ['our', 30], ['wolflike', 62], ['Yo', 21], ['fly.', 23], ['Tofu', 37]]), ('regression: interword space count', [['AT', 'staff.', 'raffle', 'fly.'], 77], [['AT staff.', 73], ['raffle fly.', 74]])], [('regression: interword space count', [['office', 'LT', 'VIA', 'Av', 'dry.'], 77], [['office LT', 74], ['VIA Av', 67], ['dry.', 32]]), ('regression: interword space count', [['Yo', 'AVAIL', 'flow'], 53], [['Yo', 21], ['AVAIL', 59], ['flow', 35]]), ('regression: interword space count', [['fi', 'Vat'], 42], [['fi', 11], ['Vat', 27]]), ('regression: interword space count', [['dry.', 'y.', 'Tofu', 'av', 'av', 'LA', 'Vat'], 46], [['dry.', 32], ['y.', 12], ['Tofu', 37], ['av av', 43], ['LA', 26], ['Vat', 27]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['Ta', 'fi', 'LA|VALLE', 'shelf|life', 'y.', 'Wavy'], 47], [['Ta fi', 37], ['LAVALLE', 88], ['shelflife', 64], ['y.', 12], ['Wavy', 45]]), ('regression: interword space count', [['LT', 'wolf|like'], 126], [['LT wolflike', 90]])], [('regression: interword space count', [['staff.', 'AVAIL', 'LA', 'LA|VALLE'], 42], [['staff.', 42], ['AVAIL', 59], ['LA', 26], ['LAVALLE', 88]]), ('regression: interword space count', [['Tofu', 'fi'], 74], [['Tofu fi', 53]]), ('regression: interword space count', [['LT', 'y.', 'flow', 'dry.'], 58], [['LT y.', 40], ['flow', 35], ['dry.', 32]]), ('regression: interword space count', [['fly.', 'Ta', 'fl.'], 68], [['fly. Ta', 49], ['fl.', 15]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: interword space count', [['Av', 'LA', 'Av', 'LA', 'Av', 'wolf|like'], 128], [['Av LA Av LA', 113], ['Av wolflike', 90]]), ('regression: interword space count', [['Tofu', 'Ta', 'staff.', 'LA|VALLE', 'Vat', 'fi', 'LT'], 88], [['Tofu Ta', 63], ['staff.', 42], ['LAVALLE', 88], ['Vat fi LT', 71]])], [('regression: interword space count', [['av', 'dry.', 'LA|VALLE', 'raffle', 'LA|VALLE', 'av'], 82], [['av dry.', 56], ['LAVALLE', 88], ['raffle', 46], ['LAVALLE', 88], ['av', 19]]), ('regression: interword space count', [['fi', 'dry.', 'fly.', 'flow', 'AT', 'Yo'], 68], [['fi dry.', 48], ['fly. flow', 63], ['AT Yo', 52]]), ('regression: interword space count', [['LT', 'Vat', 'office', 'LA', 'dry.', 'dry.', 'dry.'], 122], [['LT Vat office', 106], ['LA dry. dry.', 100], ['dry.', 32]]), ('regression: interword space count', [['LA', 'office', 'fl.', 'VIA', 'LA'], 96], [['LA office', 77], ['fl. VIA LA', 90]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['staff.', 'y.', 'dry.', 'wolf|like', 'Av'], 136], [['staff. y. dry.', 96], ['wolflike Av', 90]]), ('regression: interword space count', [['our', 'av', 'staff.', 'Av'], 56], [['our av', 54], ['staff.', 42], ['Av', 23]])]]\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":"0411e96faffea14d3468660e0874445a2e51b5c5539953d0e77948c7fd739f4a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    words, width = x\n    W = {'i': 4, 'l': 4, 'j': 4, '.': 4, ',': 4, 't': 6, 'f': 6, 'm': 15, 'w': 14, 'M': 16, 'W': 18}\n    LIG = {'fi': 11, 'fl': 11, 'ff': 12}\n    KERN = {'AV': -3, 'VA': -3, 'To': -2, 'Ta': -2, 'Yo': -2, 'LT': -3, 'Wa': -2, 'av': -1, 'va': -1, 'y.': -2, 'r.': -2, 'l.': -1, 'f.': -1, 'Va': -2}\n    SPACE = 5\n    def glyph(c):\n        return W.get(c, 13 if c.isupper() else 10)\n    def measure(w):\n        total, prev, i = 0, None, 0\n        while i < len(w):\n            if w[i] == '|':\n                prev = None\n                i += 1\n                continue\n            pair = w[i:i + 2]\n            if pair in LIG:\n                total += LIG[pair]\n                prev = None\n                i += 2\n                continue\n            g = w[i]\n            total += glyph(g)\n            if prev is not None:\n                total += KERN.get(prev + g, 0)\n            prev = g\n            i += 1\n        return total\n    def line_width(ws):\n        return sum(measure(t) for t in ws) + SPACE * (len(ws) - 1)\n    lines, cur = [], []\n    for w in words:\n        cand = cur + [w]\n        if not cur or line_width(cand) <= width:\n            cur = cand\n        else:\n            lines.append(cur)\n            cur = [w]\n    if cur:\n        lines.append(cur)\n    return [[' '.join(t.replace('|', '') for t in ln), line_width(ln)] for ln in lines]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: interword space count', [['av', 'Av', 'Av'], 104], [['av Av Av', 75]]), ('regression: interword space count', [['office', 'wolf|like', 'fl.', 'y.', 'fl.'], 72], [['office', 46], ['wolflike', 62], ['fl. y. fl.', 52]]), ('regression: interword space count', [['staff.', 'Av', 'Av', 'Av', 'LT'], 91], [['staff. Av', 70], ['Av Av LT', 79]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('regression: interword space count', [['fly.', 'Yo'], 126], [['fly. Yo', 49]]), ('regression: interword space count', [['Av', 'av', 'fly.'], 95], [['Av av fly.', 75]])], [('regression: interword space count', [['flow', 'fly.', 'Wavy', 'Ta', 'fly.', 'Vat'], 120], [['flow fly. Wavy', 113], ['Ta fly. Vat', 81]]), ('regression: interword space count', [['staff.', 'LA|VALLE', 'Av', 'Yo'], 106], [['staff.', 42], ['LAVALLE', 88], ['Av Yo', 49]]), ('regression: interword space count', [['Av', 'LA', 'Tofu', 'y.'], 125], [['Av LA Tofu y.', 113]]), ('regression: interword space count', [['fi', 'fi', 'AVAIL', 'Tofu'], 58], [['fi fi', 27], ['AVAIL', 59], ['Tofu', 37]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['wolf|like', 'our', 'wolf|like', 'Yo', 'fly.', 'Tofu'], 41], [['wolflike', 62], ['our', 30], ['wolflike', 62], ['Yo', 21], ['fly.', 23], ['Tofu', 37]]), ('regression: interword space count', [['AT', 'staff.', 'raffle', 'fly.'], 77], [['AT staff.', 73], ['raffle fly.', 74]])], [('regression: interword space count', [['office', 'LT', 'VIA', 'Av', 'dry.'], 77], [['office LT', 74], ['VIA Av', 67], ['dry.', 32]]), ('regression: interword space count', [['Yo', 'AVAIL', 'flow'], 53], [['Yo', 21], ['AVAIL', 59], ['flow', 35]]), ('regression: interword space count', [['fi', 'Vat'], 42], [['fi', 11], ['Vat', 27]]), ('regression: interword space count', [['dry.', 'y.', 'Tofu', 'av', 'av', 'LA', 'Vat'], 46], [['dry.', 32], ['y.', 12], ['Tofu', 37], ['av av', 43], ['LA', 26], ['Vat', 27]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['Ta', 'fi', 'LA|VALLE', 'shelf|life', 'y.', 'Wavy'], 47], [['Ta fi', 37], ['LAVALLE', 88], ['shelflife', 64], ['y.', 12], ['Wavy', 45]]), ('regression: interword space count', [['LT', 'wolf|like'], 126], [['LT wolflike', 90]])], [('regression: interword space count', [['staff.', 'AVAIL', 'LA', 'LA|VALLE'], 42], [['staff.', 42], ['AVAIL', 59], ['LA', 26], ['LAVALLE', 88]]), ('regression: interword space count', [['Tofu', 'fi'], 74], [['Tofu fi', 53]]), ('regression: interword space count', [['LT', 'y.', 'flow', 'dry.'], 58], [['LT y.', 40], ['flow', 35], ['dry.', 32]]), ('regression: interword space count', [['fly.', 'Ta', 'fl.'], 68], [['fly. Ta', 49], ['fl.', 15]]), ('ligature then period', [['fl.', 'fi,'], 200], [['fl. fi,', 35]]), ('cross-word pair must not kern', [['LA', 'Vat'], 200], [['LA Vat', 58]]), ('regression: interword space count', [['Av', 'LA', 'Av', 'LA', 'Av', 'wolf|like'], 128], [['Av LA Av LA', 113], ['Av wolflike', 90]]), ('regression: interword space count', [['Tofu', 'Ta', 'staff.', 'LA|VALLE', 'Vat', 'fi', 'LT'], 88], [['Tofu Ta', 63], ['staff.', 42], ['LAVALLE', 88], ['Vat fi LT', 71]])], [('regression: interword space count', [['av', 'dry.', 'LA|VALLE', 'raffle', 'LA|VALLE', 'av'], 82], [['av dry.', 56], ['LAVALLE', 88], ['raffle', 46], ['LAVALLE', 88], ['av', 19]]), ('regression: interword space count', [['fi', 'dry.', 'fly.', 'flow', 'AT', 'Yo'], 68], [['fi dry.', 48], ['fly. flow', 63], ['AT Yo', 52]]), ('regression: interword space count', [['LT', 'Vat', 'office', 'LA', 'dry.', 'dry.', 'dry.'], 122], [['LT Vat office', 106], ['LA dry. dry.', 100], ['dry.', 32]]), ('regression: interword space count', [['LA', 'office', 'fl.', 'VIA', 'LA'], 96], [['LA office', 77], ['fl. VIA LA', 90]]), ('case-sensitive pair', [['Av', 'av'], 200], [['Av av', 47]]), ('non-joiner blocks ligature', [['shelf|life'], 200], [['shelflife', 64]]), ('regression: interword space count', [['staff.', 'y.', 'dry.', 'wolf|like', 'Av'], 136], [['staff. y. dry.', 96], ['wolflike Av', 90]]), ('regression: interword space count', [['our', 'av', 'staff.', 'Av'], 56], [['our av', 54], ['staff.', 42], ['Av', 23]])]]\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 typesetting model with integer widths and a stipulated rule set; it does not claim conformance to any engine. 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-typography-line-breaking-kern-ligature-measure-interword-space-count","generated_at":"2026-09-29T14:49:51.508686+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Line breaking decides where paragraphs wrap on screen and in print; a wrong decision point shifts every following line.","repair":"Count len(words) - 1 spaces per line.","root_cause":"Spaces are counted once per word instead of once per gap.","sha256":"9879b381dd5cb7f29858378122b6257ecb2345541beee6f063ea4e68c022a32c","title":"Kerning and ligature line measure: interword space count · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.355,"exit_code":1,"observations":[{"actual":[["LA Vat",53]],"check":"cross-word pair must not kern","expected":[["LA Vat",58]],"passed":false},{"actual":[["av Av Av",70]],"check":"regression: interword space count","expected":[["av Av Av",75]],"passed":false},{"actual":[["office",46],["wolflike",62],["fl. y. fl.",47]],"check":"regression: interword space count","expected":[["office",46],["wolflike",62],["fl. y. fl.",52]],"passed":false},{"actual":[["staff. Av",65],["Av Av LT",74]],"check":"regression: interword space count","expected":[["staff. Av",70],["Av Av LT",79]],"passed":false},{"actual":[["Av av",42]],"check":"case-sensitive pair","expected":[["Av av",47]],"passed":false},{"actual":[["fl. fi,",30]],"check":"ligature then period","expected":[["fl. fi,",35]],"passed":false},{"actual":[["fly. Yo",44]],"check":"regression: interword space count","expected":[["fly. Yo",49]],"passed":false},{"actual":[["Av av fly.",70]],"check":"regression: interword space count","expected":[["Av av fly.",75]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cross-word pair must not kern\", \"actual\": [[\"LA Vat\", 53]], \"expected\": [[\"LA Vat\", 58]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"av Av Av\", 70]], \"expected\": [[\"av Av Av\", 75]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"office\", 46], [\"wolflike\", 62], [\"fl. y. fl.\", 47]], \"expected\": [[\"office\", 46], [\"wolflike\", 62], [\"fl. y. fl.\", 52]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"staff. Av\", 65], [\"Av Av LT\", 74]], \"expected\": [[\"staff. Av\", 70], [\"Av Av LT\", 79]], \"passed\": false}, {\"check\": \"case-sensitive pair\", \"actual\": [[\"Av av\", 42]], \"expected\": [[\"Av av\", 47]], \"passed\": false}, {\"check\": \"ligature then period\", \"actual\": [[\"fl. fi,\", 30]], \"expected\": [[\"fl. fi,\", 35]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"fly. Yo\", 44]], \"expected\": [[\"fly. Yo\", 49]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"Av av fly.\", 70]], \"expected\": [[\"Av av fly.\", 75]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.324,"exit_code":1,"observations":[{"actual":[["LA Vat",63]],"check":"cross-word pair must not kern","expected":[["LA Vat",58]],"passed":false},{"actual":[["av Av Av",80]],"check":"regression: interword space count","expected":[["av Av Av",75]],"passed":false},{"actual":[["office",51],["wolflike",67],["fl. y. fl.",57]],"check":"regression: interword space count","expected":[["office",46],["wolflike",62],["fl. y. fl.",52]],"passed":false},{"actual":[["staff. Av",75],["Av Av LT",84]],"check":"regression: interword space count","expected":[["staff. Av",70],["Av Av LT",79]],"passed":false},{"actual":[["Av av",52]],"check":"case-sensitive pair","expected":[["Av av",47]],"passed":false},{"actual":[["fl. fi,",40]],"check":"ligature then period","expected":[["fl. fi,",35]],"passed":false},{"actual":[["fly. Yo",54]],"check":"regression: interword space count","expected":[["fly. Yo",49]],"passed":false},{"actual":[["Av av fly.",80]],"check":"regression: interword space count","expected":[["Av av fly.",75]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cross-word pair must not kern\", \"actual\": [[\"LA Vat\", 63]], \"expected\": [[\"LA Vat\", 58]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"av Av Av\", 80]], \"expected\": [[\"av Av Av\", 75]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"office\", 51], [\"wolflike\", 67], [\"fl. y. fl.\", 57]], \"expected\": [[\"office\", 46], [\"wolflike\", 62], [\"fl. y. fl.\", 52]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"staff. Av\", 75], [\"Av Av LT\", 84]], \"expected\": [[\"staff. Av\", 70], [\"Av Av LT\", 79]], \"passed\": false}, {\"check\": \"case-sensitive pair\", \"actual\": [[\"Av av\", 52]], \"expected\": [[\"Av av\", 47]], \"passed\": false}, {\"check\": \"ligature then period\", \"actual\": [[\"fl. fi,\", 40]], \"expected\": [[\"fl. fi,\", 35]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"fly. Yo\", 54]], \"expected\": [[\"fly. Yo\", 49]], \"passed\": false}, {\"check\": \"regression: interword space count\", \"actual\": [[\"Av av fly.\", 80]], \"expected\": [[\"Av av fly.\", 75]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.953,"exit_code":0,"observations":[{"actual":[["LA Vat",58]],"check":"cross-word pair must not kern","expected":[["LA Vat",58]],"passed":true},{"actual":[["av Av Av",75]],"check":"regression: interword space count","expected":[["av Av Av",75]],"passed":true},{"actual":[["office",46],["wolflike",62],["fl. y. fl.",52]],"check":"regression: interword space count","expected":[["office",46],["wolflike",62],["fl. y. fl.",52]],"passed":true},{"actual":[["staff. Av",70],["Av Av LT",79]],"check":"regression: interword space count","expected":[["staff. Av",70],["Av Av LT",79]],"passed":true},{"actual":[["Av av",47]],"check":"case-sensitive pair","expected":[["Av av",47]],"passed":true},{"actual":[["fl. fi,",35]],"check":"ligature then period","expected":[["fl. fi,",35]],"passed":true},{"actual":[["fly. Yo",49]],"check":"regression: interword space count","expected":[["fly. Yo",49]],"passed":true},{"actual":[["Av av fly.",75]],"check":"regression: interword space count","expected":[["Av av fly.",75]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cross-word pair must not kern\", \"actual\": [[\"LA Vat\", 58]], \"expected\": [[\"LA Vat\", 58]], \"passed\": true}, {\"check\": \"regression: interword space count\", \"actual\": [[\"av Av Av\", 75]], \"expected\": [[\"av Av Av\", 75]], \"passed\": true}, {\"check\": \"regression: interword space count\", \"actual\": [[\"office\", 46], [\"wolflike\", 62], [\"fl. y. fl.\", 52]], \"expected\": [[\"office\", 46], [\"wolflike\", 62], [\"fl. y. fl.\", 52]], \"passed\": true}, {\"check\": \"regression: interword space count\", \"actual\": [[\"staff. Av\", 70], [\"Av Av LT\", 79]], \"expected\": [[\"staff. Av\", 70], [\"Av Av LT\", 79]], \"passed\": true}, {\"check\": \"case-sensitive pair\", \"actual\": [[\"Av av\", 47]], \"expected\": [[\"Av av\", 47]], \"passed\": true}, {\"check\": \"ligature then period\", \"actual\": [[\"fl. fi,\", 35]], \"expected\": [[\"fl. fi,\", 35]], \"passed\": true}, {\"check\": \"regression: interword space count\", \"actual\": [[\"fly. Yo\", 49]], \"expected\": [[\"fly. Yo\", 49]], \"passed\": true}, {\"check\": \"regression: interword space count\", \"actual\": [[\"Av av fly.\", 75]], \"expected\": [[\"Av av fly.\", 75]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}