SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.09342 · 2024

Diffusion Predictive Control with Constraints

arXiv · PDF · Open in the Atlas

Code that ran

7 of 11 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; 4 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 3 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/2412.09342.json · badge: /api/ran/2412.09342.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
ralfroemer99/dpcc canonical (classifier label)
classifier basis: census
7 ran · 4 no recorded run
FunctionStatusWhere it lives
add_deltas Ran
ran; our contract draft was wrong, not the code
ralfroemer99/dpcc/diffuser/datasets/preprocessing.py
code served (permissive licence) · get_code("5347209028588046")
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 numpy as np

torch.manual_seed(0)

# Create a mock environment (can be None or a minimal object since it's not used in _fn)
class MockEnv:
    pass

env = MockEnv()

# Create a dataset dict with 'observations' and 'next_observations' keys
# The function computes deltas = next_observations - observations
observations = torch.randn(2, 4)  # batch_size=2, dim=4
next_observations = torch.randn(2, 4)  # same shape

dataset = {
    'observations': observations,
    'next_observations': next_observations
}

ARGS = {
    'env': env
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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
atleast_2d Ran
ran, honoured the contract we drafted
ralfroemer99/dpcc/diffuser/datasets/buffer.py
code served (permissive licence) · get_code("785632d29b87adad")
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 2, dtype family int, shape (4, 1) 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

# Test case 1: 1D array - should expand to 2D
x_1d = np.array([1, 2, 3, 4])

# Test case 2: 2D array - should remain unchanged
x_2d = np.array([[1, 2, 3], [4, 5, 6]])

# Test case 3: 0D array (scalar) - should expand twice to 2D
x_0d = np.array(42)

# Test case 4: 3D array - should remain unchanged (already >= 2D)
x_3d = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]])

# Use the 1D case as the primary test
ARGS = {
    "x": x_1d
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family int, shape (4, 1) — shape (4, 1) 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
atleast_2d Ran
ran, honoured the contract we drafted
ralfroemer99/dpcc/diffuser/datasets/normalization.py
code served (permissive licence) · get_code("3ca83b3e96824f00")
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 (4, 1) 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

torch.manual_seed(0)

# The function atleast_2d takes a tensor x and checks its ndim.
# If ndim < 2, it adds a dimension using x[:, None].
# We need to test both cases: 1D and 2D+ tensors.

# Test case: 1D tensor (will be expanded to 2D)
x_1d = torch.randn(4)

ARGS = {
    "x": x_1d
}
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 (4, 1) — shape (4, 1) 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
convert_minari_to_d4rl Ran
ran; our contract draft was wrong, not the code
ralfroemer99/dpcc/diffuser/datasets/d4rl.py
code served (permissive licence) · get_code("e91c32f7d4bff61d")
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 numpy as np

class MockEpisode:
    def __init__(self):
        self.observations = {
            'observation': np.random.randn(2, 4),
            'desired_goal': np.random.randn(2, 3)
        }
        self.actions = np.random.randn(2, 5)
        self.rewards = np.random.randn(2)
        self.terminations = np.array([False, True])

class MockMinariDataset:
    def __init__(self):
        self.episodes = [MockEpisode(), MockEpisode()]
    
    def iterate_episodes(self):
        return iter(self.episodes)

dataset_minari = MockMinariDataset()

ARGS = {
    'dataset_minari': dataset_minari
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
cosine_beta_schedule Ran
ran, honoured the contract we drafted
ralfroemer99/dpcc/diffuser/models/helpers.py
code served (permissive licence) · get_code("0e2971f42b6c3323")
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 (10,) 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

torch.manual_seed(0)

ARGS = {
    "timesteps": 10,
    "s": 0.008,
    "dtype": torch.float32,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, 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 (10,) — shape (10,) 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
empirical_cdf Ran
ran, honoured the contract we drafted
ralfroemer99/dpcc/diffuser/datasets/normalization.py
code served (permissive licence) · get_code("2fd70118265255f8")
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 numpy as np

# The function takes a 'sample' parameter which should be a numpy array or array-like object
# It calls np.unique() on it, which requires an array-like input
# It also accesses sample.size, which is a numpy array attribute

# Create a small sample array with some repeated values to make the test meaningful
sample = np.array([1.0, 2.0, 2.0, 3.0, 3.0, 3.0, 4.0])

ARGS = {
    "sample": sample
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
flatten Ran
ran; our contract draft was wrong, not the code
ralfroemer99/dpcc/diffuser/datasets/normalization.py
code served (permissive licence) · get_code("505d6b06c543b4fb")
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 numpy as np

# Create a small dataset with n_episodes=2, max_path_length=5, dim=4
# The dataset is a dict with keys mapping to arrays of shape [n_episodes, max_path_length, dim]
n_episodes = 2
max_path_length = 5
dim = 4

dataset = {
    "observations": np.random.randn(n_episodes, max_path_length, dim),
    "actions": np.random.randn(n_episodes, max_path_length, dim),
    "rewards": np.random.randn(n_episodes, max_path_length, 3),
}

# path_lengths specifies the actual length of each episode
# Must have length equal to n_episodes
path_lengths = [3, 4]

ARGS = {
    "dataset": dataset,
    "path_lengths": path_lengths,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
apply_conditioning Not yet run
unverified (harvested, no recorded run)
ralfroemer99/dpcc/diffuser/models/helpers.py
code served (permissive licence) · get_code("6bd9807956a87606")
How it ran

no invocation recorded.

extract Not yet run
unverified (harvested, no recorded run)
ralfroemer99/dpcc/diffuser/models/helpers.py
code served (permissive licence) · get_code("09c8479d9a5b3e06")
How it ran

no invocation recorded.

get_policy_preprocess_fn Not yet run
unverified (harvested, no recorded run)
ralfroemer99/dpcc/diffuser/datasets/preprocessing.py
code served (permissive licence) · get_code("65e5c27060559602")
How it ran

no invocation recorded.

get_preprocess_fn Not yet run
unverified (harvested, no recorded run)
ralfroemer99/dpcc/diffuser/datasets/preprocessing.py
code served (permissive licence) · get_code("54442074c20e0e8f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 9 are also present in other papers whose code we hold (9 with at least one paper dated earlier, 2 the same month, 2 later) and 2 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
extract 77 other papers
56 dated earlier, 3 the same month, 16 later, 2 same year, order not determinable · 32 only as an assembly brick
1711.11585 (2017-11)
High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs
2006.11239 (2020-06)
Denoising Diffusion Probabilistic Models
2102.05379 (2021-02)
Argmax Flows and Multinomial Diffusion: Learning Categorical Distributions
and 74 more not named here
cosine_beta_schedule 20 other papers
14 dated earlier, 1 the same month, 5 later · 8 only as an assembly brick
2208.06193 (2022-08)
Diffusion Policies as an Expressive Policy Class for Offline Reinforcement Learning
2210.15629 (2022-10)
Language Control Diffusion: Efficiently Scaling through Space, Time, and Tasks
2303.14676 (2023-03)
PDPP: Projected Diffusion for Procedure Planning in Instructional Videos
and 17 more not named here
atleast_2d 3 other papers
3 dated earlier
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2405.14790 (2024-05)
DIDI: Diffusion-Guided Diversity for Offline Behavioral Generation
2407.01624 (2024-07)
Guided Trajectory Generation with Diffusion Models for Offline Model-based Optimization
add_deltas 2 other papers
2 dated earlier
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2405.14790 (2024-05)
DIDI: Diffusion-Guided Diversity for Offline Behavioral Generation
atleast_2d 2 other papers
2 dated earlier
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2405.14790 (2024-05)
DIDI: Diffusion-Guided Diversity for Offline Behavioral Generation
empirical_cdf 2 other papers
2 dated earlier
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2405.14790 (2024-05)
DIDI: Diffusion-Guided Diversity for Offline Behavioral Generation
flatten 2 other papers
2 dated earlier
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2405.14790 (2024-05)
DIDI: Diffusion-Guided Diversity for Offline Behavioral Generation
get_policy_preprocess_fn 2 other papers
2 dated earlier
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2405.14790 (2024-05)
DIDI: Diffusion-Guided Diversity for Offline Behavioral Generation
get_preprocess_fn 2 other papers
2 dated earlier
2305.18459 (2023-05)
Diffusion Model is an Effective Planner and Data Synthesizer for Multi-Task Reinforcement Learning
2405.14790 (2024-05)
DIDI: Diffusion-Guided Diversity for Offline Behavioral Generation

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

Diffusion models have become popular for policy learning in robotics due to their ability to capture high-dimensional and multimodal distributions. However, diffusion policies are stochastic and typically trained offline, limiting their ability to handle unseen and dynamic conditions where novel constraints not represented in the training data must be satisfied. To overcome this limitation, we propose diffusion predictive control with constraints (DPCC), an algorithm for diffusion-based control with explicit state and action constraints that can deviate from those in the training data. DPCC incorporates model-based projections into the denoising process of a trained trajectory diffusion model and uses constraint tightening to account for model mismatch. This allows us to generate constraint-satisfying, dynamically feasible, and goal-reaching trajectories for predictive control. We show through simulations of a robot manipulator that DPCC outperforms existing methods in satisfying novel test-time constraints while maintaining performance on the learned control task.

For agents

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

get_harvested_code_for_paper("2412.09342")
get_code_for_paper("2412.09342")
have("2412.09342")

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

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

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

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

Connect an agent — have() is free.