`IndependentConfig` synthesis raises "Cliques must be unique."
Maintainers usually reply within 2 days
Nobody has claimed this yet.
- #4 by @gghatano — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Domain
- data-engineering
Research direction
Start in dpsynth/discrete_mechanisms/independent.py at line 73 and run the supplied pandas reproduction with IndependentConfig. Verify that the INDEPENDENT path no longer raises the duplicate-clique ValueError, while MST and AIM still work and estimation inputs remain unchanged.
Written by the indexing model from the issue text.
Description
Summary
Calling dpsynth.generate(...) with discrete_config=IndependentConfig() fails
with a ValueError from mbi.CliqueVector.expand. MST and AIM work on the same
input; only INDEPENDENT is affected.
Environment
- Linux, Python 3.12, current
mbi(git+https://github.com/ryan112358/mbi.git)
Reproduction
import pandas as pd
import dpsynth
from dpsynth import domain, discrete_mechanisms as dm
df = pd.DataFrame({
"a": ["x", "y", "x", "y"] * 50,
"b": [0, 1, 1, 0] * 50,
})
domains = {
"a": domain.CategoricalAttribute(possible_values=["x", "y"]),
"b": domain.CategoricalAttribute(possible_values=[0, 1]),
}
dpsynth.generate(df, domains, epsilon=1.0, delta=1e-5,
discrete_config=dm.IndependentConfig())
ValueError: Cliques must be unique.
File ".../dpsynth/discrete_mechanisms/independent.py", line 73, in run_mechanism
potentials = potentials.expand([m.clique for m in measurements])
File ".../mbi/clique_vector.py", line 55, in __attrs_post_init__
raise ValueError("Cliques must be unique.")
Cause
In independent.run_mechanism, measurements starts from
initial_measurements — the one-way marginals that
data_generation_v2.generate always passes in — and then the loop appends a
freshly measured one-way marginal for every attribute. So measurements
contains each one-way clique twice.
When initial_potentials is not None (e.g. the empty CliqueVector returned by
constraints.get_initial_parameters even when there are no cross-attribute
constraints), line 73 calls
potentials.expand([m.clique for m in measurements]) with that duplicated
clique list. Current mbi requires unique cliques in expand, so it raises.
Suggested fix
De-duplicate the clique list (order-preserving) before calling expand. The
measurements passed to mirror_descent are left unchanged, so estimation and
privacy accounting are unaffected. PR attached.
- Dominant language
- Python
- Stars
- 32
- Forks
- 13
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 21
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/dpsynth
-
import dpsynth fails because mbi.Dataset is registered as a JAX dataclass twicePossibly taken @hanzalaareeb claimed this 6 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days
-
Clarify installation requirements in quickstart.ipynbPossibly taken @hanzalaareeb claimed this 5 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
google/dpsynth#194 · 1 comment ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
google/dpsynth#199 · 3 comments ·
Maintainers usually reply within 2 days
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
google/dpsynth#151 · 2 comments ·
Maintainers usually reply within 2 days
Similar issues
-
documentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ll7/robot_sf_ll7#10128 ·
Maintainers usually reply within 1 day
-
area: monitoring type: task
Difficulty 1/5 Under an hour Newbie friendliness 91/100
dkritarth/scopewatch#175 ·
Maintainers usually reply within 1 day
-
Layers of type "3D Unknown" and "3D Measured Unknown" are refused, so FileGDB multipatch layers can't be readPossibly taken @aidannewsome claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
quantization
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
vllm-project/vllm#59904 ·
Maintainers usually reply within 1 day