Repository navigation
perf(threads): warm mobile caches and offline linked mirrors - #629
Merged
Merged
Conversation
nixuuu
force-pushed
the
perf/thread-cache-mobile
branch
3 times, most recently
from
November 13, 2026 10:08
6a917e2 to
32cf309
Compare
nixuuu
force-pushed
the
perf/thread-cache-mobile
branch
2 times, most recently
from
November 13, 2026 10:33
f639dcb to
580ba33
Compare
nixuuu
force-pushed
the
perf/thread-cache-mobile
branch
from
November 13, 2026 10:44
580ba33 to
7fa1423
Compare
nixuuu
marked this pull request as ready for review
November 13, 2026 10:56
This was referenced Nov 13, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 13, 2026
A retained thread panel continued `GetThreadPanel` polling every five seconds while the app was backgrounded. Covered native-stack screens also retained clocks and decorations. Scope recurring work to foreground screen visibility, share countdown ticks, and cancel diagnostics uploads on suspension. A pure-TS lifecycle regression guard covers suspension, resumption, duplicate activity events and teardown. Fixes: #559 Related: #629 | Instrumented path | Before | After | | --- | ---: | ---: | | Visible thread panel, recurring reads/min | 12 | 12 | | Background/covered thread panel, recurring reads/min | 12 | 0 | | 20 mounted request countdowns, foreground timers | 20 | 1 | | Same countdowns, background timers | 20 | 0 | Method: temporary hook instrumentation outside the repository, executing the production query cache and hooks with a simulated 120-second clock. These are timer/request counts, not native CPU, FPS, React render rates, hardware wakeups or battery measurements. No conversation payloads were captured. Native profiling is blocked: T3 Device list and open report `Could not communicate with device support. Try refreshing devices.` Refreshing once did not recover the service. SSH profiling was available, but Android was in `DevLauncherErrorActivity` with zero recorded app frames. Its 0.2% process CPU is therefore excluded as an invalid Canopy baseline. iOS's installed process was at 0.0% in `ps`, also without a verified scenario. No native before/after claim is made. | Requested native scenario, both platforms | CPU / JS+UI FPS / renders/s / wakeups / requests per minute | | --- | --- | | Thread list with 2+ Working threads | Unavailable before and after | | Streaming thread | Unavailable before and after | | Idle open thread | Unavailable before and after | | PR panel | Unavailable before and after | | List idle for two minutes | Unavailable before and after | Inspection found UI/native-thread animation loops, stable list keys, memoized timeline/tree rows, and the existing shared status-label clock. The warmer remains bounded to one request at a time and at most 12 starts/min; unchanged heads do not schedule reads. No hot-message log spam or animated backdrop blur was found. The 24-slice text shimmer and continuous composer geometry sampling still need a native GPU/layout profile. This PR only suspends those paths when hidden/backgrounded; it does not claim to eliminate foreground heating. Validation uses `nice -n 10`: install, gen:check, typecheck, repository lint, format:check and web build passed. The focused lifecycle regression test passed. Both native JS/Hermes exports passed (approximately 12 MB each). Full check:tmp passed on the combined changes: 2,749 passed, 166 skipped, zero failures, and nothing left in the checked temp directory. All CI checks passed at this head. Expo ESLint has pre-existing findings: isolated `dev` baseline 82 errors, changed tree 79, with no new file/rule errors. No UI suites, EAS builds, release builds, publications or native dependency changes. Native fingerprints are unchanged in the same local stable config: - iOS: `74705db3a68907bc28379bb9b1080a227bc0755b` - Android: `7d38be8f5c9bf842d62060c75820a206f99c87e3` UI copy is unchanged. Native visual verification remains blocked by device support.
nixuuu
added a commit
that referenced
this pull request
Nov 13, 2026
## Projekt workspace'u — zaakceptowany układ v2 Podgląd plików przechodzi z modala do zakładek jednego wątku. Sygnet projektu, skracany tytuł i karty dzielą rząd nagłówka, z aktywną kartą zawsze widoczną i przełącznikiem overflow. Prawy rail obsługuje jeden minimalny moduł. Bez modułu podsumowanie jest dokowane i widoczne; z modułem jest zamkniętą domyślnie kartą pływającą. Na wąskich ekranach obie powierzchnie używają arkuszy. Użytkownik zaakceptował układ v2 i udzielił jawnej zgody na implementację. Przyjęte decyzje: jeden zastępowalny czysty preview, utrwalany przez Edit/Keep tab/dwuklik, zakres cwd/worktree wątku i mobilna edycja natywna bez kolorów podczas pisania (kolory w viewerze i Preview changes). Usunięto sekcję otwartych decyzji. Dokument uwzględnia jeden przycisk menu wiersza (#608), zachowanie treści PR przy odświeżaniu (#611), bounded warming/cache transkryptu (#622/#623/#629), niezależne sortowanie sidebara (#617/#619/#626), kompaktowy tekst stanów preview (#634), poprawne stany ChoiceControl (#637), kolejkę kontynuacji (#630) i podsumowania jej wierszy (#633). Nie dodaje pełnych snapshotów ani prefetch plików podczas warming. Siedem kompletnych warstw będzie osobnym stosem z podstawą dev. Wszystkie PR implementacyjne pozostaną draftami do ukończenia i weryfikacji całości oraz wspólnego scalenia przez maintenera. Migracje muszą zachować monotoniczność względem aktualnego dev. Dokumentacyjny PR po zielonym CI jest gotowy do scalenia przez maintenera. ## Weryfikacja i ograniczenia - Rebase na dev `1626a3e6b05494e7aec77942bd818950468a3b58` bez konfliktów. - `nice -n 10 bun run format` i `nice -n 10 bun run format:check` przeszły. Konfiguracja pomija Markdown; dokument sprawdzono ręcznie. `git diff --check` bez błędów po usunięciu pustej linii końcowej. - Brak zmian kodu aplikacji i kontraktów; testy wykonania oraz pomiary budżetów należą do stosu implementacyjnego. - Samodzielna makieta v2 poza repozytorium, 32 435 bajtów, przezroczyste html/body, trzy stany × trzy szerokości × dwa motywy. Poprzednio wyrenderowana i obejrzana bez błędów konsoli. ## Copy audit (§8) Brak zmian produkcyjnych etykiet. Projekt zachowuje `Thread`, `Keep tab`, `Thread details`, `Open in tab`, `Collapse panel` / `Show panel` oraz dostępne nazwy obu kontekstów `+`. Zachowuje jeden przycisk menu wiersza i kompaktowy tekst statusów pliku. Krótkie i długie etykiety są pokazane w makiecie; rzeczywiste powierzchnie i stany będą audytowane w każdej warstwie UI.
nixuuu
added a commit
that referenced
this pull request
Nov 14, 2026
When an off-screen mobile thread advances beyond the warmer's 256-record replay limit, its fresh window currently overwrites the reader's loaded history. Returning then loses older pages and the reading anchor. Mobile now uses the shared `RetainedThreads` for recently opened views. Fresh warm windows advance a separate cache copy, while the retained view keeps its pages, history boundary and cursor. Reopening renders that view and resumes its own cursor with incremental batches. Ordinary background deltas still update retained views. Retention is bounded to 12 views / 12 MiB encoded, with mounted screens protected; existing memory/disk cache limits remain separate. Pairing cleanup clears retention before disk work. Manual work-fold and tool-group choices now belong to the retained view and survive reopening. Cell heights remain owned by native `FlatList`: reusing them across screens would require a wider list-layout change and device verification, so this follow-up leaves them unchanged. The shared retention also guards an idle-leave race: accounting an old retained view after a warm fallback cannot overwrite the warmer's newer cache checkpoint. Validation: - `bun install`, `bun run gen:check`, full `bun run typecheck`, `bun run lint` (repository oxlint), `bun run format:check`: passed locally with `nice`. - Focused `check:tmp` for `thread-warming.test.ts` and `mobile-thread-cache.test.ts`: 16 passed, 128 assertions, no failures, empty temp directory. Includes real-gateway web/mobile replay after 300 off-screen records, retained pages and cursor, batches only on reopen, retention count/byte limits, shown-screen protection, pairing cleanup and delayed-leave cache isolation. No UI suites added. - iOS and Android Hermes exports: passed. iOS bytecode: 11,760,257 bytes; asset directory: 6,506,870 bytes. Android bytecode: 11,751,871 bytes; asset directory: 6,506,484 bytes. Production-profile EAS fingerprints are unchanged before/after: iOS `6ddec9ef559ee0095ac33e94ff9418a942053b17`, Android `5f6eae3ab278f1cd543e9ed763f923a319b65ec9`. - Additional Expo ESLint has existing React Hooks failures (91 errors / 19 warnings across mobile). Comparing the affected files against `dev` found the same existing errors and two fewer warnings; no new errors. The required repository oxlint check passes. - Full suite is left to CI because host load rose above 8 during checks. Device checks are blocked: no device host. Exports do not establish native anchor/frame-time behavior. Copy audit (docs/copy.md §8): no UI text changed. Polish mobile/performance documentation updated. `git show` confirms #623 introduced web/desktop warming; mobile's direct cache-replacement adapter was added by #629. This corrects that pre-existing mobile behavior, not #687. Fixes: #629 Related: #687
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.
Mobile now warms its existing persistent thread cache while the application is foreground and its overview connection is live. Restarted clients load the durable per-thread checkpoint and fetch only sequence deltas. Linked thread warming reads the local committed mirror, including while its source computer is offline.
Validation on the final stack: install, gen:check, full typecheck, lint, format:check and web build passed with nice. Focused check:tmp passed cache warming 6 tests / 41 assertions, linked mirrors 1/36, schema 23/85, sidebar ordering 5/22 and client diagnostics 9/70, with empty temp directories. Warming covers head owner scoping, bounded tails, delta reconnect, persistent mobile restart and recency independent of display/manual ordering. Current-head CI static checks, web/Linux build and commitlint passed; all four test shards are still running. A previous local full attempt was stopped after 1,092 passing tests and green CI on the preceding stack; it is not a completed local full pass for these heads.
Native before/after measurements could not run: device discovery failed twice with “Device list failed: Could not communicate with device support. Try refreshing devices.” No APK/EAS build was attempted. Therefore mobile frame time, battery use, requests/minute and native memory remain unverified; limits are implementation budgets, not measurements. The one-frame target is not established. Web measurements and their caveats are recorded on the preceding PR.
Stack 624 is based on dev cfb9846, including the merged sidebar-sorting stack and #628 citations. The generated protobuf and schema conflicts retain both behaviors. gh stack rebase completed; neither gh-stack-rebase-state nor Git's active rebase state remains. Current head: 7fa1423. All PRs remain draft. Measurement limitations above remain open.
Copy audit (§8): no additional product labels in this layer; it records the diagnostics labels introduced by the preceding layer. No merge requested; keep the entire stack draft until the remaining evidence is resolved.