broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['name']+' — '+x['parent'] if x['duplicates']>1 else x['name']
    r1 = '•' if x['dirty'] else ''
    r2 = 'pin' if x['pinned'] else ''
    r3 = x['path']
    r4 = x['name'] if len(x['name'])<=x['max_chars'] else x['name'][:max(0,x['max_chars']-1)]+'…'
    r5 = x['name']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py', '\u2022', 'pin', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 src', '', 'pin', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'x', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['x \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'x', 'x src']), ({'name': 'main.py', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py', 'main.py tests']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.py \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.py src'])], 2: [({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx', '\u2022', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 src', '', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'xx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xx src']), ({'name': 'main.pyx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx tests']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyx src'])], 3: [({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 src', '', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'xxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xxx src']), ({'name': 'main.pyxx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx tests']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyxx src'])], 4: [({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 src', '', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'xxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xxxx src']), ({'name': 'main.pyxxx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx tests']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyxxx src'])], 5: [({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 src', '', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'xxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xxxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx tests']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyxxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyxxxx src'])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['name']+' — '+x['parent'] if x['duplicates']>1 else x['name']
    r1 = '•' if x['dirty'] else ''
    r2 = 'pin' if x['pinned'] else ''
    r3 = x['path']
    r4 = x['name'] if len(x['name'])<=x['max_chars'] else x['name'][:max(0,x['max_chars']-1)]+'…'
    r5 = x['parent']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py', '\u2022', 'pin', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 src', '', 'pin', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py', 'main.py src']), ({'name': 'x', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['x \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'x', 'x src']), ({'name': 'main.py', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.py \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py', 'main.py tests']), ({'name': 'main.py', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.py \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.py src'])], 2: [({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx', '\u2022', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 src', '', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.pyx', 'main.pyx src']), ({'name': 'xx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xx src']), ({'name': 'main.pyx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.pyx', 'main.pyx tests']), ({'name': 'main.pyx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyx src'])], 3: [({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 src', '', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py\u2026', 'main.pyxx src']), ({'name': 'xxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xxx src']), ({'name': 'main.pyxx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxx tests']), ({'name': 'main.pyxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyxx src'])], 4: [({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 src', '', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx src']), ({'name': 'xxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xxxx src']), ({'name': 'main.pyxxx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxx tests']), ({'name': 'main.pyxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyxxx src'])], 5: [({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 1, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': False, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 src', '', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': False, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 src', '\u2022', '', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx src']), ({'name': 'xxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 1}, ['xxxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', '\u2026', 'xxxxx src']), ({'name': 'main.pyxxxx', 'parent': 'tests', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 8}, ['main.pyxxxx \u2014 tests', '\u2022', 'pin', '/project/src/main.py', 'main.py\u2026', 'main.pyxxxx tests']), ({'name': 'main.pyxxxx', 'parent': 'src', 'duplicates': 2, 'dirty': True, 'pinned': True, 'path': '/project/src/main.py', 'max_chars': 4}, ['main.pyxxxx \u2014 src', '\u2022', 'pin', '/project/src/main.py', 'mai\u2026', 'main.pyxxxx src'])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect searchable label.

Duplicate basenames receive parent-directory suffixes; singleton basenames remain short. Dirty marker, pin marker and tooltip are independent label channels.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-2*x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect control reservation.

A strip reserves fixed control and pinned widths before distributing remaining width equally among normal tabs, clamped to min/max; report overflow and spacer.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect pinned footprint.

A strip reserves fixed control and pinned widths before distributing remaining width equally among normal tabs, clamped to min/max; report overflow and spacer.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = x['viewport']//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect normal share.

A strip reserves fixed control and pinned widths before distributing remaining width equally among normal tabs, clamped to min/max; report overflow and spacer.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = (x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal'])
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect clamped tab width.

A strip reserves fixed control and pinned widths before distributing remaining width equally among normal tabs, clamped to min/max; report overflow and spacer.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = 0
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']-x['viewport'])
    r5 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width']-x['normal']*x['max_width'])
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect minimum overflow.

A strip reserves fixed control and pinned widths before distributing remaining width equally among normal tabs, clamped to min/max; report overflow and spacer.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = x['viewport']%x['normal']
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = x['viewport']-x['controls']
    r1 = x['pins']*x['pin_width']
    r2 = max(0,x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']
    r3 = min(x['max_width'],max(x['min_width'],(x['viewport']-x['controls']-x['pins']*x['pin_width'])//x['normal']))
    r4 = max(0,x['normal']*x['min_width']+x['pins']*x['pin_width']+x['controls']-x['viewport'])
    r5 = 0
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 60, 100, 100, 0, 0]), ({'viewport': 300, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [260, 60, 50, 80, 120, 0]), ({'viewport': 500, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 1, 'min_width': 80, 'max_width': 160}, [460, 60, 400, 160, 0, 240]), ({'viewport': 500, 'controls': 40, 'pins': 0, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [460, 0, 115, 115, 0, 0]), ({'viewport': 900, 'controls': 40, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [860, 60, 200, 160, 0, 160]), ({'viewport': 500, 'controls': 0, 'pins': 2, 'pin_width': 30, 'normal': 4, 'min_width': 80, 'max_width': 160}, [500, 60, 110, 110, 0, 0])], 2: [({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 120, 200, 200, 0, 0]), ({'viewport': 600, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [520, 120, 100, 160, 240, 0]), ({'viewport': 1000, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 1, 'min_width': 160, 'max_width': 320}, [920, 120, 800, 320, 0, 480]), ({'viewport': 1000, 'controls': 80, 'pins': 0, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [920, 0, 230, 230, 0, 0]), ({'viewport': 1800, 'controls': 80, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1720, 120, 400, 320, 0, 320]), ({'viewport': 1000, 'controls': 0, 'pins': 2, 'pin_width': 60, 'normal': 4, 'min_width': 160, 'max_width': 320}, [1000, 120, 220, 220, 0, 0])], 3: [({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 180, 300, 300, 0, 0]), ({'viewport': 900, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [780, 180, 150, 240, 360, 0]), ({'viewport': 1500, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 1, 'min_width': 240, 'max_width': 480}, [1380, 180, 1200, 480, 0, 720]), ({'viewport': 1500, 'controls': 120, 'pins': 0, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1380, 0, 345, 345, 0, 0]), ({'viewport': 2700, 'controls': 120, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [2580, 180, 600, 480, 0, 480]), ({'viewport': 1500, 'controls': 0, 'pins': 2, 'pin_width': 90, 'normal': 4, 'min_width': 240, 'max_width': 480}, [1500, 180, 330, 330, 0, 0])], 4: [({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 240, 400, 400, 0, 0]), ({'viewport': 1200, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1040, 240, 200, 320, 480, 0]), ({'viewport': 2000, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 1, 'min_width': 320, 'max_width': 640}, [1840, 240, 1600, 640, 0, 960]), ({'viewport': 2000, 'controls': 160, 'pins': 0, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [1840, 0, 460, 460, 0, 0]), ({'viewport': 3600, 'controls': 160, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [3440, 240, 800, 640, 0, 640]), ({'viewport': 2000, 'controls': 0, 'pins': 2, 'pin_width': 120, 'normal': 4, 'min_width': 320, 'max_width': 640}, [2000, 240, 440, 440, 0, 0])], 5: [({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 300, 500, 500, 0, 0]), ({'viewport': 1500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [1300, 300, 250, 400, 600, 0]), ({'viewport': 2500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 1, 'min_width': 400, 'max_width': 800}, [2300, 300, 2000, 800, 0, 1200]), ({'viewport': 2500, 'controls': 200, 'pins': 0, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2300, 0, 575, 575, 0, 0]), ({'viewport': 4500, 'controls': 200, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [4300, 300, 1000, 800, 0, 800]), ({'viewport': 2500, 'controls': 0, 'pins': 2, 'pin_width': 150, 'normal': 4, 'min_width': 400, 'max_width': 800}, [2500, 300, 550, 550, 0, 0])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect unused spacer.

A strip reserves fixed control and pinned widths before distributing remaining width equally among normal tabs, clamped to min/max; report overflow and spacer.

split: open-access


source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    r0 = list(reversed([t for t in x['ids'] if t in x['hidden']]))
    r1 = [[x['labels'][t],t] for t in x['ids'] if t in x['hidden']]
    r2 = x['active'] in x['hidden']
    r3 = [t for t in x['ids'] if t in x['hidden'] and t in x['dirty']]
    r4 = [i for i,t in enumerate(x['ids']) if t in x['hidden']]
    r5 = [x['labels'][t] for t in x['ids'] if t in x['hidden']]
    return [r0,r1,r2,r3,r4,r5]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = {1: [({'ids': ['a', 'b', 'c', 'd'], 'hidden': ['b', 'd'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same'}}, [['b', 'd'], [['same', 'b'], ['same', 'd']], True, ['b'], [1, 3], ['same', 'same']]), ({'ids': ['a', 'b', 'c', 'd'], 'hidden': ['a', 'c'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same'}}, [['a', 'c'], [['one', 'a'], ['three', 'c']], False, [], [0, 2], ['one', 'three']]), ({'ids': ['a', 'b', 'c', 'd'], 'hidden': ['b', 'd'], 'active': 'a', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same'}}, [['b', 'd'], [['same', 'b'], ['same', 'd']], False, ['b'], [1, 3], ['same', 'same']]), ({'ids': ['a', 'b', 'c', 'd'], 'hidden': ['b', 'd'], 'active': 'd', 'dirty': ['d'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same'}}, [['b', 'd'], [['same', 'b'], ['same', 'd']], True, ['d'], [1, 3], ['same', 'same']]), ({'ids': ['a', 'b', 'c', 'd'], 'hidden': [], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same'}}, [[], [], False, [], [], []]), ({'ids': ['a', 'b', 'c', 'd'], 'hidden': ['d', 'b'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same'}}, [['b', 'd'], [['same', 'b'], ['same', 'd']], True, ['b'], [1, 3], ['same', 'same']])], 2: [({'ids': ['a', 'b', 'c', 'd', 'extra0'], 'hidden': ['b', 'd', 'extra0'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional'}}, [['b', 'd', 'extra0'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0']], True, ['b'], [1, 3, 4], ['same', 'same', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0'], 'hidden': ['a', 'c', 'extra0'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional'}}, [['a', 'c', 'extra0'], [['one', 'a'], ['three', 'c'], ['additional', 'extra0']], False, [], [0, 2, 4], ['one', 'three', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0'], 'hidden': ['b', 'd', 'extra0'], 'active': 'a', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional'}}, [['b', 'd', 'extra0'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0']], False, ['b'], [1, 3, 4], ['same', 'same', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0'], 'hidden': ['b', 'd', 'extra0'], 'active': 'd', 'dirty': ['d'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional'}}, [['b', 'd', 'extra0'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0']], True, ['d'], [1, 3, 4], ['same', 'same', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0'], 'hidden': ['extra0'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional'}}, [['extra0'], [['additional', 'extra0']], False, [], [4], ['additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0'], 'hidden': ['d', 'b', 'extra0'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional'}}, [['b', 'd', 'extra0'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0']], True, ['b'], [1, 3, 4], ['same', 'same', 'additional']])], 3: [({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1'], 'hidden': ['b', 'd', 'extra0', 'extra1'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional'}}, [['b', 'd', 'extra0', 'extra1'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1']], True, ['b'], [1, 3, 4, 5], ['same', 'same', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1'], 'hidden': ['a', 'c', 'extra0', 'extra1'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional'}}, [['a', 'c', 'extra0', 'extra1'], [['one', 'a'], ['three', 'c'], ['additional', 'extra0'], ['additional', 'extra1']], False, [], [0, 2, 4, 5], ['one', 'three', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1'], 'hidden': ['b', 'd', 'extra0', 'extra1'], 'active': 'a', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional'}}, [['b', 'd', 'extra0', 'extra1'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1']], False, ['b'], [1, 3, 4, 5], ['same', 'same', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1'], 'hidden': ['b', 'd', 'extra0', 'extra1'], 'active': 'd', 'dirty': ['d'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional'}}, [['b', 'd', 'extra0', 'extra1'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1']], True, ['d'], [1, 3, 4, 5], ['same', 'same', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1'], 'hidden': ['extra0', 'extra1'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional'}}, [['extra0', 'extra1'], [['additional', 'extra0'], ['additional', 'extra1']], False, [], [4, 5], ['additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1'], 'hidden': ['d', 'b', 'extra0', 'extra1'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional'}}, [['b', 'd', 'extra0', 'extra1'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1']], True, ['b'], [1, 3, 4, 5], ['same', 'same', 'additional', 'additional']])], 4: [({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2'], 'hidden': ['b', 'd', 'extra0', 'extra1', 'extra2'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2']], True, ['b'], [1, 3, 4, 5, 6], ['same', 'same', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2'], 'hidden': ['a', 'c', 'extra0', 'extra1', 'extra2'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional'}}, [['a', 'c', 'extra0', 'extra1', 'extra2'], [['one', 'a'], ['three', 'c'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2']], False, [], [0, 2, 4, 5, 6], ['one', 'three', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2'], 'hidden': ['b', 'd', 'extra0', 'extra1', 'extra2'], 'active': 'a', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2']], False, ['b'], [1, 3, 4, 5, 6], ['same', 'same', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2'], 'hidden': ['b', 'd', 'extra0', 'extra1', 'extra2'], 'active': 'd', 'dirty': ['d'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2']], True, ['d'], [1, 3, 4, 5, 6], ['same', 'same', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2'], 'hidden': ['extra0', 'extra1', 'extra2'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional'}}, [['extra0', 'extra1', 'extra2'], [['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2']], False, [], [4, 5, 6], ['additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2'], 'hidden': ['d', 'b', 'extra0', 'extra1', 'extra2'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2']], True, ['b'], [1, 3, 4, 5, 6], ['same', 'same', 'additional', 'additional', 'additional']])], 5: [({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'hidden': ['b', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional', 'extra3': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2'], ['additional', 'extra3']], True, ['b'], [1, 3, 4, 5, 6, 7], ['same', 'same', 'additional', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'hidden': ['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional', 'extra3': 'additional'}}, [['a', 'c', 'extra0', 'extra1', 'extra2', 'extra3'], [['one', 'a'], ['three', 'c'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2'], ['additional', 'extra3']], False, [], [0, 2, 4, 5, 6, 7], ['one', 'three', 'additional', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'hidden': ['b', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'a', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional', 'extra3': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2'], ['additional', 'extra3']], False, ['b'], [1, 3, 4, 5, 6, 7], ['same', 'same', 'additional', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'hidden': ['b', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'd', 'dirty': ['d'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional', 'extra3': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2'], ['additional', 'extra3']], True, ['d'], [1, 3, 4, 5, 6, 7], ['same', 'same', 'additional', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'hidden': ['extra0', 'extra1', 'extra2', 'extra3'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional', 'extra3': 'additional'}}, [['extra0', 'extra1', 'extra2', 'extra3'], [['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2'], ['additional', 'extra3']], False, [], [4, 5, 6, 7], ['additional', 'additional', 'additional', 'additional']]), ({'ids': ['a', 'b', 'c', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], 'hidden': ['d', 'b', 'extra0', 'extra1', 'extra2', 'extra3'], 'active': 'd', 'dirty': ['b'], 'labels': {'a': 'one', 'b': 'same', 'c': 'three', 'd': 'same', 'extra0': 'additional', 'extra1': 'additional', 'extra2': 'additional', 'extra3': 'additional'}}, [['b', 'd', 'extra0', 'extra1', 'extra2', 'extra3'], [['same', 'b'], ['same', 'd'], ['additional', 'extra0'], ['additional', 'extra1'], ['additional', 'extra2'], ['additional', 'extra3']], True, ['b'], [1, 3, 4, 5, 6, 7], ['same', 'same', 'additional', 'additional', 'additional', 'additional']])]}
for i, (inputs, expected) in enumerate(fixtures[N]):
    check("workspace regression "+str(i), solve(inputs), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)

prompt:
The tab workspace reports an incorrect hidden order.

An overflow menu represents only fully hidden tabs in visual order, retains ID despite duplicate labels, exposes active/dirty badges, and locates original strip indices.

split: open-access