{"abstract":"Isolate controls at the line end keep embedded levels.","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":"Adding only PDI still misses initiators.","family":"w2-bidirectional-text-layout-whitespace-reset-isolate-controls-in-reset-runs","id":"FA-80496","implementations":{"attempt":{"sha256":"3340b23fbbaa6e1093fd0f3d6d0a515ea5a46cdb35116d36c3eac6ed5d795c51","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', '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 = [[('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('regression: isolate controls in reset runs', [['FSI', 'LRI', 'FSI', 'WS', 'B', 'RLI', 'WS', 'WS'], [1, 1, 3, 3, 2, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['S', 'WS', 'WS', 'FSI', 'B', 'ON', 'S', 'R'], [1, 1, 1, 1, 1, 1, 1, 1], 0], [0, 0, 0, 0, 0, 1, 0, 1]), ('regression: isolate controls in reset runs', [['PDI', 'WS', 'WS', 'LRI', 'RLI', 'WS'], [1, 1, 1, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('control layout', [['PDI', 'LRI', 'L', 'L', 'WS', 'ON'], [0, 0, 1, 1, 1, 1], 0], [0, 0, 1, 1, 1, 1]), ('control layout', [['WS', 'L', 'R', 'FSI', 'L'], [2, 2, 2, 2, 2], 1], [2, 2, 2, 2, 2])], [('regression: isolate controls in reset runs', [['RLI', 'R', 'LRI', 'FSI', 'WS'], [1, 2, 4, 4, 4], 0], [1, 2, 0, 0, 0]), ('regression: isolate controls in reset runs', [['ON', 'ON', 'WS', 'R', 'RLI', 'LRI'], [4, 4, 4, 4, 3, 4], 1], [4, 4, 4, 4, 1, 1]), ('regression: isolate controls in reset runs', [['ON', 'WS', 'R', 'ON', 'WS', 'R', 'WS', 'FSI', 'PDI'], [4, 4, 4, 4, 2, 2, 3, 4, 1], 0], [4, 4, 4, 4, 2, 2, 0, 0, 0]), ('regression: isolate controls in reset runs', [['S', 'WS', 'L', 'WS', 'R', 'L', 'RLI', 'PDI'], [4, 4, 2, 2, 2, 2, 3, 2], 0], [0, 4, 2, 2, 2, 2, 0, 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', [['B', 'S', 'WS', 'ON', 'L', 'FSI', 'WS', 'L', 'RLI', 'WS', 'L', 'B'], [1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0, 0], 1], [1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0, 1]), ('control layout', [['R'], [2], 1], [2])], [('regression: isolate controls in reset runs', [['L', 'L', 'WS', 'PDI'], [2, 2, 2, 2], 0], [2, 2, 0, 0]), ('regression: isolate controls in reset runs', [['ON', 'R', 'PDI', 'B', 'WS', 'RLI', 'FSI', 'B', 'WS'], [0, 0, 0, 0, 1, 1, 1, 3, 3], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['B', 'WS', 'R', 'L', 'B', 'R', 'WS', 'FSI', 'ON', 'FSI'], [3, 3, 3, 3, 4, 4, 2, 2, 2, 4], 1], [1, 3, 3, 3, 1, 4, 2, 2, 2, 1]), ('regression: isolate controls in reset runs', [['LRI', 'R', 'EN', 'S', 'L', 'L', 'LRI', 'FSI', 'WS'], [3, 3, 3, 3, 3, 3, 3, 3, 4], 1], [3, 3, 3, 1, 3, 3, 1, 1, 1]), ('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', [['L', 'L', 'R', 'ON', 'WS', 'WS', 'WS', 'L', 'WS', 'PDI', 'R'], [2, 2, 4, 4, 4, 1, 2, 2, 2, 2, 2], 0], [2, 2, 4, 4, 4, 1, 2, 2, 2, 2, 2]), ('control layout', [['LRI', 'R', 'ON', 'ON', 'PDI', 'PDI'], [1, 1, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1, 1])], [('regression: isolate controls in reset runs', [['FSI', 'LRI', 'FSI', 'WS', 'B', 'RLI', 'WS', 'WS'], [1, 1, 3, 3, 2, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['L', 'WS', 'R', 'EN', 'WS', 'B', 'B', 'R', 'B', 'WS', 'L', 'LRI'], [2, 2, 2, 1, 1, 1, 1, 4, 4, 4, 4, 4], 1], [2, 2, 2, 1, 1, 1, 1, 4, 1, 4, 4, 1]), ('regression: isolate controls in reset runs', [['WS', 'PDI', 'RLI'], [3, 1, 1], 0], [0, 0, 0]), ('regression: isolate controls in reset runs', [['PDI', 'FSI'], [0, 0], 1], [1, 1]), ('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', [['B', 'L', 'EN'], [3, 3, 1], 1], [1, 3, 1]), ('control layout', [['WS', 'R', 'L'], [1, 1, 1], 0], [1, 1, 1])], [('regression: isolate controls in reset runs', [['WS', 'FSI', 'ON', 'RLI', 'PDI', 'RLI', 'FSI'], [0, 0, 0, 1, 1, 1, 1], 0], [0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['L', 'WS', 'R', 'L', 'S', 'WS', 'L', 'LRI'], [2, 2, 2, 2, 4, 4, 4, 4], 1], [2, 2, 2, 2, 1, 4, 4, 1]), ('regression: isolate controls in reset runs', [['LRI', 'R', 'EN', 'S', 'L', 'L', 'LRI', 'FSI', 'WS'], [3, 3, 3, 3, 3, 3, 3, 3, 4], 1], [3, 3, 3, 1, 3, 3, 1, 1, 1]), ('regression: isolate controls in reset runs', [['EN', 'WS', 'L', 'WS', 'R', 'PDI', 'WS', 'R', 'R', 'S', 'RLI'], [1, 1, 1, 1, 0, 0, 2, 3, 3, 3, 3], 0], [1, 1, 1, 1, 0, 0, 2, 3, 3, 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', 'RLI', 'EN', 'R', 'R', 'R', 'L'], [1, 1, 1, 0, 0, 0, 0], 1], [1, 1, 1, 0, 0, 0, 0]), ('control layout', [['L', 'ON', 'L', 'WS', 'S', 'PDI', 'WS', 'R', 'R', 'PDI', 'EN'], [3, 1, 1, 0, 0, 2, 3, 3, 3, 0, 0], 1], [3, 1, 1, 1, 1, 2, 3, 3, 3, 0, 0])]]\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":"ab4224ec5ed4fd55499dd3efa13817cb3f0d493b5fba6d4b6218e16320329a43","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',)\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 = [[('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('regression: isolate controls in reset runs', [['FSI', 'LRI', 'FSI', 'WS', 'B', 'RLI', 'WS', 'WS'], [1, 1, 3, 3, 2, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['S', 'WS', 'WS', 'FSI', 'B', 'ON', 'S', 'R'], [1, 1, 1, 1, 1, 1, 1, 1], 0], [0, 0, 0, 0, 0, 1, 0, 1]), ('regression: isolate controls in reset runs', [['PDI', 'WS', 'WS', 'LRI', 'RLI', 'WS'], [1, 1, 1, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('control layout', [['PDI', 'LRI', 'L', 'L', 'WS', 'ON'], [0, 0, 1, 1, 1, 1], 0], [0, 0, 1, 1, 1, 1]), ('control layout', [['WS', 'L', 'R', 'FSI', 'L'], [2, 2, 2, 2, 2], 1], [2, 2, 2, 2, 2])], [('regression: isolate controls in reset runs', [['RLI', 'R', 'LRI', 'FSI', 'WS'], [1, 2, 4, 4, 4], 0], [1, 2, 0, 0, 0]), ('regression: isolate controls in reset runs', [['ON', 'ON', 'WS', 'R', 'RLI', 'LRI'], [4, 4, 4, 4, 3, 4], 1], [4, 4, 4, 4, 1, 1]), ('regression: isolate controls in reset runs', [['ON', 'WS', 'R', 'ON', 'WS', 'R', 'WS', 'FSI', 'PDI'], [4, 4, 4, 4, 2, 2, 3, 4, 1], 0], [4, 4, 4, 4, 2, 2, 0, 0, 0]), ('regression: isolate controls in reset runs', [['S', 'WS', 'L', 'WS', 'R', 'L', 'RLI', 'PDI'], [4, 4, 2, 2, 2, 2, 3, 2], 0], [0, 4, 2, 2, 2, 2, 0, 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', [['B', 'S', 'WS', 'ON', 'L', 'FSI', 'WS', 'L', 'RLI', 'WS', 'L', 'B'], [1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0, 0], 1], [1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0, 1]), ('control layout', [['R'], [2], 1], [2])], [('regression: isolate controls in reset runs', [['L', 'L', 'WS', 'PDI'], [2, 2, 2, 2], 0], [2, 2, 0, 0]), ('regression: isolate controls in reset runs', [['ON', 'R', 'PDI', 'B', 'WS', 'RLI', 'FSI', 'B', 'WS'], [0, 0, 0, 0, 1, 1, 1, 3, 3], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['B', 'WS', 'R', 'L', 'B', 'R', 'WS', 'FSI', 'ON', 'FSI'], [3, 3, 3, 3, 4, 4, 2, 2, 2, 4], 1], [1, 3, 3, 3, 1, 4, 2, 2, 2, 1]), ('regression: isolate controls in reset runs', [['LRI', 'R', 'EN', 'S', 'L', 'L', 'LRI', 'FSI', 'WS'], [3, 3, 3, 3, 3, 3, 3, 3, 4], 1], [3, 3, 3, 1, 3, 3, 1, 1, 1]), ('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', [['L', 'L', 'R', 'ON', 'WS', 'WS', 'WS', 'L', 'WS', 'PDI', 'R'], [2, 2, 4, 4, 4, 1, 2, 2, 2, 2, 2], 0], [2, 2, 4, 4, 4, 1, 2, 2, 2, 2, 2]), ('control layout', [['LRI', 'R', 'ON', 'ON', 'PDI', 'PDI'], [1, 1, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1, 1])], [('regression: isolate controls in reset runs', [['FSI', 'LRI', 'FSI', 'WS', 'B', 'RLI', 'WS', 'WS'], [1, 1, 3, 3, 2, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['L', 'WS', 'R', 'EN', 'WS', 'B', 'B', 'R', 'B', 'WS', 'L', 'LRI'], [2, 2, 2, 1, 1, 1, 1, 4, 4, 4, 4, 4], 1], [2, 2, 2, 1, 1, 1, 1, 4, 1, 4, 4, 1]), ('regression: isolate controls in reset runs', [['WS', 'PDI', 'RLI'], [3, 1, 1], 0], [0, 0, 0]), ('regression: isolate controls in reset runs', [['PDI', 'FSI'], [0, 0], 1], [1, 1]), ('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', [['B', 'L', 'EN'], [3, 3, 1], 1], [1, 3, 1]), ('control layout', [['WS', 'R', 'L'], [1, 1, 1], 0], [1, 1, 1])], [('regression: isolate controls in reset runs', [['WS', 'FSI', 'ON', 'RLI', 'PDI', 'RLI', 'FSI'], [0, 0, 0, 1, 1, 1, 1], 0], [0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['L', 'WS', 'R', 'L', 'S', 'WS', 'L', 'LRI'], [2, 2, 2, 2, 4, 4, 4, 4], 1], [2, 2, 2, 2, 1, 4, 4, 1]), ('regression: isolate controls in reset runs', [['LRI', 'R', 'EN', 'S', 'L', 'L', 'LRI', 'FSI', 'WS'], [3, 3, 3, 3, 3, 3, 3, 3, 4], 1], [3, 3, 3, 1, 3, 3, 1, 1, 1]), ('regression: isolate controls in reset runs', [['EN', 'WS', 'L', 'WS', 'R', 'PDI', 'WS', 'R', 'R', 'S', 'RLI'], [1, 1, 1, 1, 0, 0, 2, 3, 3, 3, 3], 0], [1, 1, 1, 1, 0, 0, 2, 3, 3, 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', 'RLI', 'EN', 'R', 'R', 'R', 'L'], [1, 1, 1, 0, 0, 0, 0], 1], [1, 1, 1, 0, 0, 0, 0]), ('control layout', [['L', 'ON', 'L', 'WS', 'S', 'PDI', 'WS', 'R', 'R', 'PDI', 'EN'], [3, 1, 1, 0, 0, 2, 3, 3, 3, 0, 0], 1], [3, 1, 1, 1, 1, 2, 3, 3, 3, 0, 0])]]\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":"9007bb6d62c01482a90c211d15a3b625c0dc8c9b36745b3187dd5f4085655fdd","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 = [[('trailing isolate and space', [['R', 'R', 'PDI', 'WS'], [1, 1, 1, 1], 0], [1, 1, 0, 0]), ('regression: isolate controls in reset runs', [['FSI', 'LRI', 'FSI', 'WS', 'B', 'RLI', 'WS', 'WS'], [1, 1, 3, 3, 2, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['S', 'WS', 'WS', 'FSI', 'B', 'ON', 'S', 'R'], [1, 1, 1, 1, 1, 1, 1, 1], 0], [0, 0, 0, 0, 0, 1, 0, 1]), ('regression: isolate controls in reset runs', [['PDI', 'WS', 'WS', 'LRI', 'RLI', 'WS'], [1, 1, 1, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0]), ('all whitespace line', [['WS', 'WS'], [1, 1], 0], [0, 0]), ('space before tab', [['R', 'WS', 'S', 'R'], [1, 1, 1, 1], 0], [1, 0, 0, 1]), ('control layout', [['PDI', 'LRI', 'L', 'L', 'WS', 'ON'], [0, 0, 1, 1, 1, 1], 0], [0, 0, 1, 1, 1, 1]), ('control layout', [['WS', 'L', 'R', 'FSI', 'L'], [2, 2, 2, 2, 2], 1], [2, 2, 2, 2, 2])], [('regression: isolate controls in reset runs', [['RLI', 'R', 'LRI', 'FSI', 'WS'], [1, 2, 4, 4, 4], 0], [1, 2, 0, 0, 0]), ('regression: isolate controls in reset runs', [['ON', 'ON', 'WS', 'R', 'RLI', 'LRI'], [4, 4, 4, 4, 3, 4], 1], [4, 4, 4, 4, 1, 1]), ('regression: isolate controls in reset runs', [['ON', 'WS', 'R', 'ON', 'WS', 'R', 'WS', 'FSI', 'PDI'], [4, 4, 4, 4, 2, 2, 3, 4, 1], 0], [4, 4, 4, 4, 2, 2, 0, 0, 0]), ('regression: isolate controls in reset runs', [['S', 'WS', 'L', 'WS', 'R', 'L', 'RLI', 'PDI'], [4, 4, 2, 2, 2, 2, 3, 2], 0], [0, 4, 2, 2, 2, 2, 0, 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', [['B', 'S', 'WS', 'ON', 'L', 'FSI', 'WS', 'L', 'RLI', 'WS', 'L', 'B'], [1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0, 0], 1], [1, 1, 1, 1, 3, 3, 3, 3, 0, 0, 0, 1]), ('control layout', [['R'], [2], 1], [2])], [('regression: isolate controls in reset runs', [['L', 'L', 'WS', 'PDI'], [2, 2, 2, 2], 0], [2, 2, 0, 0]), ('regression: isolate controls in reset runs', [['ON', 'R', 'PDI', 'B', 'WS', 'RLI', 'FSI', 'B', 'WS'], [0, 0, 0, 0, 1, 1, 1, 3, 3], 0], [0, 0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['B', 'WS', 'R', 'L', 'B', 'R', 'WS', 'FSI', 'ON', 'FSI'], [3, 3, 3, 3, 4, 4, 2, 2, 2, 4], 1], [1, 3, 3, 3, 1, 4, 2, 2, 2, 1]), ('regression: isolate controls in reset runs', [['LRI', 'R', 'EN', 'S', 'L', 'L', 'LRI', 'FSI', 'WS'], [3, 3, 3, 3, 3, 3, 3, 3, 4], 1], [3, 3, 3, 1, 3, 3, 1, 1, 1]), ('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', [['L', 'L', 'R', 'ON', 'WS', 'WS', 'WS', 'L', 'WS', 'PDI', 'R'], [2, 2, 4, 4, 4, 1, 2, 2, 2, 2, 2], 0], [2, 2, 4, 4, 4, 1, 2, 2, 2, 2, 2]), ('control layout', [['LRI', 'R', 'ON', 'ON', 'PDI', 'PDI'], [1, 1, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1, 1])], [('regression: isolate controls in reset runs', [['FSI', 'LRI', 'FSI', 'WS', 'B', 'RLI', 'WS', 'WS'], [1, 1, 3, 3, 2, 2, 2, 2], 0], [0, 0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['L', 'WS', 'R', 'EN', 'WS', 'B', 'B', 'R', 'B', 'WS', 'L', 'LRI'], [2, 2, 2, 1, 1, 1, 1, 4, 4, 4, 4, 4], 1], [2, 2, 2, 1, 1, 1, 1, 4, 1, 4, 4, 1]), ('regression: isolate controls in reset runs', [['WS', 'PDI', 'RLI'], [3, 1, 1], 0], [0, 0, 0]), ('regression: isolate controls in reset runs', [['PDI', 'FSI'], [0, 0], 1], [1, 1]), ('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', [['B', 'L', 'EN'], [3, 3, 1], 1], [1, 3, 1]), ('control layout', [['WS', 'R', 'L'], [1, 1, 1], 0], [1, 1, 1])], [('regression: isolate controls in reset runs', [['WS', 'FSI', 'ON', 'RLI', 'PDI', 'RLI', 'FSI'], [0, 0, 0, 1, 1, 1, 1], 0], [0, 0, 0, 0, 0, 0, 0]), ('regression: isolate controls in reset runs', [['L', 'WS', 'R', 'L', 'S', 'WS', 'L', 'LRI'], [2, 2, 2, 2, 4, 4, 4, 4], 1], [2, 2, 2, 2, 1, 4, 4, 1]), ('regression: isolate controls in reset runs', [['LRI', 'R', 'EN', 'S', 'L', 'L', 'LRI', 'FSI', 'WS'], [3, 3, 3, 3, 3, 3, 3, 3, 4], 1], [3, 3, 3, 1, 3, 3, 1, 1, 1]), ('regression: isolate controls in reset runs', [['EN', 'WS', 'L', 'WS', 'R', 'PDI', 'WS', 'R', 'R', 'S', 'RLI'], [1, 1, 1, 1, 0, 0, 2, 3, 3, 3, 3], 0], [1, 1, 1, 1, 0, 0, 2, 3, 3, 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', 'RLI', 'EN', 'R', 'R', 'R', 'L'], [1, 1, 1, 0, 0, 0, 0], 1], [1, 1, 1, 0, 0, 0, 0]), ('control layout', [['L', 'ON', 'L', 'WS', 'S', 'PDI', 'WS', 'R', 'R', 'PDI', 'EN'], [3, 1, 1, 0, 0, 2, 3, 3, 3, 0, 0], 1], [3, 1, 1, 1, 1, 2, 3, 3, 3, 0, 0])]]\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-isolate-controls-in-reset-runs","generated_at":"2026-09-29T14:49:54.237405+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":"Treat isolate formatting characters like whitespace in reset runs.","root_cause":"Only WS is treated as resettable whitespace.","sha256":"da1b110af59e7f255e087a5e01a24db2f717fca376b0dc716ce2df63d7bf2f08","title":"Line-end whitespace level reset: isolate controls in reset runs · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.944,"exit_code":1,"observations":[{"actual":[1,1,0,0],"check":"trailing isolate and space","expected":[1,1,0,0],"passed":true},{"actual":[1,1,3,0,0,2,0,0],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,0,0,0],"passed":false},{"actual":[0,1,1,1,0,1,0,1],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,1,0,1],"passed":false},{"actual":[1,1,1,2,2,0],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,0],"passed":false},{"actual":[0,0],"check":"all whitespace line","expected":[0,0],"passed":true},{"actual":[1,0,0,1],"check":"space before tab","expected":[1,0,0,1],"passed":true},{"actual":[0,0,1,1,1,1],"check":"control layout","expected":[0,0,1,1,1,1],"passed":true},{"actual":[2,2,2,2,2],"check":"control layout","expected":[2,2,2,2,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"trailing isolate and space\", \"actual\": [1, 1, 0, 0], \"expected\": [1, 1, 0, 0], \"passed\": true}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [1, 1, 3, 0, 0, 2, 0, 0], \"expected\": [0, 0, 0, 0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [0, 1, 1, 1, 0, 1, 0, 1], \"expected\": [0, 0, 0, 0, 0, 1, 0, 1], \"passed\": false}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [1, 1, 1, 2, 2, 0], \"expected\": [0, 0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"all whitespace line\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"space before tab\", \"actual\": [1, 0, 0, 1], \"expected\": [1, 0, 0, 1], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [0, 0, 1, 1, 1, 1], \"expected\": [0, 0, 1, 1, 1, 1], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [2, 2, 2, 2, 2], \"expected\": [2, 2, 2, 2, 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.094,"exit_code":1,"observations":[{"actual":[1,1,1,0],"check":"trailing isolate and space","expected":[1,1,0,0],"passed":false},{"actual":[1,1,3,0,0,2,0,0],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,0,0,0],"passed":false},{"actual":[0,1,1,1,0,1,0,1],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,1,0,1],"passed":false},{"actual":[1,1,1,2,2,0],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,0],"passed":false},{"actual":[0,0],"check":"all whitespace line","expected":[0,0],"passed":true},{"actual":[1,0,0,1],"check":"space before tab","expected":[1,0,0,1],"passed":true},{"actual":[0,0,1,1,1,1],"check":"control layout","expected":[0,0,1,1,1,1],"passed":true},{"actual":[2,2,2,2,2],"check":"control layout","expected":[2,2,2,2,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"trailing isolate and space\", \"actual\": [1, 1, 1, 0], \"expected\": [1, 1, 0, 0], \"passed\": false}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [1, 1, 3, 0, 0, 2, 0, 0], \"expected\": [0, 0, 0, 0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [0, 1, 1, 1, 0, 1, 0, 1], \"expected\": [0, 0, 0, 0, 0, 1, 0, 1], \"passed\": false}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [1, 1, 1, 2, 2, 0], \"expected\": [0, 0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"all whitespace line\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"space before tab\", \"actual\": [1, 0, 0, 1], \"expected\": [1, 0, 0, 1], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [0, 0, 1, 1, 1, 1], \"expected\": [0, 0, 1, 1, 1, 1], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [2, 2, 2, 2, 2], \"expected\": [2, 2, 2, 2, 2], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.874,"exit_code":0,"observations":[{"actual":[1,1,0,0],"check":"trailing isolate and space","expected":[1,1,0,0],"passed":true},{"actual":[0,0,0,0,0,0,0,0],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,0,0,0],"passed":true},{"actual":[0,0,0,0,0,1,0,1],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,1,0,1],"passed":true},{"actual":[0,0,0,0,0,0],"check":"regression: isolate controls in reset runs","expected":[0,0,0,0,0,0],"passed":true},{"actual":[0,0],"check":"all whitespace line","expected":[0,0],"passed":true},{"actual":[1,0,0,1],"check":"space before tab","expected":[1,0,0,1],"passed":true},{"actual":[0,0,1,1,1,1],"check":"control layout","expected":[0,0,1,1,1,1],"passed":true},{"actual":[2,2,2,2,2],"check":"control layout","expected":[2,2,2,2,2],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"trailing isolate and space\", \"actual\": [1, 1, 0, 0], \"expected\": [1, 1, 0, 0], \"passed\": true}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [0, 0, 0, 0, 0, 0, 0, 0], \"expected\": [0, 0, 0, 0, 0, 0, 0, 0], \"passed\": true}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [0, 0, 0, 0, 0, 1, 0, 1], \"expected\": [0, 0, 0, 0, 0, 1, 0, 1], \"passed\": true}, {\"check\": \"regression: isolate controls in reset runs\", \"actual\": [0, 0, 0, 0, 0, 0], \"expected\": [0, 0, 0, 0, 0, 0], \"passed\": true}, {\"check\": \"all whitespace line\", \"actual\": [0, 0], \"expected\": [0, 0], \"passed\": true}, {\"check\": \"space before tab\", \"actual\": [1, 0, 0, 1], \"expected\": [1, 0, 0, 1], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [0, 0, 1, 1, 1, 1], \"expected\": [0, 0, 1, 1, 1, 1], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [2, 2, 2, 2, 2], \"expected\": [2, 2, 2, 2, 2], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}