Three related fixes for per-key lighting state being lost on the wire:
1. The per-key canvas models layout gaps as placeholder cells with
zone_id -1. Paint strokes sweeping a gap emitted -1 in the delta,
which entered the setting's map, was persisted, and then aborted
EVERY subsequent full-map repaint at frame pack time
(OverflowError: can't convert negative int to unsigned) — the apply
was logged and ignored, so keys silently kept stale colors or went
dark. Filter gap cells from the delta before it reaches the sink.
2. PerKeyLighting now sanitizes zone keys against the device-reported
zone bitmap in update/write/read paths, so an already-poisoned
persisted map (saved by a build without fix 1) heals on read instead
of permanently breaking repaints.
3. WIRELESS_DEVICE_STATUS power-on reconfig requests went through the
ConfigChange-cookie dedup gate. On a G915 TKL the cookie survives a
power cycle, so the gate concluded nothing changed and skipped
apply_all_settings — but power-on wipes volatile state (RGB buffers,
host-mode lighting), leaving the keyboard dark until manual
intervention. A powered-on notification now forces the apply.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>