Skip to content

Step 1: explain setup failures, check output folders, choose cache location - #674

Merged
michalpelka merged 1 commit into
mainfrom
mp/step1-network-share
Dec 2, 2026
Merged

michalpelka merged 1 commit into
mainfrom
mp/step1-network-share

Conversation

@michalpelka

@michalpelka michalpelka commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #671

Summary

  • Step 1 on data from a network share or cloud drive (Google Drive for desktop) stopped with only "Initial preparation failed". Setup failures now say why: which file failed the re-read check and how, a missing data folder, or no IMU poses. csv-parser no longer aborts the process when an IMU file can't be read; it reports the file.
  • Before loading, step 1 checks that it can write to the data folder and the cache location, and stops with a clear message if not. The cache location can now be moved off the data folder: HD_MAPPING_CACHE_DIR, or the new Cache menu for the session.
  • Lazy loading records each LAZ file's size and modification time after its first read instead of before. A drive that reports other metadata once a file has been downloaded then passes the re-read check. This targets the likely cause of Step1 - report meaningful error message when initial data setup fails. #671, reproduced on Linux with a FUSE simulation; the cause is not confirmed on Windows.

User-visible changes

  • Cache folder name: the cache folder next to the data is now cache_<YYYYMMDD-HHMMSS>_<pid> instead of cache, one per run. Cleanup deletes only that folder. A cache folder left by an older version is not touched.
  • HD_MAPPING_CACHE_DIR: puts the cache in another folder, created if missing, as <folder>/<data folder name>_cache_<stamp>_<pid>. Applies to the GUI, the command line and the Python bindings.
  • Cache menu: next to "Load & process scanning", with three choices for the current session: data folder, system temporary folder, custom folder. It shows the path, where the setting comes from and free space. The cache location is also listed in the Resources panel.
  • Stop-early check: if the data folder or the cache location is not writable, step 1 stops before loading. The GUI shows a popup and writes no failure report; the command line prints the message and exits with code 1.
  • Failure messages: the failure popup and HDMapping_results_*.json list the reasons for a failed preparation.
  • Unaffected: results are unchanged (byte-identical on the Underground Parking recording). The raw data viewer is unaffected: it doesn't use the cache or run the check. The obsolete precision forestry program gets HD_MAPPING_CACHE_DIR and per-run cache folders, but not the check.

Notes for review

  • 3rdparty/csv.hpp (vendored csv-parser 2.1.3) is patched locally; the changes are marked HDMapping:. An exception on its worker thread used to call std::terminate. It is now rethrown on the reading thread, as a std::system_error naming the file. load_imu passes that error on instead of returning partial IMU data.
  • The new output_folders.h/.cpp holds the cache-location logic and the write check. It is registered in step 1, the raw viewer, pybind and the step 1 tests.
  • The commit applies cleanly to v0.107.1, and its changed files compile there (compile-only check).

Test plan

  • Underground Parking, before and after: all 54 trajectory and pose files and all 52 scans byte-identical.
  • Read-only data folder: stops before loading, exit code 1, no files left behind.
  • HD_MAPPING_CACHE_DIR set to a location that can't be created: message names the variable. Set to a missing folder: the folder is created.
  • FUSE simulation of a drive whose file times change after download: failed before, now completes with the cache in HD_MAPPING_CACHE_DIR, and its outputs match the local run.
  • FUSE simulation of metadata queries failing: "cannot read '': Input/output error" instead of terminate.
  • Full build including pybind; all ctest suites pass (8 new test cases); clang-format clean.
  • Windows: local disk, drag and drop. Results and the end-of-run message as before.
  • Windows: Google Drive for desktop Shared drive, dragged from Explorer. Completes, or the popup names the actual cause.
  • Windows: mapped SMB share.
  • Windows: read-only folder. Popup, no lio_result_N created.
  • Windows: HD_MAPPING_CACHE_DIR set, then the Cache menu. Shows the variable, then a custom folder, then the temp folder; the cache appears there and is removed after the run.
  • Linux: Cache menu by eye (path, source, free space, the three choices).

🤖 Generated with Claude Code

@michalpelka

Copy link
Copy Markdown
Contributor Author

Example of trying to open local dataset that has permission denied:
image

@michalpelka

Copy link
Copy Markdown
Contributor Author

Processing from SMB share (NAS) with cache cahnged to Windows temp
image

…cation

Data on a network share or cloud drive (Google Drive for desktop) made step 1
stop with only "Initial preparation failed".

- Setup failures say why: which file failed the re-read check and how, a
  missing data folder, no IMU poses. The GUI popup and the failure report
  list the reasons.
- csv-parser (3rdparty/csv.hpp, marked HDMapping:): an I/O error on its worker
  thread is rethrown on the reading thread as std::system_error naming the
  file, instead of aborting the process. load_imu passes it on.
- Before loading, step 1 checks that it can write to the data folder and the
  cache location (write, close, size, delete) and stops with a message if not.
- Cache location: HD_MAPPING_CACHE_DIR sets the default; the step 1 GUI has a
  Cache menu (data folder, system temp, custom folder) for the session. Each
  run uses its own folder (cache_<stamp>_<pid> next to the data), and only that
  folder is deleted.
- Lazy loading records each LAZ file's size and time after its first read, so
  a drive that reports other metadata once a file is downloaded passes the
  re-read check (likely cause of the report, not confirmed).
- Windows: every installed tool embeds cmake/utf8.manifest (activeCodePage
  UTF-8, Windows 10 1903 or later), so data folders with non-ASCII names
  (e.g. "ążć") load. Before, LASzip, which expects UTF-8 file names, got
  paths in the ANSI code page and step 1 aborted on the first LAZ file.

Fixes #671

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michalpelka

Copy link
Copy Markdown
Contributor Author

Google drive and cache on Google drive fails:
image
But usingSystem Temp allows us to process data shared with Google drive.

@michalpelka
michalpelka force-pushed the mp/step1-network-share branch from e5750d9 to efa3182 Compare December 1, 2026 23:09
@michalpelka

Copy link
Copy Markdown
Contributor Author

It also work with path likes :
image

@michalpelka
michalpelka marked this pull request as ready for review December 2, 2026 00:24
@michalpelka
michalpelka merged commit 22d9949 into main Dec 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.

Step1 - report meaningful error message when initial data setup fails.

2 participants