Skip to content

feat(gui): self-calibrating ETA, progress overhaul, --benchmark instrumentation - #1100

Merged
louis-e merged 2 commits into
mainfrom
feat/gui-progress-eta
Jun 14, 2026
Merged

louis-e merged 2 commits into
mainfrom
feat/gui-progress-eta

Conversation

@louis-e

@louis-e louis-e commented Jun 14, 2026

Copy link
Copy Markdown
Owner

GUI progress + ETA:

  • Add a phase-aware "time remaining" estimate, shown as a white pill on the progress bar. It only runs during generation (>=20%); within the current phase it extrapolates the real rate (least-squares over a sliding window), budgets remaining phases by per-regime time-weights calibrated to this run, and snaps to the real save rate. Smoothed, monotonic countdown via a 1s tick.
  • Additive streaming field on the progress-update payload (= eviction_active) via emit_gui_progress_update_ex, used only by the two terrain emits, so the ETA picks the right regime (the post-70% tail is ~instant under stream-to-disk but a real save otherwise). Graceful fallback when absent.

Progress messages/percentages (now monotonic in real execution order):

  • Fetch Overture buildings right after the OSM download (dedup stays after parse). Download 1-5, Overture 6, surface types 9, elevation 10, elevation processing 12-18 (real progress), transform 19 (fixed), generating area 20-70, ground 70-90, save 90-100.
  • Friendlier, deduplicated messages: "Downloading map data", "Adding extra buildings", "Detecting surface types", "Generating area".
  • Drop the dead stream_to_disk locale key (removed low-memory-mode toggle).

--benchmark instrumentation (gated; no output or cost without the flag):

  • Top-level per-phase marks + a per-step elevation breakdown. generation_time_ms and the peak-RSS marker are unchanged, so the PR benchmark CI is unaffected.

…umentation

GUI progress + ETA:
- Add a phase-aware "time remaining" estimate, shown as a white pill on the
  progress bar. It only runs during generation (>=20%); within the current
  phase it extrapolates the real rate (least-squares over a sliding window),
  budgets remaining phases by per-regime time-weights calibrated to this run,
  and snaps to the real save rate. Smoothed, monotonic countdown via a 1s tick.
- Additive `streaming` field on the progress-update payload (= eviction_active)
  via emit_gui_progress_update_ex, used only by the two terrain emits, so the
  ETA picks the right regime (the post-70% tail is ~instant under stream-to-disk
  but a real save otherwise). Graceful fallback when absent.

Progress messages/percentages (now monotonic in real execution order):
- Fetch Overture buildings right after the OSM download (dedup stays after
  parse). Download 1-5, Overture 6, surface types 9, elevation 10,
  elevation processing 12-18 (real progress), transform 19 (fixed),
  generating area 20-70, ground 70-90, save 90-100.
- Friendlier, deduplicated messages: "Downloading map data", "Adding extra
  buildings", "Detecting surface types", "Generating area".
- Drop the dead `stream_to_disk` locale key (removed low-memory-mode toggle).

--benchmark instrumentation (gated; no output or cost without the flag):
- Top-level per-phase marks + a per-step elevation breakdown. generation_time_ms
  and the peak-RSS marker are unchanged, so the PR benchmark CI is unaffected.
Copilot AI review requested due to automatic review settings June 14, 2026 20:49
@github-actions

github-actions Bot commented Jun 14, 2026 •

Copy link
Copy Markdown

⏱️ Benchmark run finished in 0m 56s
🏗️ Generation time: 18s (excl. data fetching)
🧠 Peak memory usage: 1004 MB

📈 Compared against baseline: 18s time, 1005 MB memory
🧮 Delta: 38s time, -1 MB memory
🔢 Commit: 7196630

🟢 Generation time is unchanged.
🟢 Peak memory is unchanged.

📅 Last benchmark: 2026-06-14 21:11:36 UTC

You can retrigger the benchmark by commenting retrigger-benchmark.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR overhauls GUI progress reporting to be monotonic in real execution order, adds a phase-aware ETA overlay to the progress bar (with optional “streaming” regime hints from the backend), and introduces --benchmark phase instrumentation across terrain/elevation steps.

Changes:

  • Re-map progress percentages/messages across download → Overture → land cover → elevation → parse/transform → generate → ground → save, and update emit sites accordingly.
  • Add GUI-side self-calibrating ETA logic and a progress-bar overlay element/style; extend the progress payload with an optional streaming field via emit_gui_progress_update_ex.
  • Add benchmark marks in CLI + terrain/elevation code paths (gated by --benchmark).

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/retrieve_data.rs Updates download-phase GUI messaging/progress emits.
src/progress.rs Adds emit_gui_progress_update_ex to emit an additive streaming payload field.
src/overture.rs Moves Overture progress emit to the new monotonic schedule.
src/osm_parser.rs Adjusts/removes parsing progress emits to fit the new phase mapping.
src/map_transformation/transform_map.rs Updates transform phase progress emit and removes per-op progress increments.
src/main.rs Reorders Overture fetch earlier and adds top-level benchmark phase marks.
src/land_cover.rs Aligns land-cover progress emit with the new percentage mapping/message.
src/ground.rs Threads benchmark into terrain/elevation setup and marks land-cover fetch timing.
src/elevation/mod.rs Adds benchmark marks for elevation sub-steps and remaps elevation progress emits.
src/data_processing.rs Renames “Processing terrain” to “Generating area”, remaps progress band to 20–70, and emits streaming in the tile-parallel path.
src/gui/js/main.js Implements the self-calibrating, phase-aware ETA estimator and wires it to progress events.
src/gui/index.html Adds the ETA overlay element to the progress bar.
src/gui/css/styles.css Styles/positions the ETA overlay and ensures the bar container is positioned for overlaying.
src/gui/locales/*.json Removes the dead stream_to_disk localization key across multiple locales.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/progress.rs
Comment thread src/data_processing.rs
- emit_gui_progress_update_ex now forwards emit failures to GUI telemetry
  (send_log), matching emit_gui_progress_update.
- Init last_emitted_pct to 20 (terrain starts at 20% now); the stale 25 value
  suppressed all per-tile progress and the first streaming payload until 26%,
  stalling the bar and delaying the ETA early in generation.
- Land-cover Gaussian (the slowest elevation step on large areas) now reports
  sub-progress: gaussian_blur_grid runs its row/column passes in ~10 chunks and
  reports a fraction between them, mapped to 14->16% of "Processing elevation",
  so the bar animates instead of freezing. Blur output is unchanged (rows and
  columns stay independent; chunking only adds reporting points).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 32 out of 32 changed files in this pull request and generated no new comments.

@louis-e
louis-e merged commit 3eca838 into main Jun 14, 2026
4 checks passed
@louis-e
louis-e deleted the feat/gui-progress-eta branch June 14, 2026 21:23
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.

2 participants