{"abstract":"RLE inside an RTL embedding produces an even level.","category":"Bidirectional text layout","checks":8,"contract":"Input [classes, paragraph level, max depth]. RLE/RLO push the next odd level, LRE/LRO the next even level (RLO/LRO set an R/L override, RLE/LRE clear it) if the level <= max depth and no overflow is pending, else count an overflow. PDF first cancels an overflow, else pops if above the base. Codes get level \"x\" and class BN; other characters take the top level and the override class if any. Return [levels, classes].","contract_signature":"x","evaluation_group":"w2-bidirectional-text-layout-explicit-embeddings","failed_approach":"Applying the LTR increments to RLE still lands on the wrong parity.","family":"w2-bidirectional-text-layout-explicit-embeddings-next-odd-level","id":"FA-80521","implementations":{"attempt":{"sha256":"3aec27957076d537c91b6f8c7ad924ccb4f57eb5af58bed4d450ae1d9dd0d363","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    classes, para, max_depth = x\n    stack = [(para, None)]\n    overflow = 0\n    levels = []\n    types = []\n    for c in classes:\n        if c in ('RLE', 'LRE', 'RLO', 'LRO'):\n            cur = stack[-1][0]\n            if c in ('RLE', 'RLO'):\n                new = cur + 1 if cur % 2 == 1 else cur + 2\n            else:\n                new = cur + 2 if cur % 2 == 0 else cur + 1\n            if new <= max_depth and overflow == 0:\n                ovr = None if c in ('RLE', 'LRE') else ('R' if c == 'RLO' else 'L')\n                stack.append((new, ovr))\n            else:\n                overflow += 1\n            levels.append('x')\n            types.append('BN')\n        elif c == 'PDF':\n            if overflow > 0:\n                overflow -= 1\n            elif len(stack) > 1:\n                stack.pop()\n            levels.append('x')\n            types.append('BN')\n        else:\n            lv, ovr = stack[-1]\n            levels.append(lv)\n            types.append(ovr if ovr else c)\n    return [levels, types]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('RLE from odd level', [['RLE', 'RLE', 'L'], 0, 6], [['x', 'x', 3], ['BN', 'BN', 'L']]), ('regression: next odd level', [['L', 'L', 'ON', 'PDF', 'RLE', 'L', 'RLO', 'R'], 0, 4], [[0, 0, 0, 'x', 'x', 1, 'x', 3], ['L', 'L', 'ON', 'BN', 'BN', 'L', 'BN', 'R']]), ('partial-repair probe', [['RLE', 'LRE', 'PDF', 'ON', 'R', 'RLO'], 0, 4], [['x', 'x', 'x', 1, 1, 'x'], ['BN', 'BN', 'BN', 'ON', 'R', 'BN']]), ('partial-repair probe', [['R', 'RLO', 'PDF', 'R', 'L', 'RLE', 'LRE', 'ON', 'R', 'RLE', 'ON', 'LRE', 'R'], 0, 4], [[0, 'x', 'x', 0, 0, 'x', 'x', 2, 2, 'x', 3, 'x', 4], ['R', 'BN', 'BN', 'R', 'L', 'BN', 'BN', 'ON', 'R', 'BN', 'ON', 'BN', 'R']]), ('LRE from odd level', [['LRE', 'R'], 1, 6], [['x', 2], ['BN', 'R']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('control layout', [['PDF', 'LRO', 'R', 'EN', 'LRE', 'L', 'L', 'L', 'RLE', 'R', 'L', 'LRO'], 1, 3], [['x', 'x', 2, 2, 'x', 2, 2, 2, 'x', 2, 2, 'x'], ['BN', 'BN', 'L', 'L', 'BN', 'L', 'L', 'L', 'BN', 'L', 'L', 'BN']]), ('control layout', [['R', 'LRO'], 0, 4], [[0, 'x'], ['R', 'BN']])], [('regression: next odd level', [['PDF', 'RLO', 'RLE', 'LRE', 'LRO', 'PDF', 'PDF', 'EN', 'PDF', 'R', 'L', 'EN', 'L'], 1, 5], [['x', 'x', 'x', 'x', 'x', 'x', 'x', 5, 'x', 3, 3, 3, 3], ['BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'EN', 'BN', 'R', 'R', 'R', 'R']]), ('regression: next odd level', [['WS', 'PDF', 'RLE', 'RLE', 'L'], 1, 5], [[1, 'x', 'x', 'x', 5], ['WS', 'BN', 'BN', 'BN', 'L']]), ('partial-repair probe', [['R', 'RLO', 'RLE', 'PDF', 'R', 'LRE', 'L', 'ON', 'R', 'ON', 'RLO'], 0, 3], [[0, 'x', 'x', 'x', 1, 'x', 2, 2, 2, 2, 'x'], ['R', 'BN', 'BN', 'BN', 'R', 'BN', 'L', 'ON', 'R', 'ON', 'BN']]), ('regression: next odd level', [['ON', 'L', 'EN', 'PDF', 'RLE', 'R', 'RLO', 'L', 'PDF'], 0, 5], [[0, 0, 0, 'x', 'x', 1, 'x', 3, 'x'], ['ON', 'L', 'EN', 'BN', 'BN', 'R', 'BN', 'R', 'BN']]), ('depth limit exactly reached', [['RLE', 'LRE', 'L', 'PDF', 'L'], 0, 2], [['x', 'x', 2, 'x', 1], ['BN', 'BN', 'L', 'BN', 'L']]), ('LRE from odd level', [['LRE', 'R'], 1, 6], [['x', 2], ['BN', 'R']]), ('control layout', [['EN', 'R'], 0, 5], [[0, 0], ['EN', 'R']]), ('control layout', [['L', 'R', 'ON', 'R', 'PDF', 'ON', 'ON'], 1, 4], [[1, 1, 1, 1, 'x', 1, 1], ['L', 'R', 'ON', 'R', 'BN', 'ON', 'ON']])], [('regression: next odd level', [['PDF', 'PDF', 'R', 'L', 'RLO', 'ON', 'R', 'ON'], 1, 2], [['x', 'x', 1, 1, 'x', 1, 1, 1], ['BN', 'BN', 'R', 'L', 'BN', 'ON', 'R', 'ON']]), ('regression: next odd level', [['RLO', 'EN', 'R', 'ON', 'EN', 'L', 'ON', 'R', 'RLO', 'RLE', 'LRE', 'PDF', 'EN', 'LRE'], 1, 3], [['x', 3, 3, 3, 3, 3, 3, 3, 'x', 'x', 'x', 'x', 3, 'x'], ['BN', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'BN', 'BN', 'BN', 'BN', 'R', 'BN']]), ('regression: next odd level', [['ON', 'L', 'PDF', 'RLO', 'R'], 1, 4], [[1, 1, 'x', 'x', 3], ['ON', 'L', 'BN', 'BN', 'R']]), ('partial-repair probe', [['WS', 'L', 'L', 'RLE', 'R', 'RLO'], 0, 5], [[0, 0, 0, 'x', 1, 'x'], ['WS', 'L', 'L', 'BN', 'R', 'BN']]), ('depth limit exactly reached', [['RLE', 'LRE', 'L', 'PDF', 'L'], 0, 2], [['x', 'x', 2, 'x', 1], ['BN', 'BN', 'L', 'BN', 'L']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('control layout', [['ON', 'ON', 'L', 'EN', 'WS'], 1, 4], [[1, 1, 1, 1, 1], ['ON', 'ON', 'L', 'EN', 'WS']]), ('control layout', [['L', 'R', 'WS', 'ON', 'RLE', 'LRE'], 0, 5], [[0, 0, 0, 0, 'x', 'x'], ['L', 'R', 'WS', 'ON', 'BN', 'BN']])], [('regression: next odd level', [['PDF', 'PDF', 'R', 'L', 'RLO', 'ON', 'R', 'ON'], 1, 2], [['x', 'x', 1, 1, 'x', 1, 1, 1], ['BN', 'BN', 'R', 'L', 'BN', 'ON', 'R', 'ON']]), ('regression: next odd level', [['RLE', 'RLO', 'EN', 'L', 'EN', 'PDF', 'L', 'LRE', 'EN', 'LRO', 'R', 'WS', 'LRE'], 1, 3], [['x', 'x', 3, 3, 3, 'x', 3, 'x', 3, 'x', 3, 3, 'x'], ['BN', 'BN', 'EN', 'L', 'EN', 'BN', 'L', 'BN', 'EN', 'BN', 'R', 'WS', 'BN']]), ('regression: next odd level', [['RLO', 'R'], 1, 3], [['x', 3], ['BN', 'R']]), ('partial-repair probe', [['R', 'L', 'RLE', 'WS', 'R', 'LRE', 'ON', 'PDF', 'RLE'], 0, 4], [[0, 0, 'x', 1, 1, 'x', 2, 'x', 'x'], ['R', 'L', 'BN', 'WS', 'R', 'BN', 'ON', 'BN', 'BN']]), ('LRE from odd level', [['LRE', 'R'], 1, 6], [['x', 2], ['BN', 'R']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('control layout', [['EN', 'LRO', 'LRO', 'LRE', 'RLO', 'EN', 'PDF', 'RLE'], 0, 3], [[0, 'x', 'x', 'x', 'x', 2, 'x', 'x'], ['EN', 'BN', 'BN', 'BN', 'BN', 'L', 'BN', 'BN']]), ('control layout', [['ON', 'RLE', 'LRE', 'RLE', 'LRE', 'R', 'L', 'LRO', 'EN', 'PDF', 'L', 'L', 'LRE', 'PDF'], 0, 4], [[0, 'x', 'x', 'x', 'x', 4, 4, 'x', 4, 'x', 4, 4, 'x', 'x'], ['ON', 'BN', 'BN', 'BN', 'BN', 'R', 'L', 'BN', 'EN', 'BN', 'L', 'L', 'BN', 'BN']])], [('regression: next odd level', [['RLO', 'ON', 'EN', 'EN', 'ON', 'R'], 1, 2], [['x', 1, 1, 1, 1, 1], ['BN', 'ON', 'EN', 'EN', 'ON', 'R']]), ('regression: next odd level', [['RLE', 'RLO', 'EN', 'L', 'EN', 'PDF', 'L', 'LRE', 'EN', 'LRO', 'R', 'WS', 'LRE'], 1, 3], [['x', 'x', 3, 3, 3, 'x', 3, 'x', 3, 'x', 3, 3, 'x'], ['BN', 'BN', 'EN', 'L', 'EN', 'BN', 'L', 'BN', 'EN', 'BN', 'R', 'WS', 'BN']]), ('regression: next odd level', [['RLO', 'R'], 1, 3], [['x', 3], ['BN', 'R']]), ('regression: next odd level', [['L', 'L', 'RLO', 'RLO', 'L', 'R', 'RLE', 'RLE', 'R', 'R', 'L', 'LRE', 'EN'], 1, 6], [[1, 1, 'x', 'x', 5, 5, 'x', 'x', 5, 5, 5, 'x', 5], ['L', 'L', 'BN', 'BN', 'R', 'R', 'BN', 'BN', 'R', 'R', 'R', 'BN', 'R']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('depth limit exactly reached', [['RLE', 'LRE', 'L', 'PDF', 'L'], 0, 2], [['x', 'x', 2, 'x', 1], ['BN', 'BN', 'L', 'BN', 'L']]), ('control layout', [['R', 'L', 'LRE', 'LRO', 'RLE'], 1, 3], [[1, 1, 'x', 'x', 'x'], ['R', 'L', 'BN', 'BN', 'BN']]), ('control layout', [['ON', 'L', 'LRO', 'RLO', 'PDF', 'PDF', 'R', 'R', 'ON', 'L', 'ON', 'L'], 1, 3], [[1, 1, 'x', 'x', 'x', 'x', 1, 1, 1, 1, 1, 1], ['ON', 'L', 'BN', 'BN', 'BN', 'BN', 'R', 'R', 'ON', 'L', 'ON', 'L']])]]\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":"c7d52a93c980942b7406465d2319b97ebdf97682b2baba809697e269a64504fb","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    classes, para, max_depth = x\n    stack = [(para, None)]\n    overflow = 0\n    levels = []\n    types = []\n    for c in classes:\n        if c in ('RLE', 'LRE', 'RLO', 'LRO'):\n            cur = stack[-1][0]\n            if c in ('RLE', 'RLO'):\n                new = cur + 1\n            else:\n                new = cur + 2 if cur % 2 == 0 else cur + 1\n            if new <= max_depth and overflow == 0:\n                ovr = None if c in ('RLE', 'LRE') else ('R' if c == 'RLO' else 'L')\n                stack.append((new, ovr))\n            else:\n                overflow += 1\n            levels.append('x')\n            types.append('BN')\n        elif c == 'PDF':\n            if overflow > 0:\n                overflow -= 1\n            elif len(stack) > 1:\n                stack.pop()\n            levels.append('x')\n            types.append('BN')\n        else:\n            lv, ovr = stack[-1]\n            levels.append(lv)\n            types.append(ovr if ovr else c)\n    return [levels, types]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('RLE from odd level', [['RLE', 'RLE', 'L'], 0, 6], [['x', 'x', 3], ['BN', 'BN', 'L']]), ('regression: next odd level', [['L', 'L', 'ON', 'PDF', 'RLE', 'L', 'RLO', 'R'], 0, 4], [[0, 0, 0, 'x', 'x', 1, 'x', 3], ['L', 'L', 'ON', 'BN', 'BN', 'L', 'BN', 'R']]), ('partial-repair probe', [['RLE', 'LRE', 'PDF', 'ON', 'R', 'RLO'], 0, 4], [['x', 'x', 'x', 1, 1, 'x'], ['BN', 'BN', 'BN', 'ON', 'R', 'BN']]), ('partial-repair probe', [['R', 'RLO', 'PDF', 'R', 'L', 'RLE', 'LRE', 'ON', 'R', 'RLE', 'ON', 'LRE', 'R'], 0, 4], [[0, 'x', 'x', 0, 0, 'x', 'x', 2, 2, 'x', 3, 'x', 4], ['R', 'BN', 'BN', 'R', 'L', 'BN', 'BN', 'ON', 'R', 'BN', 'ON', 'BN', 'R']]), ('LRE from odd level', [['LRE', 'R'], 1, 6], [['x', 2], ['BN', 'R']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('control layout', [['PDF', 'LRO', 'R', 'EN', 'LRE', 'L', 'L', 'L', 'RLE', 'R', 'L', 'LRO'], 1, 3], [['x', 'x', 2, 2, 'x', 2, 2, 2, 'x', 2, 2, 'x'], ['BN', 'BN', 'L', 'L', 'BN', 'L', 'L', 'L', 'BN', 'L', 'L', 'BN']]), ('control layout', [['R', 'LRO'], 0, 4], [[0, 'x'], ['R', 'BN']])], [('regression: next odd level', [['PDF', 'RLO', 'RLE', 'LRE', 'LRO', 'PDF', 'PDF', 'EN', 'PDF', 'R', 'L', 'EN', 'L'], 1, 5], [['x', 'x', 'x', 'x', 'x', 'x', 'x', 5, 'x', 3, 3, 3, 3], ['BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'EN', 'BN', 'R', 'R', 'R', 'R']]), ('regression: next odd level', [['WS', 'PDF', 'RLE', 'RLE', 'L'], 1, 5], [[1, 'x', 'x', 'x', 5], ['WS', 'BN', 'BN', 'BN', 'L']]), ('partial-repair probe', [['R', 'RLO', 'RLE', 'PDF', 'R', 'LRE', 'L', 'ON', 'R', 'ON', 'RLO'], 0, 3], [[0, 'x', 'x', 'x', 1, 'x', 2, 2, 2, 2, 'x'], ['R', 'BN', 'BN', 'BN', 'R', 'BN', 'L', 'ON', 'R', 'ON', 'BN']]), ('regression: next odd level', [['ON', 'L', 'EN', 'PDF', 'RLE', 'R', 'RLO', 'L', 'PDF'], 0, 5], [[0, 0, 0, 'x', 'x', 1, 'x', 3, 'x'], ['ON', 'L', 'EN', 'BN', 'BN', 'R', 'BN', 'R', 'BN']]), ('depth limit exactly reached', [['RLE', 'LRE', 'L', 'PDF', 'L'], 0, 2], [['x', 'x', 2, 'x', 1], ['BN', 'BN', 'L', 'BN', 'L']]), ('LRE from odd level', [['LRE', 'R'], 1, 6], [['x', 2], ['BN', 'R']]), ('control layout', [['EN', 'R'], 0, 5], [[0, 0], ['EN', 'R']]), ('control layout', [['L', 'R', 'ON', 'R', 'PDF', 'ON', 'ON'], 1, 4], [[1, 1, 1, 1, 'x', 1, 1], ['L', 'R', 'ON', 'R', 'BN', 'ON', 'ON']])], [('regression: next odd level', [['PDF', 'PDF', 'R', 'L', 'RLO', 'ON', 'R', 'ON'], 1, 2], [['x', 'x', 1, 1, 'x', 1, 1, 1], ['BN', 'BN', 'R', 'L', 'BN', 'ON', 'R', 'ON']]), ('regression: next odd level', [['RLO', 'EN', 'R', 'ON', 'EN', 'L', 'ON', 'R', 'RLO', 'RLE', 'LRE', 'PDF', 'EN', 'LRE'], 1, 3], [['x', 3, 3, 3, 3, 3, 3, 3, 'x', 'x', 'x', 'x', 3, 'x'], ['BN', 'R', 'R', 'R', 'R', 'R', 'R', 'R', 'BN', 'BN', 'BN', 'BN', 'R', 'BN']]), ('regression: next odd level', [['ON', 'L', 'PDF', 'RLO', 'R'], 1, 4], [[1, 1, 'x', 'x', 3], ['ON', 'L', 'BN', 'BN', 'R']]), ('partial-repair probe', [['WS', 'L', 'L', 'RLE', 'R', 'RLO'], 0, 5], [[0, 0, 0, 'x', 1, 'x'], ['WS', 'L', 'L', 'BN', 'R', 'BN']]), ('depth limit exactly reached', [['RLE', 'LRE', 'L', 'PDF', 'L'], 0, 2], [['x', 'x', 2, 'x', 1], ['BN', 'BN', 'L', 'BN', 'L']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('control layout', [['ON', 'ON', 'L', 'EN', 'WS'], 1, 4], [[1, 1, 1, 1, 1], ['ON', 'ON', 'L', 'EN', 'WS']]), ('control layout', [['L', 'R', 'WS', 'ON', 'RLE', 'LRE'], 0, 5], [[0, 0, 0, 0, 'x', 'x'], ['L', 'R', 'WS', 'ON', 'BN', 'BN']])], [('regression: next odd level', [['PDF', 'PDF', 'R', 'L', 'RLO', 'ON', 'R', 'ON'], 1, 2], [['x', 'x', 1, 1, 'x', 1, 1, 1], ['BN', 'BN', 'R', 'L', 'BN', 'ON', 'R', 'ON']]), ('regression: next odd level', [['RLE', 'RLO', 'EN', 'L', 'EN', 'PDF', 'L', 'LRE', 'EN', 'LRO', 'R', 'WS', 'LRE'], 1, 3], [['x', 'x', 3, 3, 3, 'x', 3, 'x', 3, 'x', 3, 3, 'x'], ['BN', 'BN', 'EN', 'L', 'EN', 'BN', 'L', 'BN', 'EN', 'BN', 'R', 'WS', 'BN']]), ('regression: next odd level', [['RLO', 'R'], 1, 3], [['x', 3], ['BN', 'R']]), ('partial-repair probe', [['R', 'L', 'RLE', 'WS', 'R', 'LRE', 'ON', 'PDF', 'RLE'], 0, 4], [[0, 0, 'x', 1, 1, 'x', 2, 'x', 'x'], ['R', 'L', 'BN', 'WS', 'R', 'BN', 'ON', 'BN', 'BN']]), ('LRE from odd level', [['LRE', 'R'], 1, 6], [['x', 2], ['BN', 'R']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('control layout', [['EN', 'LRO', 'LRO', 'LRE', 'RLO', 'EN', 'PDF', 'RLE'], 0, 3], [[0, 'x', 'x', 'x', 'x', 2, 'x', 'x'], ['EN', 'BN', 'BN', 'BN', 'BN', 'L', 'BN', 'BN']]), ('control layout', [['ON', 'RLE', 'LRE', 'RLE', 'LRE', 'R', 'L', 'LRO', 'EN', 'PDF', 'L', 'L', 'LRE', 'PDF'], 0, 4], [[0, 'x', 'x', 'x', 'x', 4, 4, 'x', 4, 'x', 4, 4, 'x', 'x'], ['ON', 'BN', 'BN', 'BN', 'BN', 'R', 'L', 'BN', 'EN', 'BN', 'L', 'L', 'BN', 'BN']])], [('regression: next odd level', [['RLO', 'ON', 'EN', 'EN', 'ON', 'R'], 1, 2], [['x', 1, 1, 1, 1, 1], ['BN', 'ON', 'EN', 'EN', 'ON', 'R']]), ('regression: next odd level', [['RLE', 'RLO', 'EN', 'L', 'EN', 'PDF', 'L', 'LRE', 'EN', 'LRO', 'R', 'WS', 'LRE'], 1, 3], [['x', 'x', 3, 3, 3, 'x', 3, 'x', 3, 'x', 3, 3, 'x'], ['BN', 'BN', 'EN', 'L', 'EN', 'BN', 'L', 'BN', 'EN', 'BN', 'R', 'WS', 'BN']]), ('regression: next odd level', [['RLO', 'R'], 1, 3], [['x', 3], ['BN', 'R']]), ('regression: next odd level', [['L', 'L', 'RLO', 'RLO', 'L', 'R', 'RLE', 'RLE', 'R', 'R', 'L', 'LRE', 'EN'], 1, 6], [[1, 1, 'x', 'x', 5, 5, 'x', 'x', 5, 5, 5, 'x', 5], ['L', 'L', 'BN', 'BN', 'R', 'R', 'BN', 'BN', 'R', 'R', 'R', 'BN', 'R']]), ('override on neutrals', [['RLO', 'ON', 'L', 'WS'], 0, 6], [['x', 1, 1, 1], ['BN', 'R', 'R', 'R']]), ('depth limit exactly reached', [['RLE', 'LRE', 'L', 'PDF', 'L'], 0, 2], [['x', 'x', 2, 'x', 1], ['BN', 'BN', 'L', 'BN', 'L']]), ('control layout', [['R', 'L', 'LRE', 'LRO', 'RLE'], 1, 3], [[1, 1, 'x', 'x', 'x'], ['R', 'L', 'BN', 'BN', 'BN']]), ('control layout', [['ON', 'L', 'LRO', 'RLO', 'PDF', 'PDF', 'R', 'R', 'ON', 'L', 'ON', 'L'], 1, 3], [[1, 1, 'x', 'x', 'x', 'x', 1, 1, 1, 1, 1, 1], ['ON', 'L', 'BN', 'BN', 'BN', 'BN', 'R', 'R', 'ON', 'L', 'ON', 'L']])]]\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-explicit-embeddings-next-odd-level","generated_at":"2026-09-29T14:49:54.775292+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 next odd level is always computed as current + 1.","sha256":"a4afa75abe71c0144ad2871f85d97b0ad4fc1d98d74bc51d9cb5cb0fd6c40be3","title":"Explicit embedding stack: next odd 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.43,"exit_code":1,"observations":[{"actual":[["x","x",4],["BN","BN","L"]],"check":"RLE from odd level","expected":[["x","x",3],["BN","BN","L"]],"passed":false},{"actual":[[0,0,0,"x","x",2,"x",4],["L","L","ON","BN","BN","L","BN","R"]],"check":"regression: next odd level","expected":[[0,0,0,"x","x",1,"x",3],["L","L","ON","BN","BN","L","BN","R"]],"passed":false},{"actual":[["x","x","x",2,2,"x"],["BN","BN","BN","ON","R","BN"]],"check":"partial-repair probe","expected":[["x","x","x",1,1,"x"],["BN","BN","BN","ON","R","BN"]],"passed":false},{"actual":[[0,"x","x",0,0,"x","x",4,4,"x",4,"x",4],["R","BN","BN","R","L","BN","BN","ON","R","BN","ON","BN","R"]],"check":"partial-repair probe","expected":[[0,"x","x",0,0,"x","x",2,2,"x",3,"x",4],["R","BN","BN","R","L","BN","BN","ON","R","BN","ON","BN","R"]],"passed":false},{"actual":[["x",2],["BN","R"]],"check":"LRE from odd level","expected":[["x",2],["BN","R"]],"passed":true},{"actual":[["x",2,2,2],["BN","R","R","R"]],"check":"override on neutrals","expected":[["x",1,1,1],["BN","R","R","R"]],"passed":false},{"actual":[["x","x",2,2,"x",2,2,2,"x",2,2,"x"],["BN","BN","L","L","BN","L","L","L","BN","L","L","BN"]],"check":"control layout","expected":[["x","x",2,2,"x",2,2,2,"x",2,2,"x"],["BN","BN","L","L","BN","L","L","L","BN","L","L","BN"]],"passed":true},{"actual":[[0,"x"],["R","BN"]],"check":"control layout","expected":[[0,"x"],["R","BN"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"RLE from odd level\", \"actual\": [[\"x\", \"x\", 4], [\"BN\", \"BN\", \"L\"]], \"expected\": [[\"x\", \"x\", 3], [\"BN\", \"BN\", \"L\"]], \"passed\": false}, {\"check\": \"regression: next odd level\", \"actual\": [[0, 0, 0, \"x\", \"x\", 2, \"x\", 4], [\"L\", \"L\", \"ON\", \"BN\", \"BN\", \"L\", \"BN\", \"R\"]], \"expected\": [[0, 0, 0, \"x\", \"x\", 1, \"x\", 3], [\"L\", \"L\", \"ON\", \"BN\", \"BN\", \"L\", \"BN\", \"R\"]], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [[\"x\", \"x\", \"x\", 2, 2, \"x\"], [\"BN\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\"]], \"expected\": [[\"x\", \"x\", \"x\", 1, 1, \"x\"], [\"BN\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\"]], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [[0, \"x\", \"x\", 0, 0, \"x\", \"x\", 4, 4, \"x\", 4, \"x\", 4], [\"R\", \"BN\", \"BN\", \"R\", \"L\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\", \"ON\", \"BN\", \"R\"]], \"expected\": [[0, \"x\", \"x\", 0, 0, \"x\", \"x\", 2, 2, \"x\", 3, \"x\", 4], [\"R\", \"BN\", \"BN\", \"R\", \"L\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\", \"ON\", \"BN\", \"R\"]], \"passed\": false}, {\"check\": \"LRE from odd level\", \"actual\": [[\"x\", 2], [\"BN\", \"R\"]], \"expected\": [[\"x\", 2], [\"BN\", \"R\"]], \"passed\": true}, {\"check\": \"override on neutrals\", \"actual\": [[\"x\", 2, 2, 2], [\"BN\", \"R\", \"R\", \"R\"]], \"expected\": [[\"x\", 1, 1, 1], [\"BN\", \"R\", \"R\", \"R\"]], \"passed\": false}, {\"check\": \"control layout\", \"actual\": [[\"x\", \"x\", 2, 2, \"x\", 2, 2, 2, \"x\", 2, 2, \"x\"], [\"BN\", \"BN\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"BN\"]], \"expected\": [[\"x\", \"x\", 2, 2, \"x\", 2, 2, 2, \"x\", 2, 2, \"x\"], [\"BN\", \"BN\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"BN\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[0, \"x\"], [\"R\", \"BN\"]], \"expected\": [[0, \"x\"], [\"R\", \"BN\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.405,"exit_code":1,"observations":[{"actual":[["x","x",2],["BN","BN","L"]],"check":"RLE from odd level","expected":[["x","x",3],["BN","BN","L"]],"passed":false},{"actual":[[0,0,0,"x","x",1,"x",2],["L","L","ON","BN","BN","L","BN","R"]],"check":"regression: next odd level","expected":[[0,0,0,"x","x",1,"x",3],["L","L","ON","BN","BN","L","BN","R"]],"passed":false},{"actual":[["x","x","x",1,1,"x"],["BN","BN","BN","ON","R","BN"]],"check":"partial-repair probe","expected":[["x","x","x",1,1,"x"],["BN","BN","BN","ON","R","BN"]],"passed":true},{"actual":[[0,"x","x",0,0,"x","x",2,2,"x",3,"x",4],["R","BN","BN","R","L","BN","BN","ON","R","BN","ON","BN","R"]],"check":"partial-repair probe","expected":[[0,"x","x",0,0,"x","x",2,2,"x",3,"x",4],["R","BN","BN","R","L","BN","BN","ON","R","BN","ON","BN","R"]],"passed":true},{"actual":[["x",2],["BN","R"]],"check":"LRE from odd level","expected":[["x",2],["BN","R"]],"passed":true},{"actual":[["x",1,1,1],["BN","R","R","R"]],"check":"override on neutrals","expected":[["x",1,1,1],["BN","R","R","R"]],"passed":true},{"actual":[["x","x",2,2,"x",2,2,2,"x",2,2,"x"],["BN","BN","L","L","BN","L","L","L","BN","L","L","BN"]],"check":"control layout","expected":[["x","x",2,2,"x",2,2,2,"x",2,2,"x"],["BN","BN","L","L","BN","L","L","L","BN","L","L","BN"]],"passed":true},{"actual":[[0,"x"],["R","BN"]],"check":"control layout","expected":[[0,"x"],["R","BN"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"RLE from odd level\", \"actual\": [[\"x\", \"x\", 2], [\"BN\", \"BN\", \"L\"]], \"expected\": [[\"x\", \"x\", 3], [\"BN\", \"BN\", \"L\"]], \"passed\": false}, {\"check\": \"regression: next odd level\", \"actual\": [[0, 0, 0, \"x\", \"x\", 1, \"x\", 2], [\"L\", \"L\", \"ON\", \"BN\", \"BN\", \"L\", \"BN\", \"R\"]], \"expected\": [[0, 0, 0, \"x\", \"x\", 1, \"x\", 3], [\"L\", \"L\", \"ON\", \"BN\", \"BN\", \"L\", \"BN\", \"R\"]], \"passed\": false}, {\"check\": \"partial-repair probe\", \"actual\": [[\"x\", \"x\", \"x\", 1, 1, \"x\"], [\"BN\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\"]], \"expected\": [[\"x\", \"x\", \"x\", 1, 1, \"x\"], [\"BN\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\"]], \"passed\": true}, {\"check\": \"partial-repair probe\", \"actual\": [[0, \"x\", \"x\", 0, 0, \"x\", \"x\", 2, 2, \"x\", 3, \"x\", 4], [\"R\", \"BN\", \"BN\", \"R\", \"L\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\", \"ON\", \"BN\", \"R\"]], \"expected\": [[0, \"x\", \"x\", 0, 0, \"x\", \"x\", 2, 2, \"x\", 3, \"x\", 4], [\"R\", \"BN\", \"BN\", \"R\", \"L\", \"BN\", \"BN\", \"ON\", \"R\", \"BN\", \"ON\", \"BN\", \"R\"]], \"passed\": true}, {\"check\": \"LRE from odd level\", \"actual\": [[\"x\", 2], [\"BN\", \"R\"]], \"expected\": [[\"x\", 2], [\"BN\", \"R\"]], \"passed\": true}, {\"check\": \"override on neutrals\", \"actual\": [[\"x\", 1, 1, 1], [\"BN\", \"R\", \"R\", \"R\"]], \"expected\": [[\"x\", 1, 1, 1], [\"BN\", \"R\", \"R\", \"R\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[\"x\", \"x\", 2, 2, \"x\", 2, 2, 2, \"x\", 2, 2, \"x\"], [\"BN\", \"BN\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"BN\"]], \"expected\": [[\"x\", \"x\", 2, 2, \"x\", 2, 2, 2, \"x\", 2, 2, \"x\"], [\"BN\", \"BN\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"L\", \"BN\", \"L\", \"L\", \"BN\"]], \"passed\": true}, {\"check\": \"control layout\", \"actual\": [[0, \"x\"], [\"R\", \"BN\"]], \"expected\": [[0, \"x\"], [\"R\", \"BN\"]], \"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."}}