broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(chapters, time):
    return next((name for start,name in chapters if start<=time),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [10, 'b'], [20, 'c']], 15)),'b')
check('fixture 2',solve(*([[0, 'a'], [10, 'b']], 10)),'b')
check('fixture 3',solve(*([[5, 'a']], 2)),None)
check('fixture 4',solve(*([], 0)),None)
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)

evaluation_group: xmed-chapter-selection-latest-start

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(chapters, time):
    return next((name for start,name in reversed(chapters) if start<time),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [10, 'b'], [20, 'c']], 15)),'b')
check('fixture 2',solve(*([[0, 'a'], [10, 'b']], 10)),'b')
check('fixture 3',solve(*([[5, 'a']], 2)),None)
check('fixture 4',solve(*([], 0)),None)
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 first matching chapter remains selected throughout later chapters.

Chapters are sorted unique start times. Select the latest chapter starting at or before playback time; no earlier chapter yields None.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames, start, end):
    return [[t,payload] for t,payload in frames if start<=t<end]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[8, 'a'], [10, 'b'], [12, 'c'], [14, 'd']], 10, 14)),[[0, 'b'], [2, 'c']])
check('fixture 2',solve(*([[5, 'a']], 5, 6)),[[0, 'a']])
check('fixture 3',solve(*([], 0, 1)),[])
check('fixture 4',solve(*([[1, 'a']], 1, 1)),[])
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

evaluation_group: xmed-media-trim-rebases-timestamps

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(frames, start, end):
    return [[t-start,payload] for t,payload in frames if start<=t<=end]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[8, 'a'], [10, 'b'], [12, 'c'], [14, 'd']], 10, 14)),[[0, 'b'], [2, 'c']])
check('fixture 2',solve(*([[5, 'a']], 5, 6)),[[0, 'a']])
check('fixture 3',solve(*([], 0, 1)),[])
check('fixture 4',solve(*([[1, 'a']], 1, 1)),[])
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:
Trimmed media retains source timestamps instead of beginning at the trim-relative timeline.

Select frames whose presentation starts lie in half-open trim interval and rebase their timestamps by subtracting trim start.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(position, wall_delta, rate):
    return position+wall_delta
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(10, 2, 2)),14)
check('fixture 2',solve(*(10, 2, 0.5)),11)
check('fixture 3',solve(*(10, 2, 0)),10)
check('fixture 4',solve(*(0, 0, 1)),0)
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)

evaluation_group: xmed-playback-rate-wall-to-media-delta

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(position, wall_delta, rate):
    return position+wall_delta/rate if rate else position
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(10, 2, 2)),14)
check('fixture 2',solve(*(10, 2, 0.5)),11)
check('fixture 3',solve(*(10, 2, 0)),10)
check('fixture 4',solve(*(0, 0, 1)),0)
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 media timeline advances at normal speed regardless of playback rate.

Advance media position by nonnegative wall-time delta times nonnegative playback rate; zero rate freezes position.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(last, raw, modulus):
    return raw
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(14, 1, 16)),17)
check('fixture 2',solve(*(17, 3, 16)),19)
check('fixture 3',solve(*(3, 3, 16)),3)
check('fixture 4',solve(*(0, 5, 16)),5)
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
import math
N = 1
observations = []
def solve(last, raw, modulus):
    return last+raw
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(14, 1, 16)),17)
check('fixture 2',solve(*(17, 3, 16)),19)
check('fixture 3',solve(*(3, 3, 16)),3)
check('fixture 4',solve(*(0, 5, 16)),5)
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:
A wrapped media counter is treated as an absolute time and jumps backward.

For monotonic sample delivery with less than one wrap between observations, map raw counter in [0,modulus) to the smallest timestamp >=last with that residue.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(clips):
    return [[t,value] for duration,frames in clips for t,value in frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[5, [[0, 'a'], [3, 'b']]], [4, [[0, 'c'], [2, 'd']]]],)),[[0, 'a'], [3, 'b'], [5, 'c'], [7, 'd']])
check('fixture 2',solve(*([],)),[])
check('fixture 3',solve(*([[2, [[0, 'a']]]],)),[[0, 'a']])
check('fixture 4',solve(*([[0, []], [3, [[1, 'x']]]],)),[[1, 'x']])
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
import math
N = 1
observations = []
def solve(clips):
    return [[t+i,value] for i,(duration,frames) in enumerate(clips) for t,value in frames]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[5, [[0, 'a'], [3, 'b']]], [4, [[0, 'c'], [2, 'd']]]],)),[[0, 'a'], [3, 'b'], [5, 'c'], [7, 'd']])
check('fixture 2',solve(*([],)),[])
check('fixture 3',solve(*([[2, [[0, 'a']]]],)),[[0, 'a']])
check('fixture 4',solve(*([[0, []], [3, [[1, 'x']]]],)),[[1, 'x']])
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:
Concatenated clips restart their timestamps at zero and overlap earlier clips.

Clips are [duration,local timestamped frames], with nonnegative durations and local timestamps inside each clip. Concatenate timelines using full declared clip durations.

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(position, generation, completion):
    return completion[1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(10, 3, [2, 2])),10)
check('fixture 2',solve(*(10, 3, [3, 20])),20)
check('fixture 3',solve(*(10, 3, [4, 30])),10)
check('fixture 4',solve(*(0, 0, [0, 5])),5)
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)

evaluation_group: xmed-seek-request-generation-result

source:
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(position, generation, completion):
    return completion[1] if completion[0]<=generation else position
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(10, 3, [2, 2])),10)
check('fixture 2',solve(*(10, 3, [3, 20])),20)
check('fixture 3',solve(*(10, 3, [4, 30])),10)
check('fixture 4',solve(*(0, 0, [0, 5])),5)
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:
Completion of an earlier seek overwrites the newer requested position.

Install an asynchronous seek result [generation,position] only if it belongs to the exact current seek request; retain current position otherwise.

split: open-access


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

N = 1
observations = []
def solve(tracks, current, repeat, disabled):
    if not tracks: return None
    if repeat=='one' and current in tracks: return current
    start=tracks.index(current) if current in tracks else -1
    order=list(range(start+1,len(tracks))) + (list(range(0,start+1)) if repeat=='all' else [])
    for index in order:
        candidate=tracks[index]
        if candidate not in disabled: return candidate
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ordinary successor', solve(['a', 'b', 'c'], 'a', 'none', []), 'b')
check('end without repeat', solve(['a', 'b'], 'b', 'none', []), None)
check('repeat all wraps', solve(['a', 'b'], 'b', 'all', []), 'a')
check('repeat one eligible', solve(['a', 'b'], 'a', 'one', []), 'a')
check('repeat one disabled skips', solve(['a', 'b'], 'a', 'one', ['a']), 'b')
check('skip disabled successor', solve(['a', 'b', 'c'], 'a', 'none', ['b']), 'c')
check('all disabled terminates', solve(['a', 'b'], 'b', 'all', ['a', 'b']), None)
check('missing current starts playlist', solve(['a', 'b'], 'gone', 'none', []), 'a')
check('empty playlist', solve([], 'a', 'all', []), None)
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)

evaluation_group: xplay-playlist-natural-advance

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

N = 1
observations = []
def solve(tracks, current, repeat, disabled):
    if not tracks: return None
    if repeat=='one' and current in tracks and current not in disabled: return current
    start=tracks.index(current) if current in tracks else -1
    order=list(range(start+1,len(tracks)))+list(range(0,start+1))
    for index in order:
        candidate=tracks[index]
        if candidate not in disabled: return candidate
    return None
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ordinary successor', solve(['a', 'b', 'c'], 'a', 'none', []), 'b')
check('end without repeat', solve(['a', 'b'], 'b', 'none', []), None)
check('repeat all wraps', solve(['a', 'b'], 'b', 'all', []), 'a')
check('repeat one eligible', solve(['a', 'b'], 'a', 'one', []), 'a')
check('repeat one disabled skips', solve(['a', 'b'], 'a', 'one', ['a']), 'b')
check('skip disabled successor', solve(['a', 'b', 'c'], 'a', 'none', ['b']), 'c')
check('all disabled terminates', solve(['a', 'b'], 'b', 'all', ['a', 'b']), None)
check('missing current starts playlist', solve(['a', 'b'], 'gone', 'none', []), 'a')
check('empty playlist', solve([], 'a', 'all', []), None)
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:
Repeats a current track that has been disabled and produces an incorrect media-control or presentation result.

On natural completion, choose the next enabled track in playlist order. repeat=one retains the current track only if it remains enabled; repeat=all wraps once; repeat=none does not wrap. Unknown current starts before the first item. Track IDs are unique strings; disabled is a list of IDs.

split: open-access


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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop()
        if candidate in disabled: continue
        return [candidate,pending,cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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)

evaluation_group: xplay-play-next-queue

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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,[candidate]+pending,cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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:
Consumes play-next requests in reverse insertion order and produces an incorrect media-control or presentation result.

Consume the first enabled play-next queue occurrence before advancing the playlist. Queue plays do not move the playlist cursor; disabled queued occurrences are discarded. Return [selected ID or None,remaining queue,new playlist cursor]. Queue duplicates are independent requests.

split: open-access


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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,[candidate]+pending,cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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)

evaluation_group: xplay-play-next-queue

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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,[v for v in pending if v!=candidate],cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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:
Returns a queued occurrence without removing it and produces an incorrect media-control or presentation result.

Consume the first enabled play-next queue occurrence before advancing the playlist. Queue plays do not move the playlist cursor; disabled queued occurrences are discarded. Return [selected ID or None,remaining queue,new playlist cursor]. Queue duplicates are independent requests.

split: open-access


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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,[v for v in pending if v!=candidate],cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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)

evaluation_group: xplay-play-next-queue

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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,pending,candidate]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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:
Removes all equal queued requests after playing one occurrence and produces an incorrect media-control or presentation result.

Consume the first enabled play-next queue occurrence before advancing the playlist. Queue plays do not move the playlist cursor; disabled queued occurrences are discarded. Return [selected ID or None,remaining queue,new playlist cursor]. Queue duplicates are independent requests.

split: open-access


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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,pending,candidate]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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)

evaluation_group: xplay-play-next-queue

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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,pending,cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,cursor]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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:
Moves the playlist cursor to a queued override and produces an incorrect media-control or presentation result.

Consume the first enabled play-next queue occurrence before advancing the playlist. Queue plays do not move the playlist cursor; disabled queued occurrences are discarded. Return [selected ID or None,remaining queue,new playlist cursor]. Queue duplicates are independent requests.

split: open-access


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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop(0)
        if candidate in disabled: continue
        return [candidate,pending,cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,cursor]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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)

evaluation_group: xplay-play-next-queue

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

N = 1
observations = []
def solve(playlist, cursor, queue, disabled):
    pending=list(queue)
    while pending:
        candidate=pending.pop()
        if candidate in disabled: continue
        return [candidate,pending,cursor]
    start=playlist.index(cursor) if cursor in playlist else -1
    for candidate in playlist[start+1:]:
        if candidate not in disabled:
            return [candidate,pending,candidate]
    return [None,pending,cursor]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('queue has priority', solve(['a', 'b'], 'a', ['x', 'y'], []), ['x', ['y'], 'a'])
check('same track queued twice', solve(['a', 'b'], 'a', ['x', 'x', 'y'], []), ['x', ['x', 'y'], 'a'])
check('disabled queue discarded', solve(['a', 'b'], 'a', ['x', 'y'], ['x']), ['y', [], 'a'])
check('fallback advances cursor', solve(['a', 'b'], 'a', [], []), ['b', [], 'b'])
check('all queued disabled falls back', solve(['a', 'b'], 'a', ['x'], ['x']), ['b', [], 'b'])
check('end has no track', solve(['a'], 'a', [], []), [None, [], 'a'])
check('queue works without playlist', solve([], None, ['x'], []), ['x', [], None])
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:
Fails to advance the playlist cursor on ordinary fallback and produces an incorrect media-control or presentation result.

Consume the first enabled play-next queue occurrence before advancing the playlist. Queue plays do not move the playlist cursor; disabled queued occurrences are discarded. Return [selected ID or None,remaining queue,new playlist cursor]. Queue duplicates are independent requests.

split: open-access


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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms > threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    if current is not None: forward.insert(0,current)
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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)

evaluation_group: xplay-previous-track-history

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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    if current is not None: forward.append(current)
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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:
Navigates backward at the exact restart threshold and produces an incorrect media-control or presentation result.

Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.

split: open-access


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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    if current is not None: forward.append(current)
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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)

evaluation_group: xplay-previous-track-history

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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    forward=[current] if current is not None else []
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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:
Appends the displaced current item after existing forward history and produces an incorrect media-control or presentation result.

Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.

split: open-access


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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    forward=[current] if current is not None else []
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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)

evaluation_group: xplay-previous-track-history

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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    if current is not None: forward.insert(0,current)
    return [previous,0,list(dict.fromkeys(back)),forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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:
Erases existing forward history when stepping backward and produces an incorrect media-control or presentation result.

Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.

split: open-access


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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop()
    if current is not None: forward.insert(0,current)
    return [previous,0,list(dict.fromkeys(back)),forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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)

evaluation_group: xplay-previous-track-history

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

N = 1
observations = []
def solve(current, position_ms, threshold, history, future):
    back=list(history); forward=list(future)
    if position_ms >= threshold:
        return [current,0,back,forward]
    if not back: return [current,0,back,forward]
    previous=back.pop(0)
    if current is not None: forward.insert(0,current)
    return [previous,0,back,forward]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])
check('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])
check('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])
check('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])
check('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])
check('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])
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:
Collapses repeated playback occurrences in the remaining history and produces an incorrect media-control or presentation result.

Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.

split: open-access


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

N = 1
observations = []
def solve(playlist, current, removed):
    items=list(playlist)
    old_index=items.index(current) if current in items else None
    items=[track for track in items if track not in removed]
    if current in items:
        return [items,current]
    if not items: return [items,None]
    if old_index is None: return [items,None]
    old=playlist
    successors=old[old_index+1:]
    for track in successors:
        if track in items: return [items,track]
    return [items,items[0]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove preceding item keeps identity', solve(['a', 'b', 'c'], 'b', ['a']), [['b', 'c'], 'b'])
check('current removed selects next', solve(['a', 'b', 'c'], 'b', ['b']), [['a', 'c'], 'c'])
check('skip removed successors', solve(['a', 'b', 'c', 'd'], 'b', ['b', 'c']), [['a', 'd'], 'd'])
check('removed last chooses predecessor', solve(['a', 'b', 'c'], 'c', ['c']), [['a', 'b'], 'b'])
check('absent selection remains absent', solve(['a', 'b'], None, []), [['a', 'b'], None])
check('everything removed', solve(['a'], 'a', ['a']), [[], None])
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)

evaluation_group: xplay-playlist-removal-selection

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

N = 1
observations = []
def solve(playlist, current, removed):
    items=list(playlist)
    old_index=items.index(current) if current in items else None
    items=[track for track in items if track not in removed]
    if current in items:
        return [items,current]
    if not items: return [items,None]
    if old_index is None: return [items,items[0]]
    old=playlist
    successors=old[old_index+1:]
    for track in successors:
        if track in items: return [items,track]
    return [items,items[-1]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove preceding item keeps identity', solve(['a', 'b', 'c'], 'b', ['a']), [['b', 'c'], 'b'])
check('current removed selects next', solve(['a', 'b', 'c'], 'b', ['b']), [['a', 'c'], 'c'])
check('skip removed successors', solve(['a', 'b', 'c', 'd'], 'b', ['b', 'c']), [['a', 'd'], 'd'])
check('removed last chooses predecessor', solve(['a', 'b', 'c'], 'c', ['c']), [['a', 'b'], 'b'])
check('absent selection remains absent', solve(['a', 'b'], None, []), [['a', 'b'], None])
check('everything removed', solve(['a'], 'a', ['a']), [[], None])
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:
Selects the first survivor when the removed current had no successor and produces an incorrect media-control or presentation result.

Remove listed IDs from a playlist with unique string IDs. Keep current identity when it survives. If current is removed, choose the first surviving original successor, otherwise the last survivor. If current was absent, leave selection None. Return [remaining playlist,current ID or None].

split: open-access


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

N = 1
observations = []
def solve(playlist, current, removed):
    items=list(playlist)
    old_index=items.index(current) if current in items else None
    items=[track for track in items if track not in removed]
    if current in items:
        return [items,current]
    if not items: return [items,None]
    if old_index is None: return [items,items[0]]
    old=playlist
    successors=old[old_index+1:]
    for track in successors:
        if track in items: return [items,track]
    return [items,items[-1]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove preceding item keeps identity', solve(['a', 'b', 'c'], 'b', ['a']), [['b', 'c'], 'b'])
check('current removed selects next', solve(['a', 'b', 'c'], 'b', ['b']), [['a', 'c'], 'c'])
check('skip removed successors', solve(['a', 'b', 'c', 'd'], 'b', ['b', 'c']), [['a', 'd'], 'd'])
check('removed last chooses predecessor', solve(['a', 'b', 'c'], 'c', ['c']), [['a', 'b'], 'b'])
check('absent selection remains absent', solve(['a', 'b'], None, []), [['a', 'b'], None])
check('everything removed', solve(['a'], 'a', ['a']), [[], None])
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)

evaluation_group: xplay-playlist-removal-selection

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

N = 1
observations = []
def solve(playlist, current, removed):
    items=list(playlist)
    old_index=items.index(current) if current in items else None
    items=[track for track in items if track not in removed]
    if current in items:
        return [items,items[min(old_index,len(items)-1)] if old_index is not None else current]
    if not items: return [items,None]
    if old_index is None: return [items,None]
    old=playlist
    successors=old[old_index+1:]
    for track in successors:
        if track in items: return [items,track]
    return [items,items[-1]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('remove preceding item keeps identity', solve(['a', 'b', 'c'], 'b', ['a']), [['b', 'c'], 'b'])
check('current removed selects next', solve(['a', 'b', 'c'], 'b', ['b']), [['a', 'c'], 'c'])
check('skip removed successors', solve(['a', 'b', 'c', 'd'], 'b', ['b', 'c']), [['a', 'd'], 'd'])
check('removed last chooses predecessor', solve(['a', 'b', 'c'], 'c', ['c']), [['a', 'b'], 'b'])
check('absent selection remains absent', solve(['a', 'b'], None, []), [['a', 'b'], None])
check('everything removed', solve(['a'], 'a', ['a']), [[], None])
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:
Selects a track even though no current identity existed and produces an incorrect media-control or presentation result.

Remove listed IDs from a playlist with unique string IDs. Keep current identity when it survives. If current is removed, choose the first surviving original successor, otherwise the last survivor. If current was absent, leave selection None. Return [remaining playlist,current ID or None].

split: open-access


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

N = 1
observations = []
def solve(row, col, row_abs, col_abs, dr, dc):
    return [row + dr, col + dc]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixed row movable column', solve(10, 10, True, False, N, N), [10, 10+N])
check('movable row fixed column', solve(10, 10, False, True, -N, N), [10-N, 10])
check('fully relative', solve(10, 10, False, False, N, -N), [10+N, 10-N])
check('fully anchored', solve(10, 10, True, True, N, N), [10, 10])
check('identity copy', solve(1, 1, False, True, 0, 0), [1, 1])
check('first coordinate boundary', solve(N+1, 1, False, False, -N, 0), [1, 1])
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(row, col, row_abs, col_abs, dr, dc):
    return [row, col] if row_abs or col_abs else [row + dr, col + dc]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixed row movable column', solve(10, 10, True, False, N, N), [10, 10+N])
check('movable row fixed column', solve(10, 10, False, True, -N, N), [10-N, 10])
check('fully relative', solve(10, 10, False, False, N, -N), [10+N, 10-N])
check('fully anchored', solve(10, 10, True, True, N, N), [10, 10])
check('identity copy', solve(1, 1, False, True, 0, 0), [1, 1])
check('first coordinate boundary', solve(N+1, 1, False, False, -N, 0), [1, 1])
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:
An anchored row or column changes when a formula is copied.

Given positive row and column coordinates, independent anchor booleans and copy deltas, return translated [row,column]; resulting coordinates are positive.

split: open-access


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

N = 1
observations = []
def solve(cells):
    total = 0
    for cell in cells:
        try:
            total += float(cell) if cell is not None else 0
        except ValueError:
            pass
    return total
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('numeric text ignored', solve([N, str(N)]), N)
check('logical true ignored', solve([N, True]), N)
check('blank range', solve([None, '']), 0)
check('zero retained', solve([0, N]), N)
check('negative cells', solve([-N, N/2]), -N/2)
check('empty range', solve([]), 0)
check('labels ignored', solve(['item', False, N]), N)
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(cells):
    return sum(cell for cell in cells if isinstance(cell, (int, float)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('numeric text ignored', solve([N, str(N)]), N)
check('logical true ignored', solve([N, True]), N)
check('blank range', solve([None, '']), 0)
check('zero retained', solve([0, N]), N)
check('negative cells', solve([-N, N/2]), -N/2)
check('empty range', solve([]), 0)
check('labels ignored', solve(['item', False, N]), N)
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:
A range sum includes numeric-looking labels and logical cells.

A range contains finite ints, floats, strings, booleans or None. Return SUM of numeric cells only; strings, booleans and blanks are ignored.

split: open-access


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

N = 1
observations = []
def solve(cells):
    return sum(cell is None for cell in cells)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty formula strings', solve(['']*N), N)
check('zero is occupied', solve([0]*N), 0)
check('false is occupied', solve([False, None]), 1)
check('space is occupied', solve([' ', '']), 1)
check('empty range', solve([]), 0)
check('mixed blanks', solve([None, '', N, 'x']), 2)
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(cells):
    return sum(not cell for cell in cells)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty formula strings', solve(['']*N), N)
check('zero is occupied', solve([0]*N), 0)
check('false is occupied', solve([False, None]), 1)
check('space is occupied', solve([' ', '']), 1)
check('empty range', solve([]), 0)
check('mixed blanks', solve([None, '', N, 'x']), 2)
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:
Empty string results disappear from blank counts or zero values are counted as blank.

COUNTBLANK model counts None and empty string cells, including empty formula results; numeric zero, False and whitespace are not blank.

split: open-access


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

N = 1
observations = []
def solve(rows, query):
    return min(rows, key=lambda r: abs(r[0]-query))[1] if rows else '#N/A'
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows = [[0, 'low'], [10*N, 'high']]
check('interior near upper endpoint', solve(rows, 10*N-1), 'low')
check('below minimum', solve(rows, -N), '#N/A')
check('minimum inclusive', solve(rows, 0), 'low')
check('upper inclusive', solve(rows, 10*N), 'high')
check('above maximum', solve(rows, 20*N), 'high')
check('empty table', solve([], N), '#N/A')
check('single band interior', solve([[N, 'only']], N+1), 'only')
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(rows, query):
    return next((v for k,v in rows if k == query), '#N/A')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
rows = [[0, 'low'], [10*N, 'high']]
check('interior near upper endpoint', solve(rows, 10*N-1), 'low')
check('below minimum', solve(rows, -N), '#N/A')
check('minimum inclusive', solve(rows, 0), 'low')
check('upper inclusive', solve(rows, 10*N), 'high')
check('above maximum', solve(rows, 20*N), 'high')
check('empty table', solve([], N), '#N/A')
check('single band interior', solve([[N, 'only']], N+1), 'only')
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:
A key between breakpoints gets a future band.

Unique sorted integer [key,value] rows define bands. Return value at greatest key <= query or #N/A below all keys or for empty rows.

split: open-access


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

N = 1
observations = []
def solve(rows, mode):
    return sum(v for v,f,h,s in rows)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('manual hidden counted in mode nine', solve([[N,False,True,False]],9), N)
check('manual hidden omitted in mode 109', solve([[N,False,True,False]],109), 0)
check('filtered omitted in mode nine', solve([[N,True,False,False]],9), 0)
check('nested subtotal omitted', solve([[N,False,False,True]],9), 0)
check('visible ordinary cell', solve([[N,False,False,False]],109), N)
check('empty range', solve([],9), 0)
check('mixed provenance', solve([[N,False,False,False],[2*N,False,True,False],[3*N,False,False,True]],9),3*N)
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(rows, mode):
    return sum(v for v,f,h,s in rows if not f and not h and not s)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('manual hidden counted in mode nine', solve([[N,False,True,False]],9), N)
check('manual hidden omitted in mode 109', solve([[N,False,True,False]],109), 0)
check('filtered omitted in mode nine', solve([[N,True,False,False]],9), 0)
check('nested subtotal omitted', solve([[N,False,False,True]],9), 0)
check('visible ordinary cell', solve([[N,False,False,False]],109), N)
check('empty range', solve([],9), 0)
check('mixed provenance', solve([[N,False,False,False],[2*N,False,True,False],[3*N,False,False,True]],9),3*N)
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 subtotal doubles a nested subtotal or counts rows hidden by the specified mode.

Rows are [number,filtered,manually_hidden,is_subtotal]. Mode 9 includes manually hidden rows; mode 109 excludes them. Both exclude filtered rows and subtotal cells.

split: open-access


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

N = 1
observations = []
def solve(condition, yes, no):
    return '#DIV/0!' if yes[1] == 0 or no[1] == 0 else (yes[0]/yes[1] if condition else no[0]/no[1])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unused false branch error', solve(True,[N,1],[1,0]), N)
check('unused true branch error', solve(False,[1,0],[N,1]), N)
check('selected true error', solve(True,[N,0],[1,1]), '#DIV/0!')
check('selected false error', solve(False,[1,1],[N,0]), '#DIV/0!')
check('zero quotient', solve(True,[0,N],[1,0]), 0)
check('ordinary false choice', solve(False,[8,2],[-N,1]), -N)
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(condition, yes, no):
    branch = yes if condition else no
    return 0 if branch[1] == 0 else branch[0]/branch[1]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unused false branch error', solve(True,[N,1],[1,0]), N)
check('unused true branch error', solve(False,[1,0],[N,1]), N)
check('selected true error', solve(True,[N,0],[1,1]), '#DIV/0!')
check('selected false error', solve(False,[1,1],[N,0]), '#DIV/0!')
check('zero quotient', solve(True,[0,N],[1,0]), 0)
check('ordinary false choice', solve(False,[8,2],[-N,1]), -N)
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:
A valid chosen value is replaced by an error from an unchosen branch.

Each branch is a [numerator,denominator] integer division expression with both operands in the inclusive range -1000000 through 1000000. IF evaluates only its chosen branch, returning a binary floating-point quotient or #DIV/0! when its selected denominator is zero. This bounded model excludes overflow.

split: open-access


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

N = 1
observations = []
def solve(values, targets):
    return '#SPILL!' if any(targets) else values
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty string formula blocks', solve([N], ['']), '#SPILL!')
check('zero blocks', solve([N],[0]), '#SPILL!')
check('logical false blocks', solve([N],[False]), '#SPILL!')
check('absent cell accepts', solve([N],[None]), [N])
check('later collision blocks whole spill', solve([N,N+1],[None,0]), '#SPILL!')
check('empty shape', solve([],[]), [])
check('ordinary text blocks', solve([N],['x']), '#SPILL!')
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(values, targets):
    return '#SPILL!' if any(v or v == '' for v in targets) else values
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('empty string formula blocks', solve([N], ['']), '#SPILL!')
check('zero blocks', solve([N],[0]), '#SPILL!')
check('logical false blocks', solve([N],[False]), '#SPILL!')
check('absent cell accepts', solve([N],[None]), [N])
check('later collision blocks whole spill', solve([N,N+1],[None,0]), '#SPILL!')
check('empty shape', solve([],[]), [])
check('ordinary text blocks', solve([N],['x']), '#SPILL!')
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:
A dynamic array overwrites a formula whose visible result is empty.

Given equal-length proposed values and target cells, return values if all targets are None, otherwise #SPILL!. An empty string means an occupied formula cell. No partial write occurs.

split: open-access


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

N = 1
observations = []
def solve(a, b):
    return sum(x*y for x,y in zip(a,b))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short right range', solve([N,2],[3]), '#VALUE!')
check('short left range', solve([N],[2,3]), '#VALUE!')
check('empty right range', solve([N],[]), '#VALUE!')
check('both empty', solve([],[]), 0)
check('aligned signed products', solve([N,-2],[3,4]),3*N-8)
check('zero factor retained', solve([N,0],[0,N]),0)
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(a, b):
    if not a or not b:
        return 0
    return sum(a[min(i,len(a)-1)] * b[min(i,len(b)-1)] for i in range(max(len(a),len(b))))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('short right range', solve([N,2],[3]), '#VALUE!')
check('short left range', solve([N],[2,3]), '#VALUE!')
check('empty right range', solve([N],[]), '#VALUE!')
check('both empty', solve([],[]), 0)
check('aligned signed products', solve([N,-2],[3,4]),3*N-8)
check('zero factor retained', solve([N,0],[0,N]),0)
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:
A shorter range drops trailing factors, or broadcasting repeats its last value.

One-dimensional integer ranges must have equal lengths. Return pairwise product sum or #VALUE! for mismatched lengths; two empty ranges sum to zero.

split: open-access


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

N = 1
observations = []
def solve(value, places):
    return [value*100, format(value*100, f'.{places}f')+'%']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fraction stored unchanged', solve(N/8,1), [N/8, f'{12.5*N:.1f}%'])
check('whole unit is hundred percent', solve(1,0), [1,'100%'])
check('zero percent', solve(0,2), [0,'0.00%'])
check('negative fraction', solve(-0.5,0), [-0.5,'-50%'])
check('above hundred percent', solve(2,1), [2,'200.0%'])
check('three decimal places', solve(0.125,3), [0.125,'12.500%'])
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(value, places):
    return [value/100, format(value, f'.{places}f')+'%']
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fraction stored unchanged', solve(N/8,1), [N/8, f'{12.5*N:.1f}%'])
check('whole unit is hundred percent', solve(1,0), [1,'100%'])
check('zero percent', solve(0,2), [0,'0.00%'])
check('negative fraction', solve(-0.5,0), [-0.5,'-50%'])
check('above hundred percent', solve(2,1), [2,'200.0%'])
check('three decimal places', solve(0.125,3), [0.125,'12.500%'])
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:
Applying percentage formatting multiplies the stored cell value.

For a finite float input whose binary floating-point product value*100 is also finite, and decimal places 0..3, return [unchanged stored value, fixed-point display of that product with percent suffix]. This is a formatting-only operation using Python float formatting, not exact decimal arithmetic.

split: open-access


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

N = 1
observations = []
def solve(name, sheet, workbook, local):
    return workbook.get(name, '#NAME?')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('active local shadows workbook', solve('rate','B',{'rate':N},{'A':{'rate':2*N},'B':{'rate':3*N}}),3*N)
check('other sheet does not shadow', solve('rate','B',{'rate':N},{'A':{'rate':2*N}}),N)
check('absent active sheet falls back', solve('rate','C',{'rate':N},{'A':{'rate':2*N}}),N)
check('zero local binding retained', solve('rate','B',{'rate':N},{'B':{'rate':0}}),0)
check('unknown name', solve('missing','B',{},{}),'#NAME?')
check('other sheet only name inaccessible', solve('rate','B',{}, {'A':{'rate':N}}),'#NAME?')
check('workbook only binding', solve('rate','B',{'rate':N},{}),N)
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(name, sheet, workbook, local):
    for namespace in local.values():
        if name in namespace:
            return namespace[name]
    return workbook.get(name, '#NAME?')
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('active local shadows workbook', solve('rate','B',{'rate':N},{'A':{'rate':2*N},'B':{'rate':3*N}}),3*N)
check('other sheet does not shadow', solve('rate','B',{'rate':N},{'A':{'rate':2*N}}),N)
check('absent active sheet falls back', solve('rate','C',{'rate':N},{'A':{'rate':2*N}}),N)
check('zero local binding retained', solve('rate','B',{'rate':N},{'B':{'rate':0}}),0)
check('unknown name', solve('missing','B',{},{}),'#NAME?')
check('other sheet only name inaccessible', solve('rate','B',{}, {'A':{'rate':N}}),'#NAME?')
check('workbook only binding', solve('rate','B',{'rate':N},{}),N)
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:
An expression resolves a name from the wrong sheet or workbook scope.

Names are exact strings. Resolve in local_names[active_sheet], then workbook_names; return #NAME? if absent. Numeric zero is a valid bound value.

split: open-access


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

N = 1
observations = []
def solve(nodes):
    return [ident for ident, parent, hidden in nodes if not hidden]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden grandparent', solve([('a',None,True),('b','a',False),(str(N),'b',False)]), [])
check('hidden parent', solve([('a',None,True),(str(N),'a',False)]), [])
check('visible ancestors', solve([('a',None,False),(str(N),'a',False)]), ['a',str(N)])
check('hidden leaf', solve([('a',None,False),(str(N),'a',True)]), ['a'])
check('independent roots', solve([('a',None,True),(str(N),None,False)]), [str(N)])
check('empty forest', solve([]), [])
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(nodes):
    flags = {ident: hidden for ident, parent, hidden in nodes}
    return [ident for ident, parent, hidden in nodes if not hidden and not flags.get(parent, False)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hidden grandparent', solve([('a',None,True),('b','a',False),(str(N),'b',False)]), [])
check('hidden parent', solve([('a',None,True),(str(N),'a',False)]), [])
check('visible ancestors', solve([('a',None,False),(str(N),'a',False)]), ['a',str(N)])
check('hidden leaf', solve([('a',None,False),(str(N),'a',True)]), ['a'])
check('independent roots', solve([('a',None,True),(str(N),None,False)]), [str(N)])
check('empty forest', solve([]), [])
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:
A descendant remains exposed despite a hidden container.

Input is preorder [id,parent_id,hidden] for a forest with unique IDs and parents preceding children. Return exposed IDs in input order; any hidden ancestor excludes a node even if its own hidden flag is false.

split: open-access


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

N = 1
observations = []
def solve(nodes):
    gone = set()
    result = []
    for ident,parent,presentation in nodes:
        if presentation or parent in gone: gone.add(ident)
        else: result.append([ident,parent])
    return result
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested wrapper', solve([('a',None,False),('w','a',True),(str(N),'w',False)]), [['a',None],[str(N),'a']])
check('root wrapper', solve([('w',None,True),(str(N),'w',False)]), [[str(N),None]])
check('multiple wrappers', solve([('a',None,False),('w','a',True),('v','w',True),(str(N),'v',False)]), [['a',None],[str(N),'a']])
check('meaningful child parent', solve([('a',None,False),('b','a',False),(str(N),'b',False)]), [['a',None],['b','a'],[str(N),'b']])
check('only wrapper', solve([(str(N),None,True)]), [])
check('empty', solve([]), [])
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(nodes):
    present = {ident for ident,parent,presentation in nodes if presentation}
    return [[ident, None if parent in present else parent] for ident,parent,presentation in nodes if not presentation]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('nested wrapper', solve([('a',None,False),('w','a',True),(str(N),'w',False)]), [['a',None],[str(N),'a']])
check('root wrapper', solve([('w',None,True),(str(N),'w',False)]), [[str(N),None]])
check('multiple wrappers', solve([('a',None,False),('w','a',True),('v','w',True),(str(N),'v',False)]), [['a',None],[str(N),'a']])
check('meaningful child parent', solve([('a',None,False),('b','a',False),(str(N),'b',False)]), [['a',None],['b','a'],[str(N),'b']])
check('only wrapper', solve([(str(N),None,True)]), [])
check('empty', solve([]), [])
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:
A text-bearing child disappears when its structural wrapper has no exposed role.

Input is preorder [id,parent,presentational] with unique IDs and earlier parents. Return [id,exposed_parent] for nonpresentational nodes. Presentational nodes disappear but their descendants retain the nearest nonpresentational ancestor, or None.

split: open-access


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

N = 1
observations = []
def solve(graph, root):
    def visit(key, depth=0):
        if key not in graph or depth > len(graph): return []
        text, refs = graph[key]
        return ([text] if text else []) + [part for ref in refs for part in visit(ref,depth+1)]
    return ' '.join(visit(root))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self cycle', solve({'a':[str(N),['a']]}, 'a'), str(N))
check('two node cycle', solve({'a':['A',['b']], 'b':[str(N),['a']]}, 'a'), 'A '+str(N))
check('shared diamond', solve({'a':['',['b','c']], 'b':['B',['d']], 'c':['C',['d']], 'd':[str(N),[]]}, 'a'), 'B '+str(N)+' C '+str(N))
check('missing root', solve({}, str(N)), '')
check('dangling branch', solve({'a':[str(N),['gone']]}, 'a'), str(N))
check('ordered branches', solve({'a':['',['c','b']], 'b':['B',[]], 'c':[str(N),[]]}, 'a'), str(N)+' B')
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(graph, root):
    seen = set()
    def visit(key):
        if key not in graph or key in seen: return []
        seen.add(key)
        text,refs = graph[key]
        return ([text] if text else []) + [part for ref in refs for part in visit(ref)]
    return ' '.join(visit(root))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('self cycle', solve({'a':[str(N),['a']]}, 'a'), str(N))
check('two node cycle', solve({'a':['A',['b']], 'b':[str(N),['a']]}, 'a'), 'A '+str(N))
check('shared diamond', solve({'a':['',['b','c']], 'b':['B',['d']], 'c':['C',['d']], 'd':[str(N),[]]}, 'a'), 'B '+str(N)+' C '+str(N))
check('missing root', solve({}, str(N)), '')
check('dangling branch', solve({'a':[str(N),['gone']]}, 'a'), str(N))
check('ordered branches', solve({'a':['',['c','b']], 'b':['B',[]], 'c':[str(N),[]]}, 'a'), str(N)+' B')
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:
Shared text is lost in a label-reference graph, or a cycle prevents termination.

Controlled label graph: each node has [local_text,ordered_reference_ids]. Resolve the root by concatenating its local text and recursively resolved references with spaces, omitting missing nodes and edges to path ancestors. Shared nodes contribute once per path. Graph size is bounded by fixtures.

split: open-access


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

N = 1
observations = []
def solve(parts):
    return ' '.join(parts)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ASCII line boundaries', solve(['  Item\n',str(N)+'\t name  ']), 'Item '+str(N)+' name')
check('nonbreaking space preserved', solve(['A\u00a0'+str(N)]), 'A\u00a0'+str(N))
check('nonbreaking edge preserved', solve(['\u00a0'+str(N)+'\u00a0']), '\u00a0'+str(N)+'\u00a0')
check('empty fragments', solve(['',str(N),'']), str(N))
check('all whitespace', solve([' \r\n','\f\v']), '')
check('empty list', solve([]), '')
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(parts):
    return ' '.join(' '.join(parts).split())
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('ASCII line boundaries', solve(['  Item\n',str(N)+'\t name  ']), 'Item '+str(N)+' name')
check('nonbreaking space preserved', solve(['A\u00a0'+str(N)]), 'A\u00a0'+str(N))
check('nonbreaking edge preserved', solve(['\u00a0'+str(N)+'\u00a0']), '\u00a0'+str(N)+'\u00a0')
check('empty fragments', solve(['',str(N),'']), str(N))
check('all whitespace', solve([' \r\n','\f\v']), '')
check('empty list', solve([]), '')
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:
Text fragments produce excess spaces or lose intentional nonbreaking characters.

Join text fragments with one ASCII space, collapse runs of ASCII space, tab, CR, LF, form feed and vertical tab to one space, and trim those ASCII characters at either end. Preserve nonbreaking spaces and other Unicode characters exactly.

split: open-access


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

N = 1
observations = []
def solve(headers, cell, explicit):
    return [ident for ident,scope,index,group in headers if scope in ('rowgroup','colgroup') or (scope == 'row' and index == cell[0]) or (scope == 'col' and index == cell[1])]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('row group boundary', solve([('old','rowgroup',0,'old'),('current','rowgroup',0,str(N))], [N,0,str(N),'c'], None), ['current'])
check('column group boundary', solve([('old','colgroup',0,'old'),('current','colgroup',0,str(N))], [0,N,'r',str(N)], None), ['current'])
check('explicit overrides inference', solve([('inferred','row',N,'r'),('chosen','col',100,'c')], [N,0,'r','c'], ['chosen']), ['chosen'])
check('empty explicit suppresses inference', solve([('row','row',N,'r')], [N,0,'r','c'], []), [])
check('explicit order and dedup', solve([('a','row',N,'r'),('b','col',N,'c')], [N,N,'r','c'], ['b','gone','a','b']), ['b','a'])
check('row and column inference', solve([('row','row',N,'r'),('col','col',N+1,'c'),('other','row',N+1,'r')], [N,N+1,'r','c'], None), ['row','col'])
check('empty table', solve([], [N,N,'r','c'], None), [])
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(headers, cell, explicit):
    inferred = [ident for ident,scope,index,group in headers if (scope == 'row' and index == cell[0]) or (scope == 'col' and index == cell[1]) or (scope == 'rowgroup' and group == cell[2]) or (scope == 'colgroup' and group == cell[3])]
    known = {h[0] for h in headers}
    return list(dict.fromkeys(([x for x in explicit if x in known] if explicit is not None else []) + inferred))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('row group boundary', solve([('old','rowgroup',0,'old'),('current','rowgroup',0,str(N))], [N,0,str(N),'c'], None), ['current'])
check('column group boundary', solve([('old','colgroup',0,'old'),('current','colgroup',0,str(N))], [0,N,'r',str(N)], None), ['current'])
check('explicit overrides inference', solve([('inferred','row',N,'r'),('chosen','col',100,'c')], [N,0,'r','c'], ['chosen']), ['chosen'])
check('empty explicit suppresses inference', solve([('row','row',N,'r')], [N,0,'r','c'], []), [])
check('explicit order and dedup', solve([('a','row',N,'r'),('b','col',N,'c')], [N,N,'r','c'], ['b','gone','a','b']), ['b','a'])
check('row and column inference', solve([('row','row',N,'r'),('col','col',N+1,'c'),('other','row',N+1,'r')], [N,N+1,'r','c'], None), ['row','col'])
check('empty table', solve([], [N,N,'r','c'], None), [])
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:
A cell announces a group header belonging to a different section or inferred headers alongside explicit ones.

Controlled table model: each header is [id,scope,index,group], scope is row, col, rowgroup or colgroup. Cell is [row,col,rowgroup,colgroup]. None explicit IDs enables inference: row/col match index, group scopes match corresponding group. An explicit list, even empty, disables inference; resolve its existing IDs in given order, deduplicating. Return IDs; fixture IDs are unique and every header has one scope.

split: open-access


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

N = 1
observations = []
def solve(items, offset, total):
    return [[item,i+1,len(items)] for i,item in enumerate(items)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('middle window', solve(['a','b'], N, N+10), [['a',N+1,N+10],['b',N+2,N+10]])
check('unknown total', solve(['a'], N, -1), [['a',N+1,-1]])
check('first window', solve([str(N)], 0, N+5), [[str(N),1,N+5]])
check('last window', solve(['a'], N, N+1), [['a',N+1,N+1]])
check('whole set', solve(['a','b'], 0, 2), [['a',1,2],['b',2,2]])
check('empty unknown', solve([], N, -1), [])
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(items, offset, total):
    return [[item,offset+i+1,offset+len(items)] for i,item in enumerate(items)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('middle window', solve(['a','b'], N, N+10), [['a',N+1,N+10],['b',N+2,N+10]])
check('unknown total', solve(['a'], N, -1), [['a',N+1,-1]])
check('first window', solve([str(N)], 0, N+5), [[str(N),1,N+5]])
check('last window', solve(['a'], N, N+1), [['a',N+1,N+1]])
check('whole set', solve(['a','b'], 0, 2), [['a',1,2],['b',2,2]])
check('empty unknown', solve([], N, -1), [])
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 first rendered row is announced as item one even when earlier items are offscreen.

Return [identifier,one_based_position,total] for a contiguous rendered window at zero-based offset. total is the full known dataset size or -1 for unknown; fixtures have valid offsets and known totals large enough for the window. An empty window returns [].

split: open-access


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

N = 1
observations = []
def solve(name, hint, error, invalid):
    return [name, error if invalid else hint]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hint remains with error', solve('Field '+str(N), 'Use digits', 'Required', True), ['Field '+str(N),'Use digits Required'])
check('valid suppresses stale error', solve(str(N), 'Use digits', 'Required', False), [str(N),'Use digits'])
check('no hint', solve(str(N), '', 'Required', True), [str(N),'Required'])
check('empty error retains hint', solve(str(N), 'Use digits', '', True), [str(N),'Use digits'])
check('empty channels', solve(str(N), '', '', False), [str(N),''])
check('name never replaced', solve('Name '+str(N), '', 'Error', False), ['Name '+str(N),''])
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(name, hint, error, invalid):
    return [name, ' '.join(part for part in [hint,error] if part)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('hint remains with error', solve('Field '+str(N), 'Use digits', 'Required', True), ['Field '+str(N),'Use digits Required'])
check('valid suppresses stale error', solve(str(N), 'Use digits', 'Required', False), [str(N),'Use digits'])
check('no hint', solve(str(N), '', 'Required', True), [str(N),'Required'])
check('empty error retains hint', solve(str(N), 'Use digits', '', True), [str(N),'Use digits'])
check('empty channels', solve(str(N), '', '', False), [str(N),''])
check('name never replaced', solve('Name '+str(N), '', 'Error', False), ['Name '+str(N),''])
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:
Invalid controls lose their usage hint, or error text remains announced after validation succeeds.

Given a name, hint, error text and invalid boolean, return [name,description]. Description joins nonempty hint and (only when invalid) error with one space. Name is preserved verbatim. This models channel assembly, not reference resolution or validation timing.

split: open-access


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

N = 1
observations = []
def solve(events, policy):
    return [text for kind,text in events]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('default includes edits', solve([('text',str(N)),('removals','gone')], None), [str(N)])
check('addition policy excludes removal', solve([('removals','gone'),('additions',str(N))], ['additions']), [str(N)])
check('all token expands', solve([('removals',str(N)),('text','new')], ['all']), [str(N),'new'])
check('explicit empty', solve([('additions',str(N))], []), [])
check('repeated distinct events retained', solve([('text',str(N)),('text',str(N))], ['text']), [str(N),str(N)])
check('no mutations', solve([], None), [])
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(events, policy):
    allowed = {'additions'} if policy is None else set(policy)
    if 'all' in allowed: allowed = {'additions','removals','text'}
    return [text for kind,text in events if kind in allowed]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('default includes edits', solve([('text',str(N)),('removals','gone')], None), [str(N)])
check('addition policy excludes removal', solve([('removals','gone'),('additions',str(N))], ['additions']), [str(N)])
check('all token expands', solve([('removals',str(N)),('text','new')], ['all']), [str(N),'new'])
check('explicit empty', solve([('additions',str(N))], []), [])
check('repeated distinct events retained', solve([('text',str(N)),('text',str(N))], ['text']), [str(N),str(N)])
check('no mutations', solve([], None), [])
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:
Live-region mutation filtering emits irrelevant event kinds or loses text edits under the default policy.

Events are [kind,text], where kind is additions, removals or text. Policy is None for default additions+text, or a list of relevant tokens; all admits all three kinds. An explicit empty list admits nothing. Return admitted texts in event order without deduplication. This model stops before priority, busy or speech queue scheduling.

split: open-access


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

N = 1
observations = []
def solve(tag, name, ancestors):
    return {'main':'main','nav':'navigation','aside':'complementary','form':'form','section':'region','header':'banner','footer':'contentinfo'}.get(tag)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('deep local header', solve('header', str(N), ['div']*N+['article','body']), None)
check('deep local footer', solve('footer', str(N), ['div']*N+['main','body']), None)
check('page header', solve('header', str(N), ['div']*N+['body']), 'banner')
check('page footer', solve('footer', '', ['body']), 'contentinfo')
check('unnamed section', solve('section', ' '*N, ['body']), None)
check('named section', solve('section', 'Results '+str(N), ['body']), 'region')
check('unnamed form', solve('form', '', []), None)
check('named form', solve('form', str(N), []), 'form')
check('unconditional navigation', solve('nav', '', ['article']), 'navigation')
check('nonlandmark', solve('div', str(N), []), None)
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(tag, name, ancestors):
    if tag in ('form','section') and not name.strip(''.join(map(chr, [32,9,13,10,12,11]))): return None
    if tag in ('header','footer') and ancestors and ancestors[0] in {'article','aside','main','nav','section'}: return None
    return {'main':'main','nav':'navigation','aside':'complementary','form':'form','section':'region','header':'banner','footer':'contentinfo'}.get(tag)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('deep local header', solve('header', str(N), ['div']*N+['article','body']), None)
check('deep local footer', solve('footer', str(N), ['div']*N+['main','body']), None)
check('page header', solve('header', str(N), ['div']*N+['body']), 'banner')
check('page footer', solve('footer', '', ['body']), 'contentinfo')
check('unnamed section', solve('section', ' '*N, ['body']), None)
check('named section', solve('section', 'Results '+str(N), ['body']), 'region')
check('unnamed form', solve('form', '', []), None)
check('named form', solve('form', str(N), []), 'form')
check('unconditional navigation', solve('nav', '', ['article']), 'navigation')
check('nonlandmark', solve('div', str(N), []), None)
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:
Section-local headers and footers appear in the page landmark inventory, or unnamed sections create noisy regions.

This deliberately bounded native landmark adapter accepts tag, accessible name, and nearest-first ancestor tag names. main/nav/aside map to main/navigation/complementary. Named form/section map to form/region; empty or ASCII-whitespace-only names yield None. header/footer map to banner/contentinfo only outside every article, aside, main, nav or section ancestor. Other tags yield None. This adapter does not implement author role overrides or full HTML semantics.

split: open-access