Skip to content

Add shared process reporting with honest phase progress - #141

Open
Myuavbug66 wants to merge 2 commits into
CNCKitchen:mainfrom
Myuavbug66:process-reporting
Open

Myuavbug66 wants to merge 2 commits into
CNCKitchen:mainfrom
Myuavbug66:process-reporting

Conversation

@Myuavbug66

@Myuavbug66 Myuavbug66 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Add shared process reporting with honest phase progress

Why

The need arose while I was working on a part with 37 million triangles.
During long-running operations, I wanted to see which phase was running and
when it had last reported progress, rather than relying on a busy indicator
alone.

A busy indicator cannot distinguish waiting for a worker from receiving actual
progress. Long, synchronous kernel and simplification calls can stay quiet even
while running. This adds visibility without treating elapsed time as proof of
advancement or inventing an overall percentage, ETA, or stalled-process verdict.
Repeated stops and restarts during large-file testing also exposed a second
gap: once active reporting disappears, there should still be a record of the
last phase and any reported error, without inventing a cause for a browser crash.

What changed

  • Click WORKING in the status strip to toggle a compact Processes panel.
  • Show independent tracked worker/export requests, their initial labels, elapsed
    time, latest reported phases, and time since their last received report.
  • Show a clearly labelled overall summary of the processes currently listed.
  • Keep requests without reports marked No update received yet.
  • Show percentages only for phases with measured progress; clear an old
    percentage when the next phase cannot quantify progress.
  • Report reduction preparation, simplification, indexing, sorting and both
    verification directions, with actual verification point/sample counts.
  • Report CAD kernel/helper calls and feature steps without completing their
    pending requests early.
  • Support keyboard toggling and layouts down to 280 pixels wide.
  • Explain timing, reporting limitations and lack of cancellation through the
    existing information icon.
  • Retain up to 20 recent request outcomes, with the last phase, timing and
    reported errors. Failures, timeouts and restored interruptions open details
    and stay visible until dismissed.
  • Keep the compact box dimensions unchanged on completion. An open successful
    report closes within two seconds; history remains accessible afterward.
  • Add Copy diagnostics, Clear history and best-effort tab-local reload recovery,
    without storing geometry, automatically uploading reports or retrying work.
  • Make failure details shareable through Copy diagnostics: copy a text
    report to the clipboard for pasting into a support conversation or issue,
    even after the active operation has ended.

Implementation

The existing task activity store now retains each request's original label,
start time and latest report time. Worker RPC associates progress and consumed
custom events with request IDs, retaining compatibility with older progress
messages that have no request ID. Replies and worker termination clear their
activities; a timed-out request stays visible until its late reply or worker
termination rather than falsely claiming that the worker stopped.
Terminal replies, worker errors, explicit restarts/shutdowns and export outcomes
are recorded separately. A response timeout records a warning while computation
may continue; a late reply records its eventual outcome.

Export preparation and saving now share one error boundary through saveBuilt,
including synchronous and asynchronous builders. STEP, scan mesh/cloud and
sheet SVG/DXF handlers no longer nest error-owning wrappers: a failed inner
save cannot produce a falsely completed outer export.

The bounded journal uses session storage, isolated by browser tab and site.
Starts/outcomes are saved immediately; progress checkpoints are throttled to
once per second. Pending records restored after reload become interrupted,
with cause unknown and elapsed time limited to the last saved observation.
Storage and clipboard failures are explicit. Diagnostic text redacts paths,
URLs and common credential assignments; users should review it before sharing.

The status strip owns the panel toggle. A single observed application-activity
fallback covers existing busy flags when no tracked requests are present.
The panel refreshes displayed wall-clock durations once a second while active.

Reduction instrumentation reports the same verification work at bounded
intervals. Sorting is explicitly named as a separate phase. The tolerance-first
algorithm, simplification inputs, geometry, verification coverage and output
shape are unchanged. CAD uses existing kernel/helper events.

No new dependencies, version bump, saved-project format changes, speed
optimizations, cancellation implementation or diagnostic Wasm are included.

How to use

  1. Start an operation, such as Mesh Tools -> Reduce mesh.
  2. Click WORKING at the bottom of the window, or focus it and press
    Enter or Space, to open the report.
  3. Read each process's elapsed time, last update and current phase. A percentage
    belongs to that phase only, and may restart for the next phase or pass.
  4. Open the information icon for the timing/reporting explanation.
  5. Toggle WORKING again to close the panel. If left open after successful
    requests, it shows Completed and closes within two seconds while the
    page is responsive. Failure/timeout/interruption details stay until dismissed.
  6. Click READY - Recent operations or ERROR - View details afterward.
    While work is active, click the panel's Processes heading for history.
    Manually reopened history stays open until dismissed.
  7. Use Copy diagnostics to copy recent outcomes for troubleshooting, or
    Clear history to remove them without changing active work or the project.
    A 2.5-second popup directly above the clicked button confirms that
    diagnostics are on the clipboard, no file
    was saved, and the text can be pasted into chat or a text editor. It does
    not resize the report box, steal focus or require dismissal.

Existing Cancel/Stop controls remain unchanged. This panel cannot cancel work.

Copy diagnostics after a failure

Why: an operation can fail or stop reporting before someone can record its
last phase and error. The retained history and Copy diagnostics button let
them share the available evidence afterward, rather than trying to reproduce
the failure or describe a vanished message.

  1. A tracked failure, response timeout or restored interruption automatically
    opens the recent-operation details, which remain until dismissed. If already
    dismissed, reopen them using ERROR - View details or
    READY - Recent operations at the bottom left.
  2. Click Copy diagnostics at the bottom of the history panel. While viewing
    active work, click the panel's Processes heading to reach history first.
  3. A 2.5-second confirmation directly above the button says:
    "Diagnostics copied to clipboard. No file was saved. Paste into chat or
    a text editor."
  4. Paste with Ctrl+V into a support chat, issue description or text editor.
    To keep a file, save the pasted text from the editor yourself.

The copied report is formatted JSON containing the app version, capture time,
currently tracked requests and up to 20 recent outcomes. Available details
include operation labels, last reported phases, timestamps, elapsed time,
measured progress and reported error messages. It copies the retained history,
not just the single failure currently being viewed.

No file is created, nothing is uploaded automatically, and no scan geometry
is included.
Paths, URLs and common credential assignments are redacted;
review the text before sharing because redaction cannot guarantee removal of
every private detail. If clipboard access fails, the panel shows an explicit
error instead of a success confirmation.

These are observed diagnostics, not a guaranteed crash log or automatic
root-cause analysis. A timeout does not prove that computation stopped, and a
restored interruption does not establish why the browser or operation ended.

Screenshots

Real operation: filling holes

Actual hole-filling operation reporting elapsed time and processed-hole counts

User-supplied capture from the customized local app during a real operation.
The report shows Mesh worker: edit, 7s elapsed, a last update of
0s ago, and Filling holes - 700 of 4,608.... The bottom status strip
repeats the current phase. This is an in-progress example, not evidence of
completion, a performance benchmark or an estimated time remaining.

The desktop and narrow-screen examples below use explicitly synthetic
simultaneous activities to illustrate additional reporting states. They do
not show private project data or represent CAD benchmarks.

Desktop: opening and interpreting the report

Desktop process reporting with one measured phase and one pending request

Click WORKING at the bottom left to open this panel. The screenshot shows:

  • Overall timing above the individual process rows.
  • A synthetic mesh request reporting 42% of its current measurement phase,
    with elapsed time and the age of its last update.
  • A separate synthetic CAD request showing No update received yet rather
    than an invented progress value.
  • The information icon for explanations and an explicit reminder that the
    panel cannot cancel work.

Narrow screen: the same information in a compact layout

Process reporting on a narrow screen

The panel stays within this 390-pixel viewport, keeps both requests readable,
and leaves its WORKING toggle accessible at the bottom. The browser check
also verifies that the panel fits a 280-pixel viewport without horizontal
overflow.

Failure details remain available

Synthetic worker failure retained in the compact reporting panel

An intentionally failing test worker demonstrates retained error details and
the ERROR - View details control. This is not a diagnosis of the earlier
large-scan incident. The Copy diagnostics button at the bottom copies the
retained report for sharing; it does not save a diagnostic file or send it
anywhere automatically.

Interrupted requests after reload

Reload recovery marks an unfinished synthetic request interrupted with cause unknown

An isolated reload restores the pending request's last checkpoint as interrupted,
not successful or automatically restarted. Details scroll within the small box.

These five images are GitHub attachments, not application-source assets.

Validation

Prepared against upstream v0.11.2 (89ca713).

CI follow-up: dense kernel reports and empty cut previews

The initial GitHub browser job exposed two problems, both reproduced in an
isolated local app:

  • Dense custom CAD worker events repeatedly enqueued a state update clearing
    an already empty application-activity fallback, eventually reaching React's
    update-depth limit. Only clear that fallback when it actually exists.
  • A cut plane outside the scan returned two empty arrays backed by the same
    buffer. The worker attempted to transfer that buffer twice and failed.
    Retained diagnostics correctly surfaced the previously hidden error, but the
    resulting panel covered the mesh-edit test's next control. Return independent
    empty buffers; do not hide the failure, dismiss it in the test or change cut
    geometry or validation.

Follow-up validation:

  • 50 focused unit tests passed, including transfers of empty previews for
    planes on both sides of the scan. Both new transfer cases failed before the
    fix.
  • The reporting browser check passed with no console errors, including a real
    worker sending 1,000 custom kernel-event reports during an active agent
    command. This added regression produced React errors before the fix.
  • Both originally failing browser scenarios, mesh edits and agent-driven
    Reverse engineer, passed with no console errors in the full local run.
  • Production build/type-check, plugin-boundary, units and whitespace passed.
  • The full Windows browser matrix did not pass: the recovery check stopped
    with Runtime.callFunctionOn: Promise was collected, without app console
    errors. A repeat also encountered generated-picture overwrite refusals.
    Those separate test-environment failures are not suppressed or patched here.
  • All seven GitHub checks passed on follow-up commit 64924d1: all four
    unit-test shards, build/browser (including the full browser matrix and
    production smoke), CLA and dependency licenses.
    Clean CI run.

Pre-follow-up full regression refresh

After the history, clipboard and export-outcome updates:

  • Full application suite: 3,690 passed, 24 skipped; 452 test files passed
    and 13 skipped. Private-fixture skips remain expected.
  • MCP suite: 149 passed, 0 failed.
  • Production build/type-check, plugin-boundary, display-units and whitespace
    checks: passed.
  • Latest isolated reporting browser check: passed, with no console errors,
    including retained failures, reload recovery, success-close timing and the
    button-anchored clipboard confirmation.
  • Upstream remains at 89ca713. The native local-save backend and its 512 MB
    limit removal are excluded from this reporting-only contribution.
  • At this earlier checkpoint the complete browser matrix had not run locally;
    see the subsequent CI follow-up above.

Latest history extension:

  • Export-outcome follow-up: 21 focused lifecycle/worker tests passed, including
    synchronous/asynchronous preparation failures and failed browser download
    handoff; build, boundary, units and whitespace passed. The isolated reporting
    browser check passed with no console errors, including the latest
    button-anchored clipboard notice. Local native-save size-limit changes are
    separate customization and are not included in this reporting-only PR.

  • Four focused lifecycle test files: 23 passed.

  • Reporting-only build, plugin boundary, units and whitespace checks passed.

  • Expanded isolated browser check passed with no console errors: actual worker
    failure, retained last phase, concurrent success/failure, automatic close
    measured against the two-second maximum, unchanged box dimensions, manual
    history access, clipboard failure, reload/interruption recovery, no automatic
    retries, blocked storage and generated-mesh reduction.

  • Clipboard-confirmation follow-up: build, boundary, units and whitespace
    passed. The isolated browser check verifies clipboard/no-file wording,
    measured two-to-three-second visibility, repeated-copy timer reset, continued
    visibility after closing the report and no success popup on failed copying.

  • Customized local integration: 43 focused tests passed, including native
    export success/cancellation/write errors; build and the same isolated browser
    checks passed. Its isolated candidate passed plugin-boundary and units checks.

Historical reporting baseline validation (before the history extension; the
full suites/build checks are superseded above, while the production-browser
smoke below has not been rerun for the extension):

  • npm run build: passed.
  • node scripts/check-plugin-boundary.mjs: passed.
  • node scripts/check-units.mjs: passed.
  • git diff --check: passed.
  • npm --prefix mcp test: 149 passed, after restoring this worktree's missing
    dependencies with its existing lockfile.
  • node scripts/e2e-process-reporting.mjs: passed with no console errors.
    Covers pending/independent requests, honest report timestamps, phase changes,
    numeric progress, keyboard/click toggling, help text, 280-pixel layout, rapid
    event delivery, completion, fallback activity and a generated-mesh reduction.
  • Isolated production-browser smoke: passed with no console errors. Covered
    bundled-worker import, project save/reopen and on-demand STEP/PLY/SVG/DXF
    exports.
  • npm test -- --maxWorkers=2: 3,685 passed, 24 skipped (452 test files
    passed, 13 skipped). This is the upstream-only reporting worktree; it does
    not include the additional tests in the customized local app.

Limitations and non-goals

  • This is shared reporting, not complete instrumentation of every algorithm.
    Overlapping untracked busy flags are represented by one application-activity
    row, not fabricated independent jobs.
  • A completed request is not certification of a valid CAD build or geometry.
    Existing feature/build diagnostics remain authoritative. Activity without an
    explicit outcome is labelled unknown, not successful.
  • Session storage is best-effort diagnostic retention, not a project backup or
    guaranteed crash log. Closing a tab, clearing storage or a browser crash may
    lose records. No assertion of an out-of-memory cause is made without evidence.
  • Last update means a message/status change was received, not proof of useful
    geometry progress. Queueing and quiet library calls count toward elapsed time.
  • Synchronous work on the browser's main thread can freeze the panel and timers.
    Reporting does not prevent unresponsive-page warnings or fix large-mesh
    visible-selection performance.
  • There are no system-wide CPU/GPU/RAM estimates, ETA, automatic stall diagnosis,
    or additional cancellation controls.
  • Generated browser fixtures do not certify performance on very large private
    scans. Private-fixture skips are reported rather than weakening tolerances.
  • The local full-browser-matrix attempt did not pass; see validation above.

Track honest worker phases, elapsed time and recent outcomes in a compact panel. Keep failures available, support clipboard diagnostics and tab-local interruption recovery, and preserve explicit export failure outcomes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Myuavbug66
Myuavbug66 marked this pull request as ready for review November 13, 2026 01:50
Avoid redundant fallback state updates during dense kernel events and return independently transferable empty cut-preview buffers. Add focused regressions without hiding diagnostics or changing geometry validation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

This branch has not been deployed

No deployments
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.

1 participant