{"abstract":"Tabs split neutral runs and keep a separator class.","category":"Bidirectional text layout","checks":8,"contract":"Input [resolved weak classes, sos, eos, embedding level]. A maximal run of neutrals (ON, WS, B, S) takes the direction of its surrounding strong types when both sides agree (EN and AN count as R; sos/eos at the edges); otherwise the embedding direction (L for even level, R for odd). Return classes.","evaluation_group":"w2-bidirectional-text-layout-neutral-resolution","failed_approach":"Including S but not B leaves paragraph separators unresolved.","family":"w2-bidirectional-text-layout-neutral-resolution-segment-separator-neutrality","id":"FA-80441","implementations":{"attempt":{"sha256":"9d57d536056d09187a3e179b4bb7b4437b93e977d5deca9284026117cd766010","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    types, sos, eos, level = x\n    t = list(types)\n    n = len(t)\n    NI = ('ON', 'WS', 'S')\n    e = 'L' if level % 2 == 0 else 'R'\n    def strong(c):\n        return 'R' if c in ('R', 'EN', 'AN') else c\n    i = 0\n    while i < n:\n        if t[i] in NI:\n            j = i\n            while j < n and t[j] in NI:\n                j += 1\n            before = sos if i == 0 else strong(t[i - 1])\n            after = eos if j == n else strong(t[j])\n            fill = before if before == after else e\n            for k in range(i, j):\n                t[k] = fill\n            i = j\n        else:\n            i += 1\n    return t\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('regression: segment separator neutrality', [['WS', 'EN', 'S', 'R', 'R', 'L', 'R', 'ON'], 'R', 'L', 3], ['R', 'EN', 'R', 'R', 'R', 'L', 'R', 'R']), ('partial-repair probe', [['R', 'WS', 'B', 'AN', 'L', 'L', 'EN', 'L'], 'R', 'R', 1], ['R', 'R', 'R', 'AN', 'L', 'L', 'EN', 'L']), ('regression: segment separator neutrality', [['ON', 'AN', 'EN', 'S', 'B', 'EN', 'WS', 'L'], 'L', 'R', 3], ['R', 'AN', 'EN', 'R', 'R', 'EN', 'R', 'L']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('neutral between numbers and R', [['R', 'ON', 'EN'], 'L', 'L', 0], ['R', 'R', 'EN']), ('control layout', [['WS', 'R', 'R', 'EN', 'R'], 'R', 'R', 1], ['R', 'R', 'R', 'EN', 'R']), ('control layout', [['L', 'AN'], 'L', 'R', 0], ['L', 'AN'])], [('regression: segment separator neutrality', [['EN', 'R', 'EN', 'R', 'WS', 'S', 'EN'], 'R', 'L', 1], ['EN', 'R', 'EN', 'R', 'R', 'R', 'EN']), ('regression: segment separator neutrality', [['ON', 'WS', 'R', 'ON', 'EN', 'R', 'WS', 'S'], 'R', 'L', 2], ['R', 'R', 'R', 'R', 'EN', 'R', 'L', 'L']), ('partial-repair probe', [['L', 'WS', 'B', 'B', 'B', 'L', 'L'], 'R', 'R', 0], ['L', 'L', 'L', 'L', 'L', 'L', 'L']), ('partial-repair probe', [['L', 'L', 'R', 'R', 'B', 'EN', 'R'], 'L', 'R', 0], ['L', 'L', 'R', 'R', 'R', 'EN', 'R']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('control layout', [['AN', 'WS', 'EN', 'L'], 'R', 'L', 0], ['AN', 'R', 'EN', 'L']), ('control layout', [['AN', 'AN', 'ON', 'R'], 'L', 'L', 1], ['AN', 'AN', 'R', 'R'])], [('regression: segment separator neutrality', [['S', 'L', 'ON', 'ON'], 'L', 'R', 0], ['L', 'L', 'L', 'L']), ('regression: segment separator neutrality', [['AN', 'WS', 'S', 'ON', 'B', 'WS', 'EN'], 'L', 'R', 1], ['AN', 'R', 'R', 'R', 'R', 'R', 'EN']), ('partial-repair probe', [['ON', 'R', 'B', 'WS', 'WS', 'R', 'L', 'R', 'L', 'R'], 'R', 'L', 3], ['R', 'R', 'R', 'R', 'R', 'R', 'L', 'R', 'L', 'R']), ('regression: segment separator neutrality', [['R', 'EN', 'B', 'WS', 'WS', 'S'], 'R', 'R', 2], ['R', 'EN', 'R', 'R', 'R', 'R']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('control layout', [['L', 'WS', 'EN'], 'R', 'R', 0], ['L', 'L', 'EN']), ('control layout', [['WS', 'ON', 'WS', 'WS', 'WS', 'L', 'AN', 'R'], 'L', 'L', 1], ['L', 'L', 'L', 'L', 'L', 'L', 'AN', 'R'])], [('regression: segment separator neutrality', [['R', 'ON', 'AN', 'ON', 'S', 'AN', 'WS', 'L', 'AN'], 'R', 'L', 2], ['R', 'R', 'AN', 'R', 'R', 'AN', 'L', 'L', 'AN']), ('regression: segment separator neutrality', [['R', 'R', 'ON', 'EN', 'AN', 'R', 'S', 'WS'], 'L', 'L', 1], ['R', 'R', 'R', 'EN', 'AN', 'R', 'R', 'R']), ('regression: segment separator neutrality', [['R', 'R', 'S', 'WS', 'L', 'B', 'B', 'WS', 'R', 'EN', 'L'], 'R', 'R', 1], ['R', 'R', 'R', 'R', 'L', 'R', 'R', 'R', 'R', 'EN', 'L']), ('partial-repair probe', [['AN', 'L', 'AN', 'L', 'ON', 'R', 'AN', 'AN', 'B', 'L'], 'L', 'L', 3], ['AN', 'L', 'AN', 'L', 'R', 'R', 'AN', 'AN', 'R', 'L']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('control layout', [['WS', 'AN'], 'L', 'R', 3], ['R', 'AN']), ('control layout', [['L', 'L'], 'R', 'L', 0], ['L', 'L'])], [('regression: segment separator neutrality', [['WS', 'L', 'L', 'S', 'ON', 'R', 'R', 'L', 'L'], 'R', 'L', 3], ['R', 'L', 'L', 'R', 'R', 'R', 'R', 'L', 'L']), ('regression: segment separator neutrality', [['L', 'R', 'R', 'ON', 'R', 'S', 'R', 'R', 'AN', 'R', 'AN'], 'L', 'R', 3], ['L', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'AN', 'R', 'AN']), ('regression: segment separator neutrality', [['S', 'L', 'AN', 'WS', 'B', 'B', 'ON', 'ON', 'B', 'R', 'WS'], 'R', 'R', 2], ['L', 'L', 'AN', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'R']), ('partial-repair probe', [['WS', 'AN', 'B', 'B', 'WS', 'ON', 'R', 'AN'], 'R', 'R', 2], ['R', 'AN', 'R', 'R', 'R', 'R', 'R', 'AN']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('control layout', [['R', 'L', 'R', 'AN', 'WS', 'WS', 'ON', 'L', 'AN', 'AN', 'EN'], 'L', 'R', 0], ['R', 'L', 'R', 'AN', 'L', 'L', 'L', 'L', 'AN', 'AN', 'EN']), ('control layout', [['L', 'EN', 'L', 'WS', 'R', 'AN', 'L', 'AN', 'WS', 'ON'], 'R', 'L', 3], ['L', 'EN', 'L', 'R', 'R', 'AN', 'L', 'AN', 'R', 'R'])]]\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":"3a27f2b8899b17f278569d02439f47f2e03a273086eef38be30cb113963221db","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    types, sos, eos, level = x\n    t = list(types)\n    n = len(t)\n    NI = ('ON', 'WS', 'B')\n    e = 'L' if level % 2 == 0 else 'R'\n    def strong(c):\n        return 'R' if c in ('R', 'EN', 'AN') else c\n    i = 0\n    while i < n:\n        if t[i] in NI:\n            j = i\n            while j < n and t[j] in NI:\n                j += 1\n            before = sos if i == 0 else strong(t[i - 1])\n            after = eos if j == n else strong(t[j])\n            fill = before if before == after else e\n            for k in range(i, j):\n                t[k] = fill\n            i = j\n        else:\n            i += 1\n    return t\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('regression: segment separator neutrality', [['WS', 'EN', 'S', 'R', 'R', 'L', 'R', 'ON'], 'R', 'L', 3], ['R', 'EN', 'R', 'R', 'R', 'L', 'R', 'R']), ('partial-repair probe', [['R', 'WS', 'B', 'AN', 'L', 'L', 'EN', 'L'], 'R', 'R', 1], ['R', 'R', 'R', 'AN', 'L', 'L', 'EN', 'L']), ('regression: segment separator neutrality', [['ON', 'AN', 'EN', 'S', 'B', 'EN', 'WS', 'L'], 'L', 'R', 3], ['R', 'AN', 'EN', 'R', 'R', 'EN', 'R', 'L']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('neutral between numbers and R', [['R', 'ON', 'EN'], 'L', 'L', 0], ['R', 'R', 'EN']), ('control layout', [['WS', 'R', 'R', 'EN', 'R'], 'R', 'R', 1], ['R', 'R', 'R', 'EN', 'R']), ('control layout', [['L', 'AN'], 'L', 'R', 0], ['L', 'AN'])], [('regression: segment separator neutrality', [['EN', 'R', 'EN', 'R', 'WS', 'S', 'EN'], 'R', 'L', 1], ['EN', 'R', 'EN', 'R', 'R', 'R', 'EN']), ('regression: segment separator neutrality', [['ON', 'WS', 'R', 'ON', 'EN', 'R', 'WS', 'S'], 'R', 'L', 2], ['R', 'R', 'R', 'R', 'EN', 'R', 'L', 'L']), ('partial-repair probe', [['L', 'WS', 'B', 'B', 'B', 'L', 'L'], 'R', 'R', 0], ['L', 'L', 'L', 'L', 'L', 'L', 'L']), ('partial-repair probe', [['L', 'L', 'R', 'R', 'B', 'EN', 'R'], 'L', 'R', 0], ['L', 'L', 'R', 'R', 'R', 'EN', 'R']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('control layout', [['AN', 'WS', 'EN', 'L'], 'R', 'L', 0], ['AN', 'R', 'EN', 'L']), ('control layout', [['AN', 'AN', 'ON', 'R'], 'L', 'L', 1], ['AN', 'AN', 'R', 'R'])], [('regression: segment separator neutrality', [['S', 'L', 'ON', 'ON'], 'L', 'R', 0], ['L', 'L', 'L', 'L']), ('regression: segment separator neutrality', [['AN', 'WS', 'S', 'ON', 'B', 'WS', 'EN'], 'L', 'R', 1], ['AN', 'R', 'R', 'R', 'R', 'R', 'EN']), ('partial-repair probe', [['ON', 'R', 'B', 'WS', 'WS', 'R', 'L', 'R', 'L', 'R'], 'R', 'L', 3], ['R', 'R', 'R', 'R', 'R', 'R', 'L', 'R', 'L', 'R']), ('regression: segment separator neutrality', [['R', 'EN', 'B', 'WS', 'WS', 'S'], 'R', 'R', 2], ['R', 'EN', 'R', 'R', 'R', 'R']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('control layout', [['L', 'WS', 'EN'], 'R', 'R', 0], ['L', 'L', 'EN']), ('control layout', [['WS', 'ON', 'WS', 'WS', 'WS', 'L', 'AN', 'R'], 'L', 'L', 1], ['L', 'L', 'L', 'L', 'L', 'L', 'AN', 'R'])], [('regression: segment separator neutrality', [['R', 'ON', 'AN', 'ON', 'S', 'AN', 'WS', 'L', 'AN'], 'R', 'L', 2], ['R', 'R', 'AN', 'R', 'R', 'AN', 'L', 'L', 'AN']), ('regression: segment separator neutrality', [['R', 'R', 'ON', 'EN', 'AN', 'R', 'S', 'WS'], 'L', 'L', 1], ['R', 'R', 'R', 'EN', 'AN', 'R', 'R', 'R']), ('regression: segment separator neutrality', [['R', 'R', 'S', 'WS', 'L', 'B', 'B', 'WS', 'R', 'EN', 'L'], 'R', 'R', 1], ['R', 'R', 'R', 'R', 'L', 'R', 'R', 'R', 'R', 'EN', 'L']), ('partial-repair probe', [['AN', 'L', 'AN', 'L', 'ON', 'R', 'AN', 'AN', 'B', 'L'], 'L', 'L', 3], ['AN', 'L', 'AN', 'L', 'R', 'R', 'AN', 'AN', 'R', 'L']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('control layout', [['WS', 'AN'], 'L', 'R', 3], ['R', 'AN']), ('control layout', [['L', 'L'], 'R', 'L', 0], ['L', 'L'])], [('regression: segment separator neutrality', [['WS', 'L', 'L', 'S', 'ON', 'R', 'R', 'L', 'L'], 'R', 'L', 3], ['R', 'L', 'L', 'R', 'R', 'R', 'R', 'L', 'L']), ('regression: segment separator neutrality', [['L', 'R', 'R', 'ON', 'R', 'S', 'R', 'R', 'AN', 'R', 'AN'], 'L', 'R', 3], ['L', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'AN', 'R', 'AN']), ('regression: segment separator neutrality', [['S', 'L', 'AN', 'WS', 'B', 'B', 'ON', 'ON', 'B', 'R', 'WS'], 'R', 'R', 2], ['L', 'L', 'AN', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'R']), ('partial-repair probe', [['WS', 'AN', 'B', 'B', 'WS', 'ON', 'R', 'AN'], 'R', 'R', 2], ['R', 'AN', 'R', 'R', 'R', 'R', 'R', 'AN']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('control layout', [['R', 'L', 'R', 'AN', 'WS', 'WS', 'ON', 'L', 'AN', 'AN', 'EN'], 'L', 'R', 0], ['R', 'L', 'R', 'AN', 'L', 'L', 'L', 'L', 'AN', 'AN', 'EN']), ('control layout', [['L', 'EN', 'L', 'WS', 'R', 'AN', 'L', 'AN', 'WS', 'ON'], 'R', 'L', 3], ['L', 'EN', 'L', 'R', 'R', 'AN', 'L', 'AN', 'R', 'R'])]]\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":"590772fba195f1f57e97c84b9a525c368c0bf715c59c6e1f13cdc4686af9c4d9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    types, sos, eos, level = x\n    t = list(types)\n    n = len(t)\n    NI = ('ON', 'WS', 'B', 'S')\n    e = 'L' if level % 2 == 0 else 'R'\n    def strong(c):\n        return 'R' if c in ('R', 'EN', 'AN') else c\n    i = 0\n    while i < n:\n        if t[i] in NI:\n            j = i\n            while j < n and t[j] in NI:\n                j += 1\n            before = sos if i == 0 else strong(t[i - 1])\n            after = eos if j == n else strong(t[j])\n            fill = before if before == after else e\n            for k in range(i, j):\n                t[k] = fill\n            i = j\n        else:\n            i += 1\n    return t\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('regression: segment separator neutrality', [['WS', 'EN', 'S', 'R', 'R', 'L', 'R', 'ON'], 'R', 'L', 3], ['R', 'EN', 'R', 'R', 'R', 'L', 'R', 'R']), ('partial-repair probe', [['R', 'WS', 'B', 'AN', 'L', 'L', 'EN', 'L'], 'R', 'R', 1], ['R', 'R', 'R', 'AN', 'L', 'L', 'EN', 'L']), ('regression: segment separator neutrality', [['ON', 'AN', 'EN', 'S', 'B', 'EN', 'WS', 'L'], 'L', 'R', 3], ['R', 'AN', 'EN', 'R', 'R', 'EN', 'R', 'L']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('neutral between numbers and R', [['R', 'ON', 'EN'], 'L', 'L', 0], ['R', 'R', 'EN']), ('control layout', [['WS', 'R', 'R', 'EN', 'R'], 'R', 'R', 1], ['R', 'R', 'R', 'EN', 'R']), ('control layout', [['L', 'AN'], 'L', 'R', 0], ['L', 'AN'])], [('regression: segment separator neutrality', [['EN', 'R', 'EN', 'R', 'WS', 'S', 'EN'], 'R', 'L', 1], ['EN', 'R', 'EN', 'R', 'R', 'R', 'EN']), ('regression: segment separator neutrality', [['ON', 'WS', 'R', 'ON', 'EN', 'R', 'WS', 'S'], 'R', 'L', 2], ['R', 'R', 'R', 'R', 'EN', 'R', 'L', 'L']), ('partial-repair probe', [['L', 'WS', 'B', 'B', 'B', 'L', 'L'], 'R', 'R', 0], ['L', 'L', 'L', 'L', 'L', 'L', 'L']), ('partial-repair probe', [['L', 'L', 'R', 'R', 'B', 'EN', 'R'], 'L', 'R', 0], ['L', 'L', 'R', 'R', 'R', 'EN', 'R']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('control layout', [['AN', 'WS', 'EN', 'L'], 'R', 'L', 0], ['AN', 'R', 'EN', 'L']), ('control layout', [['AN', 'AN', 'ON', 'R'], 'L', 'L', 1], ['AN', 'AN', 'R', 'R'])], [('regression: segment separator neutrality', [['S', 'L', 'ON', 'ON'], 'L', 'R', 0], ['L', 'L', 'L', 'L']), ('regression: segment separator neutrality', [['AN', 'WS', 'S', 'ON', 'B', 'WS', 'EN'], 'L', 'R', 1], ['AN', 'R', 'R', 'R', 'R', 'R', 'EN']), ('partial-repair probe', [['ON', 'R', 'B', 'WS', 'WS', 'R', 'L', 'R', 'L', 'R'], 'R', 'L', 3], ['R', 'R', 'R', 'R', 'R', 'R', 'L', 'R', 'L', 'R']), ('regression: segment separator neutrality', [['R', 'EN', 'B', 'WS', 'WS', 'S'], 'R', 'R', 2], ['R', 'EN', 'R', 'R', 'R', 'R']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('control layout', [['L', 'WS', 'EN'], 'R', 'R', 0], ['L', 'L', 'EN']), ('control layout', [['WS', 'ON', 'WS', 'WS', 'WS', 'L', 'AN', 'R'], 'L', 'L', 1], ['L', 'L', 'L', 'L', 'L', 'L', 'AN', 'R'])], [('regression: segment separator neutrality', [['R', 'ON', 'AN', 'ON', 'S', 'AN', 'WS', 'L', 'AN'], 'R', 'L', 2], ['R', 'R', 'AN', 'R', 'R', 'AN', 'L', 'L', 'AN']), ('regression: segment separator neutrality', [['R', 'R', 'ON', 'EN', 'AN', 'R', 'S', 'WS'], 'L', 'L', 1], ['R', 'R', 'R', 'EN', 'AN', 'R', 'R', 'R']), ('regression: segment separator neutrality', [['R', 'R', 'S', 'WS', 'L', 'B', 'B', 'WS', 'R', 'EN', 'L'], 'R', 'R', 1], ['R', 'R', 'R', 'R', 'L', 'R', 'R', 'R', 'R', 'EN', 'L']), ('partial-repair probe', [['AN', 'L', 'AN', 'L', 'ON', 'R', 'AN', 'AN', 'B', 'L'], 'L', 'L', 3], ['AN', 'L', 'AN', 'L', 'R', 'R', 'AN', 'AN', 'R', 'L']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('mixed neutral run', [['R', 'WS', 'ON', 'S', 'R'], 'L', 'L', 0], ['R', 'R', 'R', 'R', 'R']), ('control layout', [['WS', 'AN'], 'L', 'R', 3], ['R', 'AN']), ('control layout', [['L', 'L'], 'R', 'L', 0], ['L', 'L'])], [('regression: segment separator neutrality', [['WS', 'L', 'L', 'S', 'ON', 'R', 'R', 'L', 'L'], 'R', 'L', 3], ['R', 'L', 'L', 'R', 'R', 'R', 'R', 'L', 'L']), ('regression: segment separator neutrality', [['L', 'R', 'R', 'ON', 'R', 'S', 'R', 'R', 'AN', 'R', 'AN'], 'L', 'R', 3], ['L', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'AN', 'R', 'AN']), ('regression: segment separator neutrality', [['S', 'L', 'AN', 'WS', 'B', 'B', 'ON', 'ON', 'B', 'R', 'WS'], 'R', 'R', 2], ['L', 'L', 'AN', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'R']), ('partial-repair probe', [['WS', 'AN', 'B', 'B', 'WS', 'ON', 'R', 'AN'], 'R', 'R', 2], ['R', 'AN', 'R', 'R', 'R', 'R', 'R', 'AN']), ('trailing neutral uses eos', [['L', 'WS'], 'L', 'L', 1], ['L', 'L']), ('leading neutral uses sos', [['WS', 'R'], 'R', 'L', 0], ['R', 'R']), ('control layout', [['R', 'L', 'R', 'AN', 'WS', 'WS', 'ON', 'L', 'AN', 'AN', 'EN'], 'L', 'R', 0], ['R', 'L', 'R', 'AN', 'L', 'L', 'L', 'L', 'AN', 'AN', 'EN']), ('control layout', [['L', 'EN', 'L', 'WS', 'R', 'AN', 'L', 'AN', 'WS', 'ON'], 'R', 'L', 3], ['L', 'EN', 'L', 'R', 'R', 'AN', 'L', 'AN', 'R', 'R'])]]\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-neutral-resolution-segment-separator-neutrality","generated_at":"2026-09-29T14:49:53.869927+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":"Include B and S in the neutral set.","root_cause":"S is missing from the neutral set.","sha256":"c450862f4032d59b65dd0ff3094a46a2f9774cd7e57e2049174c6b7b55290e03","title":"Neutral run resolution: segment separator neutrality · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.091,"exit_code":1,"observations":[{"actual":["R","R","R","R","R"],"check":"mixed neutral run","expected":["R","R","R","R","R"],"passed":true},{"actual":["R","EN","R","R","R","L","R","R"],"check":"regression: segment separator neutrality","expected":["R","EN","R","R","R","L","R","R"],"passed":true},{"actual":["R","R","B","AN","L","L","EN","L"],"check":"partial-repair probe","expected":["R","R","R","AN","L","L","EN","L"],"passed":false},{"actual":["R","AN","EN","R","B","EN","R","L"],"check":"regression: segment separator neutrality","expected":["R","AN","EN","R","R","EN","R","L"],"passed":false},{"actual":["R","R"],"check":"leading neutral uses sos","expected":["R","R"],"passed":true},{"actual":["R","R","EN"],"check":"neutral between numbers and R","expected":["R","R","EN"],"passed":true},{"actual":["R","R","R","EN","R"],"check":"control layout","expected":["R","R","R","EN","R"],"passed":true},{"actual":["L","AN"],"check":"control layout","expected":["L","AN"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"mixed neutral run\", \"actual\": [\"R\", \"R\", \"R\", \"R\", \"R\"], \"expected\": [\"R\", \"R\", \"R\", \"R\", \"R\"], \"passed\": true}, {\"check\": \"regression: segment separator neutrality\", \"actual\": [\"R\", \"EN\", \"R\", \"R\", \"R\", \"L\", \"R\", \"R\"], \"expected\": [\"R\", \"EN\", \"R\", \"R\", \"R\", \"L\", \"R\", \"R\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"R\", \"R\", \"B\", \"AN\", \"L\", \"L\", \"EN\", \"L\"], \"expected\": [\"R\", \"R\", \"R\", \"AN\", \"L\", \"L\", \"EN\", \"L\"], \"passed\": false}, {\"check\": \"regression: segment separator neutrality\", \"actual\": [\"R\", \"AN\", \"EN\", \"R\", \"B\", \"EN\", \"R\", \"L\"], \"expected\": [\"R\", \"AN\", \"EN\", \"R\", \"R\", \"EN\", \"R\", \"L\"], \"passed\": false}, {\"check\": \"leading neutral uses sos\", \"actual\": [\"R\", \"R\"], \"expected\": [\"R\", \"R\"], \"passed\": true}, {\"check\": \"neutral between numbers and R\", \"actual\": [\"R\", \"R\", \"EN\"], \"expected\": [\"R\", \"R\", \"EN\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"R\", \"R\", \"R\", \"EN\", \"R\"], \"expected\": [\"R\", \"R\", \"R\", \"EN\", \"R\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"L\", \"AN\"], \"expected\": [\"L\", \"AN\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.307,"exit_code":1,"observations":[{"actual":["R","L","L","S","R"],"check":"mixed neutral run","expected":["R","R","R","R","R"],"passed":false},{"actual":["R","EN","S","R","R","L","R","R"],"check":"regression: segment separator neutrality","expected":["R","EN","R","R","R","L","R","R"],"passed":false},{"actual":["R","R","R","AN","L","L","EN","L"],"check":"partial-repair probe","expected":["R","R","R","AN","L","L","EN","L"],"passed":true},{"actual":["R","AN","EN","S","R","EN","R","L"],"check":"regression: segment separator neutrality","expected":["R","AN","EN","R","R","EN","R","L"],"passed":false},{"actual":["R","R"],"check":"leading neutral uses sos","expected":["R","R"],"passed":true},{"actual":["R","R","EN"],"check":"neutral between numbers and R","expected":["R","R","EN"],"passed":true},{"actual":["R","R","R","EN","R"],"check":"control layout","expected":["R","R","R","EN","R"],"passed":true},{"actual":["L","AN"],"check":"control layout","expected":["L","AN"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"mixed neutral run\", \"actual\": [\"R\", \"L\", \"L\", \"S\", \"R\"], \"expected\": [\"R\", \"R\", \"R\", \"R\", \"R\"], \"passed\": false}, {\"check\": \"regression: segment separator neutrality\", \"actual\": [\"R\", \"EN\", \"S\", \"R\", \"R\", \"L\", \"R\", \"R\"], \"expected\": [\"R\", \"EN\", \"R\", \"R\", \"R\", \"L\", \"R\", \"R\"], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [\"R\", \"R\", \"R\", \"AN\", \"L\", \"L\", \"EN\", \"L\"], \"expected\": [\"R\", \"R\", \"R\", \"AN\", \"L\", \"L\", \"EN\", \"L\"], \"passed\": true}, {\"check\": \"regression: segment separator neutrality\", \"actual\": [\"R\", \"AN\", \"EN\", \"S\", \"R\", \"EN\", \"R\", \"L\"], \"expected\": [\"R\", \"AN\", \"EN\", \"R\", \"R\", \"EN\", \"R\", \"L\"], \"passed\": false}, {\"check\": \"leading neutral uses sos\", \"actual\": [\"R\", \"R\"], \"expected\": [\"R\", \"R\"], \"passed\": true}, {\"check\": \"neutral between numbers and R\", \"actual\": [\"R\", \"R\", \"EN\"], \"expected\": [\"R\", \"R\", \"EN\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"R\", \"R\", \"R\", \"EN\", \"R\"], \"expected\": [\"R\", \"R\", \"R\", \"EN\", \"R\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"L\", \"AN\"], \"expected\": [\"L\", \"AN\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.39,"exit_code":0,"observations":[{"actual":["R","R","R","R","R"],"check":"mixed neutral run","expected":["R","R","R","R","R"],"passed":true},{"actual":["R","EN","R","R","R","L","R","R"],"check":"regression: segment separator neutrality","expected":["R","EN","R","R","R","L","R","R"],"passed":true},{"actual":["R","R","R","AN","L","L","EN","L"],"check":"partial-repair probe","expected":["R","R","R","AN","L","L","EN","L"],"passed":true},{"actual":["R","AN","EN","R","R","EN","R","L"],"check":"regression: segment separator neutrality","expected":["R","AN","EN","R","R","EN","R","L"],"passed":true},{"actual":["R","R"],"check":"leading neutral uses sos","expected":["R","R"],"passed":true},{"actual":["R","R","EN"],"check":"neutral between numbers and R","expected":["R","R","EN"],"passed":true},{"actual":["R","R","R","EN","R"],"check":"control layout","expected":["R","R","R","EN","R"],"passed":true},{"actual":["L","AN"],"check":"control layout","expected":["L","AN"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"mixed neutral run\", \"actual\": [\"R\", \"R\", \"R\", \"R\", \"R\"], \"expected\": [\"R\", \"R\", \"R\", \"R\", \"R\"], \"passed\": true}, {\"check\": \"regression: segment separator neutrality\", \"actual\": [\"R\", \"EN\", \"R\", \"R\", \"R\", \"L\", \"R\", \"R\"], \"expected\": [\"R\", \"EN\", \"R\", \"R\", \"R\", \"L\", \"R\", \"R\"], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [\"R\", \"R\", \"R\", \"AN\", \"L\", \"L\", \"EN\", \"L\"], \"expected\": [\"R\", \"R\", \"R\", \"AN\", \"L\", \"L\", \"EN\", \"L\"], \"passed\": true}, {\"check\": \"regression: segment separator neutrality\", \"actual\": [\"R\", \"AN\", \"EN\", \"R\", \"R\", \"EN\", \"R\", \"L\"], \"expected\": [\"R\", \"AN\", \"EN\", \"R\", \"R\", \"EN\", \"R\", \"L\"], \"passed\": true}, {\"check\": \"leading neutral uses sos\", \"actual\": [\"R\", \"R\"], \"expected\": [\"R\", \"R\"], \"passed\": true}, {\"check\": \"neutral between numbers and R\", \"actual\": [\"R\", \"R\", \"EN\"], \"expected\": [\"R\", \"R\", \"EN\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"R\", \"R\", \"R\", \"EN\", \"R\"], \"expected\": [\"R\", \"R\", \"R\", \"EN\", \"R\"], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [\"L\", \"AN\"], \"expected\": [\"L\", \"AN\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}