{"abstract":"Chunks that exactly fill the line are wrapped.","category":"Typography line breaking","checks":8,"contract":"Input [source, width]. Runs of spaces are one breakable space; \"~\" is an unbreakable space rendered \" \"; \"\\-\" is a discretionary hyphen: invisible unless the line breaks there, then rendered \"-\"; \"|\" is an invisible break opportunity. Greedy: append the next chunk if the line (without a potential hyphen) fits, else break at that opportunity. Return rendered lines.","evaluation_group":"w2-typography-line-breaking-ties-discretionaries","failed_approach":"Accepting one unit over overfills lines.","family":"w2-typography-line-breaking-ties-discretionaries-chunk-fit-comparison","id":"FA-80206","implementations":{"attempt":{"sha256":"37dc15e3d84e8a187155058920d13aecacd3ce117e894d3211750e27230f1c2c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    src, width = x\n    chunks = ['']\n    ops = []\n    i = 0\n    while i < len(src):\n        c = src[i]\n        if src.startswith('\\\\-', i):\n            ops.append('d')\n            chunks.append('')\n            i += 2\n            continue\n        if c == ' ':\n            j = i\n            while j < len(src) and src[j] == ' ':\n                j += 1\n            ops.append('s')\n            chunks.append('')\n            i = j\n            continue\n        if c == '|':\n            ops.append('z')\n            chunks.append('')\n            i += 1\n            continue\n        chunks[-1] += ' ' if c == '~' else c\n        i += 1\n    line = chunks[0]\n    lines = []\n    for op, ch in zip(ops, chunks[1:]):\n        sep = ' ' if op == 's' else ''\n        if len(line + sep + ch) <= width + 1:\n            line = line + sep + ch\n        else:\n            lines.append(line + ('-' if op == 'd' else ''))\n            line = ch\n    lines.append(line)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('regression: chunk fit comparison', ['set ~com\\\\-po\\\\-si\\\\-tion a word  hy\\\\-phen Dr.~Knuth b|c', 16], ['set  composition', 'a word hyphen', 'Dr. Knuth bc']), ('partial-repair probe', ['hy\\\\-phen x hy\\\\-phen  x a ~com\\\\-po\\\\-si\\\\-tion  hy\\\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('partial-repair probe', ['x url|path hy\\\\-phen ~com\\\\-po\\\\-si\\\\-tion  b|c  ink  com\\\\-po\\\\-si\\\\-tion hy\\\\-phen word', 10], ['x urlpath', 'hyphen', ' composi-', 'tion bc', 'ink compo-', 'sition hy-', 'phen word']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['10~pt ink 10~pt  Dr.~Knuth', 5], ['10 pt', 'ink', '10 pt', 'Dr. Knuth']), ('control layout', ['word b|c  Dr.~Knuth word 10~pt', 8], ['word bc', 'Dr. Knuth', 'word', '10 pt'])], [('regression: chunk fit comparison', ['x  word word word', 6], ['x word', 'word', 'word']), ('regression: chunk fit comparison', ['com\\\\-po\\\\-si\\\\-tion  set a', 10], ['composi-', 'tion set a']), ('partial-repair probe', ['set type  a  a  type  Dr.~Knuth  Dr.~Knuth a', 9], ['set type', 'a a type', 'Dr. Knuth', 'Dr. Knuth', 'a']), ('regression: chunk fit comparison', ['hy\\\\-phen  a ~set url|path ~url|path', 16], ['hyphen a  set', 'urlpath  urlpath']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['ink  ~Dr.~Knuth  ~Dr.~Knuth', 11], ['ink', ' Dr. Knuth', ' Dr. Knuth']), ('control layout', ['x Dr.~Knuth word  hy\\\\-phen', 8], ['x', 'Dr. Knuth', 'word hy-', 'phen'])], [('regression: chunk fit comparison', ['ink  a b|c  url|path ~url|path 10~pt word', 5], ['ink a', 'bc', 'url', 'path', ' url', 'path', '10 pt', 'word']), ('regression: chunk fit comparison', ['type a ~hy\\\\-phen  word hy\\\\-phen ~b|c', 12], ['type a  hy-', 'phen word hy-', 'phen  bc']), ('regression: chunk fit comparison', ['set url|path ~x com\\\\-po\\\\-si\\\\-tion ~10~pt hy\\\\-phen url|path url|path hy\\\\-phen', 6], ['set', 'url', 'path', ' x com-', 'posi-', 'tion', ' 10 pt', 'hyphen', 'url', 'path', 'url', 'path', 'hyphen']), ('partial-repair probe', ['word ink  Dr.~Knuth x  b|c  type  a', 5], ['word', 'ink', 'Dr. Knuth', 'x bc', 'type', 'a']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['hy\\\\-phen 10~pt hy\\\\-phen x', 9], ['hyphen', '10 pt hy-', 'phen x']), ('control layout', ['url|path x Dr.~Knuth ~10~pt', 12], ['urlpath x', 'Dr. Knuth', ' 10 pt'])], [('regression: chunk fit comparison', ['10~pt b|c a set word  word  ~a Dr.~Knuth', 7], ['10 pt b', 'c a set', 'word', 'word  a', 'Dr. Knuth']), ('regression: chunk fit comparison', ['a word url|path  ~x Dr.~Knuth  hy\\\\-phen 10~pt', 6], ['a word', 'url', 'path', ' x', 'Dr. Knuth', 'hyphen', '10 pt']), ('regression: chunk fit comparison', ['hy\\\\-phen x  url|path ~x hy\\\\-phen Dr.~Knuth 10~pt ink ~ink', 6], ['hyphen', 'x url', 'path', ' x hy-', 'phen', 'Dr. Knuth', '10 pt', 'ink', ' ink']), ('partial-repair probe', ['word  Dr.~Knuth Dr.~Knuth Dr.~Knuth type set', 13], ['word', 'Dr. Knuth', 'Dr. Knuth', 'Dr. Knuth', 'type set']), ('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('double space collapses', ['type  set', 20], ['type set']), ('control layout', ['ink b|c ink type 10~pt', 13], ['ink bc ink', 'type 10 pt']), ('control layout', ['ink type 10~pt Dr.~Knuth', 9], ['ink type', '10 pt', 'Dr. Knuth'])], [('regression: chunk fit comparison', ['set  ~url|path url|path word', 12], ['set  urlpath', 'urlpath word']), ('regression: chunk fit comparison', ['10~pt b|c a set word  word  ~a Dr.~Knuth', 7], ['10 pt b', 'c a set', 'word', 'word  a', 'Dr. Knuth']), ('regression: chunk fit comparison', ['b|c ink hy\\\\-phen url|path type com\\\\-po\\\\-si\\\\-tion', 8], ['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']), ('regression: chunk fit comparison', ['com\\\\-po\\\\-si\\\\-tion  hy\\\\-phen com\\\\-po\\\\-si\\\\-tion ink  b|c a', 10], ['composi-', 'tion hy-', 'phen compo-', 'sition ink', 'bc a']), ('double space collapses', ['type  set', 20], ['type set']), ('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('control layout', ['Dr.~Knuth type  b|c ink ink url|path url|path hy\\\\-phen', 12], ['Dr. Knuth', 'type bc ink', 'ink urlpath', 'urlpath hy-', 'phen']), ('control layout', ['a ~a  ~type hy\\\\-phen type', 15], ['a  a  type hy-', 'phen type'])]]\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":"e40f9ac453050cfbdacb76f4a1b36bb6385987db8c119d2b8ea96994bc317748","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    src, width = x\n    chunks = ['']\n    ops = []\n    i = 0\n    while i < len(src):\n        c = src[i]\n        if src.startswith('\\\\-', i):\n            ops.append('d')\n            chunks.append('')\n            i += 2\n            continue\n        if c == ' ':\n            j = i\n            while j < len(src) and src[j] == ' ':\n                j += 1\n            ops.append('s')\n            chunks.append('')\n            i = j\n            continue\n        if c == '|':\n            ops.append('z')\n            chunks.append('')\n            i += 1\n            continue\n        chunks[-1] += ' ' if c == '~' else c\n        i += 1\n    line = chunks[0]\n    lines = []\n    for op, ch in zip(ops, chunks[1:]):\n        sep = ' ' if op == 's' else ''\n        if len(line + sep + ch) < width:\n            line = line + sep + ch\n        else:\n            lines.append(line + ('-' if op == 'd' else ''))\n            line = ch\n    lines.append(line)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('regression: chunk fit comparison', ['set ~com\\\\-po\\\\-si\\\\-tion a word  hy\\\\-phen Dr.~Knuth b|c', 16], ['set  composition', 'a word hyphen', 'Dr. Knuth bc']), ('partial-repair probe', ['hy\\\\-phen x hy\\\\-phen  x a ~com\\\\-po\\\\-si\\\\-tion  hy\\\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('partial-repair probe', ['x url|path hy\\\\-phen ~com\\\\-po\\\\-si\\\\-tion  b|c  ink  com\\\\-po\\\\-si\\\\-tion hy\\\\-phen word', 10], ['x urlpath', 'hyphen', ' composi-', 'tion bc', 'ink compo-', 'sition hy-', 'phen word']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['10~pt ink 10~pt  Dr.~Knuth', 5], ['10 pt', 'ink', '10 pt', 'Dr. Knuth']), ('control layout', ['word b|c  Dr.~Knuth word 10~pt', 8], ['word bc', 'Dr. Knuth', 'word', '10 pt'])], [('regression: chunk fit comparison', ['x  word word word', 6], ['x word', 'word', 'word']), ('regression: chunk fit comparison', ['com\\\\-po\\\\-si\\\\-tion  set a', 10], ['composi-', 'tion set a']), ('partial-repair probe', ['set type  a  a  type  Dr.~Knuth  Dr.~Knuth a', 9], ['set type', 'a a type', 'Dr. Knuth', 'Dr. Knuth', 'a']), ('regression: chunk fit comparison', ['hy\\\\-phen  a ~set url|path ~url|path', 16], ['hyphen a  set', 'urlpath  urlpath']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['ink  ~Dr.~Knuth  ~Dr.~Knuth', 11], ['ink', ' Dr. Knuth', ' Dr. Knuth']), ('control layout', ['x Dr.~Knuth word  hy\\\\-phen', 8], ['x', 'Dr. Knuth', 'word hy-', 'phen'])], [('regression: chunk fit comparison', ['ink  a b|c  url|path ~url|path 10~pt word', 5], ['ink a', 'bc', 'url', 'path', ' url', 'path', '10 pt', 'word']), ('regression: chunk fit comparison', ['type a ~hy\\\\-phen  word hy\\\\-phen ~b|c', 12], ['type a  hy-', 'phen word hy-', 'phen  bc']), ('regression: chunk fit comparison', ['set url|path ~x com\\\\-po\\\\-si\\\\-tion ~10~pt hy\\\\-phen url|path url|path hy\\\\-phen', 6], ['set', 'url', 'path', ' x com-', 'posi-', 'tion', ' 10 pt', 'hyphen', 'url', 'path', 'url', 'path', 'hyphen']), ('partial-repair probe', ['word ink  Dr.~Knuth x  b|c  type  a', 5], ['word', 'ink', 'Dr. Knuth', 'x bc', 'type', 'a']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['hy\\\\-phen 10~pt hy\\\\-phen x', 9], ['hyphen', '10 pt hy-', 'phen x']), ('control layout', ['url|path x Dr.~Knuth ~10~pt', 12], ['urlpath x', 'Dr. Knuth', ' 10 pt'])], [('regression: chunk fit comparison', ['10~pt b|c a set word  word  ~a Dr.~Knuth', 7], ['10 pt b', 'c a set', 'word', 'word  a', 'Dr. Knuth']), ('regression: chunk fit comparison', ['a word url|path  ~x Dr.~Knuth  hy\\\\-phen 10~pt', 6], ['a word', 'url', 'path', ' x', 'Dr. Knuth', 'hyphen', '10 pt']), ('regression: chunk fit comparison', ['hy\\\\-phen x  url|path ~x hy\\\\-phen Dr.~Knuth 10~pt ink ~ink', 6], ['hyphen', 'x url', 'path', ' x hy-', 'phen', 'Dr. Knuth', '10 pt', 'ink', ' ink']), ('partial-repair probe', ['word  Dr.~Knuth Dr.~Knuth Dr.~Knuth type set', 13], ['word', 'Dr. Knuth', 'Dr. Knuth', 'Dr. Knuth', 'type set']), ('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('double space collapses', ['type  set', 20], ['type set']), ('control layout', ['ink b|c ink type 10~pt', 13], ['ink bc ink', 'type 10 pt']), ('control layout', ['ink type 10~pt Dr.~Knuth', 9], ['ink type', '10 pt', 'Dr. Knuth'])], [('regression: chunk fit comparison', ['set  ~url|path url|path word', 12], ['set  urlpath', 'urlpath word']), ('regression: chunk fit comparison', ['10~pt b|c a set word  word  ~a Dr.~Knuth', 7], ['10 pt b', 'c a set', 'word', 'word  a', 'Dr. Knuth']), ('regression: chunk fit comparison', ['b|c ink hy\\\\-phen url|path type com\\\\-po\\\\-si\\\\-tion', 8], ['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']), ('regression: chunk fit comparison', ['com\\\\-po\\\\-si\\\\-tion  hy\\\\-phen com\\\\-po\\\\-si\\\\-tion ink  b|c a', 10], ['composi-', 'tion hy-', 'phen compo-', 'sition ink', 'bc a']), ('double space collapses', ['type  set', 20], ['type set']), ('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('control layout', ['Dr.~Knuth type  b|c ink ink url|path url|path hy\\\\-phen', 12], ['Dr. Knuth', 'type bc ink', 'ink urlpath', 'urlpath hy-', 'phen']), ('control layout', ['a ~a  ~type hy\\\\-phen type', 15], ['a  a  type hy-', 'phen type'])]]\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":"6901944fec59080f9644d387c0d1dd39fb39c2a889cf72cf7ea0b3bdb80a79dc","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    src, width = x\n    chunks = ['']\n    ops = []\n    i = 0\n    while i < len(src):\n        c = src[i]\n        if src.startswith('\\\\-', i):\n            ops.append('d')\n            chunks.append('')\n            i += 2\n            continue\n        if c == ' ':\n            j = i\n            while j < len(src) and src[j] == ' ':\n                j += 1\n            ops.append('s')\n            chunks.append('')\n            i = j\n            continue\n        if c == '|':\n            ops.append('z')\n            chunks.append('')\n            i += 1\n            continue\n        chunks[-1] += ' ' if c == '~' else c\n        i += 1\n    line = chunks[0]\n    lines = []\n    for op, ch in zip(ops, chunks[1:]):\n        sep = ' ' if op == 's' else ''\n        if len(line + sep + ch) <= width:\n            line = line + sep + ch\n        else:\n            lines.append(line + ('-' if op == 'd' else ''))\n            line = ch\n    lines.append(line)\n    return lines\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('regression: chunk fit comparison', ['set ~com\\\\-po\\\\-si\\\\-tion a word  hy\\\\-phen Dr.~Knuth b|c', 16], ['set  composition', 'a word hyphen', 'Dr. Knuth bc']), ('partial-repair probe', ['hy\\\\-phen x hy\\\\-phen  x a ~com\\\\-po\\\\-si\\\\-tion  hy\\\\-phen  word ~type', 5], ['hy-', 'phen', 'x hy-', 'phen', 'x a', ' com-', 'posi-', 'tion', 'hy-', 'phen', 'word', ' type']), ('partial-repair probe', ['x url|path hy\\\\-phen ~com\\\\-po\\\\-si\\\\-tion  b|c  ink  com\\\\-po\\\\-si\\\\-tion hy\\\\-phen word', 10], ['x urlpath', 'hyphen', ' composi-', 'tion bc', 'ink compo-', 'sition hy-', 'phen word']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['10~pt ink 10~pt  Dr.~Knuth', 5], ['10 pt', 'ink', '10 pt', 'Dr. Knuth']), ('control layout', ['word b|c  Dr.~Knuth word 10~pt', 8], ['word bc', 'Dr. Knuth', 'word', '10 pt'])], [('regression: chunk fit comparison', ['x  word word word', 6], ['x word', 'word', 'word']), ('regression: chunk fit comparison', ['com\\\\-po\\\\-si\\\\-tion  set a', 10], ['composi-', 'tion set a']), ('partial-repair probe', ['set type  a  a  type  Dr.~Knuth  Dr.~Knuth a', 9], ['set type', 'a a type', 'Dr. Knuth', 'Dr. Knuth', 'a']), ('regression: chunk fit comparison', ['hy\\\\-phen  a ~set url|path ~url|path', 16], ['hyphen a  set', 'urlpath  urlpath']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('control layout', ['ink  ~Dr.~Knuth  ~Dr.~Knuth', 11], ['ink', ' Dr. Knuth', ' Dr. Knuth']), ('control layout', ['x Dr.~Knuth word  hy\\\\-phen', 8], ['x', 'Dr. Knuth', 'word hy-', 'phen'])], [('regression: chunk fit comparison', ['ink  a b|c  url|path ~url|path 10~pt word', 5], ['ink a', 'bc', 'url', 'path', ' url', 'path', '10 pt', 'word']), ('regression: chunk fit comparison', ['type a ~hy\\\\-phen  word hy\\\\-phen ~b|c', 12], ['type a  hy-', 'phen word hy-', 'phen  bc']), ('regression: chunk fit comparison', ['set url|path ~x com\\\\-po\\\\-si\\\\-tion ~10~pt hy\\\\-phen url|path url|path hy\\\\-phen', 6], ['set', 'url', 'path', ' x com-', 'posi-', 'tion', ' 10 pt', 'hyphen', 'url', 'path', 'url', 'path', 'hyphen']), ('partial-repair probe', ['word ink  Dr.~Knuth x  b|c  type  a', 5], ['word', 'ink', 'Dr. Knuth', 'x bc', 'type', 'a']), ('invisible break', ['url|path|x', 5], ['url', 'pathx']), ('tie keeps title with name', ['see Dr.~Knuth now', 9], ['see', 'Dr. Knuth', 'now']), ('control layout', ['hy\\\\-phen 10~pt hy\\\\-phen x', 9], ['hyphen', '10 pt hy-', 'phen x']), ('control layout', ['url|path x Dr.~Knuth ~10~pt', 12], ['urlpath x', 'Dr. Knuth', ' 10 pt'])], [('regression: chunk fit comparison', ['10~pt b|c a set word  word  ~a Dr.~Knuth', 7], ['10 pt b', 'c a set', 'word', 'word  a', 'Dr. Knuth']), ('regression: chunk fit comparison', ['a word url|path  ~x Dr.~Knuth  hy\\\\-phen 10~pt', 6], ['a word', 'url', 'path', ' x', 'Dr. Knuth', 'hyphen', '10 pt']), ('regression: chunk fit comparison', ['hy\\\\-phen x  url|path ~x hy\\\\-phen Dr.~Knuth 10~pt ink ~ink', 6], ['hyphen', 'x url', 'path', ' x hy-', 'phen', 'Dr. Knuth', '10 pt', 'ink', ' ink']), ('partial-repair probe', ['word  Dr.~Knuth Dr.~Knuth Dr.~Knuth type set', 13], ['word', 'Dr. Knuth', 'Dr. Knuth', 'Dr. Knuth', 'type set']), ('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('double space collapses', ['type  set', 20], ['type set']), ('control layout', ['ink b|c ink type 10~pt', 13], ['ink bc ink', 'type 10 pt']), ('control layout', ['ink type 10~pt Dr.~Knuth', 9], ['ink type', '10 pt', 'Dr. Knuth'])], [('regression: chunk fit comparison', ['set  ~url|path url|path word', 12], ['set  urlpath', 'urlpath word']), ('regression: chunk fit comparison', ['10~pt b|c a set word  word  ~a Dr.~Knuth', 7], ['10 pt b', 'c a set', 'word', 'word  a', 'Dr. Knuth']), ('regression: chunk fit comparison', ['b|c ink hy\\\\-phen url|path type com\\\\-po\\\\-si\\\\-tion', 8], ['bc ink', 'hyphen', 'urlpath', 'type com-', 'position']), ('regression: chunk fit comparison', ['com\\\\-po\\\\-si\\\\-tion  hy\\\\-phen com\\\\-po\\\\-si\\\\-tion ink  b|c a', 10], ['composi-', 'tion hy-', 'phen compo-', 'sition ink', 'bc a']), ('double space collapses', ['type  set', 20], ['type set']), ('discretionary taken', ['the com\\\\-po\\\\-si\\\\-tion', 9], ['the compo-', 'sition']), ('control layout', ['Dr.~Knuth type  b|c ink ink url|path url|path hy\\\\-phen', 12], ['Dr. Knuth', 'type bc ink', 'ink urlpath', 'urlpath hy-', 'phen']), ('control layout', ['a ~a  ~type hy\\\\-phen type', 15], ['a  a  type hy-', 'phen type'])]]\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-ties-discretionaries-chunk-fit-comparison","generated_at":"2026-09-29T14:49:51.635265+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":"Accept a line equal to the width.","root_cause":"The chunk fit uses a strict comparison.","sha256":"8ab697323930e26a235eb7a94cd77c2a7dee086a6d2ca17f01f7dabee8afc486","title":"Ties and discretionary hyphens: chunk fit comparison · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.852,"exit_code":1,"observations":[{"actual":["the compo-","sition"],"check":"discretionary taken","expected":["the compo-","sition"],"passed":true},{"actual":["set  composition","a word hyphen","Dr. Knuth bc"],"check":"regression: chunk fit comparison","expected":["set  composition","a word hyphen","Dr. Knuth bc"],"passed":true},{"actual":["hyphen","x hy-","phen x","a  com-","posi-","tion","hyphen","word"," type"],"check":"partial-repair probe","expected":["hy-","phen","x hy-","phen","x a"," com-","posi-","tion","hy-","phen","word"," type"],"passed":false},{"actual":["x urlpath","hyphen  com-","position bc","ink composi-","tion hyphen","word"],"check":"partial-repair probe","expected":["x urlpath","hyphen"," composi-","tion bc","ink compo-","sition hy-","phen word"],"passed":false},{"actual":["url","pathx"],"check":"invisible break","expected":["url","pathx"],"passed":true},{"actual":["see","Dr. Knuth","now"],"check":"tie keeps title with name","expected":["see","Dr. Knuth","now"],"passed":true},{"actual":["10 pt","ink","10 pt","Dr. Knuth"],"check":"control layout","expected":["10 pt","ink","10 pt","Dr. Knuth"],"passed":true},{"actual":["word bc","Dr. Knuth","word","10 pt"],"check":"control layout","expected":["word bc","Dr. Knuth","word","10 pt"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"discretionary taken\", \"actual\": [\"the compo-\", \"sition\"], \"expected\": [\"the compo-\", \"sition\"], \"passed\": true}, {\"check\": \"regression: chunk fit comparison\", \"actual\": [\"set  composition\", \"a word hyphen\", \"Dr. Knuth bc\"], \"expected\": [\"set  composition\", \"a word hyphen\", \"Dr. Knuth bc\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"hyphen\", \"x hy-\", \"phen x\", \"a  com-\", \"posi-\", \"tion\", \"hyphen\", \"word\", \" type\"], \"expected\": [\"hy-\", \"phen\", \"x hy-\", \"phen\", \"x a\", \" com-\", \"posi-\", \"tion\", \"hy-\", \"phen\", \"word\", \" type\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"x urlpath\", \"hyphen  com-\", \"position bc\", \"ink composi-\", \"tion hyphen\", \"word\"], \"expected\": [\"x urlpath\", \"hyphen\", \" composi-\", \"tion bc\", \"ink compo-\", \"sition hy-\", \"phen word\"], \"passed\": false}, {\"check\": \"invisible break\", \"actual\": [\"url\", \"pathx\"], \"expected\": [\"url\", \"pathx\"], \"passed\": true}, {\"check\": \"tie keeps title with name\", \"actual\": [\"see\", \"Dr. Knuth\", \"now\"], \"expected\": [\"see\", \"Dr. Knuth\", \"now\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"10 pt\", \"ink\", \"10 pt\", \"Dr. Knuth\"], \"expected\": [\"10 pt\", \"ink\", \"10 pt\", \"Dr. Knuth\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"word bc\", \"Dr. Knuth\", \"word\", \"10 pt\"], \"expected\": [\"word bc\", \"Dr. Knuth\", \"word\", \"10 pt\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.003,"exit_code":1,"observations":[{"actual":["the com-","position"],"check":"discretionary taken","expected":["the compo-","sition"],"passed":false},{"actual":["set  composi-","tion a word hy-","phen Dr. Knuth","bc"],"check":"regression: chunk fit comparison","expected":["set  composition","a word hyphen","Dr. Knuth bc"],"passed":false},{"actual":["hy-","phen","x hy-","phen","x a"," com-","posi-","tion","hy-","phen","word"," type"],"check":"partial-repair probe","expected":["hy-","phen","x hy-","phen","x a"," com-","posi-","tion","hy-","phen","word"," type"],"passed":true},{"actual":["x urlpath","hyphen"," composi-","tion bc","ink compo-","sition hy-","phen word"],"check":"partial-repair probe","expected":["x urlpath","hyphen"," composi-","tion bc","ink compo-","sition hy-","phen word"],"passed":true},{"actual":["url","path","x"],"check":"invisible break","expected":["url","pathx"],"passed":false},{"actual":["see","Dr. Knuth","now"],"check":"tie keeps title with name","expected":["see","Dr. Knuth","now"],"passed":true},{"actual":["10 pt","ink","10 pt","Dr. Knuth"],"check":"control layout","expected":["10 pt","ink","10 pt","Dr. Knuth"],"passed":true},{"actual":["word bc","Dr. Knuth","word","10 pt"],"check":"control layout","expected":["word bc","Dr. Knuth","word","10 pt"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"discretionary taken\", \"actual\": [\"the com-\", \"position\"], \"expected\": [\"the compo-\", \"sition\"], \"passed\": false}, {\"check\": \"regression: chunk fit comparison\", \"actual\": [\"set  composi-\", \"tion a word hy-\", \"phen Dr. Knuth\", \"bc\"], \"expected\": [\"set  composition\", \"a word hyphen\", \"Dr. Knuth bc\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"hy-\", \"phen\", \"x hy-\", \"phen\", \"x a\", \" com-\", \"posi-\", \"tion\", \"hy-\", \"phen\", \"word\", \" type\"], \"expected\": [\"hy-\", \"phen\", \"x hy-\", \"phen\", \"x a\", \" com-\", \"posi-\", \"tion\", \"hy-\", \"phen\", \"word\", \" type\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"x urlpath\", \"hyphen\", \" composi-\", \"tion bc\", \"ink compo-\", \"sition hy-\", \"phen word\"], \"expected\": [\"x urlpath\", \"hyphen\", \" composi-\", \"tion bc\", \"ink compo-\", \"sition hy-\", \"phen word\"], \"passed\": true}, {\"check\": \"invisible break\", \"actual\": [\"url\", \"path\", \"x\"], \"expected\": [\"url\", \"pathx\"], \"passed\": false}, {\"check\": \"tie keeps title with name\", \"actual\": [\"see\", \"Dr. Knuth\", \"now\"], \"expected\": [\"see\", \"Dr. Knuth\", \"now\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"10 pt\", \"ink\", \"10 pt\", \"Dr. Knuth\"], \"expected\": [\"10 pt\", \"ink\", \"10 pt\", \"Dr. Knuth\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"word bc\", \"Dr. Knuth\", \"word\", \"10 pt\"], \"expected\": [\"word bc\", \"Dr. Knuth\", \"word\", \"10 pt\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.636,"exit_code":0,"observations":[{"actual":["the compo-","sition"],"check":"discretionary taken","expected":["the compo-","sition"],"passed":true},{"actual":["set  composition","a word hyphen","Dr. Knuth bc"],"check":"regression: chunk fit comparison","expected":["set  composition","a word hyphen","Dr. Knuth bc"],"passed":true},{"actual":["hy-","phen","x hy-","phen","x a"," com-","posi-","tion","hy-","phen","word"," type"],"check":"partial-repair probe","expected":["hy-","phen","x hy-","phen","x a"," com-","posi-","tion","hy-","phen","word"," type"],"passed":true},{"actual":["x urlpath","hyphen"," composi-","tion bc","ink compo-","sition hy-","phen word"],"check":"partial-repair probe","expected":["x urlpath","hyphen"," composi-","tion bc","ink compo-","sition hy-","phen word"],"passed":true},{"actual":["url","pathx"],"check":"invisible break","expected":["url","pathx"],"passed":true},{"actual":["see","Dr. Knuth","now"],"check":"tie keeps title with name","expected":["see","Dr. Knuth","now"],"passed":true},{"actual":["10 pt","ink","10 pt","Dr. Knuth"],"check":"control layout","expected":["10 pt","ink","10 pt","Dr. Knuth"],"passed":true},{"actual":["word bc","Dr. Knuth","word","10 pt"],"check":"control layout","expected":["word bc","Dr. Knuth","word","10 pt"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"discretionary taken\", \"actual\": [\"the compo-\", \"sition\"], \"expected\": [\"the compo-\", \"sition\"], \"passed\": true}, {\"check\": \"regression: chunk fit comparison\", \"actual\": [\"set  composition\", \"a word hyphen\", \"Dr. Knuth bc\"], \"expected\": [\"set  composition\", \"a word hyphen\", \"Dr. Knuth bc\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"hy-\", \"phen\", \"x hy-\", \"phen\", \"x a\", \" com-\", \"posi-\", \"tion\", \"hy-\", \"phen\", \"word\", \" type\"], \"expected\": [\"hy-\", \"phen\", \"x hy-\", \"phen\", \"x a\", \" com-\", \"posi-\", \"tion\", \"hy-\", \"phen\", \"word\", \" type\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"x urlpath\", \"hyphen\", \" composi-\", \"tion bc\", \"ink compo-\", \"sition hy-\", \"phen word\"], \"expected\": [\"x urlpath\", \"hyphen\", \" composi-\", \"tion bc\", \"ink compo-\", \"sition hy-\", \"phen word\"], \"passed\": true}, {\"check\": \"invisible break\", \"actual\": [\"url\", \"pathx\"], \"expected\": [\"url\", \"pathx\"], \"passed\": true}, {\"check\": \"tie keeps title with name\", \"actual\": [\"see\", \"Dr. Knuth\", \"now\"], \"expected\": [\"see\", \"Dr. Knuth\", \"now\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"10 pt\", \"ink\", \"10 pt\", \"Dr. Knuth\"], \"expected\": [\"10 pt\", \"ink\", \"10 pt\", \"Dr. Knuth\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"word bc\", \"Dr. Knuth\", \"word\", \"10 pt\"], \"expected\": [\"word bc\", \"Dr. Knuth\", \"word\", \"10 pt\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}