Python — per-model detail

Every failing sample below is the real generated Python, with the assertion or error that rejected it. Trial 0 runs at temperature 0, trials 1 and 2 at 0.7 — so a task passing 1/3 is a sampling-luck pass, not a reliable one. Models are ordered best first. Other technologies: C · Python · Bash · research · how to reproduce.

Reproduce this benchmark

Setup and model serving are on the models index — including a script-free version using nothing but curl and a compiler; with a server running, this is the exact command that produced the samples below:

# Python suite (8 easy + 3 hard tasks, 3 trials each)
python scripts/eval_python.py --target <model> --set all --trials 3 \
    --dump-failures results/failures
python scripts/eval_python.py --target <model> --set brutal --trials 3 \
    --dump-failures results/failures --json > results/<model>-brutal-python.json
# each answer runs against hidden asserts in a subprocess with a timeout.

qwen3.8-flash-next 125B 88% overall↑ top

Served via llama.cpp CUDA · 33.6 tok/s · 36.3 GB RAM · coding total 111/126

Python — 24/24 (1.1 min / 2.1k tok)

No failures.

Python (hard) — 9/9 (1.5 min / 3.0k tok)

No failures.

qwen3-coder-next 80B 86% overall↑ top

Served via llama.cpp CUDA · 51.2 tok/s · 8.9 GB RAM · coding total 108/126

Python — 21/24 (0.7 min / 2.1k tok)

csv_column_sum — 0/3 passed
prompt sent to the model
Implement in Python 3: `def csv_column_sum(path, col):` Reads the CSV file at path (first row is a header). Returns the sum of the numeric values in column col as a float.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — TypeError: '<' not supported between instances of 'str' and 'int'
import csv

def csv_column_sum(path, col):
    total = 0.0
    with open(path, 'r', newline='') as csvfile:
        reader = csv.reader(csvfile)
        next(reader)  # Skip header row
        for row in reader:
            if col < len(row):
                try:
                    total += float(row[col])
                except ValueError:
                    pass  # Skip non-numeric values
    return total
trial 1 (temp 0.7) — fail — TypeError: '<' not supported between instances of 'str' and 'int'
import csv

def csv_column_sum(path, col):
    total = 0.0
    with open(path, 'r', newline='') as csvfile:
        reader = csv.reader(csvfile)
        next(reader)  # Skip header row
        for row in reader:
            if col < len(row):
                try:
                    total += float(row[col])
                except ValueError:
                    pass  # Skip non-numeric values
    return total
trial 2 (temp 0.7) — fail — TypeError: '<' not supported between instances of 'str' and 'int'
import csv

def csv_column_sum(path, col):
    total = 0.0
    with open(path, 'r', newline='') as csvfile:
        reader = csv.reader(csvfile)
        next(reader)  # Skip header row
        for row in reader:
            if col < len(row):
                try:
                    total += float(row[col])
                except ValueError:
                    pass  # Skip non-numeric values
    return total

Python (hard) — 6/9 (0.7 min / 2.1k tok)

json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b):
    def _diff(path, x, y):
        if type(x) != type(y):
            return [path] if path else []
        
        if isinstance(x, dict):
            result = []
            all_keys = set(x.keys()) | set(y.keys())
            for key in all_keys:
                new_path = f"{path}.{key}" if path else key
                if key not in x:
                    result.append(new_path)
                elif key not in y:
                    result.append(new_path)
                else:
                    result.extend(_diff(new_path, x[key], y[key]))
            return result
        
        if isinstance(x, list):
            if len(x) != len(y):
                return [path] if path else []
            result = []
            for i, (item_x, item_y) in enumerate(zip(x, y)):
                new_path = f"{path}[{i}]" if path else f"[{i}]"
                result.extend(_diff(new_path, item_x, item_y))
            return result
        
        # Scalar comparison
        if x != y:
            return [path] if path else []
        return []
    
    result = _diff("", a, b)
    return sorted(result)
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(path, x, y):
        if type(x) != type(y):
            return [path] if path else []
        
        if isinstance(x, dict):
            result = []
            all_keys = set(x.keys()) | set(y.keys())
            for key in all_keys:
                new_path = f"{path}.{key}" if path else key
                if key not in x:
                    result.append(new_path)
                elif key not in y:
                    result.append(new_path)
                else:
                    result.extend(_diff(new_path, x[key], y[key]))
            return result
        
        if isinstance(x, list):
            if len(x) != len(y):
                return [path] if path else []
            result = []
            for i, (item_x, item_y) in enumerate(zip(x, y)):
                new_path = f"{path}[{i}]" if path else f"[{i}]"
                result.extend(_diff(new_path, item_x, item_y))
            return result
        
        # Scalar comparison
        if x != y:
            return [path] if path else []
        return []
    
    result = _diff("", a, b)
    return sorted(result)
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(path, x, y):
        if type(x) != type(y):
            return [path] if path else []
        
        if isinstance(x, dict):
            result = []
            all_keys = set(x.keys()) | set(y.keys())
            for key in all_keys:
                new_path = f"{path}.{key}" if path else key
                if key not in x:
                    result.append(new_path)
                elif key not in y:
                    result.append(new_path)
                else:
                    result.extend(_diff(new_path, x[key], y[key]))
            return result
        
        if isinstance(x, list):
            if len(x) != len(y):
                return [path] if path else []
            result = []
            for i, (item_x, item_y) in enumerate(zip(x, y)):
                new_path = f"{path}[{i}]" if path else f"[{i}]"
                result.extend(_diff(new_path, item_x, item_y))
            return result
        
        # Scalar comparison
        if x != y:
            return [path] if path else []
        return []
    
    result = _diff("", a, b)
    return sorted(result)

laguna-s 2.1 117B 86% overall↑ top

Served via llama.cpp CUDA · 35.3 tok/s · 4.9 GB RAM · coding total 108/126

Python — 24/24 (1.0 min / 1.8k tok)

No failures.

Python (hard) — 9/9 (0.9 min / 1.7k tok)

No failures.

gpt-oss-120b 85% overall↑ top

Served via llama.cpp CUDA · 54.2 tok/s · 3.8 GB RAM · coding total 107/126

Python — 24/24 (2.1 min / 6.7k tok)

No failures.

Python (hard) — 9/9 (1.8 min / 5.7k tok)

No failures.

nemotron-3-super 120B 83% overall↑ top

Served via llama.cpp CUDA · 16.4 tok/s · 9.2 GB RAM · coding total 105/126

Python — 24/24 (2.0 min / 1.8k tok)

No failures.

Python (hard) — 9/9 (1.8 min / 1.7k tok)

No failures.

gpt-oss-20b 81% overall↑ top

Served via llama.cpp CUDA · 81.0 tok/s · 3.7 GB RAM · coding total 102/126

Python — 24/24 (1.7 min / 7.8k tok)

No failures.

Python (hard) — 7/9 (2.8 min / 13.3k tok)

json_diff — 1/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 1 (temp 0.7) — truncated — hit the 4096-token cap
(no code extracted)
trial 2 (temp 0.7) — truncated — hit the 4096-token cap
(no code extracted)

gemma-4-26b 81% overall↑ top

Served via llama.cpp CUDA · 55.8 tok/s · 6.6 GB RAM · coding total 102/126

Python — 24/24 (0.8 min / 2.6k tok)

No failures.

Python (hard) — 9/9 (0.7 min / 2.3k tok)

No failures.

qwen3.8-27b 81% overall↑ top

Served via llama.cpp CUDA · 11.0 tok/s · 9.6 GB RAM · coding total 102/126

Python — 24/24 (3.3 min / 2.0k tok)

No failures.

Python (hard) — 9/9 (5.1 min / 3.3k tok)

No failures.

qwen3.6-35b 81% overall↑ top

Served via llama.cpp CUDA · 59.6 tok/s · 9.3 GB RAM · coding total 102/126

Python — 21/24 (0.6 min / 1.8k tok)

merge_intervals — 0/3 passed
prompt sent to the model
Implement in Python 3: `def merge_intervals(intervals):` intervals is a list of [start, end] pairs (start <= end, any order). Returns the merged list of non-overlapping intervals sorted by start. Touching intervals merge ([1,4] and [4,5] -> [1,5]).
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def merge_intervals(intervals):
    if not intervals:
        return []
    intervals.sort(key=lambda x: x[0])
    merged = [intervals[0]]
    for start, end in intervals[1:]:
        last_start, last_end = merged[-1]
        if start <= last_end:
            merged[-1] = (last_start, max(last_end, end))
        else:
            merged.append((start, end))
    return merged
trial 1 (temp 0.7) — fail — AssertionError
def merge_intervals(intervals):
    if not intervals:
        return []
    intervals.sort(key=lambda x: x[0])
    merged = [intervals[0]]
    for start, end in intervals[1:]:
        last_start, last_end = merged[-1]
        if start <= last_end:
            merged[-1] = (last_start, max(last_end, end))
        else:
            merged.append((start, end))
    return merged
trial 2 (temp 0.7) — fail — AssertionError
def merge_intervals(intervals):
    if not intervals:
        return []
    intervals.sort(key=lambda x: x[0])
    merged = [intervals[0]]
    for start, end in intervals[1:]:
        last_start, last_end = merged[-1]
        if start <= last_end:
            merged[-1] = (last_start, max(last_end, end))
        else:
            merged.append((start, end))
    return merged

Python (hard) — 6/9 (0.7 min / 2.2k tok)

json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b, prefix=""):
    """
    Compares two JSON-like structures (dicts, lists, scalars).
    Returns a sorted list of dotted key paths where they differ.
    """
    diffs = []
    
    # If both are dicts, recurse
    if isinstance(a, dict) and isinstance(b, dict):
        all_keys = set(a.keys()) | set(b.keys())
        for key in all_keys:
            path = f"{prefix}.{key}" if prefix else key
            if key not in a:
                diffs.append(f"{path} (missing in left)")
            elif key not in b:
                diffs.append(f"{path} (missing in right)")
            else:
                diffs.extend(json_diff(a[key], b[key], path))
    # If both are lists, compare as whole values
    elif isinstance(a, list) and isinstance(b, list):
        if a != b:
            diffs.append(prefix if prefix else "root")
    # If both are scalars (or one is scalar and other is not), compare as whole values
    else:
        if a != b:
            diffs.append(prefix if prefix else "root")
            
    return sorted(diffs)
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b, prefix=""):
    """
    Compares two JSON-like structures (dicts, lists, scalars).
    Returns a sorted list of dotted key paths where they differ.
    """
    diffs = []
    
    # If both are dicts, recurse
    if isinstance(a, dict) and isinstance(b, dict):
        all_keys = set(a.keys()) | set(b.keys())
        for key in all_keys:
            path = f"{prefix}.{key}" if prefix else key
            if key not in a:
                diffs.append(f"{path} (missing in left)")
            elif key not in b:
                diffs.append(f"{path} (missing in right)")
            else:
                diffs.extend(json_diff(a[key], b[key], path))
    # If both are lists, compare as whole values
    elif isinstance(a, list) and isinstance(b, list):
        if a != b:
            diffs.append(prefix if prefix else "root")
    # If both are scalars (or one is scalar and other is not), compare as whole values
    else:
        if a != b:
            diffs.append(prefix if prefix else "root")
            
    return sorted(diffs)
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b, prefix=""):
    """
    Compares two JSON-like structures (dicts, lists, scalars).
    Returns a sorted list of dotted key paths where they differ.
    """
    diffs = []
    
    # If both are dicts, recurse
    if isinstance(a, dict) and isinstance(b, dict):
        all_keys = set(a.keys()) | set(b.keys())
        for key in all_keys:
            path = f"{prefix}.{key}" if prefix else key
            if key not in a:
                diffs.append(f"{path} (missing in left)")
            elif key not in b:
                diffs.append(f"{path} (missing in right)")
            else:
                diffs.extend(json_diff(a[key], b[key], path))
    # If both are lists, compare as whole values
    elif isinstance(a, list) and isinstance(b, list):
        if a != b:
            diffs.append(prefix if prefix else "root")
    # If both are scalars (or one is scalar and other is not), compare as whole values
    else:
        if a != b:
            diffs.append(prefix if prefix else "root")
            
    return sorted(diffs)

laguna-xs.2 81% overall↑ top

Served via llama.cpp CUDA · 93.6 tok/s · 4.3 GB RAM · coding total 102/126

Python — 24/24 (0.4 min / 1.9k tok)

No failures.

Python (hard) — 9/9 (0.3 min / 1.7k tok)

No failures.

qwen3.6-27b 79% overall↑ top

Served via llama.cpp CUDA · 11.2 tok/s · 9.3 GB RAM · coding total 99/126

Python — 24/24 (3.0 min / 2.2k tok)

No failures.

Python (hard) — 9/9 (3.3 min / 2.3k tok)

No failures.

devstral-2 24b 78% overall↑ top

Served via llama.cpp CUDA · 14.3 tok/s · 1.4 GB RAM · coding total 98/126

Python — 24/24 (2.1 min / 1.8k tok)

No failures.

Python (hard) — 6/9 (2.1 min / 1.8k tok)

json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b):
    def _diff(path, a, b):
        diffs = []
        if isinstance(a, dict) and isinstance(b, dict):
            all_keys = sorted(set(a.keys()) | set(b.keys()))
            for key in all_keys:
                new_path = f"{path}.{key}" if path else key
                if key not in a:
                    diffs.append(new_path)
                elif key not in b:
                    diffs.append(new_path)
                else:
                    diffs.extend(_diff(new_path, a[key], b[key]))
        elif isinstance(a, list) and isinstance(b, list):
            if len(a) != len(b):
                diffs.append(path)
            else:
                for i, (x, y) in enumerate(zip(a, b)):
                    new_path = f"{path}[{i}]"
                    if x != y:
                        diffs.append(new_path)
        else:
            if a != b:
                diffs.append(path)
        return diffs
    return sorted(_diff("", a, b))
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(a, b, path):
        diffs = []
        if isinstance(a, dict) and isinstance(b, dict):
            all_keys = sorted(set(a.keys()) | set(b.keys()))
            for key in all_keys:
                new_path = f"{path}.{key}" if path else key
                if key not in a:
                    diffs.append(new_path)
                elif key not in b:
                    diffs.append(new_path)
                else:
                    diffs.extend(_diff(a[key], b[key], new_path))
        elif isinstance(a, list) and isinstance(b, list):
            if len(a) != len(b):
                diffs.append(path)
            else:
                for i, (x, y) in enumerate(zip(a, b)):
                    new_path = f"{path}[{i}]"
                    diffs.extend(_diff(x, y, new_path))
        else:
            if a != b:
                diffs.append(path)
        return diffs

    return sorted(_diff(a, b, ""))
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(a, b, path):
        diffs = []
        if isinstance(a, dict) and isinstance(b, dict):
            all_keys = sorted(set(a.keys()) | set(b.keys()))
            for key in all_keys:
                new_path = f"{path}.{key}" if path else key
                if key not in a:
                    diffs.append(new_path)
                elif key not in b:
                    diffs.append(new_path)
                else:
                    diffs.extend(_diff(a[key], b[key], new_path))
        elif isinstance(a, list) and isinstance(b, list):
            if len(a) != len(b):
                diffs.append(path)
            else:
                for i, (x, y) in enumerate(zip(a, b)):
                    new_path = f"{path}[{i}]"
                    diffs.extend(_diff(x, y, new_path))
        else:
            if a != b:
                diffs.append(path)
        return diffs

    return sorted(_diff(a, b, ""))

qwen3.5-35b 76% overall↑ top

Served via llama.cpp CUDA · 68.8 tok/s · 9.3 GB RAM · coding total 96/126

Python — 21/24 (0.5 min / 1.9k tok)

csv_column_sum — 0/3 passed
prompt sent to the model
Implement in Python 3: `def csv_column_sum(path, col):` Reads the CSV file at path (first row is a header). Returns the sum of the numeric values in column col as a float.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — TypeError: '<' not supported between instances of 'str' and 'int'
import csv

def csv_column_sum(path, col):
    total = 0.0
    with open(path, 'r', newline='') as f:
        reader = csv.reader(f)
        next(reader)  # Skip header
        for row in reader:
            if col < len(row):
                try:
                    total += float(row[col])
                except ValueError:
                    continue
    return total
trial 1 (temp 0.7) — fail — TypeError: '<' not supported between instances of 'str' and 'int'
import csv

def csv_column_sum(path, col):
    total = 0.0
    with open(path, 'r', newline='') as f:
        reader = csv.reader(f)
        next(reader)  # Skip header
        for row in reader:
            if col < len(row):
                try:
                    total += float(row[col])
                except ValueError:
                    continue
    return total
trial 2 (temp 0.7) — fail — TypeError: '<' not supported between instances of 'str' and 'int'
import csv

def csv_column_sum(path, col):
    total = 0.0
    with open(path, 'r', newline='') as f:
        reader = csv.reader(f)
        next(reader)  # Skip header
        for row in reader:
            if col < len(row):
                try:
                    total += float(row[col])
                except ValueError:
                    continue
    return total

Python (hard) — 9/9 (0.5 min / 2.2k tok)

No failures.

glm-4.7-flash 76% overall↑ top

Served via llama.cpp CUDA · 67.4 tok/s · 1.7 GB RAM · coding total 96/126

Python — 24/24 (0.5 min / 2.1k tok)

No failures.

Python (hard) — 3/9 (0.6 min / 2.4k tok)

topological_sort — 0/3 passed
prompt sent to the model
Implement in Python 3: `def topological_sort(deps):` deps maps each node (str) to a list of nodes it depends on. Returns a list of all nodes in an order where every node comes after its dependencies. Returns None if the graph has a cycle (including self-dependencies). Nodes mentioned only as dependencies are included.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AttributeError: 'NoneType' object has no attribute 'index'
def topological_sort(deps):
    """
    Performs a topological sort on a directed graph defined by dependencies.
    
    Args:
        deps: A dictionary mapping a node (str) to a list of nodes it depends on.
    
    Returns:
        A list of nodes in topological order, or None if a cycle is detected.
    """
    # Initialize in-degree count for all nodes
    in_degree = {}
    # Initialize adjacency list
    graph = {}
    
    # Populate in-degree and adjacency list
    # We iterate through all nodes to ensure isolated nodes are included
    for node in deps:
        graph[node] = deps[node]
        in_degree[node] = 0
        
        for dep in deps[node]:
            if dep not in in_degree:
                in_degree[dep] = 0
            in_degree[node] += 1
            
    # Add nodes that are only dependencies and not keys in deps
    for node in in_degree:
        if node not in graph:
            graph[node] = []
            
    # Initialize queue with nodes having zero in-degree
    queue = [node for node in in_degree if in_degree[node] == 0]
    
    result = []
    
    while queue:
        # Sort queue to ensure deterministic output (optional but good for testing)
        queue.sort()
        current = queue.pop(0)
        result.append(current)
        
        for neighbor in graph[current]:
            in_degree[neighbor] -= 1
            if in_degree[neighbor] == 0:
                queue.append(neighbor)
                
    # Check for cycle: if result length is less than total nodes, there is a cycle
    if len(result) != len(in_degree):
        return None
        
    return result
trial 1 (temp 0.7) — fail — AttributeError: 'NoneType' object has no attribute 'index'
def topological_sort(deps):
    """
    Performs a topological sort on a directed graph defined by dependencies.
    
    Args:
        deps: A dictionary mapping a node (str) to a list of nodes it depends on.
    
    Returns:
        A list of nodes in topological order, or None if a cycle is detected.
    """
    # Initialize in-degree count for all nodes
    in_degree = {}
    # Initialize adjacency list
    graph = {}
    
    # Populate in-degree and adjacency list
    # We iterate through all nodes to ensure isolated nodes are included
    for node in deps:
        graph[node] = deps[node]
        in_degree[node] = 0
    
    # Count dependencies for each node
    for node in deps:
        for dep in deps[node]:
            if dep not in in_degree:
                in_degree[dep] = 0
            in_degree[node] += 1
            
    # Initialize queue with nodes having no dependencies
    queue = [node for node in in_degree if in_degree[node] == 0]
    
    result = []
    
    while queue:
        # Sort queue to ensure deterministic output (optional but good for testing)
        queue.sort()
        current = queue.pop(0)
        result.append(current)
        
        # Decrease in-degree of neighbors
        for neighbor in graph.get(current, []):
            in_degree[neighbor] -= 1
            if in_degree[neighbor] == 0:
                queue.append(neighbor)
                
    # Check for cycle
    if len(result) != len(in_degree):
        return None
        
    return result
trial 2 (temp 0.7) — fail — AttributeError: 'NoneType' object has no attribute 'index'
def topological_sort(deps):
    """
    Performs a topological sort on a directed graph defined by dependencies.
    
    Args:
        deps: A dictionary mapping a node (str) to a list of nodes it depends on.
    
    Returns:
        A list of nodes in topological order, or None if a cycle is detected.
    """
    # Initialize in-degree count for all nodes
    in_degree = {}
    # Initialize adjacency list
    graph = {}
    
    # Populate in-degree and adjacency list
    # We iterate through all nodes to ensure isolated nodes are included
    for node in deps:
        graph[node] = deps[node]
        in_degree[node] = 0
    
    # Count dependencies for each node
    for node in deps:
        for dep in deps[node]:
            if dep not in in_degree:
                in_degree[dep] = 0
            in_degree[node] += 1
            
    # Initialize queue with nodes having no dependencies
    queue = [node for node in in_degree if in_degree[node] == 0]
    
    result = []
    
    while queue:
        # Sort queue to ensure deterministic output (optional but good for testing)
        queue.sort()
        current = queue.pop(0)
        result.append(current)
        
        # Decrease in-degree of neighbors
        for neighbor in graph.get(current, []):
            in_degree[neighbor] -= 1
            if in_degree[neighbor] == 0:
                queue.append(neighbor)
                
    # Check for cycle
    if len(result) != len(in_degree):
        return None
        
    return result
json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b):
    def _diff(current_a, current_b, path):
        changes = []
        
        # Check if both are dicts
        if isinstance(current_a, dict) and isinstance(current_b, dict):
            # Keys present in both
            all_keys = set(current_a.keys()) | set(current_b.keys())
            for key in sorted(all_keys):
                new_path = f"{path}.{key}" if path else key
                if key in current_a and key in current_b:
                    changes.extend(_diff(current_a[key], current_b[key], new_path))
                elif key in current_a:
                    changes.append(new_path)
                else:
                    changes.append(new_path)
                    
        # Check if both are lists
        elif isinstance(current_a, list) and isinstance(current_b, list):
            # Compare lists by index
            length = max(len(current_a), len(current_b))
            for i in range(length):
                new_path = f"{path}[{i}]"
                if i < len(current_a) and i < len(current_b):
                    changes.extend(_diff(current_a[i], current_b[i], new_path))
                elif i < len(current_a):
                    changes.append(new_path)
                else:
                    changes.append(new_path)
                    
        # Scalars or mismatched types
        else:
            if current_a != current_b:
                changes.append(path)
                
        return changes

    return sorted(_diff(a, b, ""))
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(current_a, current_b, path):
        changes = []
        
        # Check if both are dicts
        if isinstance(current_a, dict) and isinstance(current_b, dict):
            # Keys present in both
            all_keys = set(current_a.keys()) | set(current_b.keys())
            for key in sorted(all_keys):
                new_path = f"{path}.{key}" if path else key
                if key in current_a and key in current_b:
                    changes.extend(_diff(current_a[key], current_b[key], new_path))
                elif key in current_a:
                    changes.append(new_path)
                else:
                    changes.append(new_path)
                    
        # Check if both are lists
        elif isinstance(current_a, list) and isinstance(current_b, list):
            # Compare lists element by element
            length = max(len(current_a), len(current_b))
            for i in range(length):
                new_path = f"{path}[{i}]"
                if i < len(current_a) and i < len(current_b):
                    changes.extend(_diff(current_a[i], current_b[i], new_path))
                elif i < len(current_a):
                    changes.append(new_path)
                else:
                    changes.append(new_path)
                    
        # Scalars or mismatched types
        else:
            if current_a != current_b:
                changes.append(path)
                
        return changes

    return sorted(_diff(a, b, ""))
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(current_a, current_b, path):
        changes = []
        
        # Check if both are dicts
        if isinstance(current_a, dict) and isinstance(current_b, dict):
            # Keys present in both
            all_keys = set(current_a.keys()) | set(current_b.keys())
            for key in sorted(all_keys):
                new_path = f"{path}.{key}" if path else key
                if key in current_a and key in current_b:
                    changes.extend(_diff(current_a[key], current_b[key], new_path))
                elif key in current_a:
                    changes.append(new_path)
                else:
                    changes.append(new_path)
                    
        # Check if both are lists
        elif isinstance(current_a, list) and isinstance(current_b, list):
            # Compare lists element by element
            length = max(len(current_a), len(current_b))
            for i in range(length):
                new_path = f"{path}[{i}]"
                if i < len(current_a) and i < len(current_b):
                    changes.extend(_diff(current_a[i], current_b[i], new_path))
                elif i < len(current_a):
                    changes.append(new_path)
                else:
                    changes.append(new_path)
                    
        # Scalars or mismatched types
        else:
            if current_a != current_b:
                changes.append(path)
                
        return changes

    return sorted(_diff(a, b, ""))

qwen3.5-27b 76% overall↑ top

Served via llama.cpp CUDA · 12.6 tok/s · 9.3 GB RAM · coding total 96/126

Python — 24/24 (3.1 min / 2.1k tok)

No failures.

Python (hard) — 9/9 (4.1 min / 2.8k tok)

No failures.

qwen3.5-122b-a10b 74% overall↑ top

Served via llama.cpp CUDA · 22.4 tok/s · 9.4 GB RAM · coding total 93/126

Python — 24/24 (1.7 min / 2.1k tok)

No failures.

Python (hard) — 9/9 (1.5 min / 2.0k tok)

No failures.

qwen3-coder-30b 71% overall↑ top

Served via llama.cpp CUDA · 91.1 tok/s · 2.1 GB RAM · coding total 90/126

Python — 24/24 (0.4 min / 2.1k tok)

No failures.

Python (hard) — 6/9 (0.4 min / 2.2k tok)

json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b):
    def _diff(obj_a, obj_b, path=""):
        diffs = []
        if type(obj_a) != type(obj_b):
            diffs.append(path)
        elif isinstance(obj_a, dict):
            all_keys = set(obj_a.keys()) | set(obj_b.keys())
            for key in sorted(all_keys):
                new_path = f"{path}.{key}" if path else key
                if key not in obj_a:
                    diffs.append(new_path)
                elif key not in obj_b:
                    diffs.append(new_path)
                else:
                    diffs.extend(_diff(obj_a[key], obj_b[key], new_path))
        elif isinstance(obj_a, list):
            if len(obj_a) != len(obj_b):
                diffs.append(path)
            else:
                for i, (item_a, item_b) in enumerate(zip(obj_a, obj_b)):
                    new_path = f"{path}[{i}]"
                    diffs.extend(_diff(item_a, item_b, new_path))
        else:
            if obj_a != obj_b:
                diffs.append(path)
        return diffs
    
    return sorted(_diff(a, b))
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(obj_a, obj_b, path=""):
        diffs = []
        if type(obj_a) != type(obj_b):
            diffs.append(path)
        elif isinstance(obj_a, dict):
            all_keys = set(obj_a.keys()) | set(obj_b.keys())
            for key in sorted(all_keys):
                new_path = f"{path}.{key}" if path else key
                if key not in obj_a:
                    diffs.append(new_path)
                elif key not in obj_b:
                    diffs.append(new_path)
                else:
                    diffs.extend(_diff(obj_a[key], obj_b[key], new_path))
        elif isinstance(obj_a, list):
            if len(obj_a) != len(obj_b):
                diffs.append(path)
            else:
                for i, (item_a, item_b) in enumerate(zip(obj_a, obj_b)):
                    new_path = f"{path}[{i}]"
                    diffs.extend(_diff(item_a, item_b, new_path))
        else:
            if obj_a != obj_b:
                diffs.append(path)
        return diffs
    
    return sorted(_diff(a, b))
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def _diff(obj_a, obj_b, path=""):
        diffs = []
        if type(obj_a) != type(obj_b):
            diffs.append(path)
        elif isinstance(obj_a, dict):
            all_keys = set(obj_a.keys()) | set(obj_b.keys())
            for key in sorted(all_keys):
                new_path = f"{path}.{key}" if path else key
                if key not in obj_a:
                    diffs.append(new_path)
                elif key not in obj_b:
                    diffs.append(new_path)
                else:
                    diffs.extend(_diff(obj_a[key], obj_b[key], new_path))
        elif isinstance(obj_a, list):
            if len(obj_a) != len(obj_b):
                diffs.append(path)
            else:
                for i, (item_a, item_b) in enumerate(zip(obj_a, obj_b)):
                    new_path = f"{path}[{i}]"
                    diffs.extend(_diff(item_a, item_b, new_path))
        else:
            if obj_a != obj_b:
                diffs.append(path)
        return diffs
    
    return sorted(_diff(a, b))

k2-horizon 36B-A4B 70% overall↑ top

Served via llama.cpp CUDA · 50.8 tok/s · 3.4 GB RAM · coding total 88/126

Python — 23/24 (0.6 min / 1.6k tok)

csv_column_sum — 2/3 passed
prompt sent to the model
Implement in Python 3: `def csv_column_sum(path, col):` Reads the CSV file at path (first row is a header). Returns the sum of the numeric values in column col as a float.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — TypeError: list indices must be integers or slices, not str
import csv

def csv_column_sum(path, col):
    with open(path, newline='') as f:
        reader = csv.reader(f)
        next(reader)  # skip header
        return sum(float(row[col]) for row in reader)

Python (hard) — 4/9 (0.5 min / 1.6k tok)

topological_sort — 1/3 passed
prompt sent to the model
Implement in Python 3: `def topological_sort(deps):` deps maps each node (str) to a list of nodes it depends on. Returns a list of all nodes in an order where every node comes after its dependencies. Returns None if the graph has a cycle (including self-dependencies). Nodes mentioned only as dependencies are included.
Reply with only a Python code block. No tests, no explanation.
trial 1 (temp 0.7) — fail — AttributeError: 'NoneType' object has no attribute 'index'
def topological_sort(deps):
    # Build full graph including nodes that appear only as dependencies
    graph = {node: set(d) for node, d in deps.items()}
    for node, dlist in deps.items():
        for d in dlist:
            if d not in graph:
                graph[d] = set()
    
    # Kahn's algorithm
    indegree = {node: 0 for node in graph}
    for node, dlist in graph.items():
        for d in dlist:
            indegree[node] += 1
    
    queue = [node for node, deg in indegree.items() if deg == 0]
    result = []
    
    while queue:
        node = queue.pop(0)
        result.append(node)
        for neighbor in graph[node]:
            indegree[neighbor] -= 1
            if indegree[neighbor] == 0:
                queue.append(neighbor)
    
    if len(result) != len(graph):
        return None
    
    return result
trial 2 (temp 0.7) — fail — AttributeError: 'NoneType' object has no attribute 'index'
def topological_sort(deps):
    # Build full graph including nodes that appear only as dependencies
    graph = {node: set(d) for node, d in deps.items()}
    for node, dlist in deps.items():
        for d in dlist:
            if d not in graph:
                graph[d] = set()
    
    # Kahn's algorithm
    indegree = {node: 0 for node in graph}
    for node, dlist in graph.items():
        for d in dlist:
            indegree[node] += 1
    
    queue = [node for node, deg in indegree.items() if deg == 0]
    result = []
    
    while queue:
        node = queue.pop(0)
        result.append(node)
        for neighbor in graph[node]:
            indegree[neighbor] -= 1
            if indegree[neighbor] == 0:
                queue.append(neighbor)
    
    if len(result) != len(graph):
        return None
    
    return result
json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b):
    diffs = []

    def compare(x, y, path):
        if type(x) is not type(y):
            diffs.append(path)
            return
        if isinstance(x, dict):
            keys = set(x) | set(y)
            for k in sorted(keys):
                if k not in x:
                    diffs.append(path + "." + k)
                elif k not in y:
                    diffs.append(path + "." + k)
                else:
                    compare(x[k], y[k], path + "." + k)
        elif isinstance(x, list):
            if x != y:
                diffs.append(path)
        else:
            if x != y:
                diffs.append(path)

    compare(a, b, "")
    return sorted(diffs)
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    diffs = []

    def compare(x, y, path):
        if type(x) is not type(y):
            diffs.append(path)
            return
        if isinstance(x, dict):
            keys = set(x) | set(y)
            for k in sorted(keys):
                if k not in x:
                    diffs.append(path + "." + k)
                elif k not in y:
                    diffs.append(path + "." + k)
                else:
                    compare(x[k], y[k], path + "." + k)
        elif isinstance(x, list):
            if x != y:
                diffs.append(path)
        else:
            if x != y:
                diffs.append(path)

    compare(a, b, "")
    return sorted(diffs)
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    diffs = []

    def compare(x, y, path):
        if type(x) is not type(y):
            diffs.append(path)
            return
        if isinstance(x, dict):
            keys = set(x) | set(y)
            for k in sorted(keys):
                if k not in x:
                    diffs.append(path + "." + k)
                elif k not in y:
                    diffs.append(path + "." + k)
                else:
                    compare(x[k], y[k], path + "." + k)
        elif isinstance(x, list):
            if x != y:
                diffs.append(path)
        else:
            if x != y:
                diffs.append(path)

    compare(a, b, "")
    return sorted(diffs)

mistral-small-4 119B 66% overall↑ top

Served via llama.cpp CUDA · 43.1 tok/s · 1.3 GB RAM · coding total 83/126

Python — 22/24 (0.7 min / 1.8k tok)

is_valid_ipv4 — 1/3 passed
prompt sent to the model
Implement in Python 3: `def is_valid_ipv4(s):` Returns True if s is a dotted-quad IPv4 address: four decimal octets 0-255, no leading zeros unless the octet is exactly '0'. Otherwise False.
Reply with only a Python code block. No tests, no explanation.
trial 1 (temp 0.7) — fail — AssertionError
import re

def is_valid_ipv4(s):
    pattern = r'^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
    if re.match(pattern, s):
        return True
    return False
trial 2 (temp 0.7) — fail — AssertionError
import re

def is_valid_ipv4(s):
    pattern = r'^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$'
    if re.match(pattern, s):
        return True
    return False

Python (hard) — 3/9 (0.6 min / 1.4k tok)

topological_sort — 0/3 passed
prompt sent to the model
Implement in Python 3: `def topological_sort(deps):` deps maps each node (str) to a list of nodes it depends on. Returns a list of all nodes in an order where every node comes after its dependencies. Returns None if the graph has a cycle (including self-dependencies). Nodes mentioned only as dependencies are included.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError: ['app', 'lib', 'base']
def topological_sort(deps):
    visited = set()
    visiting = set()
    sorted_nodes = []

    def visit(node):
        if node in visiting:
            return False
        if node in visited:
            return True
        visiting.add(node)
        for dependency in deps.get(node, []):
            if not visit(dependency):
                return False
        visiting.remove(node)
        visited.add(node)
        sorted_nodes.append(node)
        return True

    for node in list(deps.keys()) + [d for deps_list in deps.values() for d in deps_list]:
        if node not in visited:
            if not visit(node):
                return None

    return sorted_nodes[::-1]
trial 1 (temp 0.7) — fail — AssertionError: ['app', 'lib', 'base']
def topological_sort(deps):
    visited = set()
    visiting = set()
    sorted_nodes = []

    def visit(node):
        if node in visiting:
            return False
        if node in visited:
            return True
        visiting.add(node)
        for dependency in deps.get(node, []):
            if not visit(dependency):
                return False
        visiting.remove(node)
        visited.add(node)
        sorted_nodes.append(node)
        return True

    for node in list(deps.keys()) + [d for deps_list in deps.values() for d in deps_list]:
        if node not in visited:
            if not visit(node):
                return None

    return sorted_nodes[::-1]
trial 2 (temp 0.7) — fail — AssertionError: ['app', 'lib', 'base']
def topological_sort(deps):
    visited = set()
    visiting = set()
    sorted_nodes = []

    def visit(node):
        if node in visiting:
            return False
        if node in visited:
            return True
        visiting.add(node)
        for dependency in deps.get(node, []):
            if not visit(dependency):
                return False
        visiting.remove(node)
        visited.add(node)
        sorted_nodes.append(node)
        return True

    for node in list(deps.keys()) + [d for deps_list in deps.values() for d in deps_list]:
        if node not in visited:
            if not visit(node):
                return None

    return sorted_nodes[::-1]
json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b, path=""):
    diffs = []
    if a == b:
        return diffs
    if isinstance(a, dict) and isinstance(b, dict):
        all_keys = set(a.keys()) | set(b.keys())
        for key in sorted(all_keys):
            new_path = f"{path}.{key}" if path else key
            if key not in a:
                diffs.append(f"{new_path} (missing in a)")
            elif key not in b:
                diffs.append(f"{new_path} (missing in b)")
            else:
                diffs.extend(json_diff(a[key], b[key], new_path))
    else:
        diffs.append(f"{path} (scalar/list difference)")
    return diffs
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b, path=""):
    diffs = []
    if a == b:
        return diffs
    if isinstance(a, dict) and isinstance(b, dict):
        all_keys = set(a.keys()) | set(b.keys())
        for key in sorted(all_keys):
            new_path = f"{path}.{key}" if path else key
            if key not in a:
                diffs.append(f"{new_path} (missing in a)")
            elif key not in b:
                diffs.append(f"{new_path} (missing in b)")
            else:
                diffs.extend(json_diff(a[key], b[key], new_path))
    else:
        diffs.append(path)
    return diffs
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b, path=""):
    diffs = []
    if a == b:
        return diffs
    if isinstance(a, dict) and isinstance(b, dict):
        all_keys = set(a.keys()) | set(b.keys())
        for key in sorted(all_keys):
            new_path = f"{path}.{key}" if path else key
            if key not in a:
                diffs.append(f"{new_path} (missing in a)")
            elif key not in b:
                diffs.append(f"{new_path} (missing in b)")
            else:
                diffs.extend(json_diff(a[key], b[key], new_path))
    else:
        diffs.append(path)
    return diffs

seed-oss 36b 64% overall↑ top

Served via llama.cpp CUDA · 9.1 tok/s · 8.8 GB RAM · coding total 81/126

Python — 24/24 (57.5 min / 31.5k tok)

No failures.

Python (hard) — 3/9 (57.9 min / 31.2k tok)

topological_sort — 0/3 passed
prompt sent to the model
Implement in Python 3: `def topological_sort(deps):` deps maps each node (str) to a list of nodes it depends on. Returns a list of all nodes in an order where every node comes after its dependencies. Returns None if the graph has a cycle (including self-dependencies). Nodes mentioned only as dependencies are included.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — truncated — hit the 4096-token cap
(no code extracted)
trial 1 (temp 0.7) — truncated — hit the 4096-token cap
(no code extracted)
trial 2 (temp 0.7) — truncated — hit the 4096-token cap
(no code extracted)
json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — truncated — hit the 4096-token cap
(no code extracted)
trial 1 (temp 0.7) — truncated — hit the 4096-token cap
(no code extracted)
trial 2 (temp 0.7) — truncated — hit the 4096-token cap
(no code extracted)

aya-23 35b 58% overall↑ top

Served via llama.cpp CUDA · 8.8 tok/s · 9.7 GB RAM · coding total 73/126

Python — 21/24 (3.4 min / 1.8k tok)

is_valid_ipv4 — 0/3 passed
prompt sent to the model
Implement in Python 3: `def is_valid_ipv4(s):` Returns True if s is a dotted-quad IPv4 address: four decimal octets 0-255, no leading zeros unless the octet is exactly '0'. Otherwise False.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — ValueError: invalid literal for int() with base 10: '1.2'
def is_valid_ipv4(s):
    if s.count('.') != 3:
        return False
    for i in range(4):
        octet = s[i * 3 : i * 3 + 3]
        if not octet[0] == '0' and int(octet) > 255:
            return False
        if octet[0] == '0' and int(octet) != 0:
            return False
    return True
trial 1 (temp 0.7) — fail — ValueError: invalid literal for int() with base 10: '1.2'
def is_valid_ipv4(s):
    if s.count('.') != 3:
        return False
    for i in range(4):
        octet = s[i * 3 : i * 3 + 3]
        if not octet[0] == '0' and int(octet) > 255:
            return False
        if octet[0] == '0' and int(octet) != 0:
            return False
    return True
trial 2 (temp 0.7) — fail — ValueError: invalid literal for int() with base 10: '1.2'
def is_valid_ipv4(s):
    if s.count('.') != 3:
        return False
    for i in range(4):
        octet = s[i * 3 : i * 3 + 3]
        if not octet[0] == '0' and int(octet) > 255:
            return False
        if octet[0] == '0' and int(octet) != 0:
            return False
    return True

Python (hard) — 3/9 (3.0 min / 1.6k tok)

topological_sort — 0/3 passed
prompt sent to the model
Implement in Python 3: `def topological_sort(deps):` deps maps each node (str) to a list of nodes it depends on. Returns a list of all nodes in an order where every node comes after its dependencies. Returns None if the graph has a cycle (including self-dependencies). Nodes mentioned only as dependencies are included.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def topological_sort(deps):
    # Create a set of all nodes
    all_nodes = set(deps.keys())
    # Create a set to keep track of visited nodes
    visited = set()
    # Create a list to store the topological order
    order = []

    def visit(node):
        if node in visited:
            return
        visited.add(node)
        for neighbour in deps.get(node, []):
            visit(neighbour)
        order.append(node)

    # Visit all nodes
    for node in all_nodes:
        visit(node)

    # If all nodes were visited, return the order
    if len(order) == len(all_nodes):
        return order
    else:
        return None
trial 1 (temp 0.7) — fail — AssertionError
def topological_sort(deps):
    # Create a set of all nodes
    all_nodes = set(deps.keys())
    # Create a set to keep track of visited nodes
    visited = set()
    # Create a list to store the topological order
    order = []

    def visit(node):
        if node in visited:
            return
        visited.add(node)
        for neighbour in deps.get(node, []):
            visit(neighbour)
        order.append(node)

    # Visit all nodes
    for node in all_nodes:
        visit(node)

    # If all nodes were visited, return the order
    if len(order) == len(all_nodes):
        return order
    else:
        return None
trial 2 (temp 0.7) — fail — AssertionError
def topological_sort(deps):
    # Create a set of all nodes
    all_nodes = set(deps.keys())
    # Create a set to keep track of visited nodes
    visited = set()
    # Create a list to store the topological order
    order = []

    def visit(node):
        if node in visited:
            return
        visited.add(node)
        for neighbour in deps.get(node, []):
            visit(neighbour)
        order.append(node)

    # Visit all nodes
    for node in all_nodes:
        visit(node)

    # If all nodes were visited, return the order
    if len(order) == len(all_nodes):
        return order
    else:
        return None
json_diff — 0/3 passed
prompt sent to the model
Implement in Python 3: `def json_diff(a, b):` Compares two JSON-like structures (dicts, lists, scalars). Returns a sorted list of dotted key paths where they differ: changed scalar/list values, keys present in only one side. Dicts are recursed into; lists and scalars are compared as whole values. Empty list means identical.
Reply with only a Python code block. No tests, no explanation.
trial 0 (temp 0) — fail — AssertionError
def json_diff(a, b):
    def diff_path(path, a, b):
        if isinstance(a, dict) and isinstance(b, dict):
            return [
                f"{path}.{k}"
                for k in set(a.keys()) ^ set(b.keys())
                for subpath in diff_path(f"{path}.{k}", a[k], b.get(k, {}))
            ]
        elif isinstance(a, list) and isinstance(b, list):
            return [
                path
                for i in range(max(len(a), len(b)))
                for subpath in diff_path(f"{path}[i]", a[i] if i < len(a) else None, b[i])
            ]
        elif a != b:
            return [path]
        else:
            return []

    return diff_path("", a, b)
trial 1 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def diff_path(path, a, b):
        if isinstance(a, dict) and isinstance(b, dict):
            return [
                f"{path}.{k}"
                for k in set(a.keys()) ^ set(b.keys())
                for subpath in diff_path(f"{path}.{k}", a[k], b.get(k, {}))
            ]
        elif isinstance(a, list) and isinstance(b, list):
            return [
                path
                for i in range(max(len(a), len(b)))
                for subpath in diff_path(f"{path}[i]", a[i] if i < len(a) else None, b[i])
            ]
        elif a != b:
            return [path]
        else:
            return []

    return diff_path("", a, b)
trial 2 (temp 0.7) — fail — AssertionError
def json_diff(a, b):
    def diff_path(path, a, b):
        if isinstance(a, dict) and isinstance(b, dict):
            return [
                f"{path}.{k}"
                for k in set(a.keys()) ^ set(b.keys())
                for subpath in diff_path(f"{path}.{k}", a[k], b.get(k, {}))
            ]
        elif isinstance(a, list) and isinstance(b, list):
            return [
                path
                for i in range(max(len(a), len(b)))
                for subpath in diff_path(f"{path}[i]", a[i] if i < len(a) else None, b[i])
            ]
        elif a != b:
            return [path]
        else:
            return []

    return diff_path("", a, b)