Skip to content

feat(dp): Rényi/zCDP composition accounting (#161) - #333

Merged
ax1s-x1zz merged 2 commits into
mainfrom
feat/161-dp-rdp-zcdp
Oct 23, 2026
Merged

ax1s-x1zz merged 2 commits into
mainfrom
feat/161-dp-rdp-zcdp

Conversation

@ax1s-x1zz

Copy link
Copy Markdown
Member

What

Add an opt-in composition mode (XAZZ_DP_COMPOSITION=basic|rdp|zcdp). Default basic is unchanged.

  • zCDP: per-Gaussian ρ = ε²/(4 ln(1.25/δ)) (σ calibrated as before), composed additively, converted ε(δ) = ρ + 2√(ρ ln(1/δ)).
  • RDP: Gaussian (α, αρ)-RDP, Laplace ε-RDP for all α; Mironov conversion. The optimum over α equals the zCDP formula (test).
  • Mixed: ε = Σε(Laplace) + ρ + 2√(ρ ln(1/δ)) at the session δ.
  • Rejected requests roll the composition back atomically.

Verification

  • cargo test -p xazz-exec --lib dp:: → 28 passed (8 new).
  • cargo clippy -p xazz-exec --all-targets -- -D warnings clean.
  • cargo fmt --all -- --check clean.
  • Tests pin: ρ↔σ identity, known value (ρ=0.5, δ=1e-5 → ε≈5.2985), RDP/zCDP equivalence, 10 Gaussian queries (basic 10 vs RDP ≈3.0 ≤ basic), rollback.

Math note

The composed guarantee is converted at the session δ, so rdp/zcdp ≤ basic for the composed budget. This is a valid upper bound, not the exact analytic Gaussian mechanism; documented in docs/design/dp-spec.md §3 with the limit.

Basic sequential composition sums ε linearly, which is loose for many Gaussian
mechanisms. Add an opt-in XAZZ_DP_COMPOSITION mode:

- zCDP: ρᵢ = εᵢ²/(4 ln(1.25/δᵢ)) per Gaussian (σ calibrated as before), compose
  additively, convert ε(δ) = ρ + 2√(ρ ln(1/δ)).
- RDP: Gaussian is (α, αρ)-RDP, Laplace is ε-RDP for every α; compose per α and
  use Mironov's ε(δ) = ε_RDP + ln(1/δ)/(α-1). The optimum over α equals the
  zCDP formula (asserted by a test).
- Mixed sessions: ε = Σε(Laplace) + ρ + 2√(ρ ln(1/δ)) at the session δ budget.

Rejected requests roll the composition back atomically. Tests pin the ρ↔σ
identity, a known Gaussian value (ρ=0.5, δ=1e-5 → ε≈5.2985), the RDP/zCDP
equivalence, 10 Gaussian queries (basic 10 vs RDP ≈3.0), and rollback.
@ax1s-x1zz
ax1s-x1zz merged commit 2701428 into main Oct 23, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant