{"abstract":"Trailing spaces on RTL paragraphs are reset to level 0.","category":"Bidirectional text layout","checks":8,"contract":"Input [paragraph levels, classes, paragraph level, line lengths]. For each logical line: reset trailing WS to the paragraph level, then reorder that line alone by level reversal (lowest odd level of the line). Return per line the paragraph indices in visual order.","contract_signature":"x","evaluation_group":"w2-bidirectional-text-layout-per-line-reordering","failed_approach":"Rounding each level down to even is not the paragraph level.","family":"w2-bidirectional-text-layout-per-line-reordering-whitespace-reset-level","id":"FA-80721","implementations":{"attempt":{"sha256":"953bc740de94812aac5ca63fe5799eda7e858ba3d90acfbcb5d987623b6727e7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def reorder(lv):\n        vis = list(range(len(lv)))\n        odd = [l for l in lv if l % 2 == 1]\n        if not odd:\n            return vis\n        for lev in range(max(lv), min(odd) - 1, -1):\n            i = 0\n            while i < len(vis):\n                if lv[vis[i]] >= lev:\n                    j = i\n                    while j < len(vis) and lv[vis[j]] >= lev:\n                        j += 1\n                    vis[i:j] = vis[i:j][::-1]\n                    i = j\n                else:\n                    i += 1\n        return vis\n    \n    levels, classes, para, line_lengths = x\n    out = []\n    start = 0\n    for ln in line_lengths:\n        idx = list(range(start, start + ln))\n        lv = [levels[i] for i in idx]\n        j = ln - 1\n        while j >= 0 and classes[idx[j]] == 'WS':\n            lv[j] = lv[j] - lv[j] % 2\n            j -= 1\n        local = reorder(lv)\n        out.append([idx[v] for v in local])\n        start += ln\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: whitespace reset level', [[1, 1, 1, 1, 4, 4, 4, 3, 3, 4], ['R', 'R', 'R', 'WS', 'ON', 'WS', 'R', 'R', 'R', 'WS'], 1, [3, 2, 2, 1, 2]], [[2, 1, 0], [4, 3], [5, 6], [7], [9, 8]]), ('regression: whitespace reset level', [[2, 2, 2, 2], ['R', 'R', 'R', 'WS'], 1, [2, 2]], [[0, 1], [3, 2]]), ('regression: whitespace reset level', [[1, 1, 2, 1, 1, 1, 3, 3, 3, 1, 3, 3, 2, 2], ['WS', 'WS', 'ON', 'R', 'R', 'R', 'WS', 'WS', 'WS', 'WS', 'L', 'R', 'WS', 'R'], 1, [2, 4, 1, 4, 2, 1]], [[1, 0], [5, 4, 3, 2], [6], [10, 9, 8, 7], [12, 11], [13]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2], ['R', 'R', 'WS', 'R', 'ON', 'WS', 'WS', 'WS', 'L', 'R', 'L'], 1, [3, 5, 3]], [[2, 1, 0], [3, 4, 7, 6, 5], [8, 9, 10]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[3, 3, 3, 3, 3, 1, 1], ['R', 'L', 'WS', 'R', 'WS', 'R', 'WS'], 0, [4, 2, 1]], [[3, 2, 1, 0], [5, 4], [6]]), ('control layout', [[0, 0, 1, 1, 1, 2, 0], ['R', 'ON', 'R', 'R', 'R', 'WS', 'R'], 1, [3, 2, 1, 1]], [[0, 1, 2], [4, 3], [5], [6]]), ('control layout', [[1, 3, 3, 3, 3, 3, 3, 3], ['WS', 'R', 'WS', 'L', 'WS', 'R', 'L', 'WS'], 0, [4, 4]], [[3, 2, 1, 0], [6, 5, 4, 7]])], [('regression: whitespace reset level', [[2, 2, 2, 2, 2, 2], ['L', 'R', 'L', 'L', 'WS', 'WS'], 1, [2, 3, 1]], [[0, 1], [4, 2, 3], [5]]), ('regression: whitespace reset level', [[1, 3, 3, 3, 1, 1, 2, 2, 1, 2, 2, 2], ['WS', 'ON', 'L', 'L', 'ON', 'R', 'L', 'L', 'R', 'WS', 'L', 'WS'], 1, [1, 2, 3, 1, 1, 1, 3]], [[0], [2, 1], [5, 4, 3], [6], [7], [8], [11, 9, 10]]), ('regression: whitespace reset level', [[2, 2, 2, 2, 2, 1, 1, 1, 1, 4, 2, 2], ['R', 'R', 'WS', 'L', 'R', 'WS', 'L', 'R', 'R', 'WS', 'WS', 'WS'], 1, [1, 5, 1, 2, 3]], [[0], [5, 1, 2, 3, 4], [6], [8, 7], [11, 10, 9]]), ('regression: whitespace reset level', [[1, 1, 1, 3, 3, 3, 3, 0, 0, 0], ['L', 'WS', 'WS', 'WS', 'L', 'WS', 'WS', 'ON', 'R', 'L'], 1, [3, 4, 1, 1, 1]], [[2, 1, 0], [6, 5, 4, 3], [7], [8], [9]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[1, 1], ['ON', 'WS'], 0, [2]], [[0, 1]]), ('control layout', [[1, 1, 3, 3, 0, 0, 3, 3, 3, 1, 1], ['L', 'R', 'R', 'WS', 'L', 'ON', 'WS', 'R', 'WS', 'L', 'R'], 0, [1, 2, 3, 5]], [[0], [2, 1], [3, 4, 5], [10, 9, 8, 7, 6]]), ('control layout', [[0, 0, 0, 0, 0, 0], ['WS', 'R', 'L', 'WS', 'L', 'ON'], 0, [4, 1, 1]], [[0, 1, 2, 3], [4], [5]])], [('regression: whitespace reset level', [[0, 0, 0, 0], ['L', 'R', 'WS', 'WS'], 1, [4]], [[0, 1, 3, 2]]), ('regression: whitespace reset level', [[1, 1], ['WS', 'WS'], 1, [2]], [[1, 0]]), ('partial-repair probe', [[3, 3, 3, 4, 4, 4, 1], ['R', 'R', 'WS', 'R', 'WS', 'WS', 'R'], 0, [1, 4, 2]], [[0], [3, 2, 1, 4], [6, 5]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], ['R', 'R', 'WS', 'WS', 'L', 'ON', 'WS', 'WS', 'L', 'R', 'L'], 1, [3, 1, 5, 1, 1]], [[2, 1, 0], [3], [7, 6, 5, 4, 8], [9], [10]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[1, 2, 2, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0], ['L', 'WS', 'R', 'R', 'WS', 'R', 'L', 'WS', 'L', 'L', 'L', 'L', 'L', 'R'], 1, [1, 5, 2, 3, 3]], [[0], [1, 2, 3, 4, 5], [6, 7], [9, 8, 10], [11, 12, 13]]), ('control layout', [[2, 2, 2, 2, 2, 2], ['ON', 'WS', 'R', 'L', 'ON', 'WS'], 0, [2, 2, 1, 1]], [[0, 1], [2, 3], [4], [5]]), ('control layout', [[0, 3, 3, 3, 0, 0, 0, 0, 0, 0], ['L', 'WS', 'R', 'L', 'L', 'L', 'L', 'L', 'L', 'WS'], 1, [1, 4, 4, 1]], [[0], [3, 2, 1, 4], [5, 6, 7, 8], [9]])], [('regression: whitespace reset level', [[2, 2, 2, 2, 1, 1, 1, 3, 3, 3, 3, 1, 2, 2], ['ON', 'R', 'WS', 'R', 'L', 'R', 'R', 'R', 'R', 'L', 'R', 'R', 'WS', 'WS'], 1, [1, 1, 2, 3, 1, 2, 1, 3]], [[0], [1], [2, 3], [6, 5, 4], [7], [9, 8], [10], [13, 12, 11]]), ('regression: whitespace reset level', [[2, 2, 2, 2, 3, 3, 1], ['R', 'L', 'WS', 'WS', 'R', 'WS', 'WS'], 1, [4, 3]], [[3, 2, 0, 1], [6, 5, 4]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'R', 'WS', 'WS', 'WS'], 1, [5, 1]], [[4, 3, 2, 1, 0], [5]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 1], ['WS', 'R', 'WS', 'L', 'L'], 1, [3, 1, 1]], [[2, 1, 0], [3], [4]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[3, 3, 3, 3, 3, 3, 3, 3, 3, 0], ['WS', 'WS', 'L', 'WS', 'R', 'L', 'WS', 'WS', 'R', 'WS'], 0, [4, 2, 2, 1, 1]], [[2, 1, 0, 3], [5, 4], [6, 7], [8], [9]]), ('control layout', [[1, 1, 1, 1], ['L', 'R', 'WS', 'ON'], 0, [1, 3]], [[0], [3, 2, 1]]), ('control layout', [[0, 0, 0, 0, 0], ['R', 'L', 'L', 'WS', 'WS'], 0, [4, 1]], [[0, 1, 2, 3], [4]])], [('regression: whitespace reset level', [[2, 2, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1], ['L', 'WS', 'L', 'WS', 'ON', 'WS', 'R', 'R', 'WS', 'WS', 'R', 'R'], 1, [5, 5, 1, 1]], [[0, 1, 2, 4, 3], [9, 8, 7, 6, 5], [10], [11]]), ('regression: whitespace reset level', [[2, 4, 1, 1, 1, 3], ['ON', 'L', 'ON', 'L', 'WS', 'R'], 1, [5, 1]], [[4, 3, 2, 0, 1], [5]]), ('regression: whitespace reset level', [[1, 1, 1, 3, 1, 0, 0, 0, 0], ['R', 'WS', 'WS', 'WS', 'R', 'L', 'L', 'L', 'R'], 1, [3, 5, 1]], [[2, 1, 0], [4, 3, 5, 6, 7], [8]]), ('regression: whitespace reset level', [[1, 1], ['WS', 'WS'], 1, [2]], [[1, 0]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[3, 3, 3, 3, 1, 1, 0, 0], ['WS', 'WS', 'R', 'L', 'R', 'WS', 'R', 'ON'], 1, [3, 1, 1, 3]], [[2, 1, 0], [3], [4], [5, 6, 7]]), ('control layout', [[0, 0, 0, 0, 0], ['R', 'L', 'L', 'WS', 'WS'], 0, [4, 1]], [[0, 1, 2, 3], [4]]), ('control layout', [[2, 0, 0, 0, 1, 2, 2, 2, 0, 0, 0, 0], ['R', 'WS', 'L', 'WS', 'WS', 'L', 'WS', 'L', 'WS', 'R', 'WS', 'ON'], 1, [3, 5, 4]], [[0, 1, 2], [3, 5, 6, 7, 4], [8, 9, 10, 11]])]]\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":"5759a7a62def1925a611603cad9c0861bfb477a06c46303e522ce8c504a13586","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def reorder(lv):\n        vis = list(range(len(lv)))\n        odd = [l for l in lv if l % 2 == 1]\n        if not odd:\n            return vis\n        for lev in range(max(lv), min(odd) - 1, -1):\n            i = 0\n            while i < len(vis):\n                if lv[vis[i]] >= lev:\n                    j = i\n                    while j < len(vis) and lv[vis[j]] >= lev:\n                        j += 1\n                    vis[i:j] = vis[i:j][::-1]\n                    i = j\n                else:\n                    i += 1\n        return vis\n    \n    levels, classes, para, line_lengths = x\n    out = []\n    start = 0\n    for ln in line_lengths:\n        idx = list(range(start, start + ln))\n        lv = [levels[i] for i in idx]\n        j = ln - 1\n        while j >= 0 and classes[idx[j]] == 'WS':\n            lv[j] = 0\n            j -= 1\n        local = reorder(lv)\n        out.append([idx[v] for v in local])\n        start += ln\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('regression: whitespace reset level', [[1, 1, 1, 1, 4, 4, 4, 3, 3, 4], ['R', 'R', 'R', 'WS', 'ON', 'WS', 'R', 'R', 'R', 'WS'], 1, [3, 2, 2, 1, 2]], [[2, 1, 0], [4, 3], [5, 6], [7], [9, 8]]), ('regression: whitespace reset level', [[2, 2, 2, 2], ['R', 'R', 'R', 'WS'], 1, [2, 2]], [[0, 1], [3, 2]]), ('regression: whitespace reset level', [[1, 1, 2, 1, 1, 1, 3, 3, 3, 1, 3, 3, 2, 2], ['WS', 'WS', 'ON', 'R', 'R', 'R', 'WS', 'WS', 'WS', 'WS', 'L', 'R', 'WS', 'R'], 1, [2, 4, 1, 4, 2, 1]], [[1, 0], [5, 4, 3, 2], [6], [10, 9, 8, 7], [12, 11], [13]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 0, 0, 0, 0, 2, 2, 2], ['R', 'R', 'WS', 'R', 'ON', 'WS', 'WS', 'WS', 'L', 'R', 'L'], 1, [3, 5, 3]], [[2, 1, 0], [3, 4, 7, 6, 5], [8, 9, 10]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[3, 3, 3, 3, 3, 1, 1], ['R', 'L', 'WS', 'R', 'WS', 'R', 'WS'], 0, [4, 2, 1]], [[3, 2, 1, 0], [5, 4], [6]]), ('control layout', [[0, 0, 1, 1, 1, 2, 0], ['R', 'ON', 'R', 'R', 'R', 'WS', 'R'], 1, [3, 2, 1, 1]], [[0, 1, 2], [4, 3], [5], [6]]), ('control layout', [[1, 3, 3, 3, 3, 3, 3, 3], ['WS', 'R', 'WS', 'L', 'WS', 'R', 'L', 'WS'], 0, [4, 4]], [[3, 2, 1, 0], [6, 5, 4, 7]])], [('regression: whitespace reset level', [[2, 2, 2, 2, 2, 2], ['L', 'R', 'L', 'L', 'WS', 'WS'], 1, [2, 3, 1]], [[0, 1], [4, 2, 3], [5]]), ('regression: whitespace reset level', [[1, 3, 3, 3, 1, 1, 2, 2, 1, 2, 2, 2], ['WS', 'ON', 'L', 'L', 'ON', 'R', 'L', 'L', 'R', 'WS', 'L', 'WS'], 1, [1, 2, 3, 1, 1, 1, 3]], [[0], [2, 1], [5, 4, 3], [6], [7], [8], [11, 9, 10]]), ('regression: whitespace reset level', [[2, 2, 2, 2, 2, 1, 1, 1, 1, 4, 2, 2], ['R', 'R', 'WS', 'L', 'R', 'WS', 'L', 'R', 'R', 'WS', 'WS', 'WS'], 1, [1, 5, 1, 2, 3]], [[0], [5, 1, 2, 3, 4], [6], [8, 7], [11, 10, 9]]), ('regression: whitespace reset level', [[1, 1, 1, 3, 3, 3, 3, 0, 0, 0], ['L', 'WS', 'WS', 'WS', 'L', 'WS', 'WS', 'ON', 'R', 'L'], 1, [3, 4, 1, 1, 1]], [[2, 1, 0], [6, 5, 4, 3], [7], [8], [9]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[1, 1], ['ON', 'WS'], 0, [2]], [[0, 1]]), ('control layout', [[1, 1, 3, 3, 0, 0, 3, 3, 3, 1, 1], ['L', 'R', 'R', 'WS', 'L', 'ON', 'WS', 'R', 'WS', 'L', 'R'], 0, [1, 2, 3, 5]], [[0], [2, 1], [3, 4, 5], [10, 9, 8, 7, 6]]), ('control layout', [[0, 0, 0, 0, 0, 0], ['WS', 'R', 'L', 'WS', 'L', 'ON'], 0, [4, 1, 1]], [[0, 1, 2, 3], [4], [5]])], [('regression: whitespace reset level', [[0, 0, 0, 0], ['L', 'R', 'WS', 'WS'], 1, [4]], [[0, 1, 3, 2]]), ('regression: whitespace reset level', [[1, 1], ['WS', 'WS'], 1, [2]], [[1, 0]]), ('partial-repair probe', [[3, 3, 3, 4, 4, 4, 1], ['R', 'R', 'WS', 'R', 'WS', 'WS', 'R'], 0, [1, 4, 2]], [[0], [3, 2, 1, 4], [6, 5]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0], ['R', 'R', 'WS', 'WS', 'L', 'ON', 'WS', 'WS', 'L', 'R', 'L'], 1, [3, 1, 5, 1, 1]], [[2, 1, 0], [3], [7, 6, 5, 4, 8], [9], [10]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[1, 2, 2, 2, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0], ['L', 'WS', 'R', 'R', 'WS', 'R', 'L', 'WS', 'L', 'L', 'L', 'L', 'L', 'R'], 1, [1, 5, 2, 3, 3]], [[0], [1, 2, 3, 4, 5], [6, 7], [9, 8, 10], [11, 12, 13]]), ('control layout', [[2, 2, 2, 2, 2, 2], ['ON', 'WS', 'R', 'L', 'ON', 'WS'], 0, [2, 2, 1, 1]], [[0, 1], [2, 3], [4], [5]]), ('control layout', [[0, 3, 3, 3, 0, 0, 0, 0, 0, 0], ['L', 'WS', 'R', 'L', 'L', 'L', 'L', 'L', 'L', 'WS'], 1, [1, 4, 4, 1]], [[0], [3, 2, 1, 4], [5, 6, 7, 8], [9]])], [('regression: whitespace reset level', [[2, 2, 2, 2, 1, 1, 1, 3, 3, 3, 3, 1, 2, 2], ['ON', 'R', 'WS', 'R', 'L', 'R', 'R', 'R', 'R', 'L', 'R', 'R', 'WS', 'WS'], 1, [1, 1, 2, 3, 1, 2, 1, 3]], [[0], [1], [2, 3], [6, 5, 4], [7], [9, 8], [10], [13, 12, 11]]), ('regression: whitespace reset level', [[2, 2, 2, 2, 3, 3, 1], ['R', 'L', 'WS', 'WS', 'R', 'WS', 'WS'], 1, [4, 3]], [[3, 2, 0, 1], [6, 5, 4]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'R', 'WS', 'WS', 'WS'], 1, [5, 1]], [[4, 3, 2, 1, 0], [5]]), ('regression: whitespace reset level', [[1, 1, 1, 1, 1], ['WS', 'R', 'WS', 'L', 'L'], 1, [3, 1, 1]], [[2, 1, 0], [3], [4]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[3, 3, 3, 3, 3, 3, 3, 3, 3, 0], ['WS', 'WS', 'L', 'WS', 'R', 'L', 'WS', 'WS', 'R', 'WS'], 0, [4, 2, 2, 1, 1]], [[2, 1, 0, 3], [5, 4], [6, 7], [8], [9]]), ('control layout', [[1, 1, 1, 1], ['L', 'R', 'WS', 'ON'], 0, [1, 3]], [[0], [3, 2, 1]]), ('control layout', [[0, 0, 0, 0, 0], ['R', 'L', 'L', 'WS', 'WS'], 0, [4, 1]], [[0, 1, 2, 3], [4]])], [('regression: whitespace reset level', [[2, 2, 2, 3, 3, 3, 1, 1, 1, 1, 1, 1], ['L', 'WS', 'L', 'WS', 'ON', 'WS', 'R', 'R', 'WS', 'WS', 'R', 'R'], 1, [5, 5, 1, 1]], [[0, 1, 2, 4, 3], [9, 8, 7, 6, 5], [10], [11]]), ('regression: whitespace reset level', [[2, 4, 1, 1, 1, 3], ['ON', 'L', 'ON', 'L', 'WS', 'R'], 1, [5, 1]], [[4, 3, 2, 0, 1], [5]]), ('regression: whitespace reset level', [[1, 1, 1, 3, 1, 0, 0, 0, 0], ['R', 'WS', 'WS', 'WS', 'R', 'L', 'L', 'L', 'R'], 1, [3, 5, 1]], [[2, 1, 0], [4, 3, 5, 6, 7], [8]]), ('regression: whitespace reset level', [[1, 1], ['WS', 'WS'], 1, [2]], [[1, 0]]), ('RTL run split across lines', [[1, 1, 1, 1, 1, 1], ['R', 'R', 'WS', 'R', 'R', 'R'], 0, [3, 3]], [[1, 0, 2], [5, 4, 3]]), ('control layout', [[3, 3, 3, 3, 1, 1, 0, 0], ['WS', 'WS', 'R', 'L', 'R', 'WS', 'R', 'ON'], 1, [3, 1, 1, 3]], [[2, 1, 0], [3], [4], [5, 6, 7]]), ('control layout', [[0, 0, 0, 0, 0], ['R', 'L', 'L', 'WS', 'WS'], 0, [4, 1]], [[0, 1, 2, 3], [4]]), ('control layout', [[2, 0, 0, 0, 1, 2, 2, 2, 0, 0, 0, 0], ['R', 'WS', 'L', 'WS', 'WS', 'L', 'WS', 'L', 'WS', 'R', 'WS', 'ON'], 1, [3, 5, 4]], [[0, 1, 2], [3, 5, 6, 7, 4], [8, 9, 10, 11]])]]\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-per-line-reordering-whitespace-reset-level","generated_at":"2026-09-29T14:49:56.457431+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":"Trailing whitespace is reset to 0 instead of the paragraph level.","sha256":"d1a5ee5eb6190aee97d3303072cbe053e89f03af2a1fc2b75e9d6aee35d1bf1c","title":"Per-line visual reordering: whitespace reset level · 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":42.313,"exit_code":1,"observations":[{"actual":[[2,1,0],[4,3],[5,6],[7],[9,8]],"check":"regression: whitespace reset level","expected":[[2,1,0],[4,3],[5,6],[7],[9,8]],"passed":true},{"actual":[[0,1],[2,3]],"check":"regression: whitespace reset level","expected":[[0,1],[3,2]],"passed":false},{"actual":[[0,1],[5,4,3,2],[6],[10,9,8,7],[11,12],[13]],"check":"regression: whitespace reset level","expected":[[1,0],[5,4,3,2],[6],[10,9,8,7],[12,11],[13]],"passed":false},{"actual":[[1,0,2],[3,4,5,6,7],[8,9,10]],"check":"regression: whitespace reset level","expected":[[2,1,0],[3,4,7,6,5],[8,9,10]],"passed":false},{"actual":[[1,0,2],[5,4,3]],"check":"RTL run split across lines","expected":[[1,0,2],[5,4,3]],"passed":true},{"actual":[[3,2,1,0],[5,4],[6]],"check":"control layout","expected":[[3,2,1,0],[5,4],[6]],"passed":true},{"actual":[[0,1,2],[4,3],[5],[6]],"check":"control layout","expected":[[0,1,2],[4,3],[5],[6]],"passed":true},{"actual":[[3,2,1,0],[6,5,4,7]],"check":"control layout","expected":[[3,2,1,0],[6,5,4,7]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: whitespace reset level\", \"actual\": [[2, 1, 0], [4, 3], [5, 6], [7], [9, 8]], \"expected\": [[2, 1, 0], [4, 3], [5, 6], [7], [9, 8]], \"passed\": true}, {\"check\": \"regression: whitespace reset level\", \"actual\": [[0, 1], [2, 3]], \"expected\": [[0, 1], [3, 2]], \"passed\": false}, {\"check\": \"regression: whitespace reset level\", \"actual\": [[0, 1], [5, 4, 3, 2], [6], [10, 9, 8, 7], [11, 12], [13]], \"expected\": [[1, 0], [5, 4, 3, 2], [6], [10, 9, 8, 7], [12, 11], [13]], \"passed\": false}, {\"check\": \"regression: whitespace reset level\", \"actual\": [[1, 0, 2], [3, 4, 5, 6, 7], [8, 9, 10]], \"expected\": [[2, 1, 0], [3, 4, 7, 6, 5], [8, 9, 10]], \"passed\": false}, {\"check\": \"RTL run split across lines\", \"actual\": [[1, 0, 2], [5, 4, 3]], \"expected\": [[1, 0, 2], [5, 4, 3]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[3, 2, 1, 0], [5, 4], [6]], \"expected\": [[3, 2, 1, 0], [5, 4], [6]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[0, 1, 2], [4, 3], [5], [6]], \"expected\": [[0, 1, 2], [4, 3], [5], [6]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[3, 2, 1, 0], [6, 5, 4, 7]], \"expected\": [[3, 2, 1, 0], [6, 5, 4, 7]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.394,"exit_code":1,"observations":[{"actual":[[2,1,0],[4,3],[5,6],[7],[8,9]],"check":"regression: whitespace reset level","expected":[[2,1,0],[4,3],[5,6],[7],[9,8]],"passed":false},{"actual":[[0,1],[2,3]],"check":"regression: whitespace reset level","expected":[[0,1],[3,2]],"passed":false},{"actual":[[0,1],[5,4,3,2],[6],[10,9,8,7],[11,12],[13]],"check":"regression: whitespace reset level","expected":[[1,0],[5,4,3,2],[6],[10,9,8,7],[12,11],[13]],"passed":false},{"actual":[[1,0,2],[3,4,5,6,7],[8,9,10]],"check":"regression: whitespace reset level","expected":[[2,1,0],[3,4,7,6,5],[8,9,10]],"passed":false},{"actual":[[1,0,2],[5,4,3]],"check":"RTL run split across lines","expected":[[1,0,2],[5,4,3]],"passed":true},{"actual":[[3,2,1,0],[5,4],[6]],"check":"control layout","expected":[[3,2,1,0],[5,4],[6]],"passed":true},{"actual":[[0,1,2],[4,3],[5],[6]],"check":"control layout","expected":[[0,1,2],[4,3],[5],[6]],"passed":true},{"actual":[[3,2,1,0],[6,5,4,7]],"check":"control layout","expected":[[3,2,1,0],[6,5,4,7]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: whitespace reset level\", \"actual\": [[2, 1, 0], [4, 3], [5, 6], [7], [8, 9]], \"expected\": [[2, 1, 0], [4, 3], [5, 6], [7], [9, 8]], \"passed\": false}, {\"check\": \"regression: whitespace reset level\", \"actual\": [[0, 1], [2, 3]], \"expected\": [[0, 1], [3, 2]], \"passed\": false}, {\"check\": \"regression: whitespace reset level\", \"actual\": [[0, 1], [5, 4, 3, 2], [6], [10, 9, 8, 7], [11, 12], [13]], \"expected\": [[1, 0], [5, 4, 3, 2], [6], [10, 9, 8, 7], [12, 11], [13]], \"passed\": false}, {\"check\": \"regression: whitespace reset level\", \"actual\": [[1, 0, 2], [3, 4, 5, 6, 7], [8, 9, 10]], \"expected\": [[2, 1, 0], [3, 4, 7, 6, 5], [8, 9, 10]], \"passed\": false}, {\"check\": \"RTL run split across lines\", \"actual\": [[1, 0, 2], [5, 4, 3]], \"expected\": [[1, 0, 2], [5, 4, 3]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[3, 2, 1, 0], [5, 4], [6]], \"expected\": [[3, 2, 1, 0], [5, 4], [6]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[0, 1, 2], [4, 3], [5], [6]], \"expected\": [[0, 1, 2], [4, 3], [5], [6]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[3, 2, 1, 0], [6, 5, 4, 7]], \"expected\": [[3, 2, 1, 0], [6, 5, 4, 7]], \"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."}}