Commit Graph
26499 Commits
Author SHA1 Message Date
J. Nick Koston 3ba41c6f7e Merge remote-tracking branch 'upstream/select-switch-logv-downgrade' into integration 2026-04-02 15:12:38 -10:00
J. Nick Koston 363309a870 Merge remote-tracking branch 'upstream/uptime-text-sensor-pass-size' into integration 2026-04-02 15:12:30 -10:00
J. Nick Koston 5e471f45be Merge remote-tracking branch 'upstream/button-logv-downgrade' into integration 2026-04-02 15:12:17 -10:00
J. Nick Koston 288d98f5ef [uptime] Pass known length to publish_state to avoid redundant strlen 2026-04-02 15:11:00 -10:00
J. Nick Koston 59c33628a6 Downgrade button press logging from DEBUG to VERBOSE 2026-04-02 15:04:14 -10:00
J. Nick Koston 27522d7462 Add host platform benchmarks for text_sensor and button components 2026-04-02 14:57:39 -10:00
J. Nick Koston c8db8faab2 Merge branch 'bench-number-select-switch' into select-switch-logv-downgrade 2026-04-02 14:55:04 -10:00
J. Nick Koston 2058eda7fa Address review: fix misleading comment, remove unused constants 2026-04-02 14:54:28 -10:00
J. Nick Koston 46f8e46548 Downgrade select and switch control path logging from DEBUG to VERBOSE
The ESP_LOGD calls in SelectCall::perform() and Switch::turn_on/turn_off/toggle
are redundant with aioesphomeapi's state_log_formatter which already logs both
commands and state changes on the HA side. Benchmarks show these ESP_LOGD calls
dominate the control path cost (~13M ops/s for SelectCall vs ~180M ops/s for
publish_state).

This aligns select and switch with climate and fan which already use ESP_LOGV
for their call perform() paths.
2026-04-02 14:48:43 -10:00
J. Nick Koston 8a0d3158a0 Add host platform benchmarks for number, select, and switch components 2026-04-02 14:39:48 -10:00
J. Nick Koston 9e050c0106 Merge remote-tracking branch 'upstream/light-pass-traits' into integration 2026-04-02 14:03:53 -10:00
J. Nick Koston 9c757eae16 Merge remote-tracking branch 'upstream/light-normalize-mul' into integration 2026-04-02 14:03:49 -10:00
J. Nick Koston ea75bb83c4 Merge remote-tracking branch 'upstream/finite-set-mask-ctz' into integration 2026-04-02 14:03:44 -10:00
J. Nick Koston ded6465056 Fix clang-tidy: use uint64_t instead of unsigned long long 2026-04-02 13:59:41 -10:00
J. Nick Koston af41cc2d66 Address review: clamp to MAX_BITS, add ctzll branch for >32-bit masks
Clamp the __builtin_ctz result to MAX_BITS to match the original loop
semantics if out-of-range bits are ever present. Add ctzll branch for
hypothetical >32-bit bitmask types.
2026-04-02 13:48:36 -10:00
J. Nick Koston c35b36b8e7 [light] Pass LightTraits to compute_color_mode_ and transform_parameters_
Pass the already-fetched LightTraits from validate_() to
compute_color_mode_() and transform_parameters_() instead of each
calling get_traits() independently. This eliminates 2 redundant
virtual calls through output_->get_traits().

As a side effect, the compiler inlines both functions into validate_(),
eliminating their call overhead. Total hot path shrinks by 451 bytes.
2026-04-02 13:46:30 -10:00
J. Nick Koston bce8e6ecb6 Fix clang-tidy: add braces, use uint32_t instead of unsigned long 2026-04-02 13:41:18 -10:00
J. Nick Koston 4981b3c671 [light] Use reciprocal multiply in normalize_color
Replace 3 software float divides (__divsf3) with 1 divide + 3 native
mul.s instructions. Xtensa has no FPU divide, so __divsf3 is a ~20-30
cycle software routine. This saves ~40-60 cycles per normalize_color
call for +8 bytes of flash.
2026-04-02 13:36:48 -10:00
J. Nick Koston b4fa217ab3 [core] Use __builtin_ctz for find_lowest_set_bit in FiniteSetMask
Replace the linear bit-scanning loop in find_next_set_bit with
__builtin_ctz (compiles to single-cycle NSAU on Xtensa). Also rename
to find_lowest_set_bit and drop the unused start_bit parameter since
all call sites pass 0.

This eliminates the standalone find_next_set_bit function and replaces
3 function calls + loops in compute_color_mode_ with inline NSAU
instructions.
2026-04-02 13:33:42 -10:00
Keith Burzinski 710186998b [ota] Use modernized namespace syntax (#15398) 2026-04-02 19:12:05 -04:00
J. Nick Koston 8f49aab070 Merge branch 'scheduler-cancel-fast-path' into integration 2026-04-02 12:23:15 -10:00
J. Nick Koston 0fb534bb28 [scheduler] Skip cancel for anonymous items, add empty-container fast path
Two optimizations to reduce overhead in the scheduler hot path:

1. Skip cancel_item_locked_ entirely for anonymous items (STATIC_STRING
   with nullptr name) in set_timer_common_. These can never match any
   existing item, so the scan is pure waste. This is the common path
   for Component::defer(func).

2. Split mark_matching_items_removed_locked_ into an inline wrapper
   that checks for empty containers and a noinline slow path. This
   avoids the function call overhead when containers are empty, which
   is the common case for defer_queue_ and to_add_ after draining.
2026-04-02 11:57:57 -10:00
J. Nick Koston 4535b82483 [scheduler] Remove redundant Defer_UniqueID, keep anonymous + same-ID
UniqueID benchmark was unrealistic — unique IDs still ran
cancel_item_locked_ scanning all containers for matches that never
exist. Replace with just two meaningful defer variants:
- Defer: anonymous (nullptr name, skips cancel entirely)
- Defer_SameID: fixed ID (cancel-and-replace coalescing pattern)
2026-04-02 11:51:52 -10:00
J. Nick Koston ed14694e46 [scheduler] Add defer benchmark variants and fix anonymous defer path
- Scheduler_Defer: use nullptr name matching Component::defer(func)
  production pattern (skips cancel_item_locked_ entirely)
- Scheduler_Defer_SameID: fixed ID 0 measuring cancel-and-replace
  pattern for coalescing rapid updates
- Scheduler_Defer_UniqueID: unique IDs measuring cancel scan overhead
  when no match is found
2026-04-02 11:45:03 -10:00
J. Nick Koston ce5c36a02a [scheduler] Fix pool imbalance in benchmarks, add static_assert
Change kInnerIterations from 2000 to 2100 (divisible by batch sizes 3
and 10) to prevent pool imbalance at iteration boundaries that caused
spurious malloc. Add static_assert to each benchmark to catch this at
compile time.
2026-04-02 11:38:18 -10:00
J. Nick Koston 904577bf91 [scheduler] Extract warm_pool helper for scheduler benchmarks
Replace duplicated pool warmup blocks with a shared warm_pool() helper
that registers and replaces items twice to populate the recycling pool
before the benchmark loop begins.
2026-04-02 11:31:27 -10:00
J. Nick Koston be3e0c27bf [core] Inline fast path for enable_loop (#15392) 2026-04-02 21:28:12 +00:00
J. Nick Koston 279686b1c2 [scheduler] Add ExceedPool benchmark to measure pool overflow cliff
Add Scheduler_SetTimeout_ExceedPool with batch size 10 (exceeding
MAX_POOL_SIZE=5) to measure the performance impact when the recycling
pool is exhausted and items must be malloc'd/freed each cycle.
2026-04-02 11:26:28 -10:00
J. Nick Koston 615b2b339a [scheduler] Batch 3 registrations per call() for realistic worst case
Instead of draining after every single registration or batching 5,
use a batch size of 3 which represents a realistic worst case where
multiple components schedule in the same loop iteration while staying
within the recycling pool (MAX_POOL_SIZE=5).
2026-04-02 11:24:53 -10:00
J. Nick Koston 347f981768 [scheduler] Fix unrealistic scheduler benchmarks missing periodic drain
Scheduler registration benchmarks (SetTimeout, SetInterval, Defer) were
not calling scheduler.call() periodically to drain and clean up cancelled
items. In production, call() runs every loop iteration, keeping the
scheduler containers small. Without draining, cancelled items accumulated
causing O(n²) scan cost in cancel_item_locked_ that doesn't reflect
real-world behavior.

- SetTimeout: was only calling process_to_add() (no cleanup), now calls
  call() every kKeyCount iterations
- SetInterval: was calling process_to_add() (no cleanup of items_), now
  calls call() for proper cleanup
- Defer: was never draining the defer queue, now calls call() to process
  deferred items as production does
- All three now advance time (++now) to match production loop behavior
2026-04-02 11:18:17 -10:00
Jonathan Swoboda 4d0d3cc271 [sen5x] Remove dead voc_baseline config option (#15391) 2026-04-02 10:53:53 -10:00
Jonathan Swoboda 4134763f34 [at581x][canbus] Fix walrus operator skipping falsy config values (#15390) 2026-04-02 20:32:10 +00:00
1e72f0ee5a [nextion] Gate waveform code behind USE_NEXTION_WAVEFORM, use StaticRingBuffer (#15273)
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick+github@koston.org>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-04-02 20:17:20 +00:00
J. Nick Koston 67238e3d74 Merge remote-tracking branch 'upstream/dev' into integration
# Conflicts:
#	tests/components/time/posix_tz_parser.cpp
2026-04-02 10:13:20 -10:00
J. Nick Koston 63710a4cb7 [spi] Add spi0 and spi1 to reserved IDs for RP2040 compatibility (#15388) 2026-04-02 16:10:16 -04:00
c82166e5f3 [dsmr] Allow setting MBUS id for thermal sensors in DSMR component (#7519)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-02 10:06:49 -10:00
Jonathan Swoboda 90624e6eca [deep_sleep] Fix wakeup_pin_mode rejecting lowercase on ESP32/BK72XX (#15384) 2026-04-02 09:34:27 -10:00
Jonathan Swoboda 6b89998b60 [template] Fix cover position_action overridden by has_position default (#15379) 2026-04-02 09:29:33 -10:00
Jonathan Swoboda dde472b0cf [pipsolar] Fix set_level action passing string to cv.use_id (#15380) 2026-04-02 09:28:44 -10:00
dependabot[bot]andJ. Nick Koston f7222a0e6c Bump ruff from 0.15.8 to 0.15.9 (#15385)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
2026-04-02 19:28:30 +00:00
Jonathan Swoboda 0262d20bbe [mlx90393] Remove call to non-existent set_drdy_pin method (#15381) 2026-04-02 09:26:47 -10:00
Jonathan Swoboda 37b33f62de [htu21d] Fix set_heater action reading wrong config key (#15378) 2026-04-02 09:25:54 -10:00
Jonathan Swoboda 2f405fd96f [espnow] Fix enable_on_boot config option not passed to C++ (#15377) 2026-04-02 09:25:15 -10:00
dependabot[bot] 67ee727e38 Bump docker/login-action from 4.0.0 to 4.1.0 in the docker-actions group (#15386)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-02 09:24:26 -10:00
Jonathan Swoboda 12a0f5959f [bl0940] Fix reference_voltage config ignored in non-legacy mode (#15375) 2026-04-02 09:23:04 -10:00
Jonathan Swoboda 5dcae1a133 [climate] Fix MQTT target_temperature_low_state_topic calling wrong setter (#15376) 2026-04-02 09:22:07 -10:00
Jonathan Swoboda 0343121e9b [ble_client] Fix descriptor_uuid ignored for text sensors (#15374) 2026-04-02 09:21:18 -10:00
J. Nick Koston da09e1e1ce [time] Use O(1) closed-form leap year math for epoch-to-year conversion (#15368) 2026-04-02 09:19:47 -10:00
Jonathan Swoboda e7e590b36f [thermostat] Fix on_boot_restore_from DEFAULT_PRESET validation bypass (#15383) 2026-04-02 19:08:43 +00:00
Kevin Ahrendt da8d9d9c2d [audio] use microFLAC library for decoding (#15372) 2026-04-02 11:37:14 -04:00