Skip to content

Step 1: report stage timings and resource usage - #608

Merged
JanuszBedkowski merged 2 commits into
MapsHD:mainfrom
dancmari:HDMapping-legacy
Nov 2, 2026
Merged

JanuszBedkowski merged 2 commits into
MapsHD:mainfrom
dancmari:HDMapping-legacy

Conversation

@dancmari

@dancmari dancmari commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Step 1 currently gives GUI, CLI and manual-save elapsed values different boundaries. Initial loading/cache preparation and result writing are missing from the GUI's final elapsed value, and resource use during loading is hidden by a blocked UI.

Add per-run accounting shared by the progress window, completion summary and HDMapping_results_*.json:

  • Build RunReport once as a position-independent static library and link every consumer of the shared odometry sources, including the viewers, calibration tools and Python bindings. Native Windows libraries and thread support are declared on that common target.
  • Record monotonic durations for loading, initial trajectory, cache preparation, odometry, export, cleanup and optional consistency, with explicit pause and total definitions. Re-export and deferred cleanup extend the same run without counting interactive idle or replacing odometry time with zero.
  • Persist a versioned run_analysis containing stage/resource summaries, operation history, completion/error status and sampling coverage. Keep existing result metadata and label the legacy elapsed field's scope. Write reports through a temporary file and update them after cleanup.
  • Show current/run-peak resident RAM, private commit, GPU dedicated/shared memory where supported, system memory/commit context and available space on pagefile/cache/spill/output volumes. Save time-weighted means, sampled extrema and per-stage statistics; unavailable readings remain null.
  • Account for completed cache-file writes and export chunks, including overwrites, preparation size/file count and historical peak. Track spill size at reset/finish/destruction boundaries without adding work to each appended point.
  • Keep loading and processing on an owned worker so loading progress/resources remain visible. The renderer does not access geometry being initialized. Automatic processing and manual re-export use one completion notification; closing updates the report after cache removal without another popup.
  • Show the input recording span separately from processing time, using the first/last already loaded raw IMU timestamps, including gaps. This requires no additional data reads or scan.
  • Propagate cache/export/stream-close failures and preserve failed/cancelled status through cleanup instead of reporting successful completion.

Measurement boundaries are documented in doc/processing_report.md. Final report serialization itself is outside measured operation intervals. GUI cache is explicitly retained for later work and cleaned up on exit; CLI includes immediate cleanup. Private commit is not physical pagefile occupancy. GPU adapter sums may include shared allocations more than once. Cache-size accounting covers completed writes from this run, excluding unmodified files left by an earlier run.

Memory is sampled about once per second and disk space every five seconds, independently of frame rate, with bounded stage-boundary refreshes. OS queries run outside the report mutex; the GUI reads aggregates. The Windows GPU counter query is reused across runs. Sampling/setup/cache-accounting costs are included in the report: one local ~30 s run used ~25 ms for subsequent resource queries plus cache bookkeeping, with a separate ~0.36 s cold GPU-provider initialization; a reused query took ~0.4 ms. These are local observations, not a performance guarantee.

Validation: Windows x64 Release builds for both Step 1 entry points, the forestry entry point, both raw-data viewers and both calibration tools; all four actual Python 3.12 extension modules build and import. Ubuntu 24.04 WSL/GCC 13: the actual shared reporting CMake target builds and passes runtime checks, links into an executable and a Python 3.12 extension module, and the extension imports and reports Linux memory correctly. Existing Step 1 tests and local GUI/CLI checks cover responsive loading, raw timestamp span, actual pause/resume, re-export, spill reset/removal, cancellation, invalid input, writer failure and final JSON updates. Six trajectory CSV files were byte-identical between the comparison runs. clang-format 21 and git diff --check pass. Local test scripts, fixtures, outputs and binaries are not included.

Persistent dialog locations will be proposed in a separate PR.

Fixes #600.

@JanuszBedkowski
JanuszBedkowski merged commit be4dc8b into MapsHD:main Nov 2, 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: report stage timings, disk cache size and complete run duration

2 participants