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

N = 1
observations = []
def solve(x):
    r0 = x['pointer']-x['left']
    r1 = x['left']<=x['pointer']<x['left']+x['width']
    r2 = x['left']+x['close_start']<=x['pointer']<x['left']+x['close_start']+x['close_width']
    r3 = x['clip_left']<=x['pointer']<x['clip_right']
    r4 = x['left']+x['width']-x['grip']<=x['pointer']<x['left']+x['width']
    r5 = 'body' if x['left']<=x['pointer']<x['left']+x['width'] 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: [({'pointer': 85, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [65, True, False, True, False, 'body']), ({'pointer': 100, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [80, True, True, True, False, 'close']), ({'pointer': 20, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [0, True, False, True, False, 'body']), ({'pointer': 120, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [100, False, False, True, False, 'none']), ({'pointer': 95, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 90, 'grip': 5}, [75, True, False, False, False, 'body']), ({'pointer': 117, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [97, True, True, True, True, 'close']), ({'pointer': 200, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [180, False, False, False, False, 'none'])], 2: [({'pointer': 170, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [130, True, False, True, False, 'body']), ({'pointer': 200, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [160, True, True, True, False, 'close']), ({'pointer': 40, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [0, True, False, True, False, 'body']), ({'pointer': 240, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [200, False, False, True, False, 'none']), ({'pointer': 190, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 180, 'grip': 10}, [150, True, False, False, False, 'body']), ({'pointer': 234, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [194, True, True, True, True, 'close']), ({'pointer': 400, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [360, False, False, False, False, 'none'])], 3: [({'pointer': 255, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [195, True, False, True, False, 'body']), ({'pointer': 300, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [240, True, True, True, False, 'close']), ({'pointer': 60, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [0, True, False, True, False, 'body']), ({'pointer': 360, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [300, False, False, True, False, 'none']), ({'pointer': 285, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 270, 'grip': 15}, [225, True, False, False, False, 'body']), ({'pointer': 351, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [291, True, True, True, True, 'close']), ({'pointer': 600, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [540, False, False, False, False, 'none'])], 4: [({'pointer': 340, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [260, True, False, True, False, 'body']), ({'pointer': 400, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [320, True, True, True, False, 'close']), ({'pointer': 80, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [0, True, False, True, False, 'body']), ({'pointer': 480, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [400, False, False, True, False, 'none']), ({'pointer': 380, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 360, 'grip': 20}, [300, True, False, False, False, 'body']), ({'pointer': 468, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [388, True, True, True, True, 'close']), ({'pointer': 800, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [720, False, False, False, False, 'none'])], 5: [({'pointer': 425, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [325, True, False, True, False, 'body']), ({'pointer': 500, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [400, True, True, True, False, 'close']), ({'pointer': 100, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [0, True, False, True, False, 'body']), ({'pointer': 600, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [500, False, False, True, False, 'none']), ({'pointer': 475, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 450, 'grip': 25}, [375, True, False, False, False, 'body']), ({'pointer': 585, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [485, True, True, True, True, 'close']), ({'pointer': 1000, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [900, False, False, False, 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['pointer']-x['left']
    r1 = x['left']<=x['pointer']<x['left']+x['width']
    r2 = x['left']+x['close_start']<=x['pointer']<x['left']+x['close_start']+x['close_width']
    r3 = x['clip_left']<=x['pointer']<x['clip_right']
    r4 = x['left']+x['width']-x['grip']<=x['pointer']<x['left']+x['width']
    r5 = 'close' if x['pointer']>=x['close_start'] else 'body'
    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: [({'pointer': 85, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [65, True, False, True, False, 'body']), ({'pointer': 100, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [80, True, True, True, False, 'close']), ({'pointer': 20, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [0, True, False, True, False, 'body']), ({'pointer': 120, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [100, False, False, True, False, 'none']), ({'pointer': 95, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 90, 'grip': 5}, [75, True, False, False, False, 'body']), ({'pointer': 117, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [97, True, True, True, True, 'close']), ({'pointer': 200, 'left': 20, 'width': 100, 'close_start': 80, 'close_width': 20, 'clip_left': 0, 'clip_right': 200, 'grip': 5}, [180, False, False, False, False, 'none'])], 2: [({'pointer': 170, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [130, True, False, True, False, 'body']), ({'pointer': 200, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [160, True, True, True, False, 'close']), ({'pointer': 40, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [0, True, False, True, False, 'body']), ({'pointer': 240, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [200, False, False, True, False, 'none']), ({'pointer': 190, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 180, 'grip': 10}, [150, True, False, False, False, 'body']), ({'pointer': 234, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [194, True, True, True, True, 'close']), ({'pointer': 400, 'left': 40, 'width': 200, 'close_start': 160, 'close_width': 40, 'clip_left': 0, 'clip_right': 400, 'grip': 10}, [360, False, False, False, False, 'none'])], 3: [({'pointer': 255, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [195, True, False, True, False, 'body']), ({'pointer': 300, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [240, True, True, True, False, 'close']), ({'pointer': 60, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [0, True, False, True, False, 'body']), ({'pointer': 360, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [300, False, False, True, False, 'none']), ({'pointer': 285, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 270, 'grip': 15}, [225, True, False, False, False, 'body']), ({'pointer': 351, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [291, True, True, True, True, 'close']), ({'pointer': 600, 'left': 60, 'width': 300, 'close_start': 240, 'close_width': 60, 'clip_left': 0, 'clip_right': 600, 'grip': 15}, [540, False, False, False, False, 'none'])], 4: [({'pointer': 340, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [260, True, False, True, False, 'body']), ({'pointer': 400, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [320, True, True, True, False, 'close']), ({'pointer': 80, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [0, True, False, True, False, 'body']), ({'pointer': 480, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [400, False, False, True, False, 'none']), ({'pointer': 380, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 360, 'grip': 20}, [300, True, False, False, False, 'body']), ({'pointer': 468, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [388, True, True, True, True, 'close']), ({'pointer': 800, 'left': 80, 'width': 400, 'close_start': 320, 'close_width': 80, 'clip_left': 0, 'clip_right': 800, 'grip': 20}, [720, False, False, False, False, 'none'])], 5: [({'pointer': 425, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [325, True, False, True, False, 'body']), ({'pointer': 500, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [400, True, True, True, False, 'close']), ({'pointer': 100, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [0, True, False, True, False, 'body']), ({'pointer': 600, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [500, False, False, True, False, 'none']), ({'pointer': 475, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 450, 'grip': 25}, [375, True, False, False, False, 'body']), ({'pointer': 585, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [485, True, True, True, True, 'close']), ({'pointer': 1000, 'left': 100, 'width': 500, 'close_start': 400, 'close_width': 100, 'clip_left': 0, 'clip_right': 1000, 'grip': 25}, [900, False, False, False, 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 close over body priority.

A tab has half-open body, close-button and resize-grip regions in local coordinates. Clip hit targets to its visible strip intersection and prioritize close over body.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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['pointer']<=x['start']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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 left edge zone.

While dragging a tab, the strip scrolls within edge zones proportional to penetration, stops outside strip and clamps movement to available scroll range.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['pointer']>x['end']-x['zone']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['pointer']>=x['end']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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 right edge zone.

While dragging a tab, the strip scrolls within edge zones proportional to penetration, stops outside strip and clamps movement to available scroll range.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = True
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging'] and x['pointer']<x['end']-x['zone']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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 drag ownership.

While dragging a tab, the strip scrolls within edge zones proportional to penetration, stops outside strip and clamps movement to available scroll range.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = max(0,x['pointer']-(x['end']-x['zone']))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = x['zone']
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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 right penetration.

While dragging a tab, the strip scrolls within edge zones proportional to penetration, stops outside strip and clamps movement to available scroll range.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = max(0,x['pointer']-(x['end']-x['zone']))
    r5 = min(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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 speed ramp.

While dragging a tab, the strip scrolls within edge zones proportional to penetration, stops outside strip and clamps movement to available scroll range.

split: open-access


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

N = 1
observations = []
def solve(x):
    r0 = x['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = x['scroll']+x['speed']
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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['start']<=x['pointer']<x['start']+x['zone']
    r1 = x['end']-x['zone']<x['pointer']<x['end']
    r2 = x['dragging']
    r3 = max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))
    r4 = x['speed']*max(0,min(x['zone'],x['pointer']-(x['end']-x['zone'])))//x['zone']
    r5 = max(x['max_scroll'],x['scroll']+x['speed'])
    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: [({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 62]), ({'pointer': 5, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [True, False, True, 0, 0, 62]), ({'pointer': 100, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62]), ({'pointer': 220, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 20, 12, 62]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 298, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, True, True, 15, 9, 300]), ({'pointer': 195, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': False}, [False, True, False, 15, 9, 62]), ({'pointer': -1, 'start': 0, 'end': 200, 'zone': 20, 'scroll': 50, 'max_scroll': 300, 'speed': 12, 'dragging': True}, [False, False, True, 0, 0, 62])], 2: [({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 124]), ({'pointer': 10, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [True, False, True, 0, 0, 124]), ({'pointer': 200, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124]), ({'pointer': 440, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 40, 24, 124]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 596, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, True, True, 30, 18, 600]), ({'pointer': 390, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': False}, [False, True, False, 30, 18, 124]), ({'pointer': -2, 'start': 0, 'end': 400, 'zone': 40, 'scroll': 100, 'max_scroll': 600, 'speed': 24, 'dragging': True}, [False, False, True, 0, 0, 124])], 3: [({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 186]), ({'pointer': 15, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [True, False, True, 0, 0, 186]), ({'pointer': 300, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186]), ({'pointer': 660, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 60, 36, 186]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 894, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, True, True, 45, 27, 900]), ({'pointer': 585, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': False}, [False, True, False, 45, 27, 186]), ({'pointer': -3, 'start': 0, 'end': 600, 'zone': 60, 'scroll': 150, 'max_scroll': 900, 'speed': 36, 'dragging': True}, [False, False, True, 0, 0, 186])], 4: [({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 248]), ({'pointer': 20, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [True, False, True, 0, 0, 248]), ({'pointer': 400, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248]), ({'pointer': 880, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 80, 48, 248]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 1192, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, True, True, 60, 36, 1200]), ({'pointer': 780, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': False}, [False, True, False, 60, 36, 248]), ({'pointer': -4, 'start': 0, 'end': 800, 'zone': 80, 'scroll': 200, 'max_scroll': 1200, 'speed': 48, 'dragging': True}, [False, False, True, 0, 0, 248])], 5: [({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 310]), ({'pointer': 25, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [True, False, True, 0, 0, 310]), ({'pointer': 500, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310]), ({'pointer': 1100, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 100, 60, 310]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 1490, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, True, True, 75, 45, 1500]), ({'pointer': 975, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': False}, [False, True, False, 75, 45, 310]), ({'pointer': -5, 'start': 0, 'end': 1000, 'zone': 100, 'scroll': 250, 'max_scroll': 1500, 'speed': 60, 'dragging': True}, [False, False, True, 0, 0, 310])]}
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 right clamp.

While dragging a tab, the strip scrolls within edge zones proportional to penetration, stops outside strip and clamps movement to available scroll range.

split: open-access