Skip to content
Merged
6 changes: 3 additions & 3 deletions crates/graphforge-storage/benches/m6_storage_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(),
Expand Down
16 changes: 16 additions & 0 deletions scripts/ci/check-m6-benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down