ECLIPTIC :app — the cockpit OLED burn-in

:app · the cockpit

OLED burn-in mitigation

burnin/ protects the OLED dashboard over multi-day deployments where the cockpit runs for days with mostly static chrome — rails, gauge frames, the scanline overlay, the tracker outline, labels.

Why OLED-specific

Burn-in is an OLED phenomenon and the fleet is mixed: the Fire HD 10 is LCD (no burn-in, and the slowest GPU), the S9+ is OLED (the dashboard, and a fast Snapdragon 8 Gen 2). So the visual mitigation that costs GPU is gated to OLED; the cheap parts run everywhere.

BurnInDeviceProfile is the gate, and a case-insensitive Build.MANUFACTURER != "Amazon" check is the entire detection. There is no panel-type query available.

The phase machine

PhaseEnters atBacklightDrawn
ACTIVEAny activitysystemDashboard, pixel-shift + brightness breathe
DIM5 min idle0.40Dashboard at content alpha 0.30, breathing frozen
DEEP_IDLE30 min idle0.15standbyScreen — phosphor STANDBY + drifting scan line
SLEEP60 min idle0.01App-drawn pure black, Activity still foreground

BurnInMitigationManager is a pure phase machine on an injectable clock (SystemClock.elapsedRealtime — excludes deep-sleep drift and never jumps with the wall clock), depending only on the location and connection flows plus a narrow BurnInConfigStore persistence port. The cockpit ViewModel is untouched.

What counts as activity

  • Touch
  • Real GPS movement — ground speed ≥ 1 kph or cumulative displacement > 3 m from the reference fix (which catches slow drift below the speed threshold)
  • A vehicle-link phase change

A parked car re-emitting identical fixes does not count, or the dashboard would never idle. The synthetic FakeLocationSource is stationary when parked, so it idles correctly.

FLAG_KEEP_SCREEN_ON is held in every phase (no WAKE_LOCK); “sleep” is app-drawn black rather than a real display-off, so wake-on-touch is instant and there is no lockscreen to fight — the correct model for a mounted dashboard.

Mitigation techniques

TechniqueHowWhere it runs
Pixel-shiftWhole-UI offset{} tracing a slow Lissajous path (default ±2 px / 45 s), placement phase only, no recompositionUniversal — it is cheap
Brightness breathe / dimOne global graphicsLayer alpha with CompositingStrategy.ModulateAlpha — cheap, no offscreen composite, blend-preservingOLED only
Idle escalationDIM → STANDBY → black, plus backlight steppingEvery device, including the Fire, the latter for power

Global breathing was chosen over per-element alpha threading (~40 static call sites across the concepts) for the same wear-distribution benefit with far less surface area.

One writer for screen brightness

The single-arbiter rule

burnInScaffold wraps the entire cockpit from one node and is the single writer of window.attributes.screenBrightness. Ambient-light auto-dim (ScreenBrightness.luxToBrightness, a log-10 interpolation between 5 lux and 2000 lux, floor 0.05) is folded in there as a ceiling that can only reduce: a dark room's floor still beats DIM's larger backlight, and SLEEP's 0.01 can never be raised by a lux tick.

MainActivity used to also apply auto-dim and the two writers fought — burn-in mitigation was defeated whenever the beacon was live. MainActivity.autoDim was deleted; effectiveBacklight is now the single arbiter and the single write site.

The animation clock is a Long, not a Float

A bug that only appears on day three

The burn-in animation clock was an accumulating Float. A Float's ULP exceeds a frame delta at about 6.1 days of uptime, so pixel shift silently froze partway through a 14-day burn. Widening to Double would not have fixed it — the problem is the magnitude of the value, not the increment. It is now derived from a Long nanosecond baseline with each consumer taking its own modulo (phaseFraction), so precision no longer depends on uptime at all.

The animation frame ticker is read only inside the offset / graphicsLayer lambdas (layout and draw phase), never the composable body — matching the RADAR recomposition-storm avoidance.

The stress ledger, deliberately coarse

BurnInLedger accumulates on-time per zone, where a zone is <concept>/<phase> (e.g. RADAR/ACTIVE, MAP/DIM), and reports into the rolling file log, which already survives reboots — so it needs no persistence of its own. A backwards clock is guarded (elapsed is floored at zero) so it cannot credit negative time.

Why not per-region

The originally-planned per-screen-region accounting was not built. The app does not measure which pixels are lit, so a per-region risk figure would be invented data — and an invented burn-risk number is worse than none.

Configuration

BurnInConfig carries every tunable (shift amplitude and period, breathe amplitude and period, the three timeouts, dim and backlight levels, movement thresholds) and coerces itself on both read and write: timeouts forced strictly increasing, amplitudes and alphas clamped. Persisted as individual DataStore keys, and adjustable live on the playa from the hidden bottom-left tuning panel without a rebuild.

The coercion had a real edge-case bug: coerceIn(MAX+1, MAX) is an empty range and threw at the ceiling. Fixed by reserving headroom (MAX_DIM = MAX-2, MAX_DEEP = MAX-1) so the invariant 1 ≤ dim < deep < sleep ≤ 86 400 holds across all of Long, pinned by a 1000-case edge grid.

Verifying on device

Burn-in itself is not observable in a session. To exercise the state machine, temporarily shrink the timeouts in BurnInConfig defaults (e.g. 2 / 4 / 12 s) and DEFAULT_TICK_MILLIS to 1000, deploy, and screencap at intervals — then revert before committing.

Reliable long-press over adb needs a continuous input swipe x y x+2 y+2 900 (one stream, tiny move within slop); separate motionevent calls or a zero-distance swipe register as a tap.

Converted from
design/BURN_IN.md · ARCHITECTURE.md §4.10 · docs/AUDIT-2026-08-09.md C2, C3 (private dev repo)