feat(PrivacyEngineering): add DifferentialPrivacyBudgetAllocation benchmark - #100
Conversation
🤖 AI Code Review (gemini-3-flash-preview)🇬🇧 English Analysis1. Executive Summary
2. AI Content Analysis
3. Engineering & Economic Assessment
4. Quality Assurance
5. Security & Privacy Check
🇨🇳 中文分析1. 摘要
2. AI 成分分析
3. 工程与经济评估
4. 质量保证
5. 安全与隐私检查
|
wrh-human
left a comment
There was a problem hiding this comment.
Review — DifferentialPrivacyBudgetAllocation (PR #100)
Thank you for contributing this benchmark. Differential privacy budget allocation is a genuine privacy engineering problem with clear economic value. After a complete line-by-line review of all files, the overall design is solid, but several issues were identified that need to be addressed.
1. Domain, Economic Value, and Frontier-Eng Fit ✅
Differential privacy budget allocation is a real data analytics engineering problem — privacy budget (epsilon) is a scarce resource that must be distributed across multiple analytics queries while satisfying per-query accuracy requirements, a total budget cap, and group fairness constraints. The task is anchored by NIST SP 800-226 and Dwork & Roth's differential privacy work. A good budget allocation directly maps to maximizing data utility, giving the task clear economic value. Starting from a feasible baseline and iteratively improving via a verifier aligns with Frontier-Eng's positioning.
2. Not purely numerical ✅
The agent implements solve(instance), which must allocate an epsilon value to each query while satisfying per-query epsilon bounds, maximum error, total budget, and group fairness constraints. This is a structured constrained allocation problem involving joint tradeoffs across business value, population coverage, sensitivity, and fairness — not parameter tuning.
3. Search space ✅
Each query's epsilon is a continuous value in [epsilon_min, epsilon_max], subject to total budget and group fairness constraints. The continuous allocation space across roughly 14-18 queries cannot be brute-forced. The objective function is concave (the log1p term is concave, and the error penalty term -sensitivity/eps is also concave), which theoretically enables convex optimization and provides a meaningful improvement path for agents.
4. Evaluator and engineering verification ✅
The evaluator independently recomputes all feasibility constraints in validate_solution():
- Allocations must cover exactly the query IDs
- epsilon within [epsilon_min, epsilon_max]
- error = sensitivity / epsilon does not exceed max_error
- Total epsilon does not exceed epsilon_total
- Group average error fairness ratio does not exceed max_group_error_ratio
- Finite value checks (not bool, finite, not NaN)
The raw objective is independently recomputed in _objective() without trusting candidate-reported values. Strict JSON Schema validation is applied to both input and output. The candidate runs in a subprocess (process_runner.py with timeout, output limits, and process group cleanup), and publish evaluation uses Docker isolation (pinned image SHA, non-root, network disabled, read-only filesystem, memory/CPU/process limits).
5. Constraint enforcement ✅
Constraints are implemented one by one in the verifier and checked comprehensively. Candidate output must pass schema validation and all constraint checks in validate_solution(). Any failure results in INVALID_SCORE (-1e18) for that case.
6. Baseline experiment
baseline/heuristic.py(deterministic heuristic) andbaseline/weak.py(random) are providedreference/exact.pyprovides a reference solver- Deterministic data generation is verified (smoke test checks that two generations match)
- But there is no
baseline/result_log.txtrecording the baseline's actual raw utility and runtime. The baseline's concrete performance and scoring discriminative power cannot be directly verified.
7. Scoring system ✅
_score(baseline, candidate) computes log2(candidate / baseline) for the maximization direction, aggregated via mean. The scoring formula is reasonable: a bounded, interpretable log ratio that effectively measures improvement. The baseline uses fairness repair + greedy allocation, which is non-trivial and improvable. The concave objective provides a clear improvement path for better convex optimization solvers, so the scoring discriminative power is well supported.
8. Issues to address
Issue 1 (most critical): Evaluator lacks EVOLVE-BLOCK boundary validation
scripts/init.py has a correct EVOLVE-BLOCK structure — EVOLVE-BLOCK-START (line 8) through EVOLVE-BLOCK-END (line 76) wraps only the solve() function, with imports and the if __name__ == "__main__": block outside the markers. However, the evaluator contains no EVOLVE-related validation logic and never checks whether the candidate modified code outside the EVOLVE-BLOCK. A candidate could modify the main block, imports, or other helper logic without detection. Suggestion: validate the candidate's EVOLVE-BLOCK boundary before execution in evaluate().
Issue 2: No test file
There are no test_*.py files. Although a --smoke mode is provided, it is not a pytest suite. At minimum, the following should be added:
- Pass/fail tests for each constraint in
validate_solution() - Boundary tests for the
evaluate_solution()objective computation - A test rejecting EVOLVE-BLOCK boundary violations (after Issue 1 is fixed)
- An end-to-end test of the complete
evaluate()pipeline
Issue 3: Missing baseline run results
Suggestion: create baseline/result_log.txt recording the output of python verification/evaluator.py scripts/init.py --local, including baseline raw utility, candidate raw utility, and scores for each case, plus the reference solver's results.
Issue 4: Docker isolation configuration is inconsistent with constraint descriptions
benchmark.yaml specifies runtime.isolation: docker, but constraint #9 in constraints.txt explicitly requires "Frontier unified must use its process isolation mode because the benchmark evaluator owns the inner candidate/verifier containers; do not wrap this evaluator in another Docker runtime." If the unified framework wraps the evaluator in Docker according to benchmark.yaml, this conflicts with constraint #9 (double Docker). Suggestion: confirm which configuration field the unified framework actually reads, and eliminate the inconsistency.
Issue 5 (non-blocking): Evaluation seeds hardcoded in the evaluator
SEEDS = [210001, 210013, ...] at line 22 of verification/evaluator.py are directly exposed in the source. In --local mode (subprocess, no filesystem isolation), a candidate could read the evaluator source and discover the evaluation seeds. The README notes that local mode is only for reviewed code, and publish evaluation uses Docker isolation, so the risk is limited. Suggestion: clarify this in the documentation, or load evaluation seeds from a config file placed inside the Docker image.
Summary
The differential privacy budget allocation direction is sound, constraint validation and objective computation are independently reliable, the concave objective provides a clear optimization path, and Docker and process isolation are in place. Issues 1 (missing EVOLVE-BLOCK boundary validation), 2 (no test file), and 3 (missing baseline results) are the main items to fix; Issue 4 (Docker config inconsistency) should also be addressed. The review can proceed once the above issues are addressed.
Adds an executable differential privacy budget allocation benchmark with deterministic instances, independent feasibility verification, utility-based scoring, calibrated baseline/reference solvers, bilingual documentation, auditable privacy references, Frontier unified metadata, and PrivacyEngineering domain README files.