Commit Graph
14073 Commits
Author SHA1 Message Date
J. Nick Koston 35491f2649 Revert "[api] Merge tag + value into single __restrict__ scope in encode_uint32/uint64/bool/fixed32"
This reverts commit fe012272f8.
2026-03-28 22:15:28 -10:00
J. Nick Koston fe012272f8 [api] Merge tag + value into single __restrict__ scope in encode_uint32/uint64/bool/fixed32
Each of these methods called encode_field_raw() then a value encoder,
causing a store-load pair on pos_ between the tag and value writes.

Inline the tag write into the same __restrict__ local scope as the
value write so the compiler can emit tag + value with a single pos_
load at start and store at end. Verified on Xtensa: encode_uint32
now does one load + two writes + one store (was load-store-load-store).
2026-03-28 22:06:31 -10:00
J. Nick Koston 0603190c3c [api] Restore debug bounds checks in __restrict__ varint loops
Add sync_debug_check_bounds_() that syncs pos_ from a local pointer
before checking bounds. Use it in encode_varint_raw_64 and
encode_varint_raw_slow_ to restore per-byte bounds checking in
debug mode without breaking the __restrict__ optimization in
production (where it's a no-op).
2026-03-28 19:55:50 -10:00
J. Nick Koston 3a76f9d5d2 [api] Merge varint length + memcpy into single pos scope in encode_string
Previously encode_string called encode_varint_raw(len) then
encode_raw(data, len) as separate methods, each with their own
__restrict__ pos scope. This caused a redundant store-load pair
of pos_ between the two operations.

Inline the length varint write and memcpy under a single local
pos variable so the compiler can keep pos_ in a register across
both operations. Eliminates one load-store pair per string encode.
2026-03-28 19:51:55 -10:00
J. Nick Koston c6938adb61 [api] Apply __restrict__ local hoist to all ProtoWriteBuffer pos_ accessors
Apply the same __restrict__ local pointer pattern proven in
encode_varint_raw_64 to all remaining methods that write through
pos_: encode_varint_raw, encode_varint_raw_short, write_raw_byte,
encode_raw, write_tag_and_fixed32, encode_string, encode_bool,
and encode_fixed32.

Each method now hoists pos_ into a __restrict__ local before
writing and stores back once at the end. When the compiler inlines
these into a generated encode() method, it can keep pos_ in a
register across consecutive calls instead of reloading from memory
after every write.
2026-03-28 19:47:40 -10:00
J. Nick Koston 83e4478bc2 [api] Apply __restrict__ local hoist to encode_varint_raw_slow_
Same optimization as encode_varint_raw_64: hoist pos_ into a
__restrict__ local so the compiler keeps it in a register across
the loop instead of reloading from memory each iteration.
2026-03-28 19:45:49 -10:00
J. Nick Koston 3886751662 [api] Restore comment on __restrict__ local in encode_varint_raw_64 2026-03-28 19:45:07 -10:00
J. Nick Koston 537af1fe6b [api] Hoist pos_ to local in encode_varint_raw_64 to avoid reload per byte
Use a __restrict__ local pointer for the varint write loop so the
compiler can keep it in a register instead of reloading pos_ from
memory on each iteration. Eliminates the store→load dependency
chain that was causing 7 load/store pairs for a typical 48-bit
BLE address varint.
2026-03-28 19:44:16 -10:00
J. Nick Koston 2137e4600a [api] Hoist pos_ to local in encode_varint_raw_64 to avoid reload per byte
Use a __restrict__ local pointer for the varint write loop so the
compiler can keep it in a register instead of reloading pos_ from
memory on each iteration. Eliminates the store→load dependency
chain that was causing 7 load/store pairs for a typical 48-bit
BLE address varint.
2026-03-28 17:43:11 -10:00
J. Nick Koston 52897fd067 [api] Add 2-byte inline fast path for sint32 varint encode/size
Add encode_varint_raw_short() and ProtoSize::varint_short() that
inline both the 1-byte and 2-byte varint paths, falling back to
the noinline slow path for 3+ bytes.

Use these for sint32 fields (zigzag encoding), where values like
RSSI (-100 to 0) produce zigzag values that are 1-2 bytes. This
avoids a function call for the common case without bloating the
generic encode_varint_raw fast path.
2026-03-28 17:27:40 -10:00
J. Nick Koston 777e162070 [benchmark] Add BLE raw advertisement proto encode benchmarks
Add CodSpeed benchmarks for BluetoothLERawAdvertisementsResponse
(12 advertisements) covering calculate_size, encode, calc+encode,
and fresh-buffer paths.

Includes a lightweight bluetooth_proxy stub header in
tests/benchmarks/stubs/ so the api component can compile with
USE_BLUETOOTH_PROXY on the host platform without pulling in
ESP32 BLE dependencies.
2026-03-28 17:08:52 -10:00
Jonathan Swoboda b6abfec82e [core] Fix area/device hash collision validation not running (#15259) 2026-03-27 22:22:24 -04:00
Jonathan Swoboda 47774fb644 [modbus_controller] Fix wrong enum in function_code_to_register (#15253) 2026-03-27 19:55:57 -04:00
Jonathan Swoboda 34410e92b7 [as5600] Remove dead angle/position sensor code (#15254) 2026-03-27 19:55:40 -04:00
Edward Firmoandpre-commit-ci-lite[bot] a99f051e19 [nextion] Replace queue name string literals with short Nextion-native identifiers (#15215)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-27 13:49:00 -10:00
Keith Burzinski f6c63c62e4 [tmp117] Code clean-up (#15260) 2026-03-27 17:59:26 -05:00
Jonathan Swoboda 76d75850a3 [sgp4x] Remove dead voc_baseline config option (#15250) 2026-03-27 17:35:12 -04:00
Jonathan Swoboda 68d9f657ad [bl0940] Fix energy reference default using wrong constant in legacy mode (#15249) 2026-03-27 21:32:37 +00:00
Jonathan Swoboda 24b8a95340 [pid] Remove unused PIDSimulator class (#15247) 2026-03-27 17:24:15 -04:00
Jonathan Swoboda d245b9f123 [sm2135] Fix copy-paste error in setup pin mode (#15248) 2026-03-27 17:24:03 -04:00
Edward Firmo a2dee21e8e [nextion] Replace std::deque queues with std::list (#15211) 2026-03-27 10:24:19 -10:00
dependabot[bot] 3016cd3636 Bump github/codeql-action from 4.34.1 to 4.35.1 (#15245)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-27 09:29:08 -10:00
Jonathan Swoboda 7532e1f957 [multiple] Fix uninitialized members and error constant types (#15235) 2026-03-27 14:58:41 -04:00
Jonathan Swoboda f0db0c1054 [esp32] Add ESP-IDF 5.5.4 and 6.0.0 version mappings (#15241) 2026-03-27 14:48:08 -04:00
Jonathan Swoboda 05c15f4241 [remote_base] Fix gobox uint64_t format specifier (#15237) 2026-03-27 08:44:40 -10:00
Jonathan Swoboda 951ad91cb2 [atm90e32] Fix phase angle precision loss and remove unused member (#15238) 2026-03-27 08:39:30 -10:00
Jonathan Swoboda 53bd57f3c2 [pid] Fix inverted debug log conditions and broken smoothing formula (#15240) 2026-03-27 08:37:54 -10:00
Jonathan Swoboda 4b9467cd0c [esp32_ble_client] Fix wrong union member in OPEN_EVT handler (#15236) 2026-03-27 08:37:33 -10:00
Jonathan Swoboda 0a607b9c93 [esp32_ble_server] Fix wrong union member in STOP_EVT handler (#15239) 2026-03-27 08:36:16 -10:00
Jonathan Swoboda 810c046cc6 [multiple] Fix misc hardware register bugs (#15208) 2026-03-27 14:25:38 -04:00
J. Nick Koston 5a8d6931a8 [factory_reset] Migrate FastBootTrigger to callback automation (#15232) 2026-03-27 08:24:35 -10:00
J. Nick Koston 0d67f91fac [rf_bridge] Migrate triggers to callback automation (#15231) 2026-03-27 08:24:25 -10:00
J. Nick Koston f9d41bd36a [modbus_controller] Migrate triggers to callback automation (#15230) 2026-03-27 08:24:15 -10:00
J. Nick Koston 39509265bc [haier] Migrate triggers to callback automation (#15229) 2026-03-27 08:24:03 -10:00
J. Nick Koston 2f3c21c7c1 [ezo] Migrate triggers to callback automation (#15228) 2026-03-27 08:23:50 -10:00
J. Nick Koston d77bf23c76 [nextion] Migrate triggers to callback automation (#15227) 2026-03-27 08:23:37 -10:00
J. Nick Koston f5cd1e5e76 [ld2450] Fix flaky integration test race condition (#15226) 2026-03-27 08:23:26 -10:00
J. Nick Koston a73c67e476 [ltr501] Migrate triggers to callback automation (#15225) 2026-03-27 08:23:17 -10:00
J. Nick Koston a95f9f41fb [ltr_als_ps] Migrate triggers to callback automation (#15224) 2026-03-27 08:22:58 -10:00
J. Nick Koston 6ffb5af60c [fingerprint_grow] Migrate triggers to callback automation (#15223) 2026-03-27 08:22:47 -10:00
J. Nick Koston a5416df615 [sim800l] Migrate triggers to callback automation (#15222) 2026-03-27 08:22:36 -10:00
J. Nick Koston 985477f2cf [pn7150][pn7160] Migrate triggers to callback automation (#15221) 2026-03-27 08:22:25 -10:00
J. Nick Koston a4a8fa3027 [pn532] Migrate PN532OnFinishedWriteTrigger to callback automation (#15220) 2026-03-27 08:22:14 -10:00
J. Nick Koston 623408bbfe [hlk_fm22x] Migrate triggers to callback automation (#15219) 2026-03-27 08:22:02 -10:00
J. Nick Koston 514df6c99a [dfplayer] Migrate FinishedPlaybackTrigger to callback automation (#15218) 2026-03-27 08:21:52 -10:00
J. Nick Koston 54283a2599 [rotary_encoder] Migrate triggers to callback automation (#15217) 2026-03-27 08:21:41 -10:00
J. Nick Koston 4493d2efb6 [online_image] Migrate triggers to callback automation (#15216) 2026-03-27 08:21:27 -10:00
J. Nick Koston 83b3187126 [rtttl] Migrate FinishedPlaybackTrigger to callback automation (#15202) 2026-03-27 08:21:16 -10:00
J. Nick KostonandClaude Opus 4.6 a2d452684a [ld2450] Migrate LD2450DataTrigger to callback automation (#15201)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:21:03 -10:00
J. Nick KostonandClaude Opus 4.6 2e42547d32 [media_player] Migrate triggers to callback automation (#15200)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-27 08:20:46 -10:00