dump: v0.2.0#1
Conversation
Signed-off-by: Amol Yadav <amyssnipet@yahoo.com>
Signed-off-by: Amol Yadav <amyssnipet@yahoo.com>
|
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation. |
There was a problem hiding this comment.
Pull request overview
This PR introduces a Rust-backed differential privacy accounting core (PyO3) and expands the Python API surface to mirror Google’s dp_accounting, including RDP primitives/accountants, Gaussian mechanism calibration, and PLD composition.
Changes:
- Added Rust implementations for Gaussian mechanism calibration and a PLD engine (FFT-based) plus new RDP primitives/conversions exposed via
_core. - Added Python modules for
DpEventalgebra, privacy accountant base classes, RDP/PLD accountants, and mechanism calibration utilities. - Added extensive tests/benchmarks and updated docs + CI configuration.
Reviewed changes
Copilot reviewed 27 out of 29 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_all_mechanisms.py |
Adds mechanism accuracy cross-validation vs dp_accounting plus speed benchmark tests. |
tests/smoke_test.py |
Adds an import-and-basic-usage smoke check (currently runs at import time). |
src/pld.rs |
New Rust PLD engine with discretization + FFT-based composition and ε/δ queries. |
src/math.rs |
Switches special functions to libm and adds stability helpers (abs_sinpi, log_erfc). |
src/lib.rs |
Exposes new PyO3 functions/classes (Gaussian calibration, RDP primitives, PLD PMF). |
src/gaussian.rs |
Implements analytical Gaussian calibration (Balle & Wang) with bisection root-finding. |
src/accounting.rs |
Adds WOR Gaussian RDP, Laplace RDP, and RDP→δ conversion helpers; tweaks constants. |
python/dp_accelerator/rdp.py |
Adds RDP primitives, conversions, and an RdpAccountant compatible API. |
python/dp_accelerator/privacy_accountant.py |
Adds PrivacyAccountant base + NeighboringRelation enum and compose/ledger logic. |
python/dp_accelerator/pld/privacy_loss_distribution.py |
Adds high-level PLD wrapper and multiple factory methods (some SciPy-based). |
python/dp_accelerator/pld/pld_privacy_accountant.py |
Adds PLDAccountant that composes DpEvents into PLDs. |
python/dp_accelerator/pld/pld_pmf.py |
Adds Dense/Sparse PLD PMF wrappers delegating heavy ops to Rust. |
python/dp_accelerator/pld/__init__.py |
Exposes PLD public API. |
python/dp_accelerator/mechanism_calibration.py |
Adds DP mechanism calibration search (SciPy brentq optional, bisection fallback). |
python/dp_accelerator/gaussian_mechanism.py |
Python API for Gaussian calibration delegating to Rust. |
python/dp_accelerator/dp_event_builder.py |
Adds event builder/ledger for composed DpEvents. |
python/dp_accelerator/dp_event.py |
Adds DpEvent class hierarchy matching dp_accounting. |
python/dp_accelerator/_core.pyi |
Updates typing stubs for new Rust-exposed functions. |
python/dp_accelerator/__init__.py |
Re-exports many new APIs at package root; keeps __version__. |
benchmark_pld.py |
Adds PLD benchmark script vs Google implementation. |
benchmark_accuracy_speed.py |
Adds large benchmark suite comparing accuracy + speed vs dp_accounting. |
README.md |
Updates documentation to describe new features, APIs, and architecture. |
Cargo.toml |
Adds Rust deps (rustfft, libm) for PLD and special functions. |
Cargo.lock |
Locks new Rust dependency graph. |
.gitignore |
Ignores differential-privacy/ directory. |
.github/workflows/codeql.yml |
Adds CodeQL workflow (currently invalid YAML indentation). |
.github/workflows/check-signatures.yml |
Adds workflow enforcing signed commits. |
.github/workflows/CI.yml |
Tightens pytest invocation to pytest tests/ -v. |
.cargo/config.toml |
Adds macOS linker flags for dynamic lookup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Amol Yadav <amyssnipet@yahoo.com>
f0f96a6 to
839176e
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 29 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rewrote differential privacy from google to rust