SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.12925 · NeurIPS · 2025

CPRet: A Dataset, Benchmark, and Model for Retrieval in Competitive Programming

Wanli Ouyang, Xinzhu Ma, Yuan Meng, Shixiang Tang, Han Deng

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 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 9 have no contract verdict; 0 failures of our instrument; 2 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/2505.12925.json · badge: /api/ran/2505.12925.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
unclecode/crawl4ai canonical (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
lexiforest/curl_cffi canonical (classifier label)
classifier basis not recorded on the link
4 ran · 0 no recorded run
FunctionStatusWhere it lives
bytes_to_hex Ran
ran on a synthesized input
lexiforest/curl_cffi/curl_cffi/curl.py
code served (permissive licence) · get_code("9669a50ca25cddf8")
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

# bytes_to_hex takes two parameters:
# 1. b: bytes - a bytes object to convert
# 2. uppercase: bool - whether to use uppercase hex letters (default False)

# The function iterates through each byte and formats it as hex
# We need to provide valid arguments

b_example = bytes([10, 255, 60, 127, 0, 1])
uppercase_example = False

ARGS = {
    'b': b_example,
    'uppercase': uppercase_example
}
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 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
calculate_batch_size Ran
ran on a synthesized input
unclecode/crawl4ai/crawl4ai/model_loader.py
code served (permissive licence) · get_code("99a7758c99fcc47d")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

# The function calculate_batch_size takes a 'device' parameter
# and uses device.type to determine batch size
# We need to create a device object that has a 'type' attribute

# Create a CPU device
device = torch.device('cpu')

# ARGS dict mapping all parameters of calculate_batch_size
ARGS = {
    'device': device
}
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 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
determine_print_spec Ran
ran on a synthesized input
lexiforest/curl_cffi/curl_cffi/cli/output.py
code served (permissive licence) · get_code("8cac0a862bf83a39")
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 argparse
import sys

# Create a mock stdout that simulates a TTY
class MockStdout:
    def isatty(self):
        return False

# Store original stdout
original_stdout = sys.stdout

ARGS = {
    'args': argparse.Namespace(
        print_spec=None,
        quiet=False,
        verbose=False,
        headers_only=False,
        body_only=False,
        download=False
    )
}
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 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
get_available_memory Ran
ran on a synthesized input
unclecode/crawl4ai/crawl4ai/model_loader.py
code served (permissive licence) · get_code("5c8d701fb3651833")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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

torch.manual_seed(0)

# The function expects a device object with a .type attribute
# We'll create a simple CPU device object
cpu_device = torch.device('cpu')

ARGS = {
    'device': cpu_device
}
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 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
is_blocked Ran
ran on a synthesized input
unclecode/crawl4ai/crawl4ai/antibot_detector.py
code served (permissive licence) · get_code("4c469c8cc18a0a56")
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 re
from typing import Optional, Tuple

# Minimal setup - the function only takes 3 parameters
ARGS = {
    "status_code": 200,
    "html": "<html><body><h1>Welcome</h1><p>This is a normal page with content.</p></body></html>",
    "error_message": None
}
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, 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
is_empty_value Ran
ran on a synthesized input
unclecode/crawl4ai/crawl4ai/async_configs.py
code served (permissive licence) · get_code("a035ccc8ea9189ee")
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 torch
import numpy as np

torch.manual_seed(0)

# The function is_empty_value checks if a value is effectively empty/null
# It takes one parameter: value (Any type)
# The function tests:
# - if value is None
# - if value is a list, tuple, set, dict, or str with length 0
# - returns False otherwise

# We need to provide a test value that exercises the function
# Since the function only takes one parameter, we'll use None as the test case

ARGS = {
    "value": 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 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_request_items Ran
ran on a synthesized input
lexiforest/curl_cffi/curl_cffi/cli/parse.py
code served (permissive licence) · get_code("6b0c83ffd8abd55c")
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 ParsedItems. 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 json
import sys
from dataclasses import dataclass, field

@dataclass
class ParsedItems:
    headers: dict[str, str] = field(default_factory=dict)
    headers_to_remove: list[str] = field(default_factory=list)
    query_params: list[tuple[str, str]] = field(default_factory=list)
    data_fields: list[tuple[str, str]] = field(default_factory=list)
    json_fields: list[tuple[str, object]] = field(default_factory=list)
    files: list[tuple[str, str]] = field(default_factory=list)
    cookies: dict[str, str] = field(default_factory=dict)

def parse_request_items(items: list[str]) -> ParsedItems:
    """Parse request items into structured data."""
    result = ParsedItems()
    for item in items:
        if item.startswith('+') and '=' in item[1:]:
            key, _, value = item[1:].partition('=')
            result.cookies[key] = value
        elif ':=' in item:
            key, _, value = item.partition(':=')
            try:
                result.json_fields.append((key, json.loads(value)))
            except json.JSONDecodeError as exc:
                print(f"Error: invalid JSON in '{item}': {exc}", file=sys.stderr)
                sys.exit(1)
        elif '==' in item:
            key, _, value = item.partition('==')
            result.query_params.append((key, value))
        elif '=' in item:
            key, _, value = item.partition('=')
            result.data_fields.append((key, value))
        elif item.startswith('@'):
            filepath = item[1:]
            result.files.append(('file', filepath))
        elif ':' in item:
            key, _, value = item.partition(':')
            if value:
                result.headers[key] = value
            else:
                result.headers_to_remove.append(key)
        else:
            print(f"Error: unknown request item '{item}'", file=sys.stderr)
            sys.exit(1)
    return result

# Setup valid test cases for parse_request_items
test_items = [
    'Content-Type:application/json',
    'Authorization:Bearer token123',
    'X-Custom:',
    'name=John',
    'age=30',
    'search==query',
    'filter==active',
    'data:={"key":"value"}',
    'nested:={"a":1,"b":[2,3]}',
    '+session=abc123',
    '+user=testuser',
    '@/path/to/file.txt',
]

ARGS = {
    'items': test_items
}
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 ParsedItems — a ParsedItems output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ParsedItems 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_url Ran
ran on a synthesized input
lexiforest/curl_cffi/curl_cffi/cli/parse.py
code served (permissive licence) · get_code("9092bccbef30f7b3")
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

# process_url takes a single parameter: url (str)
# The function normalizes URLs by:
# 1. Converting localhost shortcuts (starting with ':')
# 2. Adding default schemes ('http' or 'https') if missing
# 3. Returning the URL as-is if it already has a scheme

ARGS = {
    'url': 'example.com:8080'
}
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 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
set_model_device Ran
ran on a synthesized input
unclecode/crawl4ai/crawl4ai/model_loader.py
code served (permissive licence) · get_code("2ec152ff8b3aa899")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 torch.nn as nn

torch.manual_seed(0)

class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = SimpleModel()

ARGS = {
    'model': model
}
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 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
from_serializable_dict Not yet run
unverified (harvested, no recorded run)
unclecode/crawl4ai/crawl4ai/async_configs.py
code served (permissive licence) · get_code("500a790da96ce931")
How it ran

no invocation recorded.

to_serializable_dict Not yet run
unverified (harvested, no recorded run)
unclecode/crawl4ai/crawl4ai/async_configs.py
code served (permissive licence) · get_code("fb6814e51f39f7ea")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 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.

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

Competive programming benchmarks are widely used in scenarios such as programming contests and large language model assessments. However, the growing presence of duplicate or highly similar problems raises concerns not only about competition fairness, but also about the validity of competitive programming as a benchmark for model evaluation. In this paper, we propose a new problem-similar question retrieval-to tackle the problem. Due to the lack of both data and models, solving this problem is challenging. To this end, we introduce CPRet, a retrievaloriented benchmark suite for competitive programming, covering four retrieval tasks: two code-centric (i.e., Text-to-Code, Code-to-Code) and two newly proposed problem-centric tasks (i.e., Problem-to-Duplicate, Simplified-to-Full)-built from a combination of automatically crawled problem-solution data and manually curated annotations. Our contribution includes both high-quality training data and temporally separated test sets for reliable evaluation. Besides, we further develop two task-specialized retrievers based on this dataset: CPRetriever-Code, trained with a novel Group-InfoNCE loss for problem-code alignment, and CPRetriever-Prob, fine-tuned for indentifying problem-level similarity. Both models achieve strong results and are open-sourced for local use. Finally, we analyze LiveCodeBench and find that high-similarity problems inflate model pass rates and reduce differentiation, underscoring the need for similarity-aware evaluation in future benchmarks.

For agents

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

get_harvested_code_for_paper("2505.12925")
get_code_for_paper("2505.12925")
have("2505.12925")

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

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

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

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

Connect an agent — have() is free.