Skip to content

Improve Android stability, memory handling and UI responsiveness - #741

Merged
ShiftHackZ merged 3 commits into
developfrom
fix/android-stability
Nov 15, 2026
Merged

ShiftHackZ merged 3 commits into
developfrom
fix/android-stability

Conversation

@ShiftHackZ

@ShiftHackZ ShiftHackZ commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Description

Moves Android ONNX, MediaPipe, stable-diffusion.cpp and experimental PrismML Bonsai generation into a private bound :inference process so an engine exit can return a controlled failure while the application host remains alive. Adds job ownership, progress, cancellation and result-file validation without automatically replaying interrupted inference. Foreground and WorkManager Bonsai generation share this boundary; iOS Silicon Diffusion keeps its existing Core ML and MLX paths.

Also includes:

  • Asynchronous authorization storage initialization, typed recovery and coordinated configuration publication.
  • Gallery metadata paging, bounded image decoding/caches, schema 13 migration and streaming original-image export.
  • Shared Settings/form rendering improvements, reduced theme invalidation and opt-in UI diagnostics.
  • Shared core:navigation, single-operation use-case contracts, Kotlin lint in the test workflow and native-symbol validation tooling.

Validation and remaining work

  • Android Full/FOSS/Playstore debug APKs, non-debuggable Profile, iOS KMP and signed iOS Simulator host builds passed. The Bonsai changes passed Android three-flavor builds and iOS KMP compilation.
  • Added 51 unit tests covering Bonsai gateway delegation, captured backend/NSFW fields, worker-owner cancellation, preserved iOS routing, admission serialization, child failures, quarantine/cleanup, durable replay rejection, strict request files and PNG validation. CI explicitly runs the Full flavor app tests alongside the shared-module unit suites.
  • Local testDebugUnitTest :app:testFullDebugUnitTest kotlinLint passed: 1,036 tests passed, 27 existing presentation tests skipped, zero failures; Kotlin lint passed for 1,706 files. A1111/SwarmUI custom-URL fixtures and the deferred-preview expectation are updated for the current contracts. Both API contract checks passed in the preceding CI run.
  • Real Pixel 3a XL checks covered ONNX, SDCPP and Bonsai output at 128×128, cancellation/retry, natural low-memory child exits with host survival, gallery/export, settings and form editing/scrolling. iOS Simulator shared UI/gallery checks passed.
  • Bonsai Binary MLX 1-bit on Pixel completed CPU generation at 128×128, one step and CFG 1 in 7 minutes 38 seconds. The image rendered and persisted with matching metadata. Process mappings confirmed its native library was loaded only in the child. Foreground cancellation and WorkManager generation after Home with notification cancellation preserved the host and cleaned up the child/request files. Full WorkManager output and every cancellation/fault boundary remain unverified.
  • Remaining acceptance: ordinary Debug scroll frames still reached 148 ms in the form and 59 ms in Settings. Separate Profile observations were 37 ms and 20 ms; these are descriptive runs, not a controlled release benchmark.
  • Valid MediaPipe output, affected OEM/GPU reproduction, the background/quota matrix and iOS native-editor offscreen focus/caret verification remain outstanding. iOS Silicon Diffusion generation was not rerun for the Android Bonsai changes. Production crash/ANR resolution is not claimed.

Screenshots / Video (Optional)

Checklist

  • I have ensured this PR does not contain any breaking changes for existing functionality
  • I have added automated tests that cover the new behavior and removed obsolete tests and code
  • I have added documentation for any new public APIs and update existing documentation for any changes to public APIs

Tested On

  • Android: Emulator
  • Android: Real device
  • iOS: Simulator
  • iOS: Real iPhone device

@ShiftHackZ
ShiftHackZ force-pushed the fix/android-stability branch from 37b1e7d to 2ca0149 Compare November 15, 2026 14:35
@ShiftHackZ
ShiftHackZ force-pushed the fix/android-stability branch from 2ca0149 to 88adf72 Compare November 15, 2026 14:48
@ShiftHackZ
ShiftHackZ marked this pull request as ready for review November 15, 2026 15:04
@ShiftHackZ
ShiftHackZ merged commit 2154c00 into develop Nov 15, 2026
1 check passed
@ShiftHackZ
ShiftHackZ deleted the fix/android-stability branch November 15, 2026 15:25
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