Generate the routing gRPC field mapping from a single source of truth
Maintainer thường phản hồi trong vòng 1 ngày
@ramakrishnap-nv đang làm issue này rồi.
Từ ngày 14/8/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Follow-up to review feedback from @rg20 on #1597 (mapper, to_device, round-trip test).
Problem
Adding one field to cpu_routing_problem_t today means editing five places by hand:
- the struct —
cpp/include/cuopt/routing/cpu_routing_problem.hpp - the wire format —
cpp/src/grpc/routing/cuopt_routing.proto - host → proto —
map_routing_problem_to_proto - proto → host —
map_proto_to_routing_problem - host → device —
cpu_routing_problem_t::to_device
Nothing enforces that all five stay in sync. Not the compiler, not a test.
The failure mode is worse than the usual boilerplate complaint. A forgotten field
does not crash — the value silently never crosses the wire, and the remote solve
returns a plausible answer for a different problem than the one submitted.
That is expensive to detect and easy to miss in review.
Scale: cpu_routing_problem_t currently has 41 std::vector members, 6
std::map members, and 5 nested struct types. Roughly 80% of that is one
regular pattern repeated 41 times.
Suggested direction
Both review threads share a single root cause — the field list is written out
five times — so it is worth fixing once rather than twice.
Single source of truth for the routing field list, expanded into the proto,
both mapper directions, to_device, and a round-trip test. Either:
- a routing section in
cpp/src/grpc/codegen/field_registry.yaml, reusing
generate_conversions.py(which already emits 27.incfiles and supports
repeated_messages), or - an X-macro field-list header, which is less machinery and also covers
to_device, which is outside the gRPC codegen's remit.
Caveat worth designing around: routing is less regular than LP. The 6 maps carry
real semantics — order_service_times is keyed by vehicle id with -1 meaning
"all vehicles", vehicle_breaks maps to a vector of structs. Expect ~80%
generated plus a tail of hand-written special cases, not a pure win.
Cheaper first step
A round-trip property test — populate every field with distinct values, go
host → proto → host, compare — catches the same class of bug for a fraction of
the effort and does not restructure anything. Worth doing first, and worth
keeping even after codegen lands.
Prior art in-tree: python/cuopt/cuopt/tests/routing/test_routing_grpc_serialization.py
already fails loudly when a new cuopt.routing._deferred._SETTERS entry is
unmapped. That guards the Python DataModel → cpu_routing_problem_t direction;
this issue is about the remaining C++ hops.
Not blocking #1597
#1597 is approved with these threads open, so this is design follow-up rather
than a merge blocker.
- Ngôn ngữ chính
- Cuda
- Star
- 1.1k
- Fork
- 255
- Merge trung bình
- 1 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 102
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của NVIDIA/cuopt
-
[BUG] Constraint validation reports CSR offset count as the number of rowsCó thể đã có người làm @0z5a đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ci: pr-test-summary job shows red when the GitHub API returns persistent 5xx errorsCó thể đã có người làm @0z5a đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug mip
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 53/100
NVIDIA/cuopt#2290 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] Dataset downloader reports success and replaces data after a failed downloadCó thể đã có người làm @0z5a đã nhận 2 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày