SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.08588 · 2026

LazyHMC: Hamiltonian Monte Carlo Simulation for Lazy, Infinite Dimensional Probabilistic Programs

C.-H Ong, Maria-Nicoleta Crăciun, Tom Schrijvers, Sam Staton

arXiv · PDF · Open in the Atlas

Code that ran

2 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 0 failures of our instrument; 4 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/2608.08588.json · badge: /api/ran/2608.08588.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
lazyppl-team/lazyhmc community
Papers with Code archive
2 ran · 4 no recorded run
FunctionStatusWhere it lives
ProbCtx Ran
ran on a synthesized input · constructed an object; no result was computed
lazyppl-team/lazyhmc/NPHMC-comparison/inferWoTruncInitialExt.py
code served (permissive licence) · get_code("f6c7f4c8b3c43d19")
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, ProbCtx: 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 torch
import math
from torch.distributions import Beta, Normal

torch.manual_seed(0)

# Construct a small trace tensor
# The trace is cloned and detached in __init__, and elements are accessed by index
# Keep it small but with enough elements for testing
trace = torch.randn(8, dtype=torch.float32)

ARGS = {
    "trace": trace,
}
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 ProbCtx — 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 ProbCtx 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
State Ran
ran on a synthesized input · constructed an object; no result was computed
lazyppl-team/lazyhmc/NPHMC-comparison/inferWoTruncInitialExt.py
code served (permissive licence) · get_code("43d3ce6a63d42671")
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, State: 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 torch

torch.manual_seed(0)

# Create small tensors for position and momentum
# q: position vector, shape (4,)
q = torch.randn(4)

# p: momentum vector, shape (4,)
p = torch.randn(4)

# is_cont: boolean tensor indicating which variables are continuous
# shape (4,), with mixed True/False values
is_cont = torch.tensor([True, False, True, False])

ARGS = {
    "q": q,
    "p": p,
    "is_cont": is_cont,
}
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 State — 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 State 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
ProbRun Not yet run
unverified (harvested, no recorded run)
lazyppl-team/lazyhmc/NPHMC-comparison/inferWoTruncInitialExt.py
code served (permissive licence) · get_code("16f8f780d4b4a642")
How it ran

no invocation recorded.

coord_integrator Not yet run
unverified (harvested, no recorded run)
lazyppl-team/lazyhmc/NPHMC-comparison/inferWoTruncInitialExt.py
code served (permissive licence) · get_code("230bc021c96a7314")
How it ran

no invocation recorded.

integrator_step Not yet run
unverified (harvested, no recorded run)
lazyppl-team/lazyhmc/NPHMC-comparison/inferWoTruncInitialExt.py
code served (permissive licence) · get_code("686b14660fc16526")
How it ran

no invocation recorded.

np_dhmc_woTrunc_initExt Not yet run
unverified (harvested, no recorded run)
lazyppl-team/lazyhmc/NPHMC-comparison/inferWoTruncInitialExt.py
code served (permissive licence) · get_code("c3a7b626c03c66bd")
How it ran

no invocation recorded.

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, 1 are also present in other papers whose code we hold (1 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.

FunctionAlso present inEarliest-datedOthers named
State
brick of this paper's assembly: helper
1 other paper
1 dated earlier · 1 only as an assembly brick
2106.10238 (2021-06)
Nonparametric Hamiltonian Monte Carlo

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

Hamiltonian Monte Carlo (HMC) is a successful generic inference method in probabilistic programming, but in its ordinary formulation it needs gradients and finite-dimensional parameter spaces. In Haskell, lazy evaluation lets probabilistic programs express stochastic processes and other non-parametric Bayesian models over implicit infinite-dimensional spaces. This paper develops new formulations of gradient-based HMC for this infinite-dimensional setting, via lazy evaluation. For automatic differentiation, we provide an analysis based on a new notion of "piecewise analytic under cylindrical analytic partition" (PACAP), to show that even if a program is infinite-dimensional and defined lazily, the gradient of the likelihood function is finitely supported. For the Monte Carlo method itself, we develop several HMC variants and a No-U-Turn Sampler that operate over the infinite-dimensional parameter space but are still productive because of lazy evaluation. Experiments cover Gaussian mixture clustering, random walks, and piecewise-constant regression with Poisson-process changepoints. CCS Concepts: • Mathematics of computing → Markov-chain Monte Carlo methods; Nonparametric statistics; Stochastic processes; • Software and its engineering → Functional languages; • Theory of computation → Denotational semantics; Program analysis.

For agents

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

get_harvested_code_for_paper("2608.08588")
get_code_for_paper("2608.08588")
have("2608.08588")

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

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

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

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

Connect an agent — have() is free.