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

Pipeline SWIFT query selection appears to use exact marginal errors

Open
#35 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data, security

Research direction

Start in dpsynth/pipeline_transformations/swift.py by tracing compute_exact_marginals, compute_errors, the “Swift Select Queries” budget, and swift.select_queries; compare this path with the local discrete_mechanisms.swift selection logic. Review draft PR #31, and consider the issue complete when selection scores are protected by a separate budget, measurement uses the remaining budget, and diagnostics do not publish exact errors.

Written by the indexing model from the issue text.

Description

Problem

The scalable pipeline SWIFT path appears to use exact-error-driven query selection.

In dpsynth/pipeline_transformations/swift.py, the pipeline computes exact candidate marginals, converts them into errors with marginals_computations.compute_errors(...), requests a budget named Swift Select Queries, and then passes the errors into swift.select_queries(...).

However, the selection scores do not appear to be noised before swift.select_queries(...); noise is added only later to the selected marginal measurements.

Why this matters

The selected clique tree / selected workload is itself data-dependent output. Concretely, the junction-tree topology, the selected clique set, and (when diagnostics are enabled) the exact error scores are all released and all depend on exact high-order marginals. If selection is driven by exact marginal errors, the later noisy measurement step does not protect the information leaked by which queries were selected.

This is separate from the local discrete_mechanisms.swift path, which has its own score-noising logic (_compute_initial_errors adds noise funded by a dedicated selection budget). The issue here is the scalable pipeline transformation path, which has no equivalent noising step.

Local evidence

Reviewed at commit 18c2c951bd2923f889f6e3b2b757e01aaae398ee; re-verified still present at current main (91e9181) — the pipeline path still feeds unnoised errors from compute_errors into swift.select_queries.

Relevant lines in the current tree:

  • dpsynth/pipeline_transformations/swift.py: exact_marginals = marginals_computations.compute_exact_marginals(...)
  • dpsynth/pipeline_transformations/swift.py: errors = marginals_computations.compute_errors(...)
  • dpsynth/pipeline_transformations/swift.py: budget request named Swift Select Queries
  • dpsynth/pipeline_transformations/swift.py: return swift.select_queries(errors_dict, ...)
  • dpsynth/pipeline_transformations/swift.py: noise is added at the later Add noise to selected marginals stage
  • dpsynth/pipeline_transformations/marginals_computations.py: compute_errors(...) uses exact_vals from exact marginals

Possible fix

Account separately for selection and measurement. Add DP noise to the vector of SWIFT candidate error scores before clique-tree/query selection, and use the remaining measurement budget only for selected marginal measurement. Diagnostic output should avoid publishing exact errors.

Draft PR

I opened a draft fix here: https://github.com/google/dpsynth/pull/31

Dominant language
Python
Stars
32
Forks
13
Avg merge
1d 19h
Merged PRs (30d)
20

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.