Skip to content

Query wrappers (distance/distances_from) + real-corpus benchmark; 0.3.0 - #6

Merged
VladPr merged 4 commits into
mainfrom
feat/query-wrappers-and-corpus-bench
Jul 14, 2026
Merged

Query wrappers (distance/distances_from) + real-corpus benchmark; 0.3.0#6
VladPr merged 4 commits into
mainfrom
feat/query-wrappers-and-corpus-bench

Conversation

@VladPr

@VladPr VladPr commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes two gaps from the post-0.2.0 list and preps the 0.3.0 release.

Query convenience wrappers (#4)

Adds the point-to-point and one-to-many query functions the README already advertised but never exported:

pub fn distance(cch: &CchView, metric: &MetricView, source: u32, target: u32) -> u32;
pub fn distances_from(cch: &CchView, metric: &MetricView, source: u32, targets: &[u32]) -> Vec<u32>;

Thin, zero-cost wrappers over the existing distance_matrix (single source), so they inherit its bit-identical, bounds-elided query path. Semantics match distance_matrix: INF_WEIGHT for unreachable, distance(s, s) == 0, distances_from(s, &[]) → empty vec.

Real-corpus benchmark (#3)

New env-gated benches/real_corpus.rs — measures customize parallel scaling (1 vs N threads) and a query suite on a genuine road network in the crate's own bundle format. Gated on CCH_CORPUS / CCH_CORPUS_METRIC; a plain cargo bench is a clean no-op (no cases registered). Nothing large is committed.

Measured on a real road network (Albania, ~6.29M nodes, 18 cores): customize runs 366.87 ms single-threaded → 80.7 ms on 18 threads (~4.55×) — notably better than the synthetic grids (~2.8× at 656k), consistent with real road networks having far better separators than grids. This is the honest continental data point the grid benches only approximated.

Release

Bumps 0.2.0 → 0.3.0 (minor: new public API), CHANGELOG [0.3.0] entry, README API table + real-corpus number + install pin.

Verification

  • 190 lib + 35 equivalence + 13 load_struct + 3 smoke/doctest — all pass.
  • clippy --all-targets -D warnings, fmt --check, cargo doc --no-deps (warning-free), and cargo llvm-cov --fail-under-lines 100 all clean.
  • No new unsafe; distance_matrix, the query engine, Cch layout, and on-disk formats unchanged.

Cutting v0.3.0 after merge will be the first live exercise of the automated (Trusted Publishing) release pipeline.

VladPr added 4 commits July 14, 2026 23:26
…om empty-targets behavior

Resolves 2 cargo-doc 'redundant explicit link target' warnings introduced with
the wrappers (INF_WEIGHT resolves without the explicit crate:: target), and
documents that distances_from returns early on empty targets without checking
source. Doc-only; cargo doc --no-deps now warning-free.
@VladPr
VladPr merged commit c264976 into main Jul 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant