|
|
@@ -275,37 +275,50 @@ pub async fn run(config: &Config, a: &Args, dry_run: bool) -> Result<()> {
|
|
|
fs::copy(&md_src, &md_dest)?;
|
|
|
|
|
|
// Summary: final score from the JSON + the perf table from the log.
|
|
|
- let j: serde_json::Value = serde_json::from_str(&fs::read_to_string(&json_path)?)?;
|
|
|
- let sc = &j["scores"];
|
|
|
- let final_score = sc["final_score"].as_u64();
|
|
|
- if let Some(score) = final_score {
|
|
|
- let completion = sc["completion_rate"]
|
|
|
- .as_f64()
|
|
|
- .map(|v| v.to_string())
|
|
|
- .unwrap_or_default();
|
|
|
- eprintln!(
|
|
|
- "bench: final score {score} / {} ({} points), completion {completion}",
|
|
|
- sc["max_points"], sc["total_points"]
|
|
|
- );
|
|
|
- } else {
|
|
|
- eprintln!("bench: perf-only run (no quality score)");
|
|
|
- }
|
|
|
+ // Perf-only runs have no quality score and the tool writes no JSON —
|
|
|
+ // the run package is skipped for them (the campaign run is the record).
|
|
|
+ let j = match a.perf_only {
|
|
|
+ true => {
|
|
|
+ eprintln!("bench: perf-only run (no quality score, no run package)");
|
|
|
+ None
|
|
|
+ }
|
|
|
+ false => {
|
|
|
+ let j: serde_json::Value = serde_json::from_str(&fs::read_to_string(&json_path)?)?;
|
|
|
+ let sc = &j["scores"];
|
|
|
+ let final_score = sc["final_score"].as_u64();
|
|
|
+ if let Some(score) = final_score {
|
|
|
+ let completion = sc["completion_rate"]
|
|
|
+ .as_f64()
|
|
|
+ .map(|v| v.to_string())
|
|
|
+ .unwrap_or_default();
|
|
|
+ eprintln!(
|
|
|
+ "bench: final score {score} / {} ({} points), completion {completion}",
|
|
|
+ sc["max_points"], sc["total_points"]
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ eprintln!("bench: perf-only run (no quality score)");
|
|
|
+ }
|
|
|
+ Some(j)
|
|
|
+ }
|
|
|
+ };
|
|
|
for line in fs::read_to_string(&log_path)?.lines() {
|
|
|
if line.contains("pp2048") && line.contains("tg128") {
|
|
|
println!("{line}");
|
|
|
}
|
|
|
}
|
|
|
- crate::bench_artifacts::write_run_package(&crate::bench_artifacts::RunPackage {
|
|
|
- config,
|
|
|
- cluster: &cluster,
|
|
|
- recipe: &recipe,
|
|
|
- recipe_file: &file,
|
|
|
- stem: stem.as_str(),
|
|
|
- reports_dir: &reports_dir,
|
|
|
- bench_args: &args,
|
|
|
- bench_json: &j,
|
|
|
- })
|
|
|
- .await?;
|
|
|
+ if let Some(j) = &j {
|
|
|
+ crate::bench_artifacts::write_run_package(&crate::bench_artifacts::RunPackage {
|
|
|
+ config,
|
|
|
+ cluster: &cluster,
|
|
|
+ recipe: &recipe,
|
|
|
+ recipe_file: &file,
|
|
|
+ stem: stem.as_str(),
|
|
|
+ reports_dir: &reports_dir,
|
|
|
+ bench_args: &args,
|
|
|
+ bench_json: j,
|
|
|
+ })
|
|
|
+ .await?;
|
|
|
+ }
|
|
|
eprintln!("bench: reports landed in {}", reports_dir.display());
|
|
|
Ok(())
|
|
|
}
|