Skip to content

fix(app): disable silence pause under INV-CAP-1 and cut capture-path CPU work - #20882

Merged
Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Git-on-my-level:feat/battery-no-loss-ship-now
Oct 7, 2026
Merged

Git-on-my-level merged 3 commits into
BasedHardware:mainfrom
Git-on-my-level:feat/battery-no-loss-ship-now

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Summary

Battery savings that cannot drop pendant frames, per INV-CAP-1: disables the tiered silence-pause shipped in #20837 (current firmware discards live-mode frames when the phone unsubscribes — the pause engaged exactly that path) and reduces capture-path CPU work on the phone instead.

What changed

  1. Silence pause disabled under INV-CAP-1. The timer is not armed; queued expiry events have no effect; historical #20837 auto-pause markers are recovered at startup through the serialized capture owner; explicit user mute remains authoritative. Conversation silence settings still reach the server for segmentation. Re-enablement requires an advertised, verified device retention + drain capability — there is no opt-in bypass on current firmware (app/lib/services/capture/CAPTURE_POLICY.md).
  2. Memoized native ingress policy decoding. BLE notification admission parses the policy JSON once per revision instead of per packet. Benchmark: 100k real policy loads, 0.774s → 0.082s (~89% less time in this operation). Behavioral tests: one parse across 10k unchanged loads; immediate denial on policy/latch change. Only the BLE ingress owner uses the cache.
  3. Owned BLE payload shared across WAL / socket / voice-command buffering — removes one redundant allocation+copy per connected live packet.
  4. Pendant WAL encoding into one sized buffer — byte-identical output, five-round benchmark median 2.364s → 0.267s for the 1000-chunk fixture (~89% less encoding time). Non-pendant serializer extracted unchanged.

Design doc with the full rejected-proposal ledger (client VAD, socket economy, BLE tuning — and why each was rejected): app/docs/battery-no-loss-ship-now.md.

What this does NOT claim

No whole-phone battery percentage claim. The dominant cost of a worn pendant (BLE notification wakes, socket+cellular upload) is untouched — those require either the firmware retention stack (#20838) or server-side economy. CPU/allocation savings here are measured host-side, labeled as such.

Product invariants affected

  • INV-CAP-1

Failure-Class

Failure-Class: none

Test plan

  • flutter analyze: 89 diagnostics, zero new (base parity).
  • Targeted suites: 190 passed; capture-evidence mode: 17 passed.
  • Full TZ=UTC bash test.sh --timeout 2m: 4,813 passed / 14 skipped (current-main bar: 4,791/14).
  • Spine opt-in: 138 passed. Native (Swift) tests: pass. make preflight: 33 checks.
  • Preservation regression: 300 packets delivered across the former 120s boundary with uploads failing — all 300 retained (the frame-loss path is proven dead).

Review in cubic

Failure-Class: new

Disable silence-driven unsubscribe on current firmware, recover historical automatic pauses, and reduce redundant policy decoding, payload copies, and WAL serialization allocations. Preserve INV-CAP-1, reconnect timing, and durable write cadence.
Move restore effects into the existing uplink extension and extract unchanged phone WAL serialization. Wait for observed sync-drop reconciliation in legacy-state tests and wire INV-CAP-1 path citations to the continued-delivery guards.
@Git-on-my-level
Git-on-my-level merged commit 17682e2 into BasedHardware:main Oct 7, 2026
40 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