Skip to content

feat: implement Phase 18 fixed-owner fleet optimization - #24

Merged
404khai merged 3 commits into
mainfrom
feat/phase-18-fleet-optimization
Oct 8, 2026
Merged

404khai merged 3 commits into
mainfrom
feat/phase-18-fleet-optimization

Conversation

@404khai

@404khai 404khai commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Two current unassigned orders can compete for a rider whose eligibility is constrained by a hard deadline. Sequential greedy assignment can admit only one even though the fleet can serve both. Implement Phase 18 joint batch allocation and editable suffix resequencing while preserving every committed owner, custody fact, acceptance reference and active action.

Dispatch now supports canonical greedy, multi-start construction and best-improvement local search, using the shared whole-plan evaluator. Feasible plans maximize newly admitted count before minimizing remaining road seconds, distance and canonical fleet identity. Neighborhoods insert unplaced requests, relocate editable stops/proposed pairs, and eject/reinsert proposed work. Breached or unevaluable riders remain unchanged; unknown new-order forecasts are explicitly isolated. Complete declared search over the evaluable remainder may publish despite incomplete original input coverage. Budget exhaustion cannot publish an incumbent.

Publication binds exact world/version and clock/routing/traffic/readiness/policy/execution/config context and atomically installs all new assignments, plans and acceptance terms. Simulation schema 3 forms current batches and continues existing active execution before reading the current effective plan. Schemas 1/2 retain prior semantics. Readable/JSON CLI fixtures, API/architecture docs and a complete PASS/FAIL gate report are included. Phase 19 remains deferred.

The three commits group dispatch/independent proof, simulation/scenarios, and documentation/generated benchmark evidence. Generated replay JSON lives under benchmarks/results/phase-18-replays; the handwritten gate report is docs/phase-18-completion.md.

Validation:

  • Formatting, strict workspace Clippy, API docs, release build and all 177 workspace tests pass (159 previous + 18 new).
  • Independent exact oracle enumerates ownership/unplaced choices and full precedence-valid permutations without production generation/ranking. Sixteen seeded two-order comparisons, 24 three-order seeds × three algorithms, and fixed-owner custody/resequencing cases pass.
  • Greedy trap: greedy admits one; local/multi-start admit two and match the exact oracle.
  • Explicit local optimum limitation: 32 road seconds versus the oracle's 30; no global VRP optimum is claimed.
  • Twenty-four seeded actual-readiness replays preserve semantics with reversed external collection construction.
  • All 12 CLI fixtures replay; the measured collector independently verifies 36 scenario/algorithm configurations with one warmup and 11 measured runs each.
  • Versioned evidence records hardware, source/configured dataset hashes, graph sizes, compiler/build/binary hash, raw/median/p95/p99 timing, deterministic work and exact-oracle quality. Process memory is explicitly unmeasured; small synthetic process timings make no production-scale claim.

Reproduce the evidence:

cargo fmt --all -- --check
cargo +1.99.0 clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo +1.99.0 test --workspace --all-features --locked
cargo +1.99.0 test -p roadrunner-dispatch --test fleet --locked -- --nocapture > target/phase18-oracle.log
cargo +1.99.0 build -p roadrunner-cli --release --locked
PYTHONDONTWRITEBYTECODE=1 python3 scripts/collect_fleet_benchmark.py --oracle-log target/phase18-oracle.log --output target/phase18-results.json

@404khai
404khai merged commit e2975fd into main Oct 8, 2026
4 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