routing: remove largest-SCC filtering as a hard default#17
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fafc71e831
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| let _ = tx.send(RoutingProgress::CheckingCache { percent: 8 }).await; | ||
| } | ||
| match Self::load_from_file(&cache_path).await { | ||
| match Self::load_from_file(&cache_path, config).await { |
There was a problem hiding this comment.
Key the in-memory cache by connectivity policy
This only makes the file-cache load path policy-aware. RoadNetwork::load_or_fetch still returns an in-memory hit before reaching this call, and that cache is keyed only by bbox.cache_key(). If one process loads the same bbox first with ConnectivityPolicy::KeepAll and later with LargestStronglyConnectedComponent (or vice versa), the second call silently reuses the first graph, so routes and matrices are computed with the wrong connectivity semantics.
Useful? React with 👍 / 👎.
| "Road network has {} SCCs, filtering to largest component", | ||
| scc_count | ||
| ); | ||
| network.filter_to_largest_scc(); |
There was a problem hiding this comment.
Avoid persisting SCC-filtered graphs as canonical cache files
Filtering the freshly fetched graph here mutates it before load_or_fetch writes it to the shared <bbox>.json cache file. In the scenario where a bbox is first populated with ConnectivityPolicy::LargestStronglyConnectedComponent, every later default KeepAll load—even in a fresh process—can only reload the already-pruned graph, so the new default no longer preserves disconnected components for that region.
Useful? React with 👍 / 👎.
Summary
ConnectivityPolicytoNetworkConfigand default it to preserving all fetched graph componentsValidation
cargo fmt --all -- --checkcargo test connectivity_policy_keeps_all_components --test integrationcargo test largest_scc_filter_is_opt_in --test integrationcargo clippy --workspace --all-targets -- -D warningscargo testFixes #4