metrale_bench/benchmarks/bfcl/
descriptors.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2
3//! 2026-09-26: The registered BFCL benchmark descriptors: `bfcl-subset` (the
4//! golden n=995 draw) and `bfcl-subset-echolp` (the n=1004 echolp draw), both
5//! gates, and `bfcl-full` (every scored sample), which is not. The two gated
6//! draws mix the categories differently, so their normalized scores are not
7//! interchangeable.
8//!
9//! Owner: bench, BFCL benchmark.
10//! Invariants: none beyond the types.
11
12use super::{Bfcl, Variant};
13use crate::benchmark::BenchmarkDescriptor;
14use crate::hardware::Sensitivity;
15use crate::metadata::PluginMetadata;
16
17const SUBSET_SUMMARY: &str = "The golden n=995 MLPerf-edge draw, AST-scored";
18const FULL_SUMMARY: &str = "Every single-turn sample in the three scored categories";
19const ECHOLP_SUMMARY: &str = "The echolp n=1004 draw, AST-scored";
20pub const SUBSET_METADATA: PluginMetadata = PluginMetadata::metrale(SUBSET_SUMMARY);
21pub const FULL_METADATA: PluginMetadata = PluginMetadata::metrale(FULL_SUMMARY);
22pub const ECHOLP_METADATA: PluginMetadata = PluginMetadata::metrale(ECHOLP_SUMMARY);
23
24/// 2026-09-26: The verdict params both gated draws couple to metrics. For a
25/// self-started variant, `bench_resolve::apply_threshold_params` (server crate)
26/// fills each from the variant's BENCH.toml `min` bound less its noise, so a
27/// non-MLPerf checkpoint that clears its committed bars gets the PASS verdict
28/// the gate requires (`GateRecord::verdict_passes`). The bars differ per
29/// variant, so these are params rather than constants.
30const GATE_THRESHOLD_PARAMS: &[(&str, &str)] = &[
31    ("min_overall", "overall_accuracy"),
32    ("min_normalized", "normalized_single_turn_score"),
33];
34
35pub const SUBSET_DESCRIPTOR: BenchmarkDescriptor = BenchmarkDescriptor {
36    id: "bfcl-subset",
37    name: "BFCL (subset)",
38    summary: SUBSET_SUMMARY,
39    detail: "Berkeley Function Calling Leaderboard v4, single-turn, on the golden MLPerf-edge \
40             draw: categories non_live/live/hallucination at 62/10/10 with a 25-sample floor, \
41             which is exactly 995 samples. Reports overall_accuracy and \
42             normalized_single_turn_score against the MLPerf-edge floor (83.64 / 85.32); \
43             the floor VERDICT applies only to the Qwen3.6-27B submission checkpoints — \
44             every other checkpoint is judged by its own BENCH.toml thresholds, with the \
45             floor kept as table styling for reference. \
46             Downloads bfcl-eval into ~/.metrale/artifacts on first run. \
47             ★ CERTIFIED BY FOUR SHARDS (a..d) at one commit — a whole-draw record does \
48             not satisfy the gate (since 2026-09-13). ★ SCORED OPEN: cross-request SSM \
49             snapshot reuse is ON, not --hermetic, so the number is partition- and \
50             order-dependent — 12 of 995 samples are known to answer differently between \
51             the whole draw and its shards (#936); the run warns on each and reports the \
52             count as known_partition_sensitive. Floors are cut from the SHARDED aggregate.",
53    duration_hint: "~1.7 h (measured)",
54    expected_secs: 6000,
55    updated: "2026-09-13",
56    needs_confirmation: false,
57    intended_for: Some(crate::benchmark::ModelExpectation {
58        families: &["qwen3.6-27b", "qwen3.6-35b-a3b", "qwen3.8-27b"],
59        note: "The BFCL gates are defined on Qwen3.6-27B (dense — the MLPerf-edge floor \
60               83.64/85.32 rides on this checkpoint), Qwen3.6-35B-A3B (MoE, gate B), and \
61               Qwen3.8-27B (dense, UNMEASURED — a run there baselines rather than gates, \
62               and inherits neither 3.6's floors nor the MLPerf floor). Scores on any \
63               other checkpoint have no recorded baseline to beat.",
64    }),
65    threshold_params: GATE_THRESHOLD_PARAMS,
66    // 2026-09-26: An accuracy benchmark: recorded, never gated on box state.
67    sensitivity: Sensitivity::Correctness,
68    ctor: || Box::new(Bfcl::new(Variant::Subset)),
69};
70
71pub const FULL_DESCRIPTOR: BenchmarkDescriptor = BenchmarkDescriptor {
72    id: "bfcl-full",
73    name: "BFCL (full)",
74    summary: FULL_SUMMARY,
75    detail: "The same benchmark with no sampling: every single-turn sample in the three scored \
76             categories (~3625). Same composition as the subset draw, so the normalized score \
77             stays comparable — it just removes the sampling noise, at roughly 3.6× the wall \
78             time.",
79    duration_hint: "~12 h",
80    expected_secs: 43200,
81    updated: "2026-08-15",
82    needs_confirmation: false,
83    intended_for: Some(crate::benchmark::ModelExpectation {
84        families: &["qwen3.6-27b", "qwen3.6-35b-a3b", "qwen3.8-27b"],
85        note: "The BFCL gates are defined on Qwen3.6-27B (dense — the MLPerf-edge floor \
86               83.64/85.32 rides on this checkpoint), Qwen3.6-35B-A3B (MoE, gate B), and \
87               Qwen3.8-27B (dense, UNMEASURED — a run there baselines rather than gates, \
88               and inherits neither 3.6's floors nor the MLPerf floor). Scores on any \
89               other checkpoint have no recorded baseline to beat.",
90    }),
91    threshold_params: &[],
92    // 2026-09-26: Accuracy, as the subsets.
93    sensitivity: Sensitivity::Correctness,
94    ctor: || Box::new(Bfcl::new(Variant::Full)),
95};
96
97pub const SUBSET_ECHOLP_DESCRIPTOR: BenchmarkDescriptor = BenchmarkDescriptor {
98    id: "bfcl-subset-echolp",
99    name: "BFCL (subset, echolp draw)",
100    summary: ECHOLP_SUMMARY,
101    detail: "Berkeley Function Calling Leaderboard v4, single-turn, on the echolp draw: \
102             categories non_live/live/hallucination at 46/23/12 with a 25-sample floor, which is \
103             exactly 1004 samples. This draw weights `live` more than twice as heavily as the \
104             golden one, which moves normalized_single_turn_score by ~1.8 points while leaving \
105             overall_accuracy in the same place — so its scores are NOT comparable to the golden \
106             draw's, and it carries its own baseline. It exists because the 35B's only recorded \
107             BFCL history is on this draw. \
108             ★ CERTIFIED BY FOUR SHARDS (a..d) at one commit — a whole-draw record does \
109             not satisfy the gate (since 2026-09-13). ★ SCORED OPEN: cross-request SSM \
110             snapshot reuse is ON, not --hermetic, so the number is partition- and \
111             order-dependent — the 12 samples known (on the golden draw) to answer differently between \
112             a whole draw and its shards (#936) share its mechanism; the run warns on each and reports the \
113             count as known_partition_sensitive. Floors are cut from the SHARDED aggregate.",
114    duration_hint: "~2.1 h (measured)",
115    expected_secs: 7500,
116    updated: "2026-09-13",
117    needs_confirmation: false,
118    intended_for: Some(crate::benchmark::ModelExpectation {
119        families: &["qwen3.6-35b-a3b"],
120        note: "The echolp draw is where the 35B MoE's recorded history lives (84.66 / 83.32 \
121               high-water). The dense 27B is gated on the golden n=995 draw instead — do not \
122               cross the two, the category mix alone moves normalized by ~1.8 points.",
123    }),
124    // 2026-09-26: The same two gating metrics as the golden draw (its BENCH.toml
125    // entry bounds overall_accuracy and normalized_single_turn_score), with
126    // different bars.
127    threshold_params: GATE_THRESHOLD_PARAMS,
128    // 2026-09-26: Accuracy, as the golden draw.
129    sensitivity: Sensitivity::Correctness,
130    ctor: || Box::new(Bfcl::new(Variant::SubsetEcholp)),
131};
132
133// 2026-09-26: A certification runs each gated draw as `--param shard=i/n`
134// slices, and `gate::check_group` aggregates their per-subset counts into one
135// verdict. A shard is not a benchmark of its own: its record carries the
136// group's id, with `-s<i>of<n>` in the file name (`gate::shard_suffix`).