Skip to content

Commit 3ecb8dc

Browse files
committed
chore(calib): set calibrated defaults (tau=0.12, cbf=0.5)
Winner of the v1 calibration grid (2119 instances, four benchmarks, pebble-fixed pool): (tau, cbf) = (0.12, 0.5) at min(per_benchmark file_recall) = 0.1092. Surface is flat (top-3 within 0.001), so the choice is robust rather than tuned to a sharp optimum. Per-benchmark breakdown at winner: swebench_lite 0.133, polybench 0.109, multi_swebench 0.173, contextbench 0.127 -- PolyBench is the bottleneck. The 0.1092 floor is a baseline for downstream multi-hop work, NOT a final test-set headline. Updates: - diffctx Rust defaults (SelectionConfig.core_budget_fraction, DEFAULT_STOPPING_THRESHOLD) - benchmarks Python defaults (RunParams.tau, RunParams.core_budget_fraction; run_eval.py CLI flags) - paper v2: calibration grid table now reports 4x3 grid with new numbers; narrative reframed (was "0.7287, parameters tightly clustered" - that was a metric-mismatch artefact from the buggy pool that fake-timed-out non-Python benchmarks; new narrative matches the rebuilt pebble-pool data)
1 parent 2dc3108 commit 3ecb8dc

5 files changed

Lines changed: 26 additions & 13 deletions

File tree

benchmarks/adapters/runner.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ class RunParams:
1919
near-zero effect). Anything else can be threaded through `extra_env`.
2020
"""
2121

22-
tau: float = 0.08
23-
core_budget_fraction: float = 0.70
22+
# Calibrated v1 (2119 instances, 4 benchmarks, pebble-fixed pool):
23+
# winner (tau, cbf) = (0.12, 0.5) at min(per_benchmark file_recall)
24+
# = 0.1092. Surface is flat (top-3 within 0.001) — robust default.
25+
tau: float = 0.12
26+
core_budget_fraction: float = 0.5
2427
budget: int = 8000
2528
scoring: str = "hybrid"
2629
extra_env: dict[str, str] = field(default_factory=dict)

benchmarks/run_eval.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
python -m benchmarks.run_eval \\
66
--manifest benchmarks/manifests/v1/calibration.txt \\
7-
--tau 0.08 --core-budget-fraction 0.70 --budget 8000 \\
7+
--tau 0.12 --core-budget-fraction 0.5 --budget 8000 \\
88
--workers 7 \\
99
--out results/eval_calibration_t008_c070.json
1010
"""
@@ -31,8 +31,8 @@ def _all_default_adapters() -> tuple[BenchmarkAdapter, ...]:
3131
def main() -> int:
3232
p = argparse.ArgumentParser(description=__doc__)
3333
p.add_argument("--manifest", type=Path, required=True)
34-
p.add_argument("--tau", type=float, default=0.08)
35-
p.add_argument("--core-budget-fraction", type=float, default=0.70)
34+
p.add_argument("--tau", type=float, default=0.12)
35+
p.add_argument("--core-budget-fraction", type=float, default=0.5)
3636
p.add_argument("--budget", type=int, default=8000)
3737
p.add_argument("--scoring", default="hybrid")
3838
p.add_argument("--workers", type=int, default=1)

diffctx/src/config/limits.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ impl Default for AlgorithmLimits {
3232
}
3333

3434
pub const DEFAULT_PPR_ALPHA: f64 = 0.60;
35-
pub const DEFAULT_STOPPING_THRESHOLD: f64 = 0.08;
35+
/// Calibrated on v1 manifest (2119 instances, 4 benchmarks). Winner
36+
/// of (tau, cbf) grid = (0.12, 0.5) at min(per_benchmark file_recall)
37+
/// = 0.1092. Top-3 within 0.001 — surface is flat, choice is robust.
38+
pub const DEFAULT_STOPPING_THRESHOLD: f64 = 0.12;
3639
pub const DEFAULT_PIPELINE_TIMEOUT_SECONDS: u64 = 300;
3740
pub const DEFAULT_BUDGET_TOKENS: u32 = 4096;
3841

diffctx/src/config/selection.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ pub struct SelectionConfig {
99
impl Default for SelectionConfig {
1010
fn default() -> Self {
1111
Self {
12-
core_budget_fraction: 0.70,
12+
// Calibrated on the v1 manifest (2119 instances across
13+
// SWE-bench Lite, PolyBench, Multi-SWE-bench, ContextBench)
14+
// with the pebble-fixed pool. Winner of the (tau, cbf) grid
15+
// = (0.12, 0.5) at min(per_benchmark file_recall) = 0.1092.
16+
// Surface is flat (top-3 within 0.001), so the choice is
17+
// robust rather than tuned to a sharp optimum.
18+
core_budget_fraction: 0.5,
1319
r_cap_min: 0.01,
1420
}
1521
}
@@ -51,7 +57,7 @@ impl Default for BoltzmannConfig {
5157

5258
pub fn selection() -> SelectionConfig {
5359
SelectionConfig {
54-
core_budget_fraction: read_env_fraction("DIFFCTX_OP_SELECTION_CORE_BUDGET_FRACTION", 0.70),
60+
core_budget_fraction: read_env_fraction("DIFFCTX_OP_SELECTION_CORE_BUDGET_FRACTION", 0.5),
5561
r_cap_min: read_env_fraction("DIFFCTX_OP_SELECTION_R_CAP_MIN", 0.01),
5662
}
5763
}

docs/Context-Selection-for-Git-Diff/v2/main.tex

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -484,19 +484,20 @@ \subsection{Setup}
484484
\end{itemize}
485485
Cross-benchmark contamination is filtered by \texttt{(repo, base\_commit)} key (1449 instances dropped from the calibration pool). HuggingFace dataset revisions are pinned by SHA in \texttt{benchmarks/dataset\_revisions.json}.
486486

487-
\paragraph{Calibration.} A 3$\times$3 grid over $\tau \in \{0.04, 0.08, 0.12\}$ and $\beta_{\mathrm{core}} \in \{0.5, 0.7, 0.9\}$ was run on the calibration manifest. The selection objective was the minimum file-recall across the four calibration source benchmarks (Section~\ref{sec:eval}). The full grid is reported in Table~\ref{tab:calibration-grid}. The selected cell is $\tau{=}0.12$, $\beta_{\mathrm{core}}{=}0.5$, with $B{=}8000$ tokens, $\mathrm{scoring}{=}\mathrm{hybrid}$. Two observations are worth recording: first, the winning $\tau$ row ($\tau{=}0.12$) clusters tightly across $\beta_{\mathrm{core}}$ values (0.7287--0.7298, a span of 0.001), indicating that $\beta_{\mathrm{core}}$ is essentially insensitive in this regime; second, the calibration objective varies by only $\sim$0.02 across the full grid. The remaining operational parameters (Section~\ref{sec:greedy} and the appendix) are held fixed at the values listed there.
487+
\paragraph{Calibration.} A 4$\times$3 grid over $\tau \in \{0.04, 0.08, 0.12, 0.16\}$ and $\beta_{\mathrm{core}} \in \{0.5, 0.7, 0.9\}$ was run on the full v1 calibration manifest (2{,}119 instances spanning SWE-bench Lite, PolyBench, Multi-SWE-bench, ContextBench). The selection objective is the minimum file-recall across the four calibration source benchmarks (Section~\ref{sec:eval}); minimum rather than mean prevents domination by the largest-population benchmark. The full grid is reported in Table~\ref{tab:calibration-grid}. The selected cell is $\tau{=}0.12$, $\beta_{\mathrm{core}}{=}0.5$, with $B{=}8000$ tokens, $\mathrm{scoring}{=}\mathrm{hybrid}$. Three observations: first, the surface is nearly flat---the top-3 cells lie within $0.001$ of each other (Table~\ref{tab:calibration-grid}), indicating that $(\tau, \beta_{\mathrm{core}})$ are robust rather than tuned to a sharp optimum; second, the absolute score $0.1092$ is the minimum mean recall across benchmarks on a difficult cross-language calibration mix---this is a baseline number for downstream multi-hop work, not a final test-set headline; third, the per-benchmark breakdown at the winner is $\{$swebench\_lite: 0.133, polybench: 0.109, multi\_swebench: 0.173, contextbench: 0.127$\}$, showing the bottleneck benchmark is PolyBench. The remaining operational parameters (Section~\ref{sec:greedy} and the appendix) are held fixed at the values listed there.
488488

489489
\begin{table}[h]
490490
\centering
491-
\caption{Calibration grid scores: minimum per-source-benchmark file recall on the calibration manifest. The selected cell is highlighted; $\tau{=}0.12$ dominates across $\beta_{\mathrm{core}}$. The grid is reported in full to make the parameter-sensitivity argument concrete.}
491+
\caption{Calibration grid scores: minimum per-source-benchmark file recall on the v1 calibration manifest (2{,}119 instances, four benchmarks, hybrid scoring, $B{=}8000$). The selected cell is highlighted. Surface is flat (top-3 within $0.001$); $\tau$ varies modestly across rows, $\beta_{\mathrm{core}}$ is essentially insensitive within the winning row.}
492492
\label{tab:calibration-grid}
493493
\begin{tabular}{lccc}
494494
\toprule
495495
$\tau \; \backslash \; \beta_{\mathrm{core}}$ & $0.5$ & $0.7$ & $0.9$ \\
496496
\midrule
497-
$0.04$ & $0.7196$ & $0.7196$ & $0.7196$ \\
498-
$0.08$ & $0.7113$ & $0.7113$ & $0.7113$ \\
499-
$0.12$ & $\mathbf{0.7287^\ast}$ & $0.7287$ & $0.7298$ \\
497+
$0.04$ & $0.1081$ & $0.1068$ & $0.1053$ \\
498+
$0.08$ & $0.1091$ & $0.1081$ & $0.1050$ \\
499+
$0.12$ & $\mathbf{0.1092^\ast}$ & $0.1077$ & $0.1050$ \\
500+
$0.16$ & $0.1036$ & $0.1029$ & $0.1011$ \\
500501
\bottomrule
501502
\end{tabular}
502503
\end{table}

0 commit comments

Comments
 (0)