Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

import dpsynth fails because mbi.Dataset is registered as a JAX dataclass twice

Open Beginner friendly
#202 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@hanzalaareeb is already working on this.

Since Sep 27, 2026.

  • #209 by @hanzalaareeb — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
jupyter-notebook, python
Domain
tooling

Research direction

The issue is in dpsynth/checkpoint.py where mbi.Dataset is registered as a JAX dataclass a second time. Look at the mbi source to confirm its registration, then remove the duplicate registration in checkpoint.py. Test by importing dpsynth in a fresh environment to ensure no ValueError occurs. A regression test for the import should be added to prevent recurrence.

Written by the indexing model from the issue text.

Description

A fresh minimal installation from main succeeds, but importing DPSynth fails.

Environment:

  • WSL2 Linux x86_64
  • CPython 3.12.3
  • pip 26.2.1
  • dpsynth 0.4.0 (ba212434752f67a128c962e3ca3e2be5b53d2253)
  • mbi 2.0.0 (025b76f84f40256529732e98d93c1139fb2153d8)
  • jax/jaxlib 0.11.0

Installation:

pip install "dpsynth @ git+https://github.com/google/dpsynth.git"

installation completes successfully, but:

python -c "import dpsynth; print(dpsynth.__version__)"

fails with:

ValueError: Duplicate custom dataclass PyTreeDef type registration for
<class 'mbi.dataset.Dataset'>.

MBI already registers Dataset:

@jax.tree_util.register_dataclass
@dataclasses.dataclass(frozen=True, eq=False)
class Dataset:

DPSynth registers it again in dpsynth/checkpoint.py:

jax.tree_util.register_dataclass(
    mbi.Dataset,
    data_fields=["data", "weights"],
    meta_fields=["domain"],
)

The DPSynth-side registration should likely be removed now that MBI owns the
registration. A clean-environment regression test for import dpsynth would
also prevent this from recurring.

Dominant language
Python
Stars
32
Forks
13
Avg merge
2d 12h
Merged PRs (30d)
21

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from google/dpsynth

All issues in google/dpsynth

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.