Skip to content

Step 1: cache displayed geometry and draw buckets outside map locks - #599

Merged
JanuszBedkowski merged 1 commit into
MapsHD:mainfrom
dancmari:HDMapping-legacy
Nov 1, 2026
Merged

JanuszBedkowski merged 1 commit into
MapsHD:mainfrom
dancmari:HDMapping-legacy

Conversation

@dancmari

Copy link
Copy Markdown
Contributor

Step 1 rebuilds and uploads unchanged point/line geometry each frame, and bucket drawing holds the map mutexes needed by odometry. Retain GPU geometry until its source or display settings change, and prepare/draw bucket geometry outside those locks.

Fixes #594. Follows the correctness fix in #590.

  • Cache initial/reference points, trajectory points/axes, prediction overlays, bucket points and normals. Covariances share one unit wire mesh with cached transforms.
  • Reuse the existing PointVertex layout, point shader, ScanRenderer::PointsGPU and PointBufferPart, using rlgl buffer creation/update/release functions. The final draw calls retain the existing OpenGL GL_POINTS/GL_LINES approach.
  • Copy only bucket display fields under a nonblocking map lock, at most every 100 ms during processing. Reuse the last coherent copy while the map is busy; stopped-state refreshes are unthrottled.
  • Invalidate on snapshot/source/map changes, processing transitions, manual trajectory corrections, consistency, shading, filtering and reference decimation. Camera movement and point size remain draw parameters.

Odometry math and synchronized trajectory publication are unchanged. GPU work and resource cleanup stay on the GUI thread. Only seven functional source/header files are included; there are no added tests, scripts, benchmark data or formatting-only line-ending changes.

Validation: Release builds passed for Step 1, the raw data viewer and Step 3; existing Step 1 tests passed (24 cases / 35 assertions). clang-format 21.1.8 and git diff --check passed, with CRLF preserved. Local graphical comparisons gave zero differing pixels for the tested layers, including normals and covariances; unchanged cache draws performed no geometry uploads.

One controlled recording comparison, processing time only:

Drawing path Processing Peak resident memory, including loading
Upstream GUI drawing 418.63 s 3.14 GB
Cached drawing 284.75 s 3.14 GB

This pair reduced processing time by 32.0%. Both runs used the same algorithm/libraries, saved parameters and input, processed 3,927 workers / 78,540 poses, performed 686,454 iterations and produced byte-identical full-precision pose dumps. Neither hit the optimizer time limit.

Both used a workspace input copy and hidden window targeting 60 FPS, with initial points, indoor buckets, trajectory points and intensity shading enabled. Loading and final result writing were excluded; GPU memory was not measured. This is one paired comparison. Visible-window checks of the actual gizmo/consistency workflows and repeated timing runs remain pending.

@dancmari

dancmari commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

It could be up to 1.5x faster than the legacy v106 version for larger datasets.
raw 2883s 00h:48m:03s
v106 6567s 01h:49m:27s
v106+PR#599 3842s 01h:04m:02s (x1.7)

@JanuszBedkowski
JanuszBedkowski merged commit ff8d06e into MapsHD:main Nov 1, 2026
7 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.

Step 1: reuse GPU buffers when displayed geometry has not changed

2 participants