SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.18242 · 2026

ClosureBench: Compositional Graph Reasoning ClosureBench: A Constructive Benchmark for Compositional Graph Reasoning

Stefano Goria

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2608.18242.json · badge: /api/ran/2608.18242.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
egolabs-ai/closurebench canonical (classifier label)
classifier basis: census
5 ran · 3 no recorded run
FunctionStatusWhere it lives
negative_reach Ran
ran; our contract draft was wrong, not the code
egolabs-ai/closurebench/src/closurebench/ground_truth.py
code served (permissive licence) · get_code("f424144040294d1e")
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 set. 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 networkx as nx

# Create a simple directed graph for testing
G = nx.DiGraph()

# Add nodes
G.add_nodes_from([0, 1, 2, 3, 4, 5])

# Add edges to create reachability structure
# From node 0: can reach 1, 2
# From node 1: can reach 3
# From node 2: can reach 4
# Nodes 4 and 5 have no outgoing edges
G.add_edges_from([
    (0, 1),
    (0, 2),
    (1, 3),
    (2, 4),
    (3, 4),
])

source = 0

ARGS = {
    "G": G,
    "source": source,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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_vector Ran
ran, honoured the contract we drafted
egolabs-ai/closurebench/src/closurebench/ein_runner.py
code served (permissive licence) · get_code("b01e2281dc22c58d")
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 _clean_output(output: str) -> list[str]:
    """Strip Ein metadata lines (Executed, Forward chaining, Tensors block)."""
    lines = output.strip().split('\n')
    clean = []
    in_tensors = False
    for line in lines:
        stripped = line.strip()
        if stripped.startswith('Executed:'):
            continue
        if stripped.startswith('Forward chaining'):
            continue
        if stripped == 'Tensors:':
            in_tensors = True
            continue
        if in_tensors:
            if stripped and ':' in stripped:
                continue
            in_tensors = False
            if not stripped:
                continue
        if stripped.startswith('Unknown tensor'):
            continue
        label_match = re.match('^\\w+\\s*:\\s*\\[[\\d, ]*\\]\\s*=\\s*(.*)$', stripped)
        if label_match:
            value_part = label_match.group(1).strip()
            if value_part:
                clean.append(value_part)
            continue
        clean.append(stripped)
    return clean

def parse_vector(output: str) -> list[float]:
    """Parse a 1D vector from Ein output.

    Ein prints row vectors as "  [  1.0000,   0.0000,   1.0000]" or similar.
    """
    lines = _clean_output(output)
    for line in reversed(lines):
        if not line:
            continue
        cleaned = line.replace('[', '').replace(']', '')
        parts = re.split('[,\\s]+', cleaned.strip())
        try:
            vals = [float(p) for p in parts if p]
            if len(vals) > 1:
                return vals
        except ValueError:
            continue
    raise ValueError(f'Could not parse vector from Ein output:\n{output}')

# Setup code to construct valid arguments
ein_output_with_vector = """
Executed: some_command
Forward chaining enabled
Tensors:
  x: [4] = [1.0, 2.0, 3.0, 4.0]
  y: [2] = [5.0, 6.0]

result: [3] = [  1.0000,   0.0000,   1.0000]
"""

ARGS = {
    "output": ein_output_with_vector
}
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
reachability Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
egolabs-ai/closurebench/src/closurebench/ground_truth.py
code served (permissive licence) · get_code("f94a848a84607c9d")
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 networkx as nx

# Create a directed graph for testing reachability
G = nx.DiGraph()
G.add_edges_from([(0, 1), (1, 2), (2, 3)])

# Define arguments: source can reach target (0 -> 1 -> 2 -> 3)
source = 0
target = 3

ARGS = {
    "G": G,
    "source": source,
    "target": target,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — 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
render_nl Ran
ran; our contract draft was wrong, not the code
egolabs-ai/closurebench/src/closurebench/encodings.py
code served (permissive licence) · get_code("5c0a827d52aaa26d")
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

torch.manual_seed(0)

ARGS = {
    "question": "What is the capital of France?"
}
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
triangle_count Ran
ran; our contract draft was wrong, not the code
egolabs-ai/closurebench/src/closurebench/ground_truth.py
code served (permissive licence) · get_code("6d065e534c0ea2f1")
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 networkx as nx

# Create a simple undirected graph with at least one triangle
G_undirected = nx.Graph()
G_undirected.add_edges_from([(0, 1), (1, 2), (2, 0), (3, 4)])

# Create a simple directed graph with at least one directed 3-cycle
G_directed = nx.DiGraph()
G_directed.add_edges_from([(0, 1), (1, 2), (2, 0), (3, 4)])

ARGS = {
    "G": G_undirected
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
networkx — 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
assign_node_labels Not yet run
unverified (harvested, no recorded run)
egolabs-ai/closurebench/src/closurebench/graphs.py
code served (permissive licence) · get_code("519ee8b78a10dc14")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
egolabs-ai/closurebench/src/closurebench/model_runner.py
code served (permissive licence) · get_code("2e42dd549759b1b3")
How it ran

no invocation recorded.

parse_scalar Not yet run
unverified (harvested, no recorded run)
egolabs-ai/closurebench/src/closurebench/ein_runner.py
code served (permissive licence) · get_code("2b12d31f03a54347")
How it ran

no invocation recorded.

Also present in other papers' code

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

Repositories linked to this paper

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

Abstract

Large language models are widely reported to fail on multi-step compositional and logical reasoning, and a growing body of work has measured parts of this gap. Tracking it is itself hard: new models are trained on the benchmarks used to evaluate them, so a fixed test set decays into a memorisation check soon after release, which has motivated constructive benchmarks that generate fresh instances on demand. We introduce ClosureBench, a constructive benchmark for probing, in depth and along controllable axes, where language models fail on graph-relational logical reasoning. Each task is built from explicit logic primitives-reachability, degree, set operations, connectivity, and aggregation-and its reference answer is computed by executing code that implements that logic exactly, giving programmatically verified ground truth and an unlimited supply of fresh instances. The benchmark spans 26 task categories at three compositional levels, with three independent difficulty knobs: graph size, edge density, and query depth. Evaluating models from 1.5B open weights to frontier systems (o3, GPT-4.1, Gemini 2.5, Claude Sonnet 4), we find that accuracy falls as graph size and query depth increase, and that the two interact: even the strongest frontier model degrades sharply from atomic to compositional queries. The difficulty is neither the surface form-it persists when the graph is given as a JSON edge list or an adjacency matrix rather than prose-nor the reasoning rule, which models state correctly, but carrying that rule out over the graph across many steps. A 4B model fine-tuned to emit verified programs instead of answers stays nearly flat across compositional levels, where every frontier model degrades sharply: o3, the strongest, falls from 96% on atomic queries to 82% on the most compositional, while the 4B model holds at 93%-matching or exceeding the frontier on the hardest tasks at a fraction of the token cost. The program offloads the multi-step execution to a runtime, and the model's residual errors are almost entirely misread edges-the one step it still performs itself. Constructive generation also supports a direct memorisation check, comparing accuracy on seen versus freshly generated instances.

For agents

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

get_harvested_code_for_paper("2608.18242")
get_code_for_paper("2608.18242")
have("2608.18242")

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

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

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

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

Connect an agent — have() is free.