Repository navigation
perf(monitor): keep refresh work compact and observable - #18
Merged
Merged
Conversation
Problem: Routine Monitor refreshes decode large full snapshots, while failed refresh telemetry loses phase-attempt metadata and can distort phase means. Decision: Use compact process-row snapshots and deltas for the default flat Monitor path, with full-snapshot fallback when needed. Record nullable phase timings, separate attempts from measured samples, and carry partial timings through failed or cancelled refreshes. Rationale: Avoid unnecessary deep FFI decoding without changing rich-view behavior, preserve the legacy bridge_fetch_millis scope, and never treat an unmeasured duration as zero. Validation: - `swift test --package-path macos --filter 'MonitorLiveRowsTests|SnapshotRefreshTelemetryTests|MonitorViewModelTests'` passed (12/12). - `swift test --package-path macos` passed (212/212). - SwiftLint strict passed on 12 modified Swift files (0 violations). - `cargo fmt --all --manifest-path rust/Cargo.toml --check` passed. - `git diff --check` passed. - Independent review returned PASS; it noted that failure telemetry aggregation is tested with synthetic timings, not end-to-end through AppState. - The affected Aethyme `cargo-test` gate was not run because `.aethyme/gates.toml` has `reviewed=false`. Alternatives considered: Continue fetching full snapshots on every Monitor refresh; rejected because it preserves unnecessary deep decoding. Risks: Monitor payload errors remain swallowed by `try?` and may be classified as no-change. Release build and local app rebuild remain unverified. Memory: No new persistent state or external data collection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Monitor's routine refresh path decoded the full snapshot even when the flat list only needed compact process rows. Failed or cancelled refreshes also lost phase-attempt metadata, which skewed attempt counts and timing means.
Root cause
The UI did not use a compact delta projection for the default Monitor view. In the error path,
AppStaterecorded zero timings instead of preserving the worker's attempted phases and partial measurements.Decision
Use compact process-row snapshots and deltas for the default flat Monitor, with full-snapshot fallback when a view feature or incomplete delta requires it. Preserve the thermal forecast across the FFI projection. Record phase durations as optional, count attempts separately from measured timing samples, and carry partial timings through failure and cancellation. Keep
bridge_fetch_millisscoped to the full snapshot fetch.Validation
swift test --package-path macos --filter 'MonitorLiveRowsTests|SnapshotRefreshTelemetryTests|MonitorViewModelTests': 12/12 passed.swift test --package-path macos: 212/212 passed.fe0fd9377ca78a2e75836ca7a16f8d1e373bed09:cargo-testpassed, exit 0, 163.2 s.cargo fmt --all --manifest-path rust/Cargo.toml --check: passed.git diff --check: passed.Risks and limitations
try?and can be reported as no-change.Scope and size
This is one cohesive change across the compact projection, UI fallbacks, FFI shape, telemetry, and tests. The broker warned that the PR exceeds its 800-line heuristic (14 files, 1,515 changed lines); splitting these coupled paths would make the behavior harder to review and keep synchronized.
Tracking
No matching pre-existing Aetower issue was found; this PR is the standalone delivery record.