Repository navigation
refactor(bench): migrate traversal and MERGE scaling measurements to Divan #1485
Description
Problem and parent
Native child and completion blocker of #959. Traversal and MERGE scaling tests implement their own timers and sampling while the repository already uses Divan. This in-process migration is additional scope beyond #959's original legacy-ladder retirement. It follows the #1484 measurement-policy contract and does not depend on #900.
Scope
Migrate the timing workloads in crates/graphforge-exec/tests/bench_traversal_scaling.rs and crates/graphforge-exec/tests/merge_scaling_bench.rs into supported Divan benchmark targets, preserving reusable fixtures and deterministic product tests. Include only helpers and command/build metadata needed for these workloads.
- Let Divan own clocks, repeated sampling and result statistics; remove the custom median/timing helpers from these test paths. Do not wrap the new Divan benchmark around the old timer.
- Preserve traversal provider reuse, warm/cache intent, hop counts, graph shapes and multiple scales. State what preparation and cleanup is excluded.
- Preserve MERGE create-versus-match workload semantics. Every mutable sample starts from the intended state; warmup must not turn inserts into matches or accumulate graph growth. Keep the actual execution path and query results checked.
- Keep deterministic topology-read/I/O assertions in normal product CI. Separate execution helpers from unused timing returns without losing current assertions or adding a benchmark-only product API.
- Update the relevant Makefile commands, benchmark docs and policy inventory. Respect the Cargo/Bazel distinction: benchmarks stay Cargo/Divan diagnostics; correctness tests retain required Bazel coverage and dependency drift metadata.
- Document old/new measurement boundaries and reset incompatible timing baselines explicitly. A harness boundary change is not a performance improvement.
Acceptance
- Both named timing workloads run through Divan with no nested custom timer or homegrown sampling/statistics.
- Tests or deterministic fixture checks prove fresh MERGE state and intended warm traversal state; existing read-count and semantic correctness assertions remain in normal CI.
- Actual release benchmark execution succeeds for bounded representative cases and every supported case is exercised in Divan test mode at feasible original scales. Record commands, dataset parameters, execution scope, host and durable temp-root requirements. Test mode alone is not performance evidence.
- Framework output contains expected cases/parameters and is suitable for the documented supported consumer. Preserve any existing performance gate or move it to supported framework evidence; do not silently remove coverage.
- Formatter runs after the final edit, appropriate changed-surface Cargo/Bazel checks pass, and
make pre-push-fastplusmake gate-registry-checkvalidate metadata/policy changes. Review snapshot changes if any. - Old timing helpers/commands and their migration inventory entries are removed or updated; no unrelated scaling or product optimization is included.
Completion scenarios
- Given a warmed traversal fixture at each selected scale, when Divan samples each hop workload, then the same execution/results and neighborhood I/O properties hold and Divan supplies timing.
- Given repeated MERGE samples, when each sample starts, then its intended pre-existing graph and created/matched rows are identical rather than modified by earlier samples.
- Given ordinary product tests, when the timing workload moves to a bench target, then deterministic correctness/read-count regressions still fail required CI.
Boundaries
#1484 supplies the enforcement contract. #959 retains lifecycle/GDC retirement and bounded parity; #1476 owns the Divan ingest gate and #1467 owns TCK. No S18-S26 ladder, publication claim, changed optimization threshold, or new product behavior is authorized here.
Activity
refactor(bench): migrate traversal and MERGE scaling measurements to …
refactor(bench): migrate traversal and MERGE scaling measurements to …
refactor(bench): migrate traversal and MERGE scaling measurements to …
refactor(bench): migrate traversal and MERGE scaling measurements to …
refactor(bench): migrate traversal and MERGE scaling measurements to …