Commit Graph
25078 Commits
Author SHA1 Message Date
J. Nick Koston 5f007ad05e Merge remote-tracking branch 'origin/integration' into integration 2026-03-17 14:31:06 -10:00
J. Nick Koston d27a54553c Merge remote-tracking branch 'upstream/fix-slow-serial-log-test' into integration
# Conflicts:
#	.github/workflows/ci.yml
#	esphome/components/esp32_ble_server/ble_server.cpp
#	esphome/components/mqtt/mqtt_backend_esp32.cpp
#	script/cpp_benchmark.py
#	script/determine-jobs.py
2026-03-17 14:30:31 -10:00
J. Nick Koston cdf05263df [tests] Fix test_show_logs_serial taking 30s due to unmocked serial port wait
The test was calling show_logs() which invokes _wait_for_serial_port("/dev/ttyUSB0").
Since that path doesn't exist in CI/dev environments, it spun in a 30-second polling
loop before returning. Add mock_wait_for_serial_port fixture to skip the wait.
2026-03-17 14:26:24 -10:00
b9e8da92c7 [scheduler] Fix UB in cross-thread counter/vector reads, add atomic fast-path (#14880)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2026-03-18 00:19:31 +00:00
0c5f055d45 [core] cpp tests: Allow customizing code generation during tests (#14681)
Co-authored-by: J. Nick Koston <nick@home-assistant.io>
Co-authored-by: J. Nick Koston <nick@koston.org>
2026-03-18 00:16:01 +00:00
J. Nick KostonandJesse Hills 342020e1d3 [mqtt] Fix data race on inbound event queue (#14891)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2026-03-17 13:49:24 -10:00
J. Nick Koston 62f9bc79c4 [ci] Add CodSpeed badge to README (#14901) 2026-03-17 13:48:21 -10:00
Jonathan Swoboda 53bfb02a21 [sensor][ee895][hdc2010] Fix misc bugs found during component scan (#14890) 2026-03-17 19:46:26 -04:00
J. Nick Koston 83484a8828 [esp32_ble_server] Remove vestigial semaphore from BLECharacteristic (#14900) 2026-03-17 13:38:41 -10:00
J. Nick Koston ece235218f [debug][bme680_bsec] Use fnv1_hash_extend to avoid temporary string allocations (#14876) 2026-03-17 13:27:46 -10:00
J. Nick Koston f3409acfa8 [core] Document EventPool sizing requirement with LockFreeQueue (#14897) 2026-03-17 13:08:58 -10:00
J. Nick KostonandCopilot Autofix powered by AI 77b7201eb8 [ci] Run CodSpeed benchmarks on push to dev for baseline (#14899)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 13:08:45 -10:00
J. Nick Koston 6b91df8d75 [esp32_ble][esp32_ble_server] Inline is_active/is_running and remove STL bloat (#14875) 2026-03-17 13:05:16 -10:00
J. Nick Koston 1670f04a87 [core] Add CodSpeed C++ benchmarks for protobuf, main loop, and helpers (#14878) 2026-03-17 12:29:38 -10:00
J. Nick Koston 1adf05e2d5 [esp32_ble] Fix EventPool/LockFreeQueue sizing off-by-one (#14892) 2026-03-17 22:24:02 +00:00
J. Nick Koston a94bb74d04 [usb_uart] Fix EventPool/LockFreeQueue sizing off-by-one (#14895) 2026-03-18 11:18:31 +13:00
J. Nick Koston c19c75220b [usb_host] Fix EventPool/LockFreeQueue sizing off-by-one (#14896) 2026-03-18 11:17:59 +13:00
J. Nick Koston 97382ed814 [usb_cdc_acm] Fix EventPool/LockFreeQueue sizing off-by-one (#14894) 2026-03-18 11:17:43 +13:00
J. Nick Koston 5f06679d78 [espnow] Fix EventPool/LockFreeQueue sizing off-by-one (#14893) 2026-03-18 11:16:44 +13:00
J. Nick Koston 5fc7dcc27d Merge remote-tracking branch 'origin/dev' into integration 2026-03-17 12:14:16 -10:00
J. Nick Koston f8da603339 Merge remote-tracking branch 'origin/dev' into integration 2026-03-17 12:07:30 -10:00
J. Nick Koston afb3acedeb Merge remote-tracking branch 'origin/scheduler-process-to-add-fast-path' into integration 2026-03-17 12:07:25 -10:00
J. Nick Koston 373168ccf0 Merge remote-tracking branches 'origin/ble-fix-event-pool-queue-sizing', 'origin/espnow-fix-event-pool-queue-sizing', 'origin/event-pool-document-sizing-requirement' and 'origin/mqtt-fix-event-queue-data-race' into integration 2026-03-17 12:07:12 -10:00
J. Nick Koston 8acc033873 [core] Document EventPool sizing requirement with LockFreeQueue
Add a comment to EventPool documenting that when paired with a
LockFreeQueue<T, N>, the pool should be sized to N-1 (the queue's
actual capacity) to prevent slot leaks and SPSC violations.
2026-03-17 11:58:47 -10:00
J. Nick Koston da1ee1bf66 [mqtt] Fix outbound EventPool/LockFreeQueue sizing off-by-one
Size the outbound pool to N-1 to match queue capacity, same as the
inbound pool fix in the previous commit.
2026-03-17 11:52:31 -10:00
J. Nick Koston 61513d3deb [espnow] Fix EventPool/LockFreeQueue sizing off-by-one
LockFreeQueue<T,N> is a ring buffer that holds N-1 elements (one slot
is reserved to distinguish full from empty). With the pool also sized
to N, the Nth allocate() succeeds but push() fails — permanently
leaking one pool slot since the element is never returned.

Size both receive and send pools to N-1 to match queue capacity.
2026-03-17 11:46:52 -10:00
J. Nick Koston a078d1b14d [esp32_ble] Fix EventPool/LockFreeQueue sizing off-by-one
LockFreeQueue<T,N> is a ring buffer that holds N-1 elements (one slot
is reserved to distinguish full from empty). With the pool also sized
to N, the Nth allocate() succeeds but push() fails — permanently
leaking one pool slot since the element is never returned.

Size the pool to N-1 to match queue capacity. This guarantees
allocate() returns nullptr before push() can fail.
2026-03-17 11:46:18 -10:00
J. Nick Koston 95ff70eb48 [mqtt] Fix data race on inbound event queue
The ESP-IDF MQTT client dispatches events from its own task, which
pushed to a std::queue while the main loop popped from it. std::queue
is not thread-safe; concurrent access can corrupt its internal state.

Replace with EventPool + LockFreeQueue (SPSC ring buffer) already
used elsewhere in the codebase. The pool is sized to queue capacity
(SIZE-1) so allocate() fails before push() can, which prevents both
a slot leak and an SPSC violation on the pool's free list.

Also rename the outbound pool from mqtt_event_pool_ to
mqtt_outbound_pool_ to avoid confusion with the new inbound pool.
2026-03-17 11:25:14 -10:00
Jonathan Swoboda 851e8b6c0d [gree] Fix IR checksum for YAA/YAC/YAC1FB9/GENERIC models (#14888) 2026-03-17 16:28:13 -04:00
J. Nick Koston c88a01227c Merge remote-tracking branch 'upstream/dev' into integration 2026-03-17 10:21:29 -10:00
J. Nick Koston 9a729608d5 [core] Add back deprecated set_internal() for external projects (#14887) 2026-03-17 19:58:05 +00:00
Jonathan Swoboda 53fa346ddc [speaker] Fix media playlist using announcement delay (#14889) 2026-03-17 19:18:49 +00:00
J. Nick Koston 580eb64bcf Merge branch 'codspeed-benchmarks' into scheduler-process-to-add-fast-path 2026-03-17 08:59:06 -10:00
J. Nick Koston c57c8c1784 Merge branch 'dev' into codspeed-benchmarks 2026-03-17 08:58:48 -10:00
J. Nick Koston b3210de374 [core] Extract shared C++ build helpers from cpp_unit_test.py (#14883) 2026-03-17 08:53:36 -10:00
J. Nick Koston 91dbc0f341 Merge branch 'codspeed-benchmarks' into scheduler-process-to-add-fast-path 2026-03-17 08:45:47 -10:00
J. Nick Koston f57c9d0501 Merge branch 'dev' into codspeed-benchmarks 2026-03-17 08:45:33 -10:00
J. Nick Koston 81788951da Exclude tests/benchmarks/ from clang-tidy file discovery 2026-03-17 08:44:56 -10:00
J. Nick Koston 82ccc37ba1 [ethernet] Mark EthernetComponent as final (#14842) 2026-03-17 08:14:52 -10:00
J. Nick Koston 3826e95506 [api] Fix ProtoMessage protected destructor compile error on host platform (#14882) 2026-03-17 08:14:36 -10:00
Jonathan Swoboda b083491e74 [microphone] Switch IDF test to new I2S driver (#14886) 2026-03-17 13:46:32 -04:00
Diorcet Yann 73ca0ff106 [core] Small improvements (#14884) 2026-03-17 09:22:31 -04:00
J. Nick Koston be9d8b463e Merge branch 'codspeed-benchmarks' into scheduler-process-to-add-fast-path 2026-03-17 02:11:40 -10:00
J. Nick Koston 9c9464f29f Skip to_add_count_ field on single-threaded platforms
On ESPHOME_THREAD_SINGLE there are no concurrent writers, so
to_add_empty_() checks to_add_.empty() directly. The counter
field and its increment/clear operations are compiled out.
2026-03-17 02:09:39 -10:00
J. Nick Koston 4003406f8b Remove Scheduler_NextScheduleIn benchmark — too cheap, flaps 2026-03-17 02:06:16 -10:00
J. Nick Koston 1ed30414c9 Fix duplicate comment line in to_remove_ documentation 2026-03-17 02:05:07 -10:00
J. Nick KostonandCopilot Autofix powered by AI a8bb3d8c6f Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 02:02:23 -10:00
pre-commit-ci-lite[bot] d0c39d95ad [pre-commit.ci lite] apply automatic fixes 2026-03-17 12:02:06 +00:00
J. Nick KostonandCopilot Autofix powered by AI 1c685a8a77 Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 02:00:37 -10:00
J. Nick KostonandCopilot Autofix powered by AI f2ab81a0ef Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-03-17 02:00:17 -10:00