pub struct BenchResultWriter { /* private fields */ }Implementations§
Source§impl BenchResultWriter
impl BenchResultWriter
Sourcepub fn new(out_dir: &Path, run_id: &str) -> Result<Self, ZerError>
pub fn new(out_dir: &Path, run_id: &str) -> Result<Self, ZerError>
Create a new writer. out_dir is created if it does not yet exist.
Sourcepub fn write_pairs(&self, pairs: &[PairRecord]) -> Result<(), ZerError>
pub fn write_pairs(&self, pairs: &[PairRecord]) -> Result<(), ZerError>
Write a streaming NDJSON pairs file. One JSON object per line.
Sourcepub fn write_summary(
&self,
summary: &BenchBatchSummary,
accuracy: Option<&AccuracyMetrics>,
) -> Result<(), ZerError>
pub fn write_summary( &self, summary: &BenchBatchSummary, accuracy: Option<&AccuracyMetrics>, ) -> Result<(), ZerError>
Write a single-row summary CSV in the shared cross-library format.
Accuracy columns (true_pos, false_pos, etc.) are left empty when
accuracy is None, suitable for runs without a ground-truth file.
Uses "zer" as the library name. Call Self::write_summary_with_library
when a different name is needed (e.g. "zer+judge").
Sourcepub fn write_summary_with_library(
&self,
summary: &BenchBatchSummary,
accuracy: Option<&AccuracyMetrics>,
library: &str,
) -> Result<(), ZerError>
pub fn write_summary_with_library( &self, summary: &BenchBatchSummary, accuracy: Option<&AccuracyMetrics>, library: &str, ) -> Result<(), ZerError>
Like Self::write_summary but lets the caller set the library column.
Use "zer" for the FS-only pipeline and "zer+judge" when the
MiniLM neural judge is enabled, so the comparison table distinguishes
both operating points.
Sourcepub fn write_scored_pairs_csv(
&self,
pairs: &[(f32, bool)],
) -> Result<(), ZerError>
pub fn write_scored_pairs_csv( &self, pairs: &[(f32, bool)], ) -> Result<(), ZerError>
Write a scored-pairs CSV file sorted by score descending.
The file is named <run_id>_scored_pairs.csv and contains two columns:
score (f32) and is_match (0 or 1). Separating this from the benchmark
JSON keeps the JSON small and allows millions of rows without memory cost.