feat(phase-1/m5.5): perf pass legs --perf-smoke/--perf-verify; M5 closed

Seeds 3000 notes against the real streaming UI (279 ms total, ~0.09 ms/note),
fresh observeAll 70 ms, favorite toggle 1 ms, reopen first non-empty emission
89 ms; only 4 RENDER lines during the seed (size-keyed emission coalesces).
The multi-thousand-note unknown from the Phase-0 recommendation closes:
desktop perf is a non-event at 3000 notes. §7 marked DONE + handoff
"first actions" rewritten for post-M5 sessions (four pending-MANUAL checks
listed).

Verify: :desktopApp:run --args="--data-dir /tmp/incido-perf --perf-smoke
--exit-after 150" (PERF seed 3000/279ms, rc 0) then --perf-verify same dir
(reopen 89 ms, rc 0); :desktopApp:createDistributable + image --self-test
rc=0; --keys-smoke KEYS ALL-OK; :core:data-jvm:smoke M1a PASS;
assembleDebug SUCCESSFUL.
This commit is contained in:
Incido Developer committed 2026-10-06 23:18:27 +13:00
1 parent 6f16e87ec0
commit 9f6124a501
3 files changed
+104 -8

No files matched your search

@@ -130,6 +130,12 @@ fun main(args: Array<String>) {
// --onboarding-verify on the SAME dir asserts the flag gates it off. // --onboarding-verify on the SAME dir asserts the flag gates it off.
val onboardingSmoke = "--onboarding-smoke" in args val onboardingSmoke = "--onboarding-smoke" in args
val onboardingVerify = "--onboarding-verify" in args val onboardingVerify = "--onboarding-verify" in args
// M5.5 perf legs (Phase 1 recommendation §8 "perf on a multi-thousand-
// note library"): --perf-smoke seeds + times on a FRESH dir,
// --perf-verify times the reopen of the SAME dir. UI stays composed
// throughout — the recomposition pressure is part of the measurement.
val perfSmoke = "--perf-smoke" in args
val perfVerify = "--perf-verify" in args
// Recovery-envelope file legs: --key-export writes the INCKEY1 envelope // Recovery-envelope file legs: --key-export writes the INCKEY1 envelope
// the phone's Settings screen writes; --key-import reads one (e.g. a // the phone's Settings screen writes; --key-import reads one (e.g. a
// REAL phone export) with the passphrase and installs the key — the // REAL phone export) with the passphrase and installs the key — the
@@ -239,6 +245,8 @@ fun main(args: Array<String>) {
showFirstRun = !onboarded && !otherScriptedLeg, showFirstRun = !onboarded && !otherScriptedLeg,
onboardingSmoke = onboardingSmoke, onboardingSmoke = onboardingSmoke,
onboardingVerify = onboardingVerify, onboardingVerify = onboardingVerify,
perfSmoke = perfSmoke,
perfVerify = perfVerify,
backupImport = backupImport, backupImport = backupImport,
backupExport = backupExport, backupExport = backupExport,
backupExportEnc = backupExportEnc, backupExportEnc = backupExportEnc,
@@ -272,6 +280,8 @@ private fun NotesWindow(
showFirstRun: Boolean, showFirstRun: Boolean,
onboardingSmoke: Boolean, onboardingSmoke: Boolean,
onboardingVerify: Boolean, onboardingVerify: Boolean,
perfSmoke: Boolean,
perfVerify: Boolean,
backupImport: String?, backupImport: String?,
backupExport: String?, backupExport: String?,
backupExportEnc: String?, backupExportEnc: String?,
@@ -323,6 +333,53 @@ private fun NotesWindow(
} }
} }
if (perfSmoke) {
LaunchedEffect(Unit) {
delay(1000) // past first frame, per the §3 collectAsState trap
withContext(Dispatchers.IO) {
val n = 3000
val t0 = System.currentTimeMillis()
repeat(n) { i ->
val now = System.currentTimeMillis()
repository.saveNoteWithHashtags(
note = Note(
id = 0L,
content = "Perf note $i\nbody line",
createdAt = now,
updatedAt = now,
),
hashtagsToAdd = emptySet(),
hashtagsToRemove = emptySet(),
)
}
val seedMs = System.currentTimeMillis() - t0
println("PERF seed notes=$n total=${seedMs}ms per-note=${seedMs / n}ms (UI streaming throughout)")
val t1 = System.currentTimeMillis()
val all = repository.observeAll().first()
println("PERF fresh observeAll notes=${all.size} in ${System.currentTimeMillis() - t1}ms")
all.firstOrNull()?.let { target ->
val t2 = System.currentTimeMillis()
repository.setFavorite(target.id, true)
println("PERF favorite toggle write ${System.currentTimeMillis() - t2}ms")
}
println("PERF seed leg ALL-DONE (library left at ${all.size} notes for --perf-verify)")
}
}
}
if (perfVerify) {
LaunchedEffect(Unit) {
withContext(Dispatchers.IO) {
val t0 = System.currentTimeMillis()
val delivered = repository.observeAll().first { it.isNotEmpty() }
println(
"PERF reopen first non-empty emission notes=${delivered.size} " +
"in ${System.currentTimeMillis() - t0}ms",
)
println("PERF verify leg ALL-DONE")
}
}
}
// M3: theme_mode is a real shared setting here — resolveDark picks the // M3: theme_mode is a real shared setting here — resolveDark picks the
// scheme. M4.5b: the app's OWN IncidoTheme wraps the shell — the // scheme. M4.5b: the app's OWN IncidoTheme wraps the shell — the
// shared screens get the exact color scheme + typography the phone // shared screens get the exact color scheme + typography the phone
+38
View File
@@ -972,6 +972,44 @@ M5.3 suite:
**Next up: M5.5** — §9 perf pass on the real screens. **Next up: M5.5** — §9 perf pass on the real screens.
**M5.5 — perf pass on the real screens: DONE.**
New `--perf-smoke` (fresh dir) / `--perf-verify` (reopen the same dir)
legs run against the REAL screens with the window composed and the list
streaming — recomposition pressure is part of the measurement, not a
separate microbench. Numbers on this dev box (Arch, Ryzen, no
encryption — the field-cipher leg would add the M3-proved ~55 ms PBKDF2
once per unlock, not per note):
```
--perf-smoke seed notes=3000 total=279ms per-note=0ms (UI streaming throughout)
--perf-smoke fresh observeAll notes=3000 in 70ms
--perf-smoke favorite toggle write 1ms
--perf-verify reopen first non-empty emission notes=3000 in 89ms
RENDER lines during the whole seed: 4 (size-keyed emission coalesces —
no per-save recomposition storm)
exit codes 0, clean --exit-after teardown both legs
```
Verdict: a multi-thousand-note library is a non-event on desktop — the
ObjectBox queries, flow emission and LazyColumn all stay far under a
frame budget at 3000. The §8 "perf on a multi-thousand-note library"
unknown is CLOSED.
**M5 — PACKAGING AND INTEGRATION: DONE** (sub-milestones M5.1–M5.5
above, one commit each). Remaining pending-MANUAL items, all recorded
where they arose:
1. One real Esc / Ctrl+N keypress at the desk (`esc(captured)` logs —
Wayland blocks headless injection).
2. HiDPI font crispness eyeball at `uiScale=2` (geometry scaling proven).
3. First real tag run of `desktop-release.yml` (job steps verified
locally piecewise).
4. Carried from M3: the physical phone→desktop recovery-key leg.
**Next up: Phase 2 selection (§8)** — streaming backup formatVersion 2
driven by the seed numbers above, voice notes on desktop, OS-keyring
caching, JBR bundling for native Wayland, macOS/Windows GA.
+9 -8
View File
@@ -247,7 +247,7 @@ Exit criteria: one shared UI codebase; Android visually unchanged
(`assembleDebug` + on-device smoke); desktop shows the real list, editor and (`assembleDebug` + on-device smoke); desktop shows the real list, editor and
settings wearing Incido's theme. settings wearing Incido's theme.
## 7. M5 — packaging and integration ## 7. M5 — packaging and integration — **DONE** (M5.1–M5.5, run logs in `DESKTOP_FEASIBILITY.md`; pending-manual list recorded there: real keypress, uiScale eyeball, first tag run of `desktop-release.yml`, M3's phone→desktop recovery-key leg)
`packageDistributionForCurrentOS` per OS on a GitHub Actions matrix (no `packageDistributionForCurrentOS` per OS on a GitHub Actions matrix (no
cross-compiling); icons, `.desktop` entry, tray + single-instance, first-run cross-compiling); icons, `.desktop` entry, tray + single-instance, first-run
@@ -273,10 +273,11 @@ this handoff trustworthy. Never widen a seam silently: if a platform needs a new
abstraction, justify it in the commit message. Flag anything unverifiable abstraction, justify it in the commit message. Flag anything unverifiable
instead of assuming it works. instead of assuming it works.
**First actions for a new session:** `git log --oneline -6` → read **First actions for a new session:** `git log --oneline -8` → read the
`tools/DESKTOP_FEASIBILITY.md` → run `:core:data-jvm:smoke`, the "Phase 1 status" tail of `tools/DESKTOP_FEASIBILITY.md` (M5 entries) →
`:desktopApp:run … --self-test` command, and the M3 crypto legs above to run the §1 gates to confirm the tree (they now include the M5.1/M5.2
confirm the tree matches this description → start M4 task 1 (convert legs) → **Phase 1 M1–M5 are all DONE**; what remains is the four
`:composeApp` in-place to `kotlin("multiplatform")` with pending-MANUAL checks listed at the end of the feasibility status
`androidTarget()` + `jvm()`, per §6 order of attack — decide within a day (real Esc/Ctrl+N keypress, uiScale=2 readability, first
of real friction whether to fall back to a `:ui-shared` module). `desktop-release.yml` tag run, phone→desktop recovery-key leg), then
pick Phase 2 candidates from §8.