led_brightness sat at companion offset 174, in front of the WiFi
fields, so a 272-byte file written by upstream dev decoded with the
wrong led_brightness and a shifted SSID. Append it after wifi_pwd
(offset 272) and restore the original test offsets and the 208/272
historical lengths.
WT2 and V4.3 only got CONFIG_PWM through esp32s3_pwm_led.conf, which
the release build never passes, so release links would fail. Set
CONFIG_PWM=y in each board.conf instead. board.conf is app-only and
mcuboot does not inherit it, so the mcuboot link failure that rules out
the defconfig does not apply.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
companionPrefsEncode()/serverPrefsEncode() never wrote the led_brightness
byte that companionPrefsDecode()/serverPrefsDecode() already read,
desyncing every field that follows it by one byte on the companion side
(wifi_enabled/wifi_ssid/wifi_pwd) and silently truncating the server
format by one byte. Caught by CI's ASan/UBSan run on the host regression
suite: an out-of-bounds read/write in the pinned layout tests.
Since led_brightness never existed upstream, nothing already accounted
for it: fixing only the encoder still leaves the pinned byte tables and
the documented 272/311-byte totals (COMPANION_PREFS_SIZE/
SERVER_PREFS_SIZE, used by the real prefs stores too, not just tests)
one byte short of what the encoder now actually produces.
- PrefsCodec.h: bump both size constants (272->273, 311->312).
- PrefsCodec.cpp: add the missing w.put() in both encoders, mirroring
the position already used by both decoders.
- prefs_codec_tests.cpp: add led_brightness to both layout tables at its
real file offset (shifts wifi_enabled/wifi_ssid/wifi_pwd by one byte
on the companion side; server's is appended last, nothing else
shifts), extend both historical-boundary length lists with the new
full-format length, and give it a non-default value in sample() so
the layout/roundtrip tests actually exercise it.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
- tests/ (114 host cases over production sources), the CI workflow
(ASan/UBSan on PRs and master pushes) and REGRESSION_TEST_PLAN.md
are tracked
- .gitignore grouped and deduplicated (173 -> 96 lines, same ignored set)