SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2410.01215 · 2024

From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debugging

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 7 failures of our instrument; 1 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2410.01215.json · badge: /api/ran/2410.01215.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
YerbaPage/MGDebugger canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
create_dependency_graph Ran
ran; our contract draft was wrong, not the code
YerbaPage/MGDebugger/src/utils.py
code served (permissive licence) · get_code("e037404ea645cd8f")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import ast
from loguru import logger

# Create test functions with various dependency patterns
functions = {
    "func_a": """
def func_a():
    x = 1
    return x
""",
    "func_b": """
def func_b():
    result = func_a()
    return result + 1
""",
    "func_c": """
def func_c():
    val1 = func_a()
    val2 = func_b()
    return val1 + val2
""",
    "func_d": """
def func_d():
    x = 5
    return x
""",
    "func_e": """
def func_e():
    return func_c() + func_d()
""",
    "func_f": """
def func_f():
    independent = 10
    return independent
"""
}

ARGS = {
    "functions": functions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
function_with_timeout Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
YerbaPage/MGDebugger/src/timeout_utils.py
code served (permissive licence) · get_code("bcdb4977bf68667c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
from threading import Thread
from loguru import logger

torch.manual_seed(0)

# Define a simple function to pass as `func`
def simple_computation(x):
    """A simple function that takes an argument and returns a result"""
    result = x * 2 + 1
    return result

# Define arguments for function_with_timeout
ARGS = {
    'func': simple_computation,
    'args': (42,),
    'timeout': 5,
    'max_memory': 100 * 1024 * 1024
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_parameter_names Ran
ran on a synthesized input
YerbaPage/MGDebugger/src/testcase_utils.py
code served (permissive licence) · get_code("c85ba1046609f5b4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import ast
from typing import List, Dict, Any

# Create a valid prompt containing a function definition
prompt = '''
def example_function(x: int, y: str, z: float = 3.14) -> str:
    """Example function for testing parameter extraction."""
    return f"{x}, {y}, {z}"
'''

# The entry point is the function name we want to extract parameters from
entry_point = "example_function"

ARGS = {
    "prompt": prompt,
    "entry_point": entry_point,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
merge_changes_to_parents Ran
ran; our contract draft was wrong, not the code
YerbaPage/MGDebugger/src/utils.py
code served (permissive licence) · get_code("dbf7462bc9cefeaf")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
from loguru import logger

# Set seed for reproducibility
torch.manual_seed(0)

# Construct arguments for merge_changes_to_parents
func_name = "calculate_sum"

dependency_graph = {
    "process_data": ["calculate_sum", "validate_input"],
    "aggregate_results": ["calculate_sum"],
    "main_pipeline": ["process_data", "aggregate_results"]
}

functions = {
    "calculate_sum": "def calculate_sum(x, y):\n    return x + y",
    "validate_input": "def validate_input(data):\n    return len(data) > 0",
    "process_data": "def process_data(arr):\n    result = calculate_sum(arr[0], arr[1])\n    valid = validate_input(arr)\n    return result",
    "aggregate_results": "def aggregate_results(results):\n    total = calculate_sum(results[0], results[1])\n    return total",
    "main_pipeline": "def main_pipeline(data):\n    processed = process_data(data)\n    aggregated = aggregate_results(processed)\n    return aggregated"
}

ARGS = {
    "func_name": func_name,
    "dependency_graph": dependency_graph,
    "functions": functions
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
loguru, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
parse_tests Ran
ran; our contract draft was wrong, not the code
YerbaPage/MGDebugger/src/testcase_utils.py
code served (permissive licence) · get_code("2c7d6590d386f8d9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import ast
import re
from typing import List, Dict, Any

# Simple test string with assert statements
test_string = """
def candidate(x, y):
    return x + y

assert candidate(1, 2) == 3
assert candidate(5, 10) == 15
"""

parameter_names = ["x", "y"]
entry_point = "candidate"

ARGS = {
    "test": test_string,
    "parameter_names": parameter_names,
    "entry_point": entry_point
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
process_assert Ran
ran; our contract draft was wrong, not the code
YerbaPage/MGDebugger/src/testcase_utils.py
code served (permissive licence) · get_code("4880ae3be078f0c3")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import ast

# Define a small stand-in for parameter_names
parameter_names = ['x', 'y', 'z']

# Create sample ast.expr objects by parsing Python code
code_samples = [
    "42",
    "[1, 2, 3]",
    "{'key': 'value'}"
]

# Parse these into ast.expr nodes
args = []
for code in code_samples:
    parsed = ast.parse(code, mode='eval')
    args.append(parsed.body)

# Create a sample Assert node
# assert candidate(42, [1, 2, 3]) == 100
call_node = ast.Call(
    func=ast.Name(id='candidate', ctx=ast.Load()),
    args=[ast.Constant(value=42), ast.List(elts=[ast.Constant(value=1), ast.Constant(value=2), ast.Constant(value=3)], ctx=ast.Load())],
    keywords=[]
)

compare_node = ast.Compare(
    left=call_node,
    ops=[ast.Eq()],
    comparators=[ast.Constant(value=100)]
)

assert_node = ast.Assert(test=compare_node, msg=None)

# Define entry_point
entry_point = 'candidate'

# Build ARGS dictionary
ARGS = {
    'node': assert_node,
    'entry_point': entry_point,
    'parameter_names': parameter_names
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
set_memory_limit Ran
ran; our contract draft was wrong, not the code
YerbaPage/MGDebugger/src/timeout_utils.py
code served (permissive licence) · get_code("efd6500fc32bf1eb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import resource

def set_memory_limit(max_memory):
    def limit_memory():
        resource.setrlimit(resource.RLIMIT_AS, (max_memory, max_memory))
    return limit_memory

# max_memory should be an integer representing bytes
# A reasonable value is something like 512MB = 512 * 1024 * 1024
max_memory_bytes = 512 * 1024 * 1024

ARGS = {
    "max_memory": max_memory_bytes
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
topological_sort Ran
ran; our contract draft was wrong, not the code
YerbaPage/MGDebugger/src/utils.py
code served (permissive licence) · get_code("a37aeb14211cb8a6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# The topological_sort function takes a graph parameter
# It expects graph to be a dict-like object where:
# - Keys are nodes
# - Values are iterables of neighbors (adjacent nodes)
# - It iterates over graph with `for node in graph`
# - It accesses graph[node] to get neighbors
# - It checks membership with `in` operator

# Create a simple directed acyclic graph (DAG)
graph = {
    'A': ['B', 'C'],
    'B': ['D'],
    'C': ['D'],
    'D': [],
    'E': ['A']
}

ARGS = {
    'graph': graph
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_completion_with_retry Not yet run
unverified (harvested, no recorded run)
YerbaPage/MGDebugger/baseline/common.py
code served (permissive licence) · get_code("9a0e376a4327ffd4")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

While large language models have made significant strides in code generation, the pass rate of the generated code is bottlenecked on subtle errors, often requiring human intervention to pass tests, especially for complex problems. Existing LLM-based debugging systems treat generated programs as monolithic units, failing to address bugs at multiple levels of granularity, from low-level syntax errors to high-level algorithmic flaws. In this paper, we introduce Multi-Granularity Debugger (MGDebugger), a hierarchical code debugger by isolating, identifying, and resolving bugs at various levels of granularity. MGDebugger decomposes problematic code into a hierarchical tree structure of subfunctions, with each level representing a particular granularity of error. During debugging, it analyzes each subfunction and iteratively resolves bugs in a bottom-up manner. To effectively test each subfunction, we propose an LLM-simulated Python executor, which traces code execution and tracks important variable states to pinpoint errors accurately. Extensive experiments demonstrate that MGDebugger outperforms existing debugging systems, achieving an 18.9% improvement in accuracy over seed generations in HumanEval and a 97.6% repair success rate in HumanEvalFix. Furthermore, MGDebugger effectively fixes bugs across different categories and difficulty levels, demonstrating its robustness and effectiveness.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2410.01215")
get_code_for_paper("2410.01215")
have("2410.01215")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2410.01215.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2410.01215.svg)](https://syntology.ai/paper/2410.01215)

Connect an agent — have() is free.