SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.13632 · ICML · 2021

Black-box density function estimation using recursive partitioning

Erik Bodin, Zhenwen Dai, Neill Campbell, Carl Ek

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2010.13632.json · badge: /api/ran/2010.13632.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
bodin-e/defer canonical (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
FunctionStatusWhere it lives
BoundedSpace Ran
ran on a synthesized input · constructed an object; no result was computed
bodin-e/defer/defer/divide.py
code served (permissive licence) · get_code("82b5a2ffce294207")
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 an instance of its own class, BoundedSpace: the run constructed the object and did not call it, so no result was computed. 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 torch
from abc import ABC, abstractmethod

# Define a concrete Backend implementation for testing
class NumpyBackend(ABC):
    """NumPy-based backend implementation."""
    name = "numpy"
    
    def asarray(self, data: object) -> np.ndarray:
        return np.asarray(data, dtype=np.float64)
    
    def as_int(self, data: object) -> np.ndarray:
        return np.asarray(data, dtype=np.int64)
    
    def to_numpy(self, x: np.ndarray) -> np.ndarray:
        return np.asarray(x)
    
    def item(self, x: np.ndarray) -> float:
        return float(x)
    
    def exp(self, x: np.ndarray) -> np.ndarray:
        return np.exp(x)
    
    def log(self, x: np.ndarray) -> np.ndarray:
        return np.log(x)
    
    def sqrt(self, x: np.ndarray) -> np.ndarray:
        return np.sqrt(x)
    
    def abs(self, x: np.ndarray) -> np.ndarray:
        return np.abs(x)
    
    def sum(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.sum(x, axis=axis)
    
    def prod(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.prod(x, axis=axis)
    
    def max(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.max(x, axis=axis)
    
    def argmax(self, x: np.ndarray) -> np.ndarray:
        return np.argmax(x)
    
    def argsort(self, x: np.ndarray) -> np.ndarray:
        return np.argsort(x)
    
    def logsumexp(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.log(np.sum(np.exp(x - np.max(x, axis=axis, keepdims=True)), axis=axis)) + np.max(x, axis=axis)
    
    def all(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.all(x, axis=axis)
    
    def any(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.any(x, axis=axis)
    
    def maximum(self, a: np.ndarray, b: np.ndarray) -> np.ndarray:
        return np.maximum(a, b)
    
    def where(self, cond: np.ndarray, a: np.ndarray, b: np.ndarray) -> np.ndarray:
        return np.where(cond, a, b)
    
    def stack(self, xs, axis: int = 0) -> np.ndarray:
        return np.stack(xs, axis=axis)
    
    def concatenate(self, xs, axis: int = 0) -> np.ndarray:
        return np.concatenate(xs, axis=axis)
    
    def zeros(self, shape: tuple[int, ...]) -> np.ndarray:
        return np.zeros(shape, dtype=np.float64)
    
    def full(self, shape: tuple[int, ...], value: float) -> np.ndarray:
        return np.full(shape, value, dtype=np.float64)
    
    def arange(self, n: int) -> np.ndarray:
        return np.arange(n, dtype=np.float64)
    
    def uniform(self, low: np.ndarray, high: np.ndarray, sample_shape: tuple[int, ...]) -> np.ndarray:
        return np.random.uniform(low, high, size=sample_shape + low.shape)
    
    def rand(self, shape: tuple[int, ...]) -> np.ndarray:
        return np.random.uniform(0, 1, size=shape)

# Create backend instance
backend = NumpyBackend()

# Create valid lower and upper bounds for BoundedSpace
lower = np.array([0.0, -1.0, -2.0, -3.0])
upper = np.array([1.0, 2.0, 3.0, 4.0])

ARGS = {
    "lower": lower,
    "upper": upper,
    "backend": backend,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BoundedSpace — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BoundedSpace 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
_one_hot Ran
ran, honoured the contract we drafted
bodin-e/defer/defer/divide.py
code served (permissive licence) · get_code("8a6aba89ff293a18")
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, 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 torch
from abc import ABC, abstractmethod

# Define a concrete Backend implementation for testing
class NumpyBackend(ABC):
    """Simple NumPy-based backend implementation."""
    name = "numpy"
    
    def asarray(self, data):
        return np.asarray(data, dtype=np.float64)
    
    def as_int(self, data):
        return np.asarray(data, dtype=np.int64)
    
    def to_numpy(self, x):
        if isinstance(x, np.ndarray):
            return x
        return np.asarray(x)
    
    def item(self, x):
        return float(x)
    
    def exp(self, x):
        return np.exp(x)
    
    def log(self, x):
        return np.log(x)
    
    def sqrt(self, x):
        return np.sqrt(x)
    
    def abs(self, x):
        return np.abs(x)
    
    def sum(self, x, axis=None):
        return np.sum(x, axis=axis)
    
    def prod(self, x, axis=None):
        return np.prod(x, axis=axis)
    
    def max(self, x, axis=None):
        return np.max(x, axis=axis)
    
    def argmax(self, x):
        return np.argmax(x)
    
    def argsort(self, x):
        return np.argsort(x)
    
    def logsumexp(self, x, axis=None):
        from scipy.special import logsumexp
        return logsumexp(x, axis=axis)
    
    def all(self, x, axis=None):
        return np.all(x, axis=axis)
    
    def any(self, x, axis=None):
        return np.any(x, axis=axis)
    
    def maximum(self, a, b):
        return np.maximum(a, b)
    
    def where(self, cond, a, b):
        return np.where(cond, a, b)
    
    def stack(self, xs, axis=0):
        return np.stack(xs, axis=axis)
    
    def concatenate(self, xs, axis=0):
        return np.concatenate(xs, axis=axis)
    
    def zeros(self, shape):
        return np.zeros(shape, dtype=np.float64)
    
    def full(self, shape, value):
        return np.full(shape, value, dtype=np.float64)
    
    def arange(self, n):
        return np.arange(n, dtype=np.float64)
    
    def uniform(self, low, high, sample_shape):
        return np.random.uniform(low, high, sample_shape + low.shape)
    
    def rand(self, shape):
        return np.random.rand(*shape)

# Import necessary classes from the function definition
EPS = 1e-06

class BoundedSpace:
    def __init__(self, lower, upper, backend):
        lower = backend.asarray(lower)
        upper = backend.asarray(upper)
        if lower.shape != upper.shape:
            raise ValueError(f'lower/upper shapes differ: {lower.shape} vs {upper.shape}')
        if len(lower.shape) != 1 or lower.shape[0] < 1:
            raise ValueError(f'bounds must be non-empty vectors, got shape {lower.shape}')
        if bool(backend.item(backend.any(upper + EPS <= lower))):
            raise ValueError('upper must exceed lower in every dimension')
        self.backend = backend
        self.lower = lower
        self.upper = upper
        self.range = upper - lower
        self.center = (upper + lower) / 2
        self.volume = backend.prod(self.range)
        self.diameter = backend.sqrt(backend.sum(self.range ** 2))
        self.ndims = int(lower.shape[0])

    def __repr__(self):
        lower = self.backend.to_numpy(self.lower)
        upper = self.backend.to_numpy(self.upper)
        return f'BoundedSpace[{lower}, {upper}]'

# Create test instances
backend = NumpyBackend()
lower_bounds = np.array([0.0, 1.0, 2.0, 3.0])
upper_bounds = np.array([10.0, 11.0, 12.0, 13.0])
domain = BoundedSpace(lower_bounds, upper_bounds, backend)

# Build arguments for _one_hot function
ARGS = {
    'dim': 2,
    'ndims': 4,
    'domain': domain,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, numpy, scipy, torch — 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, 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
child_partition_domains Ran
ran; our contract draft was wrong, not the code
bodin-e/defer/defer/divide.py
code served (permissive licence) · get_code("0a3195ab65af3e18")
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 torch
import numpy as np
from abc import ABC, abstractmethod

torch.manual_seed(0)

class NumpyBackend(ABC):
    """Concrete Backend implementation using NumPy."""
    name = "numpy"

    def asarray(self, data):
        return np.asarray(data, dtype=np.float64)

    def as_int(self, data):
        return np.asarray(data, dtype=np.int64)

    def to_numpy(self, x):
        if isinstance(x, np.ndarray):
            return x
        return x

    def exp(self, x):
        return np.exp(x)

    def log(self, x):
        return np.log(x)

    def sqrt(self, x):
        return np.sqrt(x)

    def abs(self, x):
        return np.abs(x)

    def sum(self, x, axis=None):
        return np.sum(x, axis=axis)

    def prod(self, x, axis=None):
        return np.prod(x, axis=axis)

    def max(self, x, axis=None):
        return np.max(x, axis=axis)

    def argmax(self, x):
        return np.argmax(x)

    def argsort(self, x):
        return np.argsort(x)

    def logsumexp(self, x, axis=None):
        from scipy.special import logsumexp as scipy_logsumexp
        return scipy_logsumexp(x, axis=axis)

    def all(self, x, axis=None):
        return np.all(x, axis=axis)

    def any(self, x, axis=None):
        return np.any(x, axis=axis)

    def maximum(self, a, b):
        return np.maximum(a, b)

    def where(self, cond, a, b):
        return np.where(cond, a, b)

    def stack(self, xs, axis=0):
        return np.stack(xs, axis=axis)

    def concatenate(self, xs, axis=0):
        return np.concatenate(xs, axis=axis)

    def zeros(self, shape):
        return np.zeros(shape, dtype=np.float64)

    def full(self, shape, value):
        return np.full(shape, value, dtype=np.float64)

    def arange(self, n):
        return np.arange(n, dtype=np.float64)

    def uniform(self, low, high, sample_shape):
        return np.random.uniform(low, high, size=sample_shape + low.shape)

    def rand(self, shape):
        return np.random.rand(*shape)

    def item(self, x):
        return float(x)


# Create backend instance
backend = NumpyBackend()

# Create parent domain with 4 dimensions
lower = np.array([0.0, 0.0, 0.0, 0.0], dtype=np.float64)
upper = np.array([10.0, 20.0, 30.0, 40.0], dtype=np.float64)

parent_domain = type('BoundedSpace', (), {
    'backend': backend,
    'lower': lower,
    'upper': upper,
    'range': upper - lower,
    'center': (upper + lower) / 2,
    'volume': np.prod(upper - lower),
    'diameter': np.sqrt(np.sum((upper - lower) ** 2)),
    'ndims': 4
})()

dim_to_divide_along = 1

ARGS = {
    'parent_domain': parent_domain,
    'dim_to_divide_along': dim_to_divide_along
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, numpy, scipy, torch — 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
space_with_center Ran
ran; our contract draft was wrong, not the code
bodin-e/defer/defer/divide.py
code served (permissive licence) · get_code("898712da5878cc8f")
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 BoundedSpace. 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 torch
from abc import ABC, abstractmethod


class NumpyBackend(ABC):
    """Simple NumPy backend implementation."""
    name = "numpy"

    def asarray(self, data: object) -> np.ndarray:
        return np.asarray(data, dtype=np.float64)

    def as_int(self, data: object) -> np.ndarray:
        return np.asarray(data, dtype=np.int64)

    def to_numpy(self, x: np.ndarray) -> np.ndarray:
        return np.asarray(x, dtype=np.float64)

    def item(self, x: np.ndarray) -> float:
        return float(x)

    def exp(self, x: np.ndarray) -> np.ndarray:
        return np.exp(x)

    def log(self, x: np.ndarray) -> np.ndarray:
        return np.log(x)

    def sqrt(self, x: np.ndarray) -> np.ndarray:
        return np.sqrt(x)

    def abs(self, x: np.ndarray) -> np.ndarray:
        return np.abs(x)

    def sum(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.sum(x, axis=axis)

    def prod(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.prod(x, axis=axis)

    def max(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.max(x, axis=axis)

    def argmax(self, x: np.ndarray) -> np.ndarray:
        return np.argmax(x)

    def argsort(self, x: np.ndarray) -> np.ndarray:
        return np.argsort(x)

    def logsumexp(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        from scipy.special import logsumexp
        return logsumexp(x, axis=axis)

    def all(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.all(x, axis=axis)

    def any(self, x: np.ndarray, axis: int | None = None) -> np.ndarray:
        return np.any(x, axis=axis)

    def maximum(self, a: np.ndarray, b: np.ndarray) -> np.ndarray:
        return np.maximum(a, b)

    def where(self, cond: np.ndarray, a: np.ndarray, b: np.ndarray) -> np.ndarray:
        return np.where(cond, a, b)

    def stack(self, xs, axis: int = 0) -> np.ndarray:
        return np.stack(xs, axis=axis)

    def concatenate(self, xs, axis: int = 0) -> np.ndarray:
        return np.concatenate(xs, axis=axis)

    def zeros(self, shape: tuple[int, ...]) -> np.ndarray:
        return np.zeros(shape, dtype=np.float64)

    def full(self, shape: tuple[int, ...], value: float) -> np.ndarray:
        return np.full(shape, value, dtype=np.float64)

    def arange(self, n: int) -> np.ndarray:
        return np.arange(n, dtype=np.float64)

    def uniform(self, low: np.ndarray, high: np.ndarray, sample_shape: tuple[int, ...]) -> np.ndarray:
        return np.random.uniform(low, high, size=sample_shape + low.shape)

    def rand(self, shape: tuple[int, ...]) -> np.ndarray:
        return np.random.uniform(0, 1, size=shape).astype(np.float64)


torch.manual_seed(0)

backend = NumpyBackend()
center = np.array([1.0, 2.0, 3.0, 4.0], dtype=np.float64)
range_ = np.array([0.5, 0.6, 0.7, 0.8], dtype=np.float64)

ARGS = {
    "center": center,
    "range_": range_,
    "backend": backend,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jaxtyping, numpy, scipy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type BoundedSpace — a BoundedSpace output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BoundedSpace 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
Backend Not yet run
unverified (harvested, no recorded run)
bodin-e/defer/defer/divide.py
code served (permissive licence) · get_code("c6467c64d8da9594")
How it ran

no invocation recorded.

Also present in other papers' code

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

We present a novel approach to Bayesian inference and general Bayesian computation that is defined through a sequential decision loop. Our method defines a recursive partitioning of the sample space. It neither relies on gradients nor requires any problem-specific tuning, and is asymptotically exact for any density function with a bounded domain. The output is an approximation to the whole density function including the normalisation constant, via partitions organised in efficient data structures. Such approximations may be used for evidence estimation or fast posterior sampling, but also as building blocks to treat a larger class of estimation problems. The algorithm shows competitive performance to recent state-of-the-art methods on synthetic and realworld problems including parameter inference for gravitational-wave physics. 1 Such as constituting up to around ten random variables.

For agents

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

get_harvested_code_for_paper("2010.13632")
get_code_for_paper("2010.13632")
have("2010.13632")

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

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

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

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

Connect an agent — have() is free.