SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.08109 · 2020

NeuroCard: One Cardinality Estimator for All Tables

arXiv · PDF · Open in the Atlas

Code that ran

17 of 19 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 17 have no contract verdict; 0 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/2006.08109.json · badge: /api/ran/2006.08109.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
neurocard/neurocard canonical (classifier label)
classifier basis: census
17 ran · 2 no recorded run
FunctionStatusWhere it lives
CachedReadCsv Ran
ran on a synthesized input
neurocard/neurocard/neurocard/datasets.py
code served (permissive licence) · get_code("e184f2c17059d8c9")
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 os
import pickle
import pandas as pd
import tempfile

# Create a temporary directory and CSV file for testing
temp_dir = tempfile.mkdtemp()
csv_filepath = os.path.join(temp_dir, 'test_data.csv')

# Create a simple CSV file
df_original = pd.DataFrame({
    'col1': [1, 2, 3],
    'col2': ['a', 'b', 'c'],
    'col3': [1.1, 2.2, 3.3]
})
df_original.to_csv(csv_filepath, index=False)

ARGS = {
    'filepath': csv_filepath
}
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
ConcatTables Ran
ran on a synthesized input
neurocard/neurocard/neurocard/common.py
code served (permissive licence) · get_code("fbeeb14d1ed6f185")
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 Table. 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 numpy as np
import pandas as pd

class Column:
    """A simple Column class for testing."""
    def __init__(self, name, data):
        self.name = name
        self.data = data
    
    def Name(self):
        return self.name
    
    def BinToVal(self, x):
        return x
    
    def ValToBin(self, x):
        return x


class Table(object):
    """A collection of Columns."""

    def __init__(self, name, columns, pg_name=None, validate_cardinality=True):
        """Creates a Table.

        Args:
            name: Name of this table object.
            columns: List of Column instances to populate this table.
            pg_name: name of the corresponding table in Postgres.
        """
        self.name = name
        if validate_cardinality:
            self.cardinality = self._validate_cardinality(columns)
        else:
            self.cardinality = None
        self.columns = columns
        self.column_bin_to_val_funcs = [c.BinToVal for c in columns]
        self.val_to_bin_funcs = [c.ValToBin for c in columns]
        self.name_to_index = {c.Name(): i for i, c in enumerate(self.columns)}
        if pg_name:
            self.pg_name = pg_name
        else:
            self.pg_name = name

    def __repr__(self):
        return '{}({})'.format(self.name, self.columns)

    def _validate_cardinality(self, columns):
        """Checks that all the columns have same the number of rows."""
        cards = [len(c.data) for c in columns]
        c = np.unique(cards)
        assert len(c) == 1, c
        return c[0]

    def to_df(self):
        return pd.DataFrame({c.name: c.data for c in self.columns})

    def Name(self):
        """Name of this table."""
        return self.name

    def Columns(self):
        """Return the list of Columns under this table."""
        return self.columns

    def ColumnIndex(self, name):
        """Returns index of column with the specified name."""
        assert name in self.name_to_index, (name, list(self.name_to_index.keys()))
        return self.name_to_index[name]

    def __getitem__(self, column_name):
        return self.columns[self.name_to_index[column_name]]

    def TableColumnIndex(self, source_table, col):
        """Returns index of column with the specified name/source."""
        name = JoinTableAndColumnNames(source_table, col)
        assert name in self.name_to_index, (name, list(self.name_to_index.keys()))
        return self.name_to_index[name]


def JoinTableAndColumnNames(table_name, column_name, sep=':'):
    return '{}{}{}'.format(table_name, sep, column_name)


def ConcatTables(tables, join_keys, disambiguate_column_names=False, sample_from_join_dataset=None):
    """Makes a dummy Table to represent the schema of a join result."""
    cols_in_join = sample_from_join_dataset.columns_in_join()
    names = [t.name for t in tables]
    table = Table('-'.join(names), cols_in_join, validate_cardinality=False)
    table.table_names = names
    return table


class JoinDataset:
    """Mock join dataset with columns_in_join method."""
    def __init__(self, cols):
        self.cols = cols
    
    def columns_in_join(self):
        return self.cols


# Create sample data
data1 = [1, 2, 3]
data2 = [4, 5, 6]
data3 = [7, 8, 9]

col1 = Column('col1', data1)
col2 = Column('col2', data2)
col3 = Column('col3', data3)

table1 = Table('table1', [col1, col2])
table2 = Table('table2', [col3])

join_cols = [
    Column('table1:col1', data1),
    Column('table2:col3', data3)
]

join_dataset = JoinDataset(join_cols)

ARGS = {
    'tables': [table1, table2],
    'join_keys': [('table1', 'col1'), ('table2', 'col3')],
    'disambiguate_column_names': False,
    'sample_from_join_dataset': join_dataset
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Table — a Table output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Table 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
Discretize Ran
ran on a synthesized input
neurocard/neurocard/neurocard/common.py
code served (permissive licence) · get_code("c2a2b36b24276540")
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 ndarray, ndim 1, dtype family int, shape (4,) 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 numpy as np
import pandas as pd

class Column:
    """Stand-in Column class with required attributes."""
    def __init__(self, all_distinct_values, data):
        self.all_distinct_values = all_distinct_values
        self.data = data

# Case 1: all_distinct_values without NaN
col_no_nan = Column(
    all_distinct_values=np.array(['a', 'b', 'c']),
    data=['a', 'b', 'a', 'c']
)

# Case 2: all_distinct_values with NaN (NaN first, then values)
col_with_nan = Column(
    all_distinct_values=np.array([np.nan, 'x', 'y', 'z']),
    data=['x', 'y', 'x', np.nan]
)

ARGS = {
    'col': col_no_nan,
    'data': ['a', 'b', 'c', 'a'],
    'fail_out_of_domain': True,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family int, shape (4,) — shape (4,) 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
ScaleInput Ran
ran on a synthesized input
neurocard/neurocard/neurocard/distributions.py
code served (permissive licence) · get_code("1c7fef4de7980c21")
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 Tensor, ndim 2, dtype family float, shape (2, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small integer tensor in range [0, num_classes - 1]
# Using batch size 2, with values as integers
x = torch.tensor([[0, 1, 2], [1, 2, 3]], dtype=torch.int64)

num_classes = 4

ARGS = {
    "x": x,
    "num_classes": num_classes,
}
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 Tensor, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
discretized_mixture_of_logistics_logprobs Ran
ran on a synthesized input
neurocard/neurocard/neurocard/distributions.py
code served (permissive licence) · get_code("fbda26488645dbb8")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Set up parameters
batch_size = 2
num_mixtures = 4
num_classes = 10

# Create dmol_params: (batch_size, num_mixtures * 3)
# Contains log_probs (1/3), means (1/3), log_scales (1/3)
dmol_params = torch.randn(batch_size, num_mixtures * 3)

# Create x: (batch_size,) with integer values in [0, num_classes - 1]
x = torch.randint(0, num_classes, (batch_size,))

ARGS = {
    "dmol_params": dmol_params,
    "x": x,
    "num_classes": num_classes,
    "num_mixtures": num_mixtures,
    "scale_input": False,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
dmol_query Ran
ran on a synthesized input
neurocard/neurocard/neurocard/distributions.py
code served (permissive licence) · get_code("80528654d3431119")
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 Tensor, ndim 1, dtype family float, shape (2,) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create small tensors for testing
batch_size = 2
num_mixtures = 3
num_classes = 5

# dmol_params: shape (batch_size, num_mixtures * 3)
# Contains log_probs, means, and log_scales for each mixture
dmol_params = torch.randn(batch_size, num_mixtures * 3)

# x: shape (batch_size,)
# Integer values in range [0, num_classes - 1]
x = torch.randint(0, num_classes, (batch_size,))

ARGS = {
    "dmol_params": dmol_params,
    "x": x,
    "num_classes": num_classes,
    "num_mixtures": num_mixtures,
    "scale_input": False,
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_bottom_up_table_ordering Ran
ran on a synthesized input
neurocard/neurocard/neurocard/join_utils.py
code served (permissive licence) · get_code("1281b27adc4bf3a2")
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_reverseiterator. 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

class MockJoinSpec:
    def __init__(self, join_root, join_tree):
        self.join_root = join_root
        self.join_tree = join_tree

# Create a simple join tree graph
join_tree = nx.DiGraph()
join_tree.add_edges_from([
    (0, 1),
    (0, 2),
    (1, 3),
    (1, 4),
    (2, 5)
])

join_spec = MockJoinSpec(
    join_root=0,
    join_tree=join_tree
)

ARGS = {
    "join_spec": join_spec
}
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 list_reverseiterator — a list_reverseiterator output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a list_reverseiterator 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_fanout_columns Ran
ran on a synthesized input
neurocard/neurocard/neurocard/factorized_sampler.py
code served (permissive licence) · get_code("30183552631e5dd6")
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.

class JoinSpec:
    def __init__(self):
        self.join_root = 'users'
        self.join_tables = ['users', 'orders', 'products', 'reviews']
        self.join_keys = {
            'users': ['user_id'],
            'orders': ['order_id', 'user_id'],
            'products': ['product_id'],
            'reviews': ['review_id', 'product_id', 'user_id']
        }

join_spec = JoinSpec()

ARGS = {
    'join_spec': join_spec
}
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_jct_count_columns Ran
ran on a synthesized input
neurocard/neurocard/neurocard/factorized_sampler.py
code served (permissive licence) · get_code("28a933386693e950")
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.

class JoinSpec:
    def __init__(self, join_root, join_tables, join_keys):
        self.join_root = join_root
        self.join_tables = join_tables
        self.join_keys = join_keys

# Create a simple join specification
join_spec = JoinSpec(
    join_root="users",
    join_tables=["users", "orders", "products"],
    join_keys={
        "users": ["user_id"],
        "orders": ["order_id", "user_id"],
        "products": ["product_id"]
    }
)

ARGS = {
    "join_spec": join_spec
}
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_join_spec Ran
ran on a synthesized input
neurocard/neurocard/neurocard/join_utils.py
code served (permissive licence) · get_code("826a572f7a1eb82b")
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 JoinSpec. 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 collections
import re
import hashlib
import networkx as nx

JoinSpec = collections.namedtuple('JoinSpec', ['join_tables', 'join_keys', 'join_clauses', 'join_graph', 'join_tree', 'join_root', 'join_how', 'join_name'])

def match_join_clause_or_fail(clause):
    m = re.match('(.*)\\.(.*)=(.*)\\.(.*)', clause)
    assert m, clause
    groups = m.groups()
    assert len(groups) == 4, (clause, groups)
    return m

def _make_join_graph(join_clauses, root):
    """Constructs nx.Graph and nx.DiGraph representations of the specified join.

    Constructs an undirected graph in which vertices are tables, and edges are
    joins.

    Also returns an arborescence (directed tree) in which edges originate from
    the join root to every joined table.
    """
    clauses = []
    for line in join_clauses:
        groups = match_join_clause_or_fail(line).groups()
        clauses.append(groups)
    g = nx.Graph()
    for t1, c1, t2, c2 in clauses:
        assert not g.has_edge(t1, t2)
        g.add_edge(t1, t2, join_keys={t1: c1, t2: c2})
    assert nx.is_tree(g), g.edges
    paths = nx.single_source_shortest_path(g, root)
    dg = nx.DiGraph()
    for path in paths.values():
        prev = None
        for t in path:
            if prev is not None:
                dg.add_edge(prev, t)
            prev = t
    assert set(g.nodes) == set(dg.nodes)
    return (g, dg)

def _infer_join_clauses(tables, join_keys, t0):
    """For backward compatibility with single equivalence class joins."""
    for keys in join_keys.values():
        assert len(keys) == 1, join_keys
    assert t0 in tables, tables
    t0_idx = tables.index(t0)
    k0 = join_keys[t0][0]
    return ['{}.{}={}.{}'.format(t0, k0, t, join_keys[t][0]) for i, t in enumerate(tables) if i != t0_idx]

def get_join_spec(config):
    join_clauses = config.get('join_clauses')
    if join_clauses is None:
        join_clauses = _infer_join_clauses(config['join_tables'], config['join_keys'], config['join_root'])
    g, dg = _make_join_graph(join_clauses, config['join_root'])
    join_hash = hashlib.sha1(str([join_clauses, config['join_root'], config['join_how']]).encode()).hexdigest()[:8]
    return JoinSpec(join_tables=config['join_tables'], join_keys=config['join_keys'], join_clauses=join_clauses, join_graph=g, join_tree=dg, join_root=config['join_root'], join_how=config['join_how'], join_name='{}-{}'.format(config.get('join_name'), join_hash))

ARGS = {
    'config': {
        'join_tables': ['users', 'orders', 'items'],
        'join_keys': {
            'users': ['user_id'],
            'orders': ['user_id'],
            'items': ['order_id']
        },
        'join_root': 'users',
        'join_how': 'left',
        'join_name': 'multi_table_join',
        'join_clauses': None
    }
}
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 JoinSpec — a JoinSpec 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
get_table_info Ran
ran on a synthesized input
neurocard/neurocard/neurocard/fair_sampler.py
code served (permissive licence) · get_code("75f57a10f841fe57")
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 collections
import re

def _get_join_tables_and_columns(clause):
    """Parses a join clause like `<t1>.<c1>=<t2>.<c2>` into tables and columns."""
    pattern = re.compile('^(.*)\\.(.*?)\\s*=\\s*(.*)\\.(.*)$')
    match = pattern.match(clause)
    assert match, clause
    return (match.group(1), match.group(2), match.group(3), match.group(4))

def get_table_info(join_clauses):
    """
    Parses join clauses.

    Returns a dictionary of tables to a list of columns in the table used in the join,
    and a list of 4-tuples of parsed join clauses.
    """
    table_info = collections.defaultdict(set)
    parsed_join_clauses = []
    for clause in join_clauses:
        t1, c1, t2, c2 = _get_join_tables_and_columns(clause)
        parsed_join_clauses.append((t1, c1, t2, c2))
        table_info[t1].add(c1)
        table_info[t2].add(c2)
    return (table_info, parsed_join_clauses)

# Setup code
ARGS = {
    "join_clauses": [
        "users.id=orders.user_id",
        "orders.product_id=products.id",
        "products.category_id=categories.id"
    ]
}
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
make_join_graph Ran
ran on a synthesized input
neurocard/neurocard/neurocard/fair_sampler.py
code served (permissive licence) · get_code("128a7bc81ffe8772")
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 Graph. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-27T00:55:27Z. 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

# The function expects parsed_join_clauses which is an iterable of tuples
# Each tuple contains: (table1, column1, table2, column2)
# These represent join conditions between tables

parsed_join_clauses = [
    ('users', 'user_id', 'orders', 'user_id'),
    ('orders', 'order_id', 'items', 'order_id'),
    ('users', 'user_id', 'payments', 'user_id'),
    ('orders', 'order_id', 'items', 'order_id'),  # duplicate edge with different columns
]

ARGS = {
    'parsed_join_clauses': parsed_join_clauses,
}
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 Graph — a Graph output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Graph output the recorded ndim 1 and dtype family float describe that coercion, not the output, and are not stated
Environment
image syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
match_join_clause_or_fail Ran
ran on a synthesized input
neurocard/neurocard/neurocard/join_utils.py
code served (permissive licence) · get_code("77fd3e98c92026d7")
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 Match. 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 re

def match_join_clause_or_fail(clause):
    m = re.match('(.*)\\.(.*)=(.*)\\.(.*)', clause)
    assert m, clause
    groups = m.groups()
    assert len(groups) == 4, (clause, groups)
    return m

# Construct a valid clause that matches the regex pattern:
# (.*)\\.(.*)=(.*)\\.(.*) 
# This means: something.something=something.something

ARGS = {
    "clause": "table1.column1=table2.column2"
}
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 Match — a Match output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Match 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
operator_isnull Ran
ran on a synthesized input
neurocard/neurocard/neurocard/estimators.py
code served (permissive licence) · get_code("8bdf97c21650c966")
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 Series. 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 pandas as pd
import numpy as np

# Create test data for the xs parameter
# Use a mix of valid values and NaN values to test the isnull functionality
test_data = pd.Series([1.0, np.nan, 3.0, np.nan, 5.0])

# Define ARGS dict with all parameters
ARGS = {
    'xs': test_data,
    '_unused_val': None,
    'negate': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Series — a Series output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Series output the recorded ndim 1 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
operator_like Ran
ran on a synthesized input
neurocard/neurocard/neurocard/estimators.py
code served (permissive licence) · get_code("9c08c58ad03d1324")
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 ndarray, ndim 1, dtype family float; no output shape is stated. It ran in syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1) at 2026-09-27T00:55:27Z. 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
import numpy as np
import pandas as pd

# Create test data - a numpy array with strings and potentially null values
xs = np.array(['apple', 'banana', 'apricot', None, 'blueberry'], dtype=object)

# Create a like_pattern to match strings starting with 'a'
like_pattern = 'a%'

# Set negate flag
negate = False

# Construct the ARGS dictionary with all parameters
ARGS = {
    'xs': xs,
    'like_pattern': like_pattern,
    'negate': negate
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 1, dtype family float — no output shape is stated: no later run recorded an output shape for this sample (observed_output and metamorphic_properties carry none; shape_contract and output_contract record ndim only)
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 syntology-harvest-sandbox:v5-deps (sha256:6a292aa1aed1); 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
profile Ran
ran on a synthesized input
neurocard/neurocard/neurocard/estimators.py
code served (permissive licence) · get_code("9523f843e8a3e38c")
How it ran

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

import torch
import torch.nn as nn

def dummy_function(x):
    """A simple function to profile"""
    return x * 2

ARGS = {
    "func": dummy_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
time_this Ran
ran on a synthesized input
neurocard/neurocard/neurocard/common.py
code served (permissive licence) · get_code("b1266ed534d4e507")
How it ran

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

import torch
import torch.nn as nn
import time

def time_this(f):
    def timed_wrapper(*args, **kw):
        start_time = time.time()
        result = f(*args, **kw)
        end_time = time.time()
        print('| func:%r took: %2.4f seconds |' % (f.__name__, end_time - start_time))
        return result
    return timed_wrapper

# Create a simple function to time
def sample_computation(x, y):
    """A simple function that does some work"""
    result = x + y
    for _ in range(1000000):
        result = result * 1.0001
    return result

# Apply the decorator
decorated_func = time_this(sample_computation)

# Define ARGS mapping the parameter 'f' to a callable
ARGS = {
    'f': decorated_func
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
ExecuteSql Not yet run
unverified (harvested, no recorded run)
neurocard/neurocard/neurocard/make_job_queries.py
code served (permissive licence) · get_code("abb495347c7887a0")
How it ran

no invocation recorded.

get_fanout_columns_impl Not yet run
unverified (harvested, no recorded run)
neurocard/neurocard/neurocard/factorized_sampler.py
code served (permissive licence) · get_code("51717647e20d5a6b")
How it ran

no invocation recorded.

Also present in other papers' code

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

Query optimizers rely on accurate cardinality estimates to produce good execution plans. Despite decades of research, existing cardinality estimators are inaccurate for complex queries, due to making lossy modeling assumptions and not capturing inter-table correlations. In this work, we show that it is possible to learn the correlations across all tables in a database without any independence assumptions. We present NeuroCard, a join cardinality estimator that builds a single neural density estimator over an entire database. Leveraging join sampling and modern deep autoregressive models, NeuroCard makes no inter-table or inter-column independence assumptions in its probabilistic modeling. NeuroCard achieves orders of magnitude higher accuracy than the best prior methods (a new state-of-the-art result of 8.5$\times$ maximum error on JOB-light), scales to dozens of tables, while being compact in space (several MBs) and efficient to construct or update (seconds to minutes).

For agents

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

get_harvested_code_for_paper("2006.08109")
get_code_for_paper("2006.08109")
have("2006.08109")

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

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

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

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

Connect an agent — have() is free.