Skip to content

fix(desktop): scope native activity and distinguish decode CPU time - #74

Merged
rldyourmnd merged 2 commits into
mainfrom
fix/desktop-native-work-cpu-timing
Oct 1, 2026
Merged

rldyourmnd merged 2 commits into
mainfrom
fix/desktop-native-work-cpu-timing

Conversation

@rldyourmnd

@rldyourmnd rldyourmnd commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Installed diagnostics reported occasional 0.3–0.75 second native decode stages even for tiny packets, alongside separate multi-second frame reads. Elapsed native duration alone could not distinguish actual CPU work from waiting/preemption, and reporting delay could inflate the completed stage.

Completed decode probes now fix their end time before reporting and sample the worker's read-only thread CPU clock. Unsupported/failed CPU observations stay absent. A macOS viewer-lifetime Foundation user-initiated activity keeps ongoing reference processing classified as user-requested work while the window is covered, explicitly allowing idle system sleep and preserving ordinary display sleep/lock behavior. No global power/QoS policy is changed.

Validation: a real blocking-worker fixture performs 20 ms of CPU work and 80 ms of sleeping and verifies that thread CPU excludes the wait. All 72 macOS desktop unit tests and strict workspace/all-target/all-feature lint passed. All-feature focused suites passed 217 tests on macOS and 220 on Linux (9 explicit display-dependent ignores). Linux strict all-feature workspace lint and both optimized builds passed. Installed executable digests, original identities, IPC and remote service health were verified; native follow-up is running. Existing pinned Rustix/Foundation bindings are reused; no new package or wire change.

App Nap is a candidate, not a proven cause. The installed predecessor still failed native continuity (ten minutes: decoded-age p95 799 ms/max 6570 ms, zero reconnects). CPU observations and the activity guard require current installed follow-up; this PR does not close latency, quality or sustained stability acceptance.

@rldyourmnd
rldyourmnd marked this pull request as ready for review October 1, 2026 22:02
@rldyourmnd
rldyourmnd merged commit 1dad4e5 into main Oct 1, 2026
18 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.

1 participant