SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.10275 · 2021

Composite Goodness-of-fit Tests with Kernels

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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 6 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2111.10275.json · badge: /api/ran/2111.10275.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
oscarkey/composite-tests canonical (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
FunctionStatusWhere it lives
compute_js_and_sqrt_factorials Ran
ran on a synthesized input
oscarkey/composite-tests/src/composite_tests/distributions/kef.py
code served (permissive licence) · get_code("673e2f197fdba413")
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 2, 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 math
from typing import Tuple
import jax.numpy as jnp
from jax import Array

def compute_js_and_sqrt_factorials(p: int) -> Tuple[Array, Array]:
    """Computes the square roots of 1...p factorial."""
    index_start, index_end = (1, p + 1)
    js = jnp.arange(index_start, index_end)
    sqrt_factorials = [1.0]
    for j in range(index_start + 1, index_end):
        sqrt_factorials.append(sqrt_factorials[-1] * math.sqrt(j))
    return (js, jnp.array(sqrt_factorials))

ARGS = {
    "p": 5
}
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 tuple, ndim 2, 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
gram Ran
ran on a synthesized input
oscarkey/composite-tests/src/composite_tests/kernels.py
code served (permissive licence) · get_code("4c2b05c3929a08ab")
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 2, dtype family float, shape (2, 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 jax.numpy as jnp
import jax

def rbf_kernel(x, y):
    """Simple RBF kernel for testing"""
    diff = x - y
    return jnp.exp(-jnp.sum(diff ** 2))

# Create small test arrays
x1 = jnp.array([[1.0, 2.0, 3.0, 4.0],
                 [5.0, 6.0, 7.0, 8.0]])  # [2 x 4]

x2 = jnp.array([[0.5, 1.5, 2.5, 3.5],
                 [4.5, 5.5, 6.5, 7.5]])  # [2 x 4]

ARGS = {
    "x1": x1,
    "x2": x2,
    "kernel": rbf_kernel,
}
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 2, dtype family float, shape (2, 2) — shape (2, 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
median_heuristic Ran
ran on a synthesized input
oscarkey/composite-tests/src/composite_tests/kernels.py
code served (permissive licence) · get_code("af940c702487b5b5")
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
import jax.numpy as jnp
from jax import Array
import numpy as np

# Create small JAX arrays for testing
x1 = jnp.array([[1.0, 2.0, 3.0, 4.0],
                 [5.0, 6.0, 7.0, 8.0]], dtype=jnp.float32)

x2 = jnp.array([[2.0, 3.0, 4.0, 5.0],
                 [6.0, 7.0, 8.0, 9.0]], dtype=jnp.float32)

ARGS = {
    "x1": x1,
    "x2": x2,
}
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
phi Ran
ran on a synthesized input
oscarkey/composite-tests/src/composite_tests/distributions/kef.py
code served (permissive licence) · get_code("b96ed8238f45cae0")
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 (5,) 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 math

# Set up arguments for the phi function
x_scalar = jnp.array(0.5)  # scalar value
l_array = jnp.array(2.0)   # scalar array for l (inverse sigma)
p_int = 5                    # polynomial degree

ARGS = {
    'x': x_scalar,
    'l': l_array,
    'p': p_int,
}
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 (5,) — shape (5,) 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
to_scalar Ran
ran on a synthesized input
oscarkey/composite-tests/src/composite_tests/jax_utils.py
code served (permissive licence) · get_code("3965ee391a84606f")
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 jax.numpy as jnp
from jax import Array

torch.manual_seed(0)

# The function `to_scalar` takes a single parameter:
# f: Callable[P, Array] - a function that returns a JAX Array
# 
# The function wraps f so that it reshapes the output to a scalar.
# We need to provide a callable that returns a JAX Array.

def sample_function(x: Array) -> Array:
    """A simple function that returns a JAX array."""
    # Return a multi-dimensional array that will be reshaped to scalar
    return jnp.array([[1.0, 2.0], [3.0, 4.0]])

ARGS = {
    'f': sample_function
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
jax, 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
tree_concatenate Ran
ran on a synthesized input
oscarkey/composite-tests/src/composite_tests/jax_utils.py
code served (permissive licence) · get_code("e88d7e08222f1145")
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 dict. 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.numpy as jnp
from jax import Array

# Create sample pytrees containing JAX arrays
# A pytree can be nested dicts, lists, tuples of arrays

# First pytree: a dict with two arrays
tree1 = {
    'a': jnp.array([[1.0, 2.0, 3.0, 4.0]]),
    'b': jnp.array([[5.0, 6.0, 7.0, 8.0]])
}

# Second pytree: same structure, different values
tree2 = {
    'a': jnp.array([[9.0, 10.0, 11.0, 12.0]]),
    'b': jnp.array([[13.0, 14.0, 15.0, 16.0]])
}

# Third pytree: same structure for variety
tree3 = {
    'a': jnp.array([[17.0, 18.0, 19.0, 20.0]]),
    'b': jnp.array([[21.0, 22.0, 23.0, 24.0]])
}

# Create an iterable of these pytrees
trees = [tree1, tree2, tree3]

ARGS = {
    'trees': trees
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-24.

Repositories linked to this paper

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

Abstract

Model misspecification can create significant challenges for the implementation of probabilistic models, and this has led to development of a range of robust methods which directly account for this issue. However, whether these more involved methods are required will depend on whether the model is really misspecified, and there is a lack of generally applicable methods to answer this question. In this paper, we propose one such method. More precisely, we propose kernel-based hypothesis tests for the challenging composite testing problem, where we are interested in whether the data comes from any distribution in some parametric family. Our tests make use of minimum distance estimators based on the maximum mean discrepancy and the kernel Stein discrepancy. They are widely applicable, including whenever the density of the parametric model is known up to normalisation constant, or if the model takes the form of a simulator. As our main result, we show that we are able to estimate the parameter and conduct our test on the same data (without data splitting), while maintaining a correct test level. Our approach is illustrated on a range of problems, including testing for goodness-of-fit of an unnormalised non-parametric density model, and an intractable generative model of a biological cellular network.

For agents

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

get_harvested_code_for_paper("2111.10275")
get_code_for_paper("2111.10275")
have("2111.10275")

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

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

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

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

Connect an agent — have() is free.