SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.10797 · 2024

BlackJAX: Composable Bayesian inference in JAX

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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, 1 violated it and 0 have no contract verdict; 5 failures of our instrument; 4 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/2402.10797.json · badge: /api/ran/2402.10797.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
blackjax-devs/blackjax canonical (classifier label)
classifier basis: census
6 ran · 4 no recorded run
FunctionStatusWhere it lives
add_all_chains_info Ran
ran; our contract draft was wrong, not the code
blackjax-devs/blackjax/blackjax/eca.py
code served (permissive licence) · get_code("c24e814330351970")
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 jax
import jax.numpy as jnp
from jax import device_put, lax, shard_map, vmap
from functools import partial

# Create a simple state class that will hold position and other state
class State:
    def __init__(self, position):
        self.position = position

class AdaptationState:
    def __init__(self):
        self.value = 0.0

# Create a mock step function that matches the expected signature
def mock_step(state_all, xs):
    state, adaptation_state = state_all
    # Return updated state_all and info dict
    info_to_be_stored = {
        'log_prob': jnp.array(1.5),
        'acceptance_rate': jnp.array(0.8)
    }
    return ((state, adaptation_state), info_to_be_stored)

# Create a mock all_chains_info function that takes position and returns info
def mock_all_chains_info(position):
    # This function is vmapped over state.position, so it takes a single position
    return jnp.sum(position)

# Create sample data for step function
# position should have shape that can be vmapped
position = jnp.array([[1.0, 2.0, 3.0, 4.0],
                       [5.0, 6.0, 7.0, 8.0]])

state = State(position)
adaptation_state = AdaptationState()
state_all = (state, adaptation_state)

# Create sample input xs for the step function
xs = jnp.array([0.1, 0.2, 0.3, 0.4])

ARGS = {
    'step': mock_step,
    'all_chains_info': mock_all_chains_info
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — 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
bias Ran
ran; our contract draft was wrong, not the code
blackjax-devs/blackjax/blackjax/adaptation/laps.py
code served (permissive licence) · get_code("905d11e4487465d9")
How it ran

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

import jax.numpy as jnp
import numpy as np

class MockModel:
    """Stand-in model with required attributes and methods."""
    
    def __init__(self):
        # Small tensors for testing
        self.E_x2 = jnp.array(2.5)
        self.Var_x2 = jnp.array(0.5)
    
    def transform(self, position):
        """Transform position - returns a small array."""
        # Simulate a simple transformation
        return jnp.sum(position) * jnp.ones(2)

# Create model instance
model = MockModel()

ARGS = {
    "model": model
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_filter_adapt_info_fn Ran
ran; our contract draft was wrong, not the code
blackjax-devs/blackjax/blackjax/adaptation/base.py
code served (permissive licence) · get_code("38454867d14bcb6a")
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.

from typing import NamedTuple
import jax

# Define minimal NamedTuple classes for state, info, and adaptation_state
class SampleState(NamedTuple):
    params: float
    step: int
    learning_rate: float

class InfoTuple(NamedTuple):
    loss: float
    grad_norm: float
    entropy: float

class AdaptationState(NamedTuple):
    scale: float
    momentum: float
    iteration: int

ARGS = {
    "state_keys": {"params", "step"},
    "info_keys": {"loss", "grad_norm"},
    "adapt_state_keys": {"scale", "momentum"}
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — 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
linear_map Ran
ran; our contract draft was wrong, not the code
blackjax-devs/blackjax/blackjax/util.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from albcab/mfm, is pointer only (licence: NONE) · get_code("78c695bb394d4bf8")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from albcab/mfm, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

nan_reject Ran
ran; our contract draft was wrong, not the code
blackjax-devs/blackjax/blackjax/adaptation/laps_burn_in.py
code served (permissive licence) · get_code("ad40068acf923437")
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 ArrayImpl, 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 jax
import jax.numpy as jnp

def nan_reject(nonans, old, new):
    """Equivalent to
    return new if nonans else old"""
    return jax.lax.cond(nonans, lambda: new, lambda: old)

# Setup code to construct valid arguments

# nonans: a boolean condition (JAX array or Python bool)
nonans = True

# old: a JAX array or value to return if condition is False
old = jnp.array([1.0, 2.0, 3.0, 4.0])

# new: a JAX array or value to return if condition is True
new = jnp.array([5.0, 6.0, 7.0, 8.0])

ARGS = {
    "nonans": nonans,
    "old": old,
    "new": new
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
no_nans Ran
ran, violated the contract we drafted
blackjax-devs/blackjax/blackjax/adaptation/laps_burn_in.py
code served (permissive licence) · get_code("903ab9794bcd494e")
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 ArrayImpl, 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 jax.numpy as jnp
import numpy as np

def no_nans(a):
    flat_a, unravel_fn = ravel_pytree(a)
    return jnp.all(jnp.isfinite(flat_a))

# The function expects a pytree that can be flattened
# Valid inputs are nested structures like dicts, lists, tuples of arrays/scalars

# Create test data - a simple JAX array (valid, finite values)
test_array = jnp.array([1.0, 2.0, 3.0, 4.0])

# Also test with nested structure (pytree)
test_pytree = {
    'layer1': jnp.array([1.0, 2.0]),
    'layer2': jnp.array([[3.0, 4.0], [5.0, 6.0]])
}

ARGS = {
    'a': test_pytree
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ArrayImpl, 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
read_progress Not yet run
unverified (harvested, no recorded run)
blackjax-devs/blackjax/blackjax/progress_reader.py
code served (permissive licence) · get_code("6205159ff9cc8a77")
How it ran

no invocation recorded.

return_all_adapt_info Not yet run
unverified (harvested, no recorded run)
blackjax-devs/blackjax/blackjax/adaptation/base.py
code served (permissive licence) · get_code("659a5f0475c52541")
How it ran

no invocation recorded.

weighted_empirical_mean Not yet run
unverified (harvested, no recorded run)
blackjax-devs/blackjax/blackjax/adaptation/chees_adaptation.py
code served (permissive licence) · get_code("28a6255e169f74cc")
How it ran

no invocation recorded.

while_steps_num Not yet run
unverified (harvested, no recorded run)
blackjax-devs/blackjax/blackjax/adaptation/laps.py
code served (permissive licence) · get_code("03f5f7f969be024c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 9 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
linear_map 1 other paper
1 later
2405.14392 (2024-05)
Markovian Flow Matching: Accelerating MCMC with Continuous Normalizing Flows

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

BlackJAX is a library implementing sampling and variational inference algorithms commonly used in Bayesian computation. It is designed for ease of use, speed, and modularity by taking a functional approach to the algorithms' implementation. BlackJAX is written in Python, using JAX to compile and run NumpPy-like samplers and variational methods on CPUs, GPUs, and TPUs. The library integrates well with probabilistic programming languages by working directly with the (un-normalized) target log density function. BlackJAX is intended as a collection of low-level, composable implementations of basic statistical 'atoms' that can be combined to perform well-defined Bayesian inference, but also provides high-level routines for ease of use. It is designed for users who need cutting-edge methods, researchers who want to create complex sampling methods, and people who want to learn how these work.

For agents

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

get_harvested_code_for_paper("2402.10797")
get_code_for_paper("2402.10797")
have("2402.10797")

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

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

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

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

Connect an agent — have() is free.