Skip to content

iOS: OLED Driving Mode, Benchmark Dim Screen, and Core ML Placement - #31

Open
moltenglue wants to merge 1 commit into
zoompilot:mainfrom
moltenglue:ios-driving-mode
Open

moltenglue wants to merge 1 commit into
zoompilot:mainfrom
moltenglue:ios-driving-mode

Conversation

@moltenglue

Copy link
Copy Markdown
Contributor

Summary

Split out from #30 as an independent iOS-only PR based on main (214c31c / v0.10.4):

  • OLED Driving Mode (RootView, StatusScreen, StatusContent, HeroCard):
    • Pure-black OLED overlay accessible from the Status toolbar or Display & Accelerator > Driving Mode while connected to a comma.
    • Shows connection headline, active model name, live fps / P99, and thermal state without charts or bright UI cards.
    • Automatically dims the active UIWindowScene's screen brightness to 0.05 and restores the user's previous brightness on exit or scene deactivation.
  • Benchmark Dim Screen (BenchmarkScreen):
    • Adds a Dim Screen button next to Cancel during a benchmark run, presenting a pure-black OLED progress overlay (.fullScreenCover) with brightness dimming (0.05 + restore) lifecycle handled cleanly on the overlay itself so BenchmarkScreen.onDisappear never undoes it.
  • Reliable isIdleTimerDisabled & OLED Poll Pacing (AppModel, JetlinkPhoneApp, DeviceMonitor):
    • Keeps UIApplication.shared.isIdleTimerDisabled = true while Driving Mode, Benchmark Dim Screen, an active benchmark/comparison, or serving with Keep Screen On is in the foreground (only re-enabling auto-lock when actually entering .background, with a false → true refresh on activation/dimming so iOS never sleeps or locks while dimmed).
    • Pauses 1 Hz os_proc_available_memory polling while dimmed and quantizes routine memory updates (>= 8 MB deltas above a 256 MB low watermark) to cut SwiftUI invalidations.
  • Core ML Placement Readout & CPU Fallback Banner (PhoneServer, StatusState, StatusContent):
    • Reads meta["placement"] from the loaded engine's sidecar (already written by OrtBackend on main) to display % ANE (N/total ops) in Display & Accelerator, plus an orange Core ML CPU Fallback banner when >= 10% of ops fall back to CPU.

Verification

  • xcrun swift-format lint --strict --configuration macos/.swift-format --recursive ios/Jetlink: 0 errors.
  • xcodebuild -project ios/Jetlink.xcodeproj -scheme Jetlink -destination 'generic/platform=iOS' CODE_SIGNING_ALLOWED=NO build: BUILD SUCCEEDED.

How to Test

  1. Build and run Jetlink on an iPhone or iPad.
  2. Start a 10 Minutes benchmark on the Benchmark tab and tap Dim Screen; confirm the screen dims to black, displays elapsed time / P50 / P99, stays awake past the device's normal Auto-Lock timeout, and restores brightness when tapped or finished.
  3. Connect to a comma on Status, check the Core ML Placement readout, and enter Driving Mode to confirm OLED dimming + wake lock + brightness restore on exit.

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