{"abstract":"Tabs inside right-to-left text keep the embedded level.","category":"Bidirectional text layout","checks":8,"contract":"Input [original classes, resolved levels, paragraph level]. Reset to the paragraph level: every S and B; any run of WS and isolate formatting characters (FSI LRI RLI PDI) immediately before an S or B; and such a run at the end of the line. Return levels.","evaluation_group":"w2-bidirectional-text-layout-whitespace-reset","failed_approach":"Treating every space as a separator resets interior whitespace.","family":"w2-bidirectional-text-layout-whitespace-reset-segment-separator-reset","id":"FA-80501","implementations":{"attempt":{"sha256":"909bd41d26217909735a4b4d1890dddfa02ee33c3e0db4459f4aea2782d1cd4b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    classes, levels, para = x\n    out = list(levels)\n    n = len(classes)\n    RESETTABLE = ('WS', 'FSI', 'LRI', 'RLI', 'PDI')\n    j = n - 1\n    while j >= 0 and classes[j] in RESETTABLE:\n        out[j] = para\n        j -= 1\n    for i, c in enumerate(classes):\n        if c in ('S', 'B', 'WS'):\n            out[i] = para\n            k = i - 1\n            while k >= 0 and classes[k] in RESETTABLE:\n                out[k] = para\n                k -= 1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('regression: segment separator reset', [['S', 'R', 'WS', 'ON', 'S'], [0, 0, 0, 0, 3], 1], [1, 0, 0, 0, 1]), ('partial-repair probe', [['WS', 'ON'], [3, 3], 0], [3, 3]), ('partial-repair probe', [['L', 'PDI', 'WS', 'ON', 'ON', 'PDI'], [3, 1, 1, 1, 1, 1], 0], [3, 1, 1, 1, 1, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('control layout', [['ON', 'LRI', 'EN', 'ON'], [1, 2, 2, 2], 0], [1, 2, 2, 2]), ('control layout', [['R', 'FSI', 'L'], [1, 3, 3], 0], [1, 3, 3])], [('regression: segment separator reset', [['R', 'LRI', 'L', 'S', 'R', 'ON', 'R', 'L'], [1, 3, 3, 3, 0, 2, 2, 2], 0], [1, 3, 3, 0, 0, 2, 2, 2]), ('regression: segment separator reset', [['S', 'S', 'PDI', 'WS', 'R', 'ON', 'LRI', 'WS', 'ON', 'R', 'WS', 'ON'], [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2], 1], [1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]), ('partial-repair probe', [['FSI', 'L', 'L', 'LRI', 'WS', 'ON', 'WS', 'RLI', 'WS', 'B', 'PDI', 'L'], [2, 2, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1], 0], [2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 1, 1]), ('regression: segment separator reset', [['EN', 'S', 'RLI', 'EN', 'R', 'WS', 'R', 'FSI', 'ON', 'WS', 'WS', 'FSI'], [4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 1], 0], [4, 0, 4, 4, 4, 4, 4, 3, 3, 0, 0, 0]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['R', 'L', 'R', 'WS'], [1, 1, 1, 1], 0], [1, 1, 1, 0]), ('control layout', [['L', 'RLI', 'ON', 'RLI'], [4, 4, 4, 4], 0], [4, 4, 4, 0])], [('regression: segment separator reset', [['WS', 'EN', 'RLI', 'WS', 'PDI', 'R', 'EN', 'WS', 'S'], [2, 2, 2, 2, 3, 3, 3, 0, 0], 1], [2, 2, 2, 2, 3, 3, 3, 1, 1]), ('regression: segment separator reset', [['L', 'WS', 'B', 'ON', 'WS', 'R', 'S', 'WS', 'WS', 'L', 'PDI', 'S'], [1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4], 0], [1, 0, 0, 2, 2, 2, 0, 2, 2, 4, 0, 0]), ('partial-repair probe', [['EN', 'R', 'B', 'WS', 'R', 'L', 'L', 'ON', 'LRI', 'ON', 'EN'], [2, 2, 4, 4, 4, 1, 1, 1, 4, 1, 3], 1], [2, 2, 1, 4, 4, 1, 1, 1, 4, 1, 3]), ('partial-repair probe', [['L', 'WS', 'B', 'WS', 'ON'], [0, 0, 0, 2, 2], 1], [0, 1, 1, 2, 2]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['ON', 'WS'], [2, 2], 1], [2, 1]), ('control layout', [['RLI', 'ON'], [2, 2], 1], [2, 2])], [('regression: segment separator reset', [['LRI', 'EN', 'WS', 'WS', 'R', 'RLI', 'S', 'WS', 'ON', 'L', 'EN', 'PDI'], [2, 2, 1, 2, 2, 2, 1, 1, 3, 3, 1, 3], 0], [2, 2, 1, 2, 2, 0, 0, 1, 3, 3, 1, 0]), ('regression: segment separator reset', [['PDI', 'S', 'R', 'ON', 'LRI'], [1, 4, 4, 4, 4], 1], [1, 1, 4, 4, 1]), ('partial-repair probe', [['WS', 'R', 'LRI'], [0, 0, 1], 1], [0, 0, 1]), ('partial-repair probe', [['L', 'B', 'WS', 'PDI', 'L', 'B', 'L', 'L', 'RLI'], [2, 2, 2, 2, 3, 3, 3, 2, 2], 1], [2, 1, 2, 2, 3, 1, 3, 2, 1]), ('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('control layout', [['L', 'FSI'], [1, 4], 0], [1, 0]), ('control layout', [['WS', 'L', 'EN', 'R', 'R'], [1, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1])], [('regression: segment separator reset', [['S', 'RLI', 'B', 'L', 'WS', 'L', 'WS'], [1, 1, 1, 2, 2, 2, 0], 0], [0, 0, 0, 2, 2, 2, 0]), ('regression: segment separator reset', [['EN', 'LRI', 'LRI', 'S', 'B', 'FSI', 'R', 'ON', 'PDI', 'B'], [2, 2, 2, 2, 2, 2, 2, 2, 2, 3], 1], [2, 1, 1, 1, 1, 2, 2, 2, 1, 1]), ('partial-repair probe', [['WS', 'PDI', 'L', 'L'], [1, 1, 1, 1], 0], [1, 1, 1, 1]), ('partial-repair probe', [['R', 'ON', 'LRI', 'L', 'WS', 'WS', 'PDI', 'ON'], [1, 3, 3, 3, 2, 4, 4, 4], 0], [1, 3, 3, 3, 2, 4, 4, 4]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['EN', 'R', 'ON', 'R', 'WS'], [1, 1, 1, 1, 3], 0], [1, 1, 1, 1, 0]), ('control layout', [['FSI', 'RLI', 'B', 'R', 'ON', 'RLI', 'LRI', 'ON', 'WS'], [2, 2, 2, 2, 2, 1, 2, 0, 0], 1], [1, 1, 1, 2, 2, 1, 2, 0, 1])]]\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":"e88e693af66242f4311820f1868855fb722b4d6c023e30438317d264e0163b3f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    classes, levels, para = x\n    out = list(levels)\n    n = len(classes)\n    RESETTABLE = ('WS', 'FSI', 'LRI', 'RLI', 'PDI')\n    j = n - 1\n    while j >= 0 and classes[j] in RESETTABLE:\n        out[j] = para\n        j -= 1\n    for i, c in enumerate(classes):\n        if c == 'B':\n            out[i] = para\n            k = i - 1\n            while k >= 0 and classes[k] in RESETTABLE:\n                out[k] = para\n                k -= 1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('regression: segment separator reset', [['S', 'R', 'WS', 'ON', 'S'], [0, 0, 0, 0, 3], 1], [1, 0, 0, 0, 1]), ('partial-repair probe', [['WS', 'ON'], [3, 3], 0], [3, 3]), ('partial-repair probe', [['L', 'PDI', 'WS', 'ON', 'ON', 'PDI'], [3, 1, 1, 1, 1, 1], 0], [3, 1, 1, 1, 1, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('control layout', [['ON', 'LRI', 'EN', 'ON'], [1, 2, 2, 2], 0], [1, 2, 2, 2]), ('control layout', [['R', 'FSI', 'L'], [1, 3, 3], 0], [1, 3, 3])], [('regression: segment separator reset', [['R', 'LRI', 'L', 'S', 'R', 'ON', 'R', 'L'], [1, 3, 3, 3, 0, 2, 2, 2], 0], [1, 3, 3, 0, 0, 2, 2, 2]), ('regression: segment separator reset', [['S', 'S', 'PDI', 'WS', 'R', 'ON', 'LRI', 'WS', 'ON', 'R', 'WS', 'ON'], [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2], 1], [1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]), ('partial-repair probe', [['FSI', 'L', 'L', 'LRI', 'WS', 'ON', 'WS', 'RLI', 'WS', 'B', 'PDI', 'L'], [2, 2, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1], 0], [2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 1, 1]), ('regression: segment separator reset', [['EN', 'S', 'RLI', 'EN', 'R', 'WS', 'R', 'FSI', 'ON', 'WS', 'WS', 'FSI'], [4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 1], 0], [4, 0, 4, 4, 4, 4, 4, 3, 3, 0, 0, 0]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['R', 'L', 'R', 'WS'], [1, 1, 1, 1], 0], [1, 1, 1, 0]), ('control layout', [['L', 'RLI', 'ON', 'RLI'], [4, 4, 4, 4], 0], [4, 4, 4, 0])], [('regression: segment separator reset', [['WS', 'EN', 'RLI', 'WS', 'PDI', 'R', 'EN', 'WS', 'S'], [2, 2, 2, 2, 3, 3, 3, 0, 0], 1], [2, 2, 2, 2, 3, 3, 3, 1, 1]), ('regression: segment separator reset', [['L', 'WS', 'B', 'ON', 'WS', 'R', 'S', 'WS', 'WS', 'L', 'PDI', 'S'], [1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4], 0], [1, 0, 0, 2, 2, 2, 0, 2, 2, 4, 0, 0]), ('partial-repair probe', [['EN', 'R', 'B', 'WS', 'R', 'L', 'L', 'ON', 'LRI', 'ON', 'EN'], [2, 2, 4, 4, 4, 1, 1, 1, 4, 1, 3], 1], [2, 2, 1, 4, 4, 1, 1, 1, 4, 1, 3]), ('partial-repair probe', [['L', 'WS', 'B', 'WS', 'ON'], [0, 0, 0, 2, 2], 1], [0, 1, 1, 2, 2]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['ON', 'WS'], [2, 2], 1], [2, 1]), ('control layout', [['RLI', 'ON'], [2, 2], 1], [2, 2])], [('regression: segment separator reset', [['LRI', 'EN', 'WS', 'WS', 'R', 'RLI', 'S', 'WS', 'ON', 'L', 'EN', 'PDI'], [2, 2, 1, 2, 2, 2, 1, 1, 3, 3, 1, 3], 0], [2, 2, 1, 2, 2, 0, 0, 1, 3, 3, 1, 0]), ('regression: segment separator reset', [['PDI', 'S', 'R', 'ON', 'LRI'], [1, 4, 4, 4, 4], 1], [1, 1, 4, 4, 1]), ('partial-repair probe', [['WS', 'R', 'LRI'], [0, 0, 1], 1], [0, 0, 1]), ('partial-repair probe', [['L', 'B', 'WS', 'PDI', 'L', 'B', 'L', 'L', 'RLI'], [2, 2, 2, 2, 3, 3, 3, 2, 2], 1], [2, 1, 2, 2, 3, 1, 3, 2, 1]), ('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('control layout', [['L', 'FSI'], [1, 4], 0], [1, 0]), ('control layout', [['WS', 'L', 'EN', 'R', 'R'], [1, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1])], [('regression: segment separator reset', [['S', 'RLI', 'B', 'L', 'WS', 'L', 'WS'], [1, 1, 1, 2, 2, 2, 0], 0], [0, 0, 0, 2, 2, 2, 0]), ('regression: segment separator reset', [['EN', 'LRI', 'LRI', 'S', 'B', 'FSI', 'R', 'ON', 'PDI', 'B'], [2, 2, 2, 2, 2, 2, 2, 2, 2, 3], 1], [2, 1, 1, 1, 1, 2, 2, 2, 1, 1]), ('partial-repair probe', [['WS', 'PDI', 'L', 'L'], [1, 1, 1, 1], 0], [1, 1, 1, 1]), ('partial-repair probe', [['R', 'ON', 'LRI', 'L', 'WS', 'WS', 'PDI', 'ON'], [1, 3, 3, 3, 2, 4, 4, 4], 0], [1, 3, 3, 3, 2, 4, 4, 4]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['EN', 'R', 'ON', 'R', 'WS'], [1, 1, 1, 1, 3], 0], [1, 1, 1, 1, 0]), ('control layout', [['FSI', 'RLI', 'B', 'R', 'ON', 'RLI', 'LRI', 'ON', 'WS'], [2, 2, 2, 2, 2, 1, 2, 0, 0], 1], [1, 1, 1, 2, 2, 1, 2, 0, 1])]]\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":"0edaca853bd4b5d46033039b51132bb8680896284bcaf5b9c2ed4630ab2a0b29","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    classes, levels, para = x\n    out = list(levels)\n    n = len(classes)\n    RESETTABLE = ('WS', 'FSI', 'LRI', 'RLI', 'PDI')\n    j = n - 1\n    while j >= 0 and classes[j] in RESETTABLE:\n        out[j] = para\n        j -= 1\n    for i, c in enumerate(classes):\n        if c in ('S', 'B'):\n            out[i] = para\n            k = i - 1\n            while k >= 0 and classes[k] in RESETTABLE:\n                out[k] = para\n                k -= 1\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('regression: segment separator reset', [['S', 'R', 'WS', 'ON', 'S'], [0, 0, 0, 0, 3], 1], [1, 0, 0, 0, 1]), ('partial-repair probe', [['WS', 'ON'], [3, 3], 0], [3, 3]), ('partial-repair probe', [['L', 'PDI', 'WS', 'ON', 'ON', 'PDI'], [3, 1, 1, 1, 1, 1], 0], [3, 1, 1, 1, 1, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('control layout', [['ON', 'LRI', 'EN', 'ON'], [1, 2, 2, 2], 0], [1, 2, 2, 2]), ('control layout', [['R', 'FSI', 'L'], [1, 3, 3], 0], [1, 3, 3])], [('regression: segment separator reset', [['R', 'LRI', 'L', 'S', 'R', 'ON', 'R', 'L'], [1, 3, 3, 3, 0, 2, 2, 2], 0], [1, 3, 3, 0, 0, 2, 2, 2]), ('regression: segment separator reset', [['S', 'S', 'PDI', 'WS', 'R', 'ON', 'LRI', 'WS', 'ON', 'R', 'WS', 'ON'], [0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2], 1], [1, 1, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2]), ('partial-repair probe', [['FSI', 'L', 'L', 'LRI', 'WS', 'ON', 'WS', 'RLI', 'WS', 'B', 'PDI', 'L'], [2, 2, 2, 2, 1, 0, 0, 1, 1, 1, 1, 1], 0], [2, 2, 2, 2, 1, 0, 0, 0, 0, 0, 1, 1]), ('regression: segment separator reset', [['EN', 'S', 'RLI', 'EN', 'R', 'WS', 'R', 'FSI', 'ON', 'WS', 'WS', 'FSI'], [4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 2, 1], 0], [4, 0, 4, 4, 4, 4, 4, 3, 3, 0, 0, 0]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['R', 'L', 'R', 'WS'], [1, 1, 1, 1], 0], [1, 1, 1, 0]), ('control layout', [['L', 'RLI', 'ON', 'RLI'], [4, 4, 4, 4], 0], [4, 4, 4, 0])], [('regression: segment separator reset', [['WS', 'EN', 'RLI', 'WS', 'PDI', 'R', 'EN', 'WS', 'S'], [2, 2, 2, 2, 3, 3, 3, 0, 0], 1], [2, 2, 2, 2, 3, 3, 3, 1, 1]), ('regression: segment separator reset', [['L', 'WS', 'B', 'ON', 'WS', 'R', 'S', 'WS', 'WS', 'L', 'PDI', 'S'], [1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4], 0], [1, 0, 0, 2, 2, 2, 0, 2, 2, 4, 0, 0]), ('partial-repair probe', [['EN', 'R', 'B', 'WS', 'R', 'L', 'L', 'ON', 'LRI', 'ON', 'EN'], [2, 2, 4, 4, 4, 1, 1, 1, 4, 1, 3], 1], [2, 2, 1, 4, 4, 1, 1, 1, 4, 1, 3]), ('partial-repair probe', [['L', 'WS', 'B', 'WS', 'ON'], [0, 0, 0, 2, 2], 1], [0, 1, 1, 2, 2]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['ON', 'WS'], [2, 2], 1], [2, 1]), ('control layout', [['RLI', 'ON'], [2, 2], 1], [2, 2])], [('regression: segment separator reset', [['LRI', 'EN', 'WS', 'WS', 'R', 'RLI', 'S', 'WS', 'ON', 'L', 'EN', 'PDI'], [2, 2, 1, 2, 2, 2, 1, 1, 3, 3, 1, 3], 0], [2, 2, 1, 2, 2, 0, 0, 1, 3, 3, 1, 0]), ('regression: segment separator reset', [['PDI', 'S', 'R', 'ON', 'LRI'], [1, 4, 4, 4, 4], 1], [1, 1, 4, 4, 1]), ('partial-repair probe', [['WS', 'R', 'LRI'], [0, 0, 1], 1], [0, 0, 1]), ('partial-repair probe', [['L', 'B', 'WS', 'PDI', 'L', 'B', 'L', 'L', 'RLI'], [2, 2, 2, 2, 3, 3, 3, 2, 2], 1], [2, 1, 2, 2, 3, 1, 3, 2, 1]), ('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('control layout', [['L', 'FSI'], [1, 4], 0], [1, 0]), ('control layout', [['WS', 'L', 'EN', 'R', 'R'], [1, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1])], [('regression: segment separator reset', [['S', 'RLI', 'B', 'L', 'WS', 'L', 'WS'], [1, 1, 1, 2, 2, 2, 0], 0], [0, 0, 0, 2, 2, 2, 0]), ('regression: segment separator reset', [['EN', 'LRI', 'LRI', 'S', 'B', 'FSI', 'R', 'ON', 'PDI', 'B'], [2, 2, 2, 2, 2, 2, 2, 2, 2, 3], 1], [2, 1, 1, 1, 1, 2, 2, 2, 1, 1]), ('partial-repair probe', [['WS', 'PDI', 'L', 'L'], [1, 1, 1, 1], 0], [1, 1, 1, 1]), ('partial-repair probe', [['R', 'ON', 'LRI', 'L', 'WS', 'WS', 'PDI', 'ON'], [1, 3, 3, 3, 2, 4, 4, 4], 0], [1, 3, 3, 3, 2, 4, 4, 4]), ('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('control layout', [['EN', 'R', 'ON', 'R', 'WS'], [1, 1, 1, 1, 3], 0], [1, 1, 1, 1, 0]), ('control layout', [['FSI', 'RLI', 'B', 'R', 'ON', 'RLI', 'LRI', 'ON', 'WS'], [2, 2, 2, 2, 2, 1, 2, 0, 0], 1], [1, 1, 1, 2, 2, 1, 2, 0, 1])]]\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 bidi model over stipulated class labels and integer levels; it is inspired by, but does not claim conformance to, any published algorithm. 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-bidirectional-text-layout-whitespace-reset-segment-separator-reset","generated_at":"2026-09-29T14:49:54.420516+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Mixed right-to-left and left-to-right text must resolve levels and visual order exactly, or words, numbers and carets land in the wrong place.","repair":"Reset segment separators (S) and paragraph separators (B).","root_cause":"Only paragraph separators trigger the reset.","sha256":"e942718dc9ac63f6648ce91eef26ce2293b85f44663b4109e92139036e125c36","title":"Line-end whitespace level reset: segment separator reset · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.473,"exit_code":1,"observations":[{"actual":[1,0,0,1],"check":"space before tab","expected":[1,0,0,1],"passed":true},{"actual":[1,0,1,0,1],"check":"regression: segment separator reset","expected":[1,0,0,0,1],"passed":false},{"actual":[0,3],"check":"partial-repair probe","expected":[3,3],"passed":false},{"actual":[3,0,0,1,1,0],"check":"partial-repair probe","expected":[3,1,1,1,1,0],"passed":false},{"actual":[0,0],"check":"all whitespace line","expected":[0,0],"passed":true},{"actual":[1,1,0,0],"check":"trailing isolate and space","expected":[1,1,0,0],"passed":true},{"actual":[1,2,2,2],"check":"control layout","expected":[1,2,2,2],"passed":true},{"actual":[1,3,3],"check":"control layout","expected":[1,3,3],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"space before tab\", \"actual\": [1, 0, 0, 1], \"expected\": [1, 0, 0, 1], \"passed\": true}, {\"check\": \"regression: segment separator reset\", \"actual\": [1, 0, 1, 0, 1], \"expected\": [1, 0, 0, 0, 1], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [0, 3], \"expected\": [3, 3], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [3, 0, 0, 1, 1, 0], \"expected\": [3, 1, 1, 1, 1, 0], \"passed\": false}, {\"check\": \"all whitespace line\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"trailing isolate and space\", \"actual\": [1, 1, 0, 0], \"expected\": [1, 1, 0, 0], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 2, 2, 2], \"expected\": [1, 2, 2, 2], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 3, 3], \"expected\": [1, 3, 3], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.295,"exit_code":1,"observations":[{"actual":[1,1,1,1],"check":"space before tab","expected":[1,0,0,1],"passed":false},{"actual":[0,0,0,0,3],"check":"regression: segment separator reset","expected":[1,0,0,0,1],"passed":false},{"actual":[3,3],"check":"partial-repair probe","expected":[3,3],"passed":true},{"actual":[3,1,1,1,1,0],"check":"partial-repair probe","expected":[3,1,1,1,1,0],"passed":true},{"actual":[0,0],"check":"all whitespace line","expected":[0,0],"passed":true},{"actual":[1,1,0,0],"check":"trailing isolate and space","expected":[1,1,0,0],"passed":true},{"actual":[1,2,2,2],"check":"control layout","expected":[1,2,2,2],"passed":true},{"actual":[1,3,3],"check":"control layout","expected":[1,3,3],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"space before tab\", \"actual\": [1, 1, 1, 1], \"expected\": [1, 0, 0, 1], \"passed\": false}, {\"check\": \"regression: segment separator reset\", \"actual\": [0, 0, 0, 0, 3], \"expected\": [1, 0, 0, 0, 1], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [3, 3], \"expected\": [3, 3], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [3, 1, 1, 1, 1, 0], \"expected\": [3, 1, 1, 1, 1, 0], \"passed\": true}, {\"check\": \"all whitespace line\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"trailing isolate and space\", \"actual\": [1, 1, 0, 0], \"expected\": [1, 1, 0, 0], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 2, 2, 2], \"expected\": [1, 2, 2, 2], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 3, 3], \"expected\": [1, 3, 3], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.452,"exit_code":0,"observations":[{"actual":[1,0,0,1],"check":"space before tab","expected":[1,0,0,1],"passed":true},{"actual":[1,0,0,0,1],"check":"regression: segment separator reset","expected":[1,0,0,0,1],"passed":true},{"actual":[3,3],"check":"partial-repair probe","expected":[3,3],"passed":true},{"actual":[3,1,1,1,1,0],"check":"partial-repair probe","expected":[3,1,1,1,1,0],"passed":true},{"actual":[0,0],"check":"all whitespace line","expected":[0,0],"passed":true},{"actual":[1,1,0,0],"check":"trailing isolate and space","expected":[1,1,0,0],"passed":true},{"actual":[1,2,2,2],"check":"control layout","expected":[1,2,2,2],"passed":true},{"actual":[1,3,3],"check":"control layout","expected":[1,3,3],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"space before tab\", \"actual\": [1, 0, 0, 1], \"expected\": [1, 0, 0, 1], \"passed\": true}, {\"check\": \"regression: segment separator reset\", \"actual\": [1, 0, 0, 0, 1], \"expected\": [1, 0, 0, 0, 1], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [3, 3], \"expected\": [3, 3], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [3, 1, 1, 1, 1, 0], \"expected\": [3, 1, 1, 1, 1, 0], \"passed\": true}, {\"check\": \"all whitespace line\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"trailing isolate and space\", \"actual\": [1, 1, 0, 0], \"expected\": [1, 1, 0, 0], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 2, 2, 2], \"expected\": [1, 2, 2, 2], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 3, 3], \"expected\": [1, 3, 3], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}