SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.01007 · ICLR · 2025

CoRNStack: High-Quality Contrastive Data for Better Code Retrieval and Reranking

Zach Nussbaum, Heng Ji, Tarun Suresh, Lapis Labs, Revanth Reddy, Yifei Xu, Andriy Mulyar, Brandon Duderstadt

arXiv · PDF · Open in the Atlas

Code that ran

12 of 14 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, 1 violated it and 0 have no contract verdict; 11 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2412.01007.json · badge: /api/ran/2412.01007.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
gangiswag/cornstack canonical (classifier label)
classifier basis: census
12 ran · 2 no recorded run
FunctionStatusWhere it lives
convert_nl2code_examples_to_features Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/create/utils.py
code served (permissive licence) · get_code("c69d01c2084ebd2a")
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 tuple, 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

torch.manual_seed(0)

# Construct a valid argument for the function
js_example = {
    'code_tokens': ['def', 'hello', 'world', ':', 'pass'],
    'docstring_tokens': ['This', 'is', 'a', 'function'],
    'url': 'https://example.com/code'
}

ARGS = {
    'js': js_example,
    'prefix': None
}
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 tuple, ndim 1, dtype family float — a tuple 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
convert_solutions_dict Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/evaluations/eval_localization.py
code served (permissive licence) · get_code("6f9605ad563fe8e2")
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

torch.manual_seed(0)

# Construct a dataset that contains dicts with 'instance_id' and 'model_patch' keys
dataset = [
    {
        'instance_id': 'instance_001',
        'model_patch': 'patch_data_1'
    },
    {
        'instance_id': 'instance_002',
        'model_patch': 'patch_data_2'
    },
    {
        'instance_id': 'instance_003',
        'model_patch': 'patch_data_3'
    }
]

ARGS = {
    'dataset': dataset,
    'key': 'model_patch'
}
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
create_structure Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/get_repo_structure/get_repo_structure.py
code served (permissive licence) · get_code("f1736b2867021430")
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 tempfile
import os

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()

# Create a simple Python file with classes and functions
py_file_content = '''
class MyClass:
    def method_one(self):
        pass
    
    def method_two(self):
        return 42

class AnotherClass:
    def __init__(self):
        self.value = 10

def standalone_function():
    return "hello"

def another_function(x, y):
    return x + y
'''

# Write the test Python file to the temporary directory
test_file_path = os.path.join(temp_dir, "test_module.py")
with open(test_file_path, 'w') as f:
    f.write(py_file_content)

# Create a subdirectory with another Python file
subdir = os.path.join(temp_dir, "subpackage")
os.makedirs(subdir, exist_ok=True)

subdir_file_content = '''
class SubClass:
    def sub_method(self):
        pass

def sub_function():
    return "sub"
'''

subdir_file_path = os.path.join(subdir, "sub_module.py")
with open(subdir_file_path, 'w') as f:
    f.write(subdir_file_content)

# Create a non-Python file to test that it's handled
non_py_file = os.path.join(temp_dir, "README.txt")
with open(non_py_file, 'w') as f:
    f.write("This is a readme file")

ARGS = {
    "directory_path": temp_dir
}
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
evaluate_results Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/rerank.py
code served (permissive licence) · get_code("f86d9af6bb4990db")
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 os
import json
import tempfile

# Create temporary directory for evaluation
temp_dir = tempfile.mkdtemp()

# Create a qrels file (ground truth relevance judgments)
qrels_path = os.path.join(temp_dir, 'qrels.txt')
with open(qrels_path, 'w') as f:
    f.write("query-id\tdocid\tscore\n")
    f.write("q1\tdoc1\t1\n")
    f.write("q1\tdoc2\t0\n")
    f.write("q1\tdoc3\t1\n")
    f.write("q2\tdoc4\t1\n")
    f.write("q2\tdoc5\t0\n")

# Create a results file (ranked results from reranking)
results_path = os.path.join(temp_dir, 'results.json')
results = {
    "q1": {
        "doc1": 0.9,
        "doc2": 0.8,
        "doc3": 0.7,
        "doc4": 0.6,
        "doc5": 0.5
    },
    "q2": {
        "doc4": 0.95,
        "doc1": 0.85,
        "doc2": 0.75,
        "doc3": 0.65
    }
}
with open(results_path, 'w') as f:
    json.dump(results, f)

ARGS = {
    'eval_dir': temp_dir,
    'dataset_name': 'test_dataset',
    'qrels_path': qrels_path,
    'results_path': results_path
}
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
get_project_structure_from_scratch Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/get_repo_structure/get_repo_structure.py
code served (permissive licence) · get_code("f39c013c44ae666e")
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 os
import tempfile
import shutil

# Create a temporary directory structure for testing
temp_dir = tempfile.mkdtemp()
repo_playground = temp_dir

# Create a mock repository structure
repo_name = 'django/django'
commit_id = 'abc1234567890def'
instance_id = 'test_instance_001'

# Create the nested directory structure that would exist after cloning
top_folder = 'django'
repo_path = os.path.join(repo_playground, top_folder)
os.makedirs(repo_path, exist_ok=True)

# Create some Python files in the mock repository
test_file_path = os.path.join(repo_path, 'test_module.py')
with open(test_file_path, 'w') as f:
    f.write("""
class TestClass:
    def method_one(self):
        pass
    
    def method_two(self):
        return 42

def standalone_function():
    return "hello"
""")

# Create a subdirectory with another Python file
subdir = os.path.join(repo_path, 'submodule')
os.makedirs(subdir, exist_ok=True)
subfile_path = os.path.join(subdir, 'utils.py')
with open(subfile_path, 'w') as f:
    f.write("""
class UtilityClass:
    def utility_method(self):
        pass

def helper_function(x):
    return x * 2
""")

# Initialize a git repository (minimal setup)
try:
    import subprocess
    subprocess.run(['git', 'init'], cwd=repo_path, check=True, capture_output=True)
    subprocess.run(['git', 'config', 'user.email', 'test@test.com'], cwd=repo_path, check=True, capture_output=True)
    subprocess.run(['git', 'config', 'user.name', 'Test User'], cwd=repo_path, check=True, capture_output=True)
    subprocess.run(['git', 'add', '.'], cwd=repo_path, check=True, capture_output=True)
    subprocess.run(['git', 'commit', '-m', 'initial'], cwd=repo_path, check=True, capture_output=True)
except:
    pass

ARGS = {
    'repo_name': 'django/django',
    'commit_id': 'HEAD',
    'instance_id': 'test_instance_001',
    'repo_playground': repo_playground
}
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
ingest_files Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/create/swebench.py
code served (permissive licence) · get_code("2b0d2c14b7cc8d61")
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 tempfile
import os

# Create temporary files with test content
temp_dir = tempfile.mkdtemp()
test_files = []

# Create a few test files with different content
file1_path = os.path.join(temp_dir, "file1.txt")
with open(file1_path, "w") as f:
    f.write("This is the content of file 1")
test_files.append(file1_path)

file2_path = os.path.join(temp_dir, "file2.txt")
with open(file2_path, "w") as f:
    f.write("This is the content of file 2")
test_files.append(file2_path)

file3_path = os.path.join(temp_dir, "file3.txt")
with open(file3_path, "w") as f:
    f.write("This is the content of file 3")
test_files.append(file3_path)

ARGS = {
    "filenames": test_files
}
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
is_test Ran
ran, violated the contract we drafted
gangiswag/cornstack/src/create/swebench.py
code served (permissive licence) · get_code("066de324a66b8e18")
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 bool, ndim 0, dtype family float, 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 re

def is_test(name, test_phrases=None):
    if test_phrases is None:
        test_phrases = ['test', 'tests', 'testing']
    words = set(re.split(' |_|\\/|\\.', name.lower()))
    return any((word in words for word in test_phrases))

# Setup code
ARGS = {
    'name': 'my_test_module',
    'test_phrases': ['test', 'tests', 'testing']
}
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 bool, ndim 0, dtype family float, 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
parse_patch Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/get_repo_structure/get_patch_info.py
code served (permissive licence) · get_code("f2c4e9391d254c7e")
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 re

def parse_patch(patch):
    """
    Parse a git patch into a structured format.

    Parameters:
        patch (str): The git patch as a string.

    Returns:
        list: A list of dictionaries representing the file changes and hunks.
    """
    file_changes = []
    current_file = None
    current_hunk = None
    deleted_lines = 0
    patch_lines = patch.split('\n')
    for line in patch_lines:
        if line.startswith('diff --git'):
            if current_file:
                file_changes.append(current_file)
            current_file = {'file': '', 'hunks': []}
        elif line.startswith('--- a/'):
            pass
        elif line.startswith('+++ b/'):
            if current_file is not None:
                current_file['file'] = line[6:]
        elif line.startswith('@@ '):
            if current_file is not None:
                match = re.match('@@ -(\\d+)(?:,\\d+)? \\+(\\d+)(?:,\\d+)? @@', line)
                if match:
                    current_hunk = {'start_line': int(match.group(2)), 'changes': []}
                    current_file['hunks'].append(current_hunk)
                    deleted_lines = 0
                    added_lines = 0
        elif line.startswith('+') or line.startswith('-'):
            if current_hunk is not None:
                change_type = 'add' if line.startswith('+') else 'delete'
                if change_type == 'delete':
                    deleted_lines += 1
                    current_hunk['changes'].append({'type': change_type, 'content': line[1:].strip(), 'line': current_hunk['start_line'] - added_lines})
                    current_hunk['start_line'] += 1
                else:
                    added_lines += 1
                    current_hunk['changes'].append({'type': change_type, 'content': line[1:].strip(), 'line': current_hunk['start_line'] - deleted_lines})
                    current_hunk['start_line'] += 1
        elif current_hunk is not None:
            current_hunk['start_line'] += 1
    if current_file:
        file_changes.append(current_file)
    return file_changes


patch_content = """diff --git a/file1.py b/file1.py
--- a/file1.py
+++ b/file1.py
@@ -1,3 +1,4 @@
 def hello():
-    print("old")
+    print("new")
+    return True
@@ -10,2 +11,3 @@
-    x = 1
+    x = 2
+    y = 3
"""

ARGS = {
    'patch': patch_content
}
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
parse_python_file Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/get_repo_structure/get_repo_structure.py
code served (permissive licence) · get_code("94dc3cbe589f0afa")
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 tuple. 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 tempfile
import os

# Create a valid Python file content to parse
sample_python_code = '''
class MyClass:
    def __init__(self):
        self.value = 42
    
    def method_one(self):
        return self.value
    
    def method_two(self, x):
        return x * 2

def standalone_function():
    return "hello"

def another_function(a, b):
    return a + b
'''

# We can pass file_content directly to avoid file I/O
file_path = "dummy_file.py"
file_content = sample_python_code

ARGS = {
    "file_path": file_path,
    "file_content": file_content
}
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 tuple — a tuple output has no array shape of its own; none is 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
patch_to_dict Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/get_repo_structure/get_patch_info.py
code served (permissive licence) · get_code("57f9d3d6cb7bc783")
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.

# Analyze the function to understand what it expects
# patch_to_dict takes a patch_string parameter which should be a string
# containing patch content with diff markers and hunk markers (@@)

# Construct a minimal valid patch string
patch_string = """diff --git a/file1.py b/file1.py
--- a/file1.py
+++ b/file1.py
@@ -1,3 +1,4 @@
 def hello():
     print("world")
+    print("added line")
@@ -10,2 +11,3 @@
 def goodbye():
     print("farewell")
+    print("extra")
diff --git a/file2.txt b/file2.txt
--- a/file2.txt
+++ b/file2.txt
@@ -5,1 +5,2 @@
 some content
+new content
"""

ARGS = {
    "patch_string": patch_string
}
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
read_jsonl Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/evaluations/eval_localization.py
code served (permissive licence) · get_code("a4312a4596349487")
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 json
import tempfile
import os

# Create a temporary JSONL file with valid data
temp_dir = tempfile.mkdtemp()
filepath = os.path.join(temp_dir, "test_data.jsonl")

# Write some test JSONL data
with open(filepath, 'w') as f:
    f.write(json.dumps({"id": 1, "text": "hello"}) + "\n")
    f.write(json.dumps({"id": 2, "text": "world"}) + "\n")
    f.write(json.dumps({"id": 3, "value": 42}) + "\n")

ARGS = {
    "filepath": filepath
}
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
split_github_patch Ran
ran; our contract draft was wrong, not the code
gangiswag/cornstack/src/get_repo_structure/get_patch_info.py
code served (permissive licence) · get_code("d276dddd6eaf20be")
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 re

def split_github_patch(patch_string):
    pattern = '@@ -(\\d+)(?:,\\d+)? \\+(\\d+)(?:,\\d+)? @@ '
    split_patches = re.split(pattern, patch_string)
    split_patches = [patch.strip() for patch in split_patches if patch.strip()]
    return split_patches

# Construct valid arguments
patch_string = """@@ -10,5 +10,6 @@
 def hello():
     print("world")
+    return True
 
@@ -20,3 +21,4 @@
 def goodbye():
     pass
+    # bye"""

ARGS = {
    "patch_string": patch_string
}
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
get_top_docs Not yet run
unverified (harvested, no recorded run)
gangiswag/cornstack/src/evaluations/eval_swebench.py
code served (permissive licence) · get_code("04d54a12d25d3ae7")
How it ran

no invocation recorded.

topk_accuracy Not yet run
unverified (harvested, no recorded run)
gangiswag/cornstack/src/evaluations/eval_localization.py
code served (permissive licence) · get_code("323b01ced4cb3d3f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 2 later) and 11 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.

FunctionAlso present inEarliest-datedOthers named
parse_python_file 2 other papers
1 dated earlier, 1 later
2410.14684 (2024-10)
RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graph
2502.19811 (2025-02)
Comet: Fine-grained Computation-communication Overlapping for Mixture-of-Experts
create_structure 1 other paper
1 dated earlier
2410.14684 (2024-10)
RepoGraph: Enhancing AI Software Engineering with Repository-level Code Graph
parse_patch 1 other paper
1 later
2502.19811 (2025-02)
Comet: Fine-grained Computation-communication Overlapping for Mixture-of-Experts

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-22.

Repositories linked to this paper

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

Abstract

Effective code retrieval plays a crucial role in advancing code generation, bug fixing, and software maintenance, particularly as software systems increase in complexity. While current code embedding models have demonstrated promise in retrieving code snippets for small-scale, well-defined tasks, they often underperform in more demanding real-world applications such as bug localization within GitHub repositories. We hypothesize that a key issue is their reliance on noisy and inconsistent datasets for training, which impedes their ability to generalize to more complex retrieval scenarios. To address these limitations, we introduce CORNSTACK 1 , a large-scale, high-quality contrastive training dataset for code that spans multiple programming languages. This dataset is curated using consistency filtering to eliminate noisy positives and is further enriched with mined hard negatives, thereby facilitating more effective learning. We demonstrate that contrastive training of embedding models using CORNSTACK leads to state-of-theart performance across a variety of code retrieval tasks. Furthermore, the dataset can be leveraged for training code reranking models, a largely underexplored area compared to text reranking. Our finetuned code reranking model significantly improves the ranking quality over the retrieved results. Finally, by employing our code retriever and reranker together, we demonstrate significant improvements in function localization for GitHub issues, an important component of real-world software development.

For agents

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

get_harvested_code_for_paper("2412.01007")
get_code_for_paper("2412.01007")
have("2412.01007")

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

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

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

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

Connect an agent — have() is free.