{"abstract":"Only one space before a tab is reset.","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.","contract_signature":"x","evaluation_group":"w2-bidirectional-text-layout-whitespace-reset","failed_approach":"Stopping before index 0 misses runs at the line start.","family":"w2-bidirectional-text-layout-whitespace-reset-whitespace-before-separator","id":"FA-80511","implementations":{"attempt":{"sha256":"7e24ec3be781a319297ed2d940d23ba2dbc76e2e2edb3f355c377a6c8b4f6b7c","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 = [[('regression: whitespace before separator', [['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]), ('regression: whitespace before separator', [['WS', 'WS', 'WS', 'S', 'WS'], [1, 1, 1, 1, 2], 0], [0, 0, 0, 0, 0]), ('partial-repair probe', [['PDI', 'S', 'ON', 'R'], [3, 3, 1, 1], 1], [1, 1, 1, 1]), ('partial-repair probe', [['WS', 'S', 'FSI', 'FSI', 'EN', 'ON'], [1, 1, 1, 1, 1, 1], 0], [0, 0, 1, 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', 'WS', 'L', 'WS', 'WS', 'ON', 'S', 'WS', 'WS'], [2, 2, 2, 1, 1, 1, 1, 1, 1], 0], [2, 2, 2, 1, 1, 1, 0, 0, 0]), ('control layout', [['ON', 'WS', 'ON'], [1, 1, 1], 0], [1, 1, 1])], [('regression: whitespace before separator', [['L', 'B', 'RLI', 'WS', 'B', 'R', 'WS', 'RLI', 'L'], [1, 1, 1, 1, 3, 3, 3, 1, 2], 0], [1, 0, 0, 0, 0, 3, 3, 1, 2]), ('regression: whitespace before separator', [['WS', 'WS', 'RLI', 'S', 'WS', 'WS', 'WS', 'PDI', 'LRI', 'ON'], [4, 4, 4, 3, 3, 4, 4, 4, 4, 4], 0], [0, 0, 0, 0, 3, 4, 4, 4, 4, 4]), ('regression: whitespace before separator', [['PDI', 'WS', 'LRI', 'B'], [0, 1, 1, 1], 1], [1, 1, 1, 1]), ('regression: whitespace before separator', [['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]), ('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', [['FSI'], [1], 1], [1]), ('control layout', [['EN', 'L'], [2, 2], 0], [2, 2])], [('regression: whitespace before separator', [['LRI', 'L', 'FSI', 'R', 'WS', 'FSI', 'S', 'R', 'WS'], [1, 1, 2, 2, 2, 0, 0, 0, 0], 0], [1, 1, 2, 2, 0, 0, 0, 0, 0]), ('regression: whitespace before separator', [['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]), ('partial-repair probe', [['PDI', 'S', 'ON', 'R'], [3, 3, 1, 1], 1], [1, 1, 1, 1]), ('partial-repair probe', [['WS', 'S'], [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', [['FSI'], [1], 1], [1]), ('control layout', [['ON', 'B', 'WS', 'LRI', 'R'], [1, 2, 2, 2, 2], 0], [1, 0, 2, 2, 2])], [('regression: whitespace before separator', [['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: whitespace before separator', [['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: whitespace before separator', [['PDI', 'WS', 'LRI', 'B'], [0, 1, 1, 1], 1], [1, 1, 1, 1]), ('regression: whitespace before separator', [['WS', 'WS', 'S', 'L', 'R', 'R', 'R'], [2, 2, 2, 2, 2, 0, 0], 0], [0, 0, 0, 2, 2, 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', [['FSI', 'R', 'S', 'RLI', 'S', 'R', 'PDI', 'ON', 'LRI', 'L', 'WS'], [1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1]), ('control layout', [['L', 'L', 'RLI', 'PDI'], [1, 1, 2, 1], 1], [1, 1, 1, 1])], [('regression: whitespace before separator', [['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]), ('regression: whitespace before separator', [['ON', 'S', 'B', 'WS', 'WS', 'FSI', 'S', 'R', 'S', 'L', 'PDI'], [4, 4, 4, 4, 3, 3, 2, 1, 1, 1, 1], 0], [4, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0]), ('partial-repair probe', [['WS', 'S', 'L', 'R', 'PDI', 'R', 'B', 'WS', 'RLI', 'LRI'], [0, 2, 2, 2, 2, 3, 3, 0, 0, 0], 1], [1, 1, 2, 2, 2, 3, 1, 1, 1, 1]), ('regression: whitespace before separator', [['WS', 'WS', 'RLI', 'S', 'WS', 'WS', 'WS', 'PDI', 'LRI', 'ON'], [4, 4, 4, 3, 3, 4, 4, 4, 4, 4], 0], [0, 0, 0, 0, 3, 4, 4, 4, 4, 4]), ('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', [['RLI', 'L', 'PDI', 'WS', 'L'], [4, 4, 4, 1, 4], 0], [4, 4, 4, 1, 4]), ('control layout', [['EN', 'WS'], [1, 1], 1], [1, 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":"6147eeb5fdb9a2dab6c82081c39e81da5894f8cb055767e7c6607ceb66b70519","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            if k >= 0 and classes[k] in RESETTABLE:\n                out[k] = para\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: whitespace before separator', [['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]), ('regression: whitespace before separator', [['WS', 'WS', 'WS', 'S', 'WS'], [1, 1, 1, 1, 2], 0], [0, 0, 0, 0, 0]), ('partial-repair probe', [['PDI', 'S', 'ON', 'R'], [3, 3, 1, 1], 1], [1, 1, 1, 1]), ('partial-repair probe', [['WS', 'S', 'FSI', 'FSI', 'EN', 'ON'], [1, 1, 1, 1, 1, 1], 0], [0, 0, 1, 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', 'WS', 'L', 'WS', 'WS', 'ON', 'S', 'WS', 'WS'], [2, 2, 2, 1, 1, 1, 1, 1, 1], 0], [2, 2, 2, 1, 1, 1, 0, 0, 0]), ('control layout', [['ON', 'WS', 'ON'], [1, 1, 1], 0], [1, 1, 1])], [('regression: whitespace before separator', [['L', 'B', 'RLI', 'WS', 'B', 'R', 'WS', 'RLI', 'L'], [1, 1, 1, 1, 3, 3, 3, 1, 2], 0], [1, 0, 0, 0, 0, 3, 3, 1, 2]), ('regression: whitespace before separator', [['WS', 'WS', 'RLI', 'S', 'WS', 'WS', 'WS', 'PDI', 'LRI', 'ON'], [4, 4, 4, 3, 3, 4, 4, 4, 4, 4], 0], [0, 0, 0, 0, 3, 4, 4, 4, 4, 4]), ('regression: whitespace before separator', [['PDI', 'WS', 'LRI', 'B'], [0, 1, 1, 1], 1], [1, 1, 1, 1]), ('regression: whitespace before separator', [['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]), ('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', [['FSI'], [1], 1], [1]), ('control layout', [['EN', 'L'], [2, 2], 0], [2, 2])], [('regression: whitespace before separator', [['LRI', 'L', 'FSI', 'R', 'WS', 'FSI', 'S', 'R', 'WS'], [1, 1, 2, 2, 2, 0, 0, 0, 0], 0], [1, 1, 2, 2, 0, 0, 0, 0, 0]), ('regression: whitespace before separator', [['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]), ('partial-repair probe', [['PDI', 'S', 'ON', 'R'], [3, 3, 1, 1], 1], [1, 1, 1, 1]), ('partial-repair probe', [['WS', 'S'], [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', [['FSI'], [1], 1], [1]), ('control layout', [['ON', 'B', 'WS', 'LRI', 'R'], [1, 2, 2, 2, 2], 0], [1, 0, 2, 2, 2])], [('regression: whitespace before separator', [['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: whitespace before separator', [['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: whitespace before separator', [['PDI', 'WS', 'LRI', 'B'], [0, 1, 1, 1], 1], [1, 1, 1, 1]), ('regression: whitespace before separator', [['WS', 'WS', 'S', 'L', 'R', 'R', 'R'], [2, 2, 2, 2, 2, 0, 0], 0], [0, 0, 0, 2, 2, 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', [['FSI', 'R', 'S', 'RLI', 'S', 'R', 'PDI', 'ON', 'LRI', 'L', 'WS'], [1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1], 1], [1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1]), ('control layout', [['L', 'L', 'RLI', 'PDI'], [1, 1, 2, 1], 1], [1, 1, 1, 1])], [('regression: whitespace before separator', [['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]), ('regression: whitespace before separator', [['ON', 'S', 'B', 'WS', 'WS', 'FSI', 'S', 'R', 'S', 'L', 'PDI'], [4, 4, 4, 4, 3, 3, 2, 1, 1, 1, 1], 0], [4, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0]), ('partial-repair probe', [['WS', 'S', 'L', 'R', 'PDI', 'R', 'B', 'WS', 'RLI', 'LRI'], [0, 2, 2, 2, 2, 3, 3, 0, 0, 0], 1], [1, 1, 2, 2, 2, 3, 1, 1, 1, 1]), ('regression: whitespace before separator', [['WS', 'WS', 'RLI', 'S', 'WS', 'WS', 'WS', 'PDI', 'LRI', 'ON'], [4, 4, 4, 3, 3, 4, 4, 4, 4, 4], 0], [0, 0, 0, 0, 3, 4, 4, 4, 4, 4]), ('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', [['RLI', 'L', 'PDI', 'WS', 'L'], [4, 4, 4, 1, 4], 0], [4, 4, 4, 1, 4]), ('control layout', [['EN', 'WS'], [1, 1], 1], [1, 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-whitespace-before-separator","generated_at":"2026-09-29T14:49:54.552068+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.","root_cause":"The backward scan before a separator resets a single character.","sha256":"31f737d34bce4acb96feb37d5975c180339d31498cbf62479cc6f019d4fd1815","title":"Line-end whitespace level reset: whitespace before separator · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":46.155,"exit_code":1,"observations":[{"actual":[2,1,1,2,2,1,2,0,1],"check":"regression: whitespace before separator","expected":[1,1,1,2,2,1,2,0,1],"passed":false},{"actual":[1,0,0,0,0],"check":"regression: whitespace before separator","expected":[0,0,0,0,0],"passed":false},{"actual":[3,1,1,1],"check":"partial-repair probe","expected":[1,1,1,1],"passed":false},{"actual":[1,0,1,1,1,1],"check":"partial-repair probe","expected":[0,0,1,1,1,1],"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":[2,2,2,1,1,1,0,0,0],"check":"control layout","expected":[2,2,2,1,1,1,0,0,0],"passed":true},{"actual":[1,1,1],"check":"control layout","expected":[1,1,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: whitespace before separator\", \"actual\": [2, 1, 1, 2, 2, 1, 2, 0, 1], \"expected\": [1, 1, 1, 2, 2, 1, 2, 0, 1], \"passed\": false}, {\"check\": \"regression: whitespace before separator\", \"actual\": [1, 0, 0, 0, 0], \"expected\": [0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [3, 1, 1, 1], \"expected\": [1, 1, 1, 1], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [1, 0, 1, 1, 1, 1], \"expected\": [0, 0, 1, 1, 1, 1], \"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\": [2, 2, 2, 1, 1, 1, 0, 0, 0], \"expected\": [2, 2, 2, 1, 1, 1, 0, 0, 0], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 1, 1], \"expected\": [1, 1, 1], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.623,"exit_code":1,"observations":[{"actual":[2,1,1,2,2,1,2,0,1],"check":"regression: whitespace before separator","expected":[1,1,1,2,2,1,2,0,1],"passed":false},{"actual":[1,1,0,0,0],"check":"regression: whitespace before separator","expected":[0,0,0,0,0],"passed":false},{"actual":[1,1,1,1],"check":"partial-repair probe","expected":[1,1,1,1],"passed":true},{"actual":[0,0,1,1,1,1],"check":"partial-repair probe","expected":[0,0,1,1,1,1],"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":[2,2,2,1,1,1,0,0,0],"check":"control layout","expected":[2,2,2,1,1,1,0,0,0],"passed":true},{"actual":[1,1,1],"check":"control layout","expected":[1,1,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: whitespace before separator\", \"actual\": [2, 1, 1, 2, 2, 1, 2, 0, 1], \"expected\": [1, 1, 1, 2, 2, 1, 2, 0, 1], \"passed\": false}, {\"check\": \"regression: whitespace before separator\", \"actual\": [1, 1, 0, 0, 0], \"expected\": [0, 0, 0, 0, 0], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [1, 1, 1, 1], \"expected\": [1, 1, 1, 1], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [0, 0, 1, 1, 1, 1], \"expected\": [0, 0, 1, 1, 1, 1], \"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\": [2, 2, 2, 1, 1, 1, 0, 0, 0], \"expected\": [2, 2, 2, 1, 1, 1, 0, 0, 0], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [1, 1, 1], \"expected\": [1, 1, 1], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}