SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.09930 · 2026

Compile Once, Differentiate Everywhere: A Differentiable Meta-Circular Interpreter

Lucas Sheneman

arXiv · PDF

Code that ran

9 of 13 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 0 have no contract verdict; 9 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/2606.09930.json · badge: /api/ran/2606.09930.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
sheneman/dmci canonical (classifier label)
classifier basis: census
9 ran · 4 no recorded run
FunctionStatusWhere it lives
compose_product Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/experiments/exp_g/modules.py
code served (permissive licence) · get_code("2f9b95133bdfab29")
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 = {
    'expr1': '(+ x y)',
    'expr2': '(- a b)'
}
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
compose_sum Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/experiments/exp_g/modules.py
code served (permissive licence) · get_code("7910057042a93b28")
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 = {
    'expr1': '(* x 2)',
    'expr2': '(+ y 3)'
}
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
load_data Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/benchmarks/plot_benchmarks.py
code served (permissive licence) · get_code("8875030ea2485c34")
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 DataFrame. 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 pandas as pd
import tempfile
import os

# Create a temporary CSV file with the required columns
temp_dir = tempfile.mkdtemp()
csv_path = os.path.join(temp_dir, "test_data.csv")

# Create sample data with the columns the function expects
data = {
    'mean_s': ['1.5', '2.3', '3.1'],
    'std_s': ['0.5', '0.8', '0.2'],
    'min_s': ['0.1', '0.5', '0.9'],
    'median_s': ['1.2', '2.0', '2.8'],
    'throughput': ['100.5', '200.3', '150.8'],
    'other_col': ['a', 'b', 'c']
}

df = pd.DataFrame(data)
df.to_csv(csv_path, index=False)

ARGS = {
    'csv_path': csv_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
make_chain Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/benchmarks/run_benchmarks.py
code served (permissive licence) · get_code("b233d4e94dc70dbc")
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 Program. 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
from dataclasses import dataclass

@dataclass
class Program:
    name: str
    source: str
    inputs: list[str]
    description: str

def make_chain(depth: int) -> Program:
    expr = 'x'
    for _ in range(depth):
        expr = f'(+ {expr} 1)'
    return Program(f'chain_{depth}', expr, ['x'], f'chain of {depth} adds')

# The function takes only one parameter: depth (an int)
# Looking at the function body, it builds a nested expression string
# and returns a Program object. depth controls how many additions to nest.

ARGS = {
    'depth': 5
}
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 Program — a Program output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Program 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
make_tree Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/benchmarks/run_benchmarks.py
code served (permissive licence) · get_code("2420c254d5ba9c8a")
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 Program. 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
from dataclasses import dataclass

@dataclass
class Program:
    name: str
    source: str
    inputs: list[str]
    description: str

def make_tree(width: int) -> Program:
    vars_needed = 2 * width
    var_names = [f'v{i}' for i in range(vars_needed)]
    products = [f'(* {var_names[2 * i]} {var_names[2 * i + 1]})' for i in range(width)]
    while len(products) > 1:
        new = []
        for i in range(0, len(products) - 1, 2):
            new.append(f'(+ {products[i]} {products[i + 1]})')
        if len(products) % 2 == 1:
            new.append(products[-1])
        products = new
    return Program(f'tree_{width}', products[0], var_names, f'tree of {width} muls')

ARGS = {
    'width': 4
}
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 Program — a Program output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Program 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
manifest_text Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/experiments/check_manifests.py
code served (permissive licence) · get_code("5885ea8c05d86d9f")
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

ARGS = {
    'reldir': 'experiments/outputs',
    'names': ['model_checkpoint_001.pt', 'results_final.json', 'metrics_summary.csv']
}
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
read_manifest Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/experiments/check_manifests.py
code served (permissive licence) · get_code("ad5da3ef9764d7ec")
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 tempfile
from pathlib import Path

# Create a temporary directory and file for testing
temp_dir = tempfile.TemporaryDirectory()
temp_path = Path(temp_dir.name) / "manifest.txt"

# Write test content to the manifest file
manifest_content = """# This is a comment
file1.txt
file2.txt
file3.txt

# Another comment
file4.txt
"""
temp_path.write_text(manifest_content)

ARGS = {
    "path": temp_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 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_top_level_forms Ran
ran; our contract draft was wrong, not the code
sheneman/dmci/neural_compiler/dmci.py
code served (permissive licence) · get_code("203ca9d3ae2046d6")
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 torch.nn as nn

# Construct a valid Scheme source string with top-level S-expressions
source = """
(define (factorial n)
  (if (<= n 1)
      1
      (* n (factorial (- n 1)))))

; This is a comment that should be skipped
(define (fibonacci n)
  (if (<= n 1)
      n
      (+ (fibonacci (- n 1))
         (fibonacci (- n 2)))))

(+ 1 2 3)
; Another comment
(* 4 5)
"""

ARGS = {
    "source": source
}
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 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
unsupported_interpreter_ops Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
sheneman/dmci/neural_compiler/dmci.py
code served (permissive licence) · get_code("d67550ff7c4be8e2")
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.

# Define the constants and classes needed
INTERPRETER_OPS = {'+', '-', '*', '/', '=', '<', '>', '<=', '>=', 'cons', 'car', 'cdr', 'null?', 'pair?', 'number?', 'boolean?', 'symbol?', 'eq?', 'not', 'list', 'sin', 'cos', 'exp', 'sqrt', 'log', 'abs', 'pow', 'min', 'max', 'modulo', 'remainder', 'vec', 'mat', 'ref', 'dot', 'cross', 'norm', 'normalize', 'vsum', 'vlen', 'scale', 'matvec', 'matmul', 'transpose', 'trace', 'det', 'logdet', 'inv', 'outer', 'eye', 'zeros', 'ones'}

INTERPRETER_SPECIAL_FORMS = {'quote', 'if', 'cond', 'let', 'letrec', 'lambda', 'begin', 'define', 'else'}

class UnsupportedOperatorError(ValueError):
    """A program handed to the DMCI interpreter uses an operator or special form the
    meta-circular evaluator (``bootstrap/compiler.scm``) does not implement.

    Without this static check such an operator would hit eval-apply's ``(#t 0)``
    fallthrough and *silently evaluate to 0*, corrupting results or causing
    non-termination (a recursion guard that never fires).
    """
    pass

# Helper function to check if token is a number
def _is_number_token(tok: object) -> bool:
    if not isinstance(tok, str):
        return False
    try:
        float(tok)
        return True
    except ValueError:
        return False

# Helper function to scan form for bound names and head symbols
def _scan_form(node: object, bound: set, heads: set) -> None:
    """Walk one program datum collecting locally bound names and operator symbols."""
    if not isinstance(node, list) or not node:
        return
    head = node[0]
    if head == 'quote':
        return
    if head == 'lambda':
        params = node[1] if len(node) > 1 else []
        if isinstance(params, list):
            bound.update((p for p in params if isinstance(p, str)))
        for sub in node[2:]:
            _scan_form(sub, bound, heads)
        return
    if head in ('let', 'letrec'):
        binds = node[1] if len(node) > 1 else []
        if isinstance(binds, list):
            for b in binds:
                if isinstance(b, list) and b and isinstance(b[0], str):
                    bound.add(b[0])
                    for v in b[1:]:
                        _scan_form(v, bound, heads)
        for sub in node[2:]:
            _scan_form(sub, bound, heads)
        return
    if head == 'define':
        target = node[1] if len(node) > 1 else None
        if isinstance(target, list):
            bound.update((s for s in target if isinstance(s, str)))
        elif isinstance(target, str):
            bound.add(target)
        for sub in node[2:]:
            _scan_form(sub, bound, heads)
        return
    if isinstance(head, str):
        heads.add(head)
    else:
        _scan_form(head, bound, heads)
    for sub in node[1:]:
        _scan_form(sub, bound, heads)

def unsupported_interpreter_ops(program: list) -> None:
    """Check if program uses any unsupported operators or special forms."""
    bound = set()
    heads = set()
    
    for form in program:
        _scan_form(form, bound, heads)
    
    unsupported = heads - INTERPRETER_OPS - INTERPRETER_SPECIAL_FORMS - bound
    if unsupported:
        raise UnsupportedOperatorError(
            f"Unsupported operators: {unsupported}"
        )

# Example program: simple arithmetic expression
example_program = [
    ['+', '1', '2'],
    ['define', 'x', ['*', '3', '4']],
    ['lambda', ['a', 'b'], ['+', 'a', 'b']]
]

ARGS = {
    'program': example_program
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
neural_compiler — 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
bench Not yet run
unverified (harvested, no recorded run)
sheneman/dmci/benchmarks/run_benchmarks.py
code served (permissive licence) · get_code("2d07c976b1334d89")
How it ran

no invocation recorded.

dmci_wrap Not yet run
unverified (harvested, no recorded run)
sheneman/dmci/neural_compiler/dmci.py
code served (permissive licence) · get_code("373ef1fde5910993")
How it ran

no invocation recorded.

plot_large_programs Not yet run
unverified (harvested, no recorded run)
sheneman/dmci/benchmarks/plot_benchmarks.py
code served (permissive licence) · get_code("7d97cce990a1e71a")
How it ran

no invocation recorded.

tracked_basenames Not yet run
unverified (harvested, no recorded run)
sheneman/dmci/experiments/check_manifests.py
code served (permissive licence) · get_code("8f5dbe719f430fe1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 13 samples lifted from this paper's linked repositories, 13 carry a function identity and 0 do not. Of the 13 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 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.

FunctionAlso present inEarliest-datedOthers named
load_data 1 other paper
1 dated earlier
2605.22498 (2026-05)
The Neural Compiler: Program-to-Network Translation for Hybrid Scientific Machine Learning
plot_large_programs 1 other paper
1 dated earlier
2605.22498 (2026-05)
The Neural Compiler: Program-to-Network Translation for Hybrid Scientific Machine Learning

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

The boundary between program execution and gradient-based optimization has long limited the use of code itself as a learnable scientific model. We present a compiler that translates a substantial, self-hosting subset of Scheme into differentiable computation graphs for standard autograd backends. Because the subset is expressive enough to compile its own evaluator, this yields differentiable meta-circular interpretation (DMCI): a compiled Scheme interpreter executes programs supplied as data, while reverse-mode autodiff propagates gradients through the interpreter to continuous constants embedded in those programs. The interpreter is compiled once, so new programs inherit differentiability without recompilation or custom gradient machinery, while retaining ordinary language features such as closures, recursion, and data structures. We prove that gradients through the compiled interpreter are correct almost everywhere and show that they match direct compilation to numerical precision across 171 recursive and higher-order program-seed pairs. We then use DMCI for program-and-parameter co-search, where a large language model proposes Scheme programs and exact gradients calibrate their continuous parameters through a single frozen interpreter. This enables a hybrid workflow that can be embedded inside OpenEvolve-style program search: the outer loop proposes discrete program structures, while DMCI supplies exact gradient-based calibration of each candidate's continuous parameters. On battery capacity-fade data, the search recovers a knee-like degradation structure and improves held-out extrapolation over hand-crafted baselines on the harder early-extrapolation split (matching them on the later split); on a high-dimensional El Niño inverse problem, DMCI optimizes an interpreted Kalman-filter likelihood where gradient-free search fails. These results extend symbolic regression and neurosymbolic search from closed-form expressions to executable, stateful programs, making model-generated code directly optimizable against data.

For agents

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

get_harvested_code_for_paper("2606.09930")
get_code_for_paper("2606.09930")
have("2606.09930")

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

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

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

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

Connect an agent — have() is free.