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

N = 1
observations = []
def solve(x):
    r0 = x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']
    r1 = 'left' if x['px']<x['width']/2 else 'right'
    r2 = 'top' if x['py']<x['height']/2 else 'bottom'
    r3 = 'horizontal' if min(x['px'],x['width']-x['px'])<=min(x['py'],x['height']-x['py']) else 'vertical'
    r4 = x['source_pane']==x['target_pane'] and (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge'])
    r5 = x['target_group'] if (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']) else None
    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: [({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 190, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 100, 'py': 95, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 5, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 2: [({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 380, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 200, 'py': 190, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 10, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 3: [({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 570, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 300, 'py': 285, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 15, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 4: [({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 760, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 400, 'py': 380, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 20, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 5: [({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 950, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 500, 'py': 475, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 25, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])]}
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['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']
    r1 = 'left' if x['px']<x['width']/2 else 'right'
    r2 = 'top' if x['py']<x['height']/2 else 'bottom'
    r3 = 'horizontal'
    r4 = x['source_pane']==x['target_pane'] and (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge'])
    r5 = x['target_group'] if (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']) else None
    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: [({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 190, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 100, 'py': 95, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 5, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 2: [({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 380, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 200, 'py': 190, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 10, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 3: [({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 570, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 300, 'py': 285, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 15, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 4: [({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 760, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 400, 'py': 380, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 20, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 5: [({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 950, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 500, 'py': 475, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 25, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])]}
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 nearest axis.

A dropped tab creates a new ungrouped pane only in an edge docking zone; center targets join the destination group. Center drops into the source pane are no-ops. Corners resolve to the nearest normalized edge.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']
    r1 = 'left' if x['px']<x['width']/2 else 'right'
    r2 = 'top' if x['py']<x['height']/2 else 'bottom'
    r3 = 'horizontal' if min(x['px'],x['width']-x['px'])*x['height']<=min(x['py'],x['height']-x['py'])*x['width'] else 'vertical'
    r4 = x['source_pane']==x['target_pane']
    r5 = x['target_group'] if (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']) else None
    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: [({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 190, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 100, 'py': 95, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 5, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 2: [({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 380, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 200, 'py': 190, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 10, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 3: [({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 570, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 300, 'py': 285, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 15, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 4: [({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 760, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 400, 'py': 380, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 20, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 5: [({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 950, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 500, 'py': 475, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 25, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])]}
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['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']
    r1 = 'left' if x['px']<x['width']/2 else 'right'
    r2 = 'top' if x['py']<x['height']/2 else 'bottom'
    r3 = 'horizontal' if min(x['px'],x['width']-x['px'])*x['height']<=min(x['py'],x['height']-x['py'])*x['width'] else 'vertical'
    r4 = False
    r5 = x['target_group'] if (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']) else None
    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: [({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 190, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 100, 'py': 95, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 5, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 2: [({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 380, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 200, 'py': 190, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 10, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 3: [({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 570, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 300, 'py': 285, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 15, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 4: [({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 760, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 400, 'py': 380, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 20, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 5: [({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 950, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 500, 'py': 475, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 25, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])]}
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 center self drop noop.

A dropped tab creates a new ungrouped pane only in an edge docking zone; center targets join the destination group. Center drops into the source pane are no-ops. Corners resolve to the nearest normalized edge.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']
    r1 = 'left' if x['px']<x['width']/2 else 'right'
    r2 = 'top' if x['py']<x['height']/2 else 'bottom'
    r3 = 'horizontal' if min(x['px'],x['width']-x['px'])*x['height']<=min(x['py'],x['height']-x['py'])*x['width'] else 'vertical'
    r4 = x['source_pane']==x['target_pane'] and (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge'])
    r5 = x['target_group']
    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: [({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 190, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 100, 'py': 95, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 5, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 2: [({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 380, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 200, 'py': 190, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 10, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 3: [({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 570, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 300, 'py': 285, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 15, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 4: [({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 760, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 400, 'py': 380, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 20, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 5: [({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 950, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 500, 'py': 475, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 25, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])]}
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['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge']
    r1 = 'left' if x['px']<x['width']/2 else 'right'
    r2 = 'top' if x['py']<x['height']/2 else 'bottom'
    r3 = 'horizontal' if min(x['px'],x['width']-x['px'])*x['height']<=min(x['py'],x['height']-x['py'])*x['width'] else 'vertical'
    r4 = x['source_pane']==x['target_pane'] and (x['edge']<=x['px']<x['width']-x['edge'] and x['edge']<=x['py']<x['height']-x['edge'])
    r5 = None
    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: [({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 190, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 100, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 100, 'py': 95, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 5, 'py': 5, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 100, 'py': 50, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 10, 'py': 70, 'width': 200, 'height': 100, 'edge': 20, 'gutter': 4, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 2: [({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 380, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 200, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 200, 'py': 190, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 10, 'py': 10, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 200, 'py': 100, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 20, 'py': 140, 'width': 400, 'height': 200, 'edge': 40, 'gutter': 8, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 3: [({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 570, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 300, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 300, 'py': 285, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 15, 'py': 15, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 300, 'py': 150, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 30, 'py': 210, 'width': 600, 'height': 300, 'edge': 60, 'gutter': 12, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 4: [({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 760, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 400, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 400, 'py': 380, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 20, 'py': 20, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 400, 'py': 200, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 40, 'py': 280, 'width': 800, 'height': 400, 'edge': 80, 'gutter': 16, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])], 5: [({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', False, 'g']), ({'px': 950, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'horizontal', False, None]), ({'px': 500, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'top', 'vertical', False, None]), ({'px': 500, 'py': 475, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'right', 'bottom', 'vertical', False, None]), ({'px': 25, 'py': 25, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'p', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'top', 'horizontal', False, None]), ({'px': 500, 'py': 250, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [True, 'right', 'bottom', 'horizontal', True, 'g']), ({'px': 50, 'py': 350, 'width': 1000, 'height': 500, 'edge': 100, 'gutter': 20, 'source_pane': 'q', 'target_pane': 'q', 'new_pane': 'r', 'target_group': 'g'}, [False, 'left', 'bottom', 'horizontal', False, None])]}
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 new pane group isolation.

A dropped tab creates a new ungrouped pane only in an edge docking zone; center targets join the destination group. Center drops into the source pane are no-ops. Corners resolve to the nearest normalized edge.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['pane_width']
    r1 = x['pane_height']
    r2 = x['tabs_count']*x['row_height']
    r3 = x['headers']*x['header_height']
    r4 = max(0,x['tabs_count']*x['row_height']+x['headers']*x['header_height']-x['pane_height'])
    r5 = x['strip_width']-x['padding']-x['button_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: [({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 40, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 0, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 0, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 20, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 560, 40, 200, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 80, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [420, 400, 224, 40, 0, 58]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 0}, [380, 400, 224, 40, 0, 104]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 0, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 0, 40, 0, 98])], 2: [({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 80, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 0, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 0, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 20, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 1120, 80, 400, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 160, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [840, 800, 448, 80, 0, 116]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 0}, [760, 800, 448, 80, 0, 208]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 0, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 0, 80, 0, 196])], 3: [({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 120, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 0, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 0, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 20, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 1680, 120, 600, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 240, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1260, 1200, 672, 120, 0, 174]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 0}, [1140, 1200, 672, 120, 0, 312]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 0, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 0, 120, 0, 294])], 4: [({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 160, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 0, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 0, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 20, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 2240, 160, 800, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 320, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1680, 1600, 896, 160, 0, 232]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 0}, [1520, 1600, 896, 160, 0, 416]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 0, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 0, 160, 0, 392])], 5: [({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 200, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 0, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 0, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 20, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 2800, 200, 1000, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 400, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [2100, 2000, 1120, 200, 0, 290]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 0}, [1900, 2000, 1120, 200, 0, 520]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 0, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 0, 200, 0, 490])]}
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 = max(0,x['pane_width']-x['row_height'])
    r1 = x['pane_height']
    r2 = x['tabs_count']*x['row_height']
    r3 = x['headers']*x['header_height']
    r4 = max(0,x['tabs_count']*x['row_height']+x['headers']*x['header_height']-x['pane_height'])
    r5 = x['strip_width']-x['padding']-x['button_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: [({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 40, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 0, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 0, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 20, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 560, 40, 200, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 80, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [420, 400, 224, 40, 0, 58]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 0}, [380, 400, 224, 40, 0, 104]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 0, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 0, 40, 0, 98])], 2: [({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 80, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 0, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 0, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 20, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 1120, 80, 400, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 160, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [840, 800, 448, 80, 0, 116]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 0}, [760, 800, 448, 80, 0, 208]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 0, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 0, 80, 0, 196])], 3: [({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 120, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 0, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 0, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 20, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 1680, 120, 600, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 240, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1260, 1200, 672, 120, 0, 174]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 0}, [1140, 1200, 672, 120, 0, 312]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 0, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 0, 120, 0, 294])], 4: [({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 160, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 0, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 0, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 20, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 2240, 160, 800, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 320, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1680, 1600, 896, 160, 0, 232]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 0}, [1520, 1600, 896, 160, 0, 416]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 0, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 0, 160, 0, 392])], 5: [({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 200, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 0, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 0, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 20, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 2800, 200, 1000, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 400, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [2100, 2000, 1120, 200, 0, 290]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 0}, [1900, 2000, 1120, 200, 0, 520]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 0, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 0, 200, 0, 490])]}
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 panel horizontal remainder.

Vertical tab strips consume pane width rather than height, reserve group-header rows, size scroll content from row heights and keep close buttons aligned to the strip trailing edge.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = max(0,x['pane_width']-x['strip_width'])
    r1 = x['pane_height']-x['strip_width']
    r2 = x['tabs_count']*x['row_height']
    r3 = x['headers']*x['header_height']
    r4 = max(0,x['tabs_count']*x['row_height']+x['headers']*x['header_height']-x['pane_height'])
    r5 = x['strip_width']-x['padding']-x['button_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: [({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 40, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 0, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 0, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 20, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 560, 40, 200, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 80, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [420, 400, 224, 40, 0, 58]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 0}, [380, 400, 224, 40, 0, 104]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 0, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 0, 40, 0, 98])], 2: [({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 80, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 0, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 0, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 20, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 1120, 80, 400, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 160, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [840, 800, 448, 80, 0, 116]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 0}, [760, 800, 448, 80, 0, 208]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 0, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 0, 80, 0, 196])], 3: [({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 120, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 0, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 0, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 20, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 1680, 120, 600, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 240, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1260, 1200, 672, 120, 0, 174]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 0}, [1140, 1200, 672, 120, 0, 312]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 0, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 0, 120, 0, 294])], 4: [({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 160, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 0, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 0, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 20, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 2240, 160, 800, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 320, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1680, 1600, 896, 160, 0, 232]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 0}, [1520, 1600, 896, 160, 0, 416]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 0, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 0, 160, 0, 392])], 5: [({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 200, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 0, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 0, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 20, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 2800, 200, 1000, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 400, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [2100, 2000, 1120, 200, 0, 290]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 0}, [1900, 2000, 1120, 200, 0, 520]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 0, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 0, 200, 0, 490])]}
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 = max(0,x['pane_width']-x['strip_width'])
    r1 = x['pane_height']-x['row_height']
    r2 = x['tabs_count']*x['row_height']
    r3 = x['headers']*x['header_height']
    r4 = max(0,x['tabs_count']*x['row_height']+x['headers']*x['header_height']-x['pane_height'])
    r5 = x['strip_width']-x['padding']-x['button_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: [({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 40, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 0, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 224, 0, 0, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 20, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 560, 40, 200, 98]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 80, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [420, 400, 224, 40, 0, 58]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 8, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 0}, [380, 400, 224, 40, 0, 104]), ({'pane_width': 500, 'pane_height': 400, 'strip_width': 120, 'row_height': 28, 'tabs_count': 0, 'headers': 2, 'header_height': 20, 'button_width': 16, 'padding': 6}, [380, 400, 0, 40, 0, 98])], 2: [({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 80, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 0, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 448, 0, 0, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 20, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 1120, 80, 400, 196]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 160, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [840, 800, 448, 80, 0, 116]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 8, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 0}, [760, 800, 448, 80, 0, 208]), ({'pane_width': 1000, 'pane_height': 800, 'strip_width': 240, 'row_height': 56, 'tabs_count': 0, 'headers': 2, 'header_height': 40, 'button_width': 32, 'padding': 12}, [760, 800, 0, 80, 0, 196])], 3: [({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 120, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 0, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 672, 0, 0, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 20, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 1680, 120, 600, 294]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 240, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1260, 1200, 672, 120, 0, 174]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 8, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 0}, [1140, 1200, 672, 120, 0, 312]), ({'pane_width': 1500, 'pane_height': 1200, 'strip_width': 360, 'row_height': 84, 'tabs_count': 0, 'headers': 2, 'header_height': 60, 'button_width': 48, 'padding': 18}, [1140, 1200, 0, 120, 0, 294])], 4: [({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 160, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 0, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 896, 0, 0, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 20, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 2240, 160, 800, 392]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 320, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1680, 1600, 896, 160, 0, 232]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 8, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 0}, [1520, 1600, 896, 160, 0, 416]), ({'pane_width': 2000, 'pane_height': 1600, 'strip_width': 480, 'row_height': 112, 'tabs_count': 0, 'headers': 2, 'header_height': 80, 'button_width': 64, 'padding': 24}, [1520, 1600, 0, 160, 0, 392])], 5: [({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 200, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 0, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 1120, 0, 0, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 20, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 2800, 200, 1000, 490]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 400, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [2100, 2000, 1120, 200, 0, 290]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 8, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 0}, [1900, 2000, 1120, 200, 0, 520]), ({'pane_width': 2500, 'pane_height': 2000, 'strip_width': 600, 'row_height': 140, 'tabs_count': 0, 'headers': 2, 'header_height': 100, 'button_width': 80, 'padding': 30}, [1900, 2000, 0, 200, 0, 490])]}
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 panel height unchanged.

Vertical tab strips consume pane width rather than height, reserve group-header rows, size scroll content from row heights and keep close buttons aligned to the strip trailing edge.

split: open-access