js-streaming-private-quantile-adaptive-adversary-20261009
Done. The solution is written to ~/SOLUTION.md, and the embedded code was extracted and re-run from scratch (33/33 passing) to prove it's self-contained.
The spec secretly requires six fixes that a naive "quantile sketch + Laplace noise" fails:
A zero-dependency solution.js with five layers:
DyadicHistogram — fixed 2^levels bucket grid, signed float counts, exact additive merge, O(1) ingest.isotonicPAV — deterministic monotone projection of the noisy CDF (DP post-processing).RDPAccountant — Gaussian Rényi-DP; mergeParallel (ε=max, disjoint shards) vs mergeSequential (ε=sum, overlapping users); inverts to calibrate σ with sigmaForTotalBudget.PrivateQuantileSketch — cumulative noisy histogram; returns value, rankError, rankErrorFraction, epsUsed, delta; recomputes variance after merges.LatenessAwareEstimator — window W with delayed release; in-window deletes cancel exactly, out-of-window mass becomes reported residual.Guarantee: (ε,δ)-DP with ε = min_α[α·perUnit + ln(1/δ)/(α−1)], and w.p. ≥1−β, |C(v̂)−p| ≤ (t+R)/N + 2/B where t = √(2Bv·ln(2B/β)).
node verify.js)================ RESULT: 33 passed, 0 failed ================
Covers: exact shard merge + bounded memory, ties, deletions, σ-calibration to target ε, discrete-vs-continuous RDP optimum, empirical rank-error coverage over 300 trials, parallel/sequential merge semantics with additive noise variance, late/delete residual accounting, path-independent budget under an adaptive adversary, and a 200k-event jittered stream with no in-window drops.
# Evidence - Problem class: js-streaming-private-quantile-adaptive-adversary-20261009 - Model: openrouter/deepseek/deepseek-v4.1-flash - Solved: 2026-10-09T22:32:48.971Z - Verification: solution produced by pi in sandbox; see signatures.json
{"description": "Design a bounded-memory streaming estimator for an approximate quantile over a high-volume event stream under continual observation, where an adaptive analyst chooses later queries from earlier outputs and privacy must compose across epochs. Implement calibrated noise and a mergeable summary with explicit error and privacy-budget accounting, including adversarially chosen ties, deletions, and late events; return guarantees that remain valid after distributed shard merges rather than relying on independent-query assumptions.", "environment": "node20", "language": "js", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "js-streaming-private-quantile-adaptive-adversary-20261009", "provider": "openrouter", "solved_at": "2026-10-09T22:32:48.971Z", "version": "20"}