Repository navigation
Conversation
There was a problem hiding this comment.
go2 replay realtime (arm64)
Details
| Benchmark suite | Current: 6587949 | Previous: 0ea05f6 | Ratio |
|---|---|---|---|
peak memory |
1619.074 MB |
1699.445 MB |
0.95 |
peak threads |
351 threads |
357 threads |
0.98 |
network (transport) |
2724.794 MB |
2725.914 MB |
1.00 |
disk write |
2.129 MB |
1.469 MB |
1.45 |
instructions |
117.174 G |
136.571 G |
0.86 |
This comment was automatically generated by workflow using github-action-benchmark.
[Medium impact] The PR adds shared utilities, with production-call-site changes limited to the Rerun CDR adapter. Not safe to merge until the depth-resizing corruption and float-image reopening failure are fixed. The occupancy boundary concern is non-blocking. FindingsSummaryThis PR groups generated-message helpers under domain modules and adds geometry, calibration, occupancy, image, and point-cloud operations.
The affected helpers remain unchanged across all eight supplied higher-stack revisions through PR #4740; those PRs do not resolve these failures. Reviews (1) · Last reviewed commit: "ci: remove dedicated CDR workflow" · Reviewed by Greptile |
| pixels = cv2.resize( | ||
| view(message), | ||
| (max(1, int(message.width * scale)), max(1, int(message.height * scale))), | ||
| interpolation=cv2.INTER_LINEAR, |
There was a problem hiding this comment.
resize_to_fit passes big-endian pixels directly to OpenCV, which interprets their bytes in native order. A constant 16UC1 image containing 1000 becomes 59395 when resized from 2×2 to 1×1. The same corruption occurs when to_compressed resizes through max_width; PNG decoding then returns the incorrect depth.
Convert pixels to native byte order before resizing, as the PNG and JXL branches already do. This depth-data corruption should be fixed before merging.
| if pixels.dtype.kind not in ("u", "f") or ( | ||
| pixels.dtype.kind, | ||
| pixels.dtype.itemsize, | ||
| ) not in (("u", 1), ("u", 2), ("f", 4)): | ||
| raise ValueError(f"JXL cannot encode dtype {pixels.dtype}") |
There was a problem hiding this comment.
Saved float images cannot reopen
to_compressed accepts 32FC3 for JXL, but from_compressed labels every decoded three-channel image as rgb8. A float32 image therefore encodes successfully and then fails to reopen with ValueError: array dtype does not match rgb8, even though the JXL payload contains the correct float32 pixels.
Preserve 32FC3 when decoding float32 three-channel pixels, or reject that layout before encoding. The supported save-and-reopen flow should work before merging.
| def cell_value(message: OccupancyGrid, point: Point) -> int: | ||
| """Read a world cell, retaining the planner's unknown result outside the map.""" | ||
| x, y = world_to_grid(message, point) | ||
| column, row = int(x), int(y) |
There was a problem hiding this comment.
Outside points read edge cells
cell_value converts coordinates with int before checking bounds. Negative fractions round toward zero, so a point half a cell outside the map reads row or column zero instead of returning UNKNOWN. With an identity origin and resolution 1, both Point(x=-0.5, y=0, z=0) and the corresponding negative-y query return the edge cell's value.
This is a non-blocking boundary correctness concern: callers receive known free or occupied space for an outside-map point. Use math.floor before checking bounds, or check the continuous coordinates first.
| column, row = int(x), int(y) | |
| column, row = math.floor(x), math.floor(y) |
Artifacts
- The executed script constructs and CDR-round-trips real generated messages, tests boundary queries, and loads exact snapshot source without changing checkout, making the narrow reproduction repeatable.
- Ran 20 queries against the original helper with FREE and OCCUPIED grids, showing six negative-fraction failures while all 14 controls passed.
- Repeated the same 20 queries after replacing truncation with floor only in memory, showing that every case passed without modifying tracked source.
- Compared and executed the occupancy helper from all eight supplied exact SHAs, showing identical source and six failures per snapshot, so the higher stack does not fix this helper.
Consolidate generated-message utilities in one review layer before migrating their consumers. This PR absorbs the geometry and pointcloud additions from #4801 and #4802, plus the occupancy and per-point coordinate helpers formerly introduced with mapping.
Use domain modules as namespaces:
image.from_array,image.view,image.to_rgb,image.to_jpeg,image.to_compressed,camera_info.intrinsic_matrix,geometry.quaternion_from_euler,pointcloud.from_xyz,pointcloud.transform, andoccupancy.from_array. Generated classes remain wire values, without wrappers, mixins or package re-exports.Borrowed views are read-only and retain their buffers; source mutations remain visible. Array conversions return independent writable storage. JPEG bytes and CompressedImage messages have distinct APIs. Resize and downsample document when they return the original input. Pointcloud construction now always owns its float32 input, and stamp arrays are independent copies. The unused message_header helper is removed from time.py.
Validation: 225 utility tests passed; focused mypy, Ruff lint and formatting passed. No dependency installation was needed.
Base: #4733. Next: #4734 for consumer migration. #4803 is closed and its buffer behavior changes have been removed from the downstream stack. #4801 and #4802 are superseded by this PR.
The dedicated
.github/workflows/cdr-native.ymlis removed throughout this stack. Test sources remain; CDR integration CI will be designed separately.