Skip to content

feat(bench): validate CPU/GPU 2-opt selection - #12

Merged
pedrozaz merged 2 commits into
developfrom
feature/cpu-gpu-validation
Sep 22, 2026
Merged

pedrozaz merged 2 commits into
developfrom
feature/cpu-gpu-validation

Conversation

@pedrozaz

Copy link
Copy Markdown
Owner

Summary

Adds a correctness-first, reproducible comparison of the existing CPU and GPU 2-opt move-selection APIs. The runner validates all candidate deltas, the selected move, and the cost after reversal before recording full public-API latency. It changes no public library, kernel, or PTX code.

Key Changes

  1. Validation runner

    • Adds deterministic synthetic routes and opt-in local Solomon inputs to the unpublished vrp-gpu-bench package.
    • Compares every valid GPU delta against the CPU reference, requires invalid matrix cells to be +inf, and compares selected indices exactly.
    • Independently recomputes route cost in f64 after applying a selected reversal. Rejects invalid or divergent results before writing a report.
  2. Reproducible timing and results

    • Measures complete synchronous CPU and GPU selection calls in release mode after warmup, alternating call order and retaining raw per-sample nanoseconds.
    • Adds a create-new CSV report, a standard-library summarizer, a protocol, and a dated report with source, data, PTX, hardware, driver, compiler, and checksum provenance.

Observed Result

The recorded RTX 5060 Ti run passed all delta, selection, and reversal-cost checks on nine synthetic cases and ten C101 routes. For the 2048-customer synthetic route, median complete API latency was 25.52 ms on CPU and 156.17 ms on GPU. The current GPU API was slower for every measured route with at least two customers. These measurements include GPU context/module setup, validation, transfers, kernels, synchronization, and download; they do not isolate kernel time or compare converged solvers.

Commits Included

  • feat(bench): validate CPU GPU 2-opt selection
  • docs(bench): record CPU GPU validation results

Verification

  • just ci: format, all-feature check, strict Clippy, 43 library tests, five runner tests, one doctest, rustdoc, package verification, and cargo-deny.
  • CPU-only workspace tests and Rust 1.88 all-feature bench check, as recorded in the dated report.
  • Recorded pilot and final GPU hardware runs passed every correctness gate; raw CSV contains 380 paired samples.
  • Report statistics were regenerated from the raw CSV and compared with the Markdown table.
  • Both commits have valid GPG signatures and Signed-off-by trailers.

Scope

This PR validates one-move selection and its full public-API latency. It does not implement GPU route convergence, compare equal-budget complete solvers, measure kernel-only throughput, or claim support beyond the tested hardware.

Signed-off-by: Guilherme Pedroza <guilhermebarb0sa@proton.me>
Signed-off-by: Guilherme Pedroza <guilhermebarb0sa@proton.me>
Copilot AI lite review requested due to automatic review settings September 22, 2026 21:46

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@pedrozaz pedrozaz self-assigned this Sep 22, 2026
@pedrozaz
pedrozaz merged commit 962e3c6 into develop Sep 22, 2026
7 checks passed
@pedrozaz
pedrozaz deleted the feature/cpu-gpu-validation branch September 23, 2026 00:47
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.

2 participants