Skip to content

Add KD-tree conflict detection benchmark slice#40

Open
ArizmendiWan wants to merge 1 commit intoopen-rmf:mainfrom
ArizmendiWan:traffic-dependency-kdtree-slice1
Open

Add KD-tree conflict detection benchmark slice#40
ArizmendiWan wants to merge 1 commit intoopen-rmf:mainfrom
ArizmendiWan:traffic-dependency-kdtree-slice1

Conversation

@ArizmendiWan
Copy link

@ArizmendiWan ArizmendiWan commented Mar 20, 2026

This PR adds a first slice for evaluating faster conflict detection in mapf negotiation by introducing an experimental KD-tree broad phase for proposal conflict checks.

What Changed

  • add ConflictDetectionAlgorithm::{Baseline, KdTree} and detect_conflicts_for_proposals(...)
  • add a KD-tree broad phase over trajectory bounding-box envelopes before exact conflict checks
  • add parity tests to compare baseline vs KD-tree outputs on deterministic synthetic workloads
  • add a Criterion benchmark for low/medium/high-overlap synthetic cases
  • add a small example that prints baseline-vs-KD-tree comparison stats
  • add notes describing the benchmark slice and how to run it

Why

This is meant to test whether a spatial broad phase can reduce candidate pair enumeration before exact conflict checking, especially in sparse workloads, without changing planner semantics.

Verification

Run locally with:

CARGO_HOME=$PWD/.cargo_home cargo test -p mapf
CARGO_HOME=$PWD/.cargo_home cargo run --release -p mapf --example conflict_detection_report
CARGO_HOME=$PWD/.cargo_home cargo bench -p mapf --bench conflict_detection

Observed comparison from the report example:

  • low overlap, 64 agents, 32 waypoints: pair enumeration 2016 -> 363
  • runtime ~0.51 ms -> ~0.05 ms
  • conflict outputs matched the baseline path in the added parity tests

GenAI Use

  • I used a GenAI tool in this PR.
  • I did not use GenAI
    Generated-by:
    OpenAI Codex (v0.115.0) with GPT-5.4

Signed-off-by: ArizmendiWan <2311602492@qq.com>
@mxgrey mxgrey added this to PMC Board Mar 20, 2026
@github-project-automation github-project-automation bot moved this to Inbox in PMC Board Mar 20, 2026
@mxgrey mxgrey self-requested a review March 24, 2026 01:14
@mxgrey mxgrey moved this from Inbox to In Review in PMC Board Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

2 participants