diff --git a/crates/graphforge-storage/benches/m6_storage_io.rs b/crates/graphforge-storage/benches/m6_storage_io.rs index 6ea16331e..84b38c911 100644 --- a/crates/graphforge-storage/benches/m6_storage_io.rs +++ b/crates/graphforge-storage/benches/m6_storage_io.rs @@ -102,10 +102,10 @@ fn seed_generation_chain(root: &std::path::Path, delta_count: usize) { fn durable_commit(bencher: Bencher) { bencher .with_inputs(prepared_publication) - .bench_local_values(|(root, workspace, request)| { + .bench_local_refs(|(root, workspace, request)| { let ProjectStageOutcome::Staged(staged) = stage_project_generation_with_graph_tree( root.path(), - &request, + request, Some(workspace.path()), ) .unwrap() else { @@ -191,7 +191,7 @@ fn spill_compaction(bencher: Bencher) { publish_delta(root.path()); root }) - .bench_local_values(|root| { + .bench_local_refs(|root| { let limits = GraphDeltaCompactionLimits::default(); compact_graph_delta( root.path(), diff --git a/scripts/ci/check-m6-benchmarks.py b/scripts/ci/check-m6-benchmarks.py index fed85b93d..431ffbaf6 100644 --- a/scripts/ci/check-m6-benchmarks.py +++ b/scripts/ci/check-m6-benchmarks.py @@ -42,6 +42,22 @@ print("missing M6 benchmarks: " + ", ".join(missing), file=sys.stderr) raise SystemExit(1) +walltime_source = (ROOT / "crates/graphforge-storage/benches/m6_storage_io.rs").read_text( + encoding="utf-8" +) +for name in ("durable_commit", "spill_compaction"): + function = re.search( + rf"(?ms)^fn\s+{re.escape(name)}\s*\([^)]*\)\s*\{{(.*?)(?=^#\[divan::bench|\Z)", + walltime_source, + ) + if function is None: + raise SystemExit(f"cannot inspect TempDir-backed benchmark {name}") + body = function.group(1) + if ".bench_local_refs(" not in body or ".bench_local_values(" in body: + raise SystemExit( + f"{name} must keep TempDir teardown outside the timed region with bench_local_refs" + ) + workflow = WORKFLOW.read_text(encoding="utf-8") walltime_job = workflow.split(" m6-walltime:\n", 1) if len(walltime_job) != 2: