Commit Graph
23715 Commits
Author SHA1 Message Date
J. Nick Koston bd35d55729 Merge remote-tracking branch 'origin/esp8266-wake-loop-any-context' into integration 2026-03-02 09:30:43 -10:00
J. Nick Koston 483b3cc553 Merge remote-tracking branch 'origin/esp32-millis-euclidean-decomposition' into integration 2026-03-02 09:30:38 -10:00
J. Nick Koston 760fa7c050 Merge branch 'dev' into esp32-millis-euclidean-decomposition 2026-03-02 09:28:12 -10:00
J. Nick Koston d0930a4766 lint 2026-03-02 09:20:09 -10:00
J. Nick Koston 641d188dec lint 2026-03-02 09:19:58 -10:00
J. Nick Koston d55cf73021 Merge branch 'dev' into esp8266-wake-loop-any-context 2026-03-02 09:18:14 -10:00
J. Nick Koston cb232d8288 [core] Fix compile-time loop() detection for multiple inheritance (#14411) 2026-03-02 19:11:47 +00:00
J. Nick Koston 2fa244715d [socket] Fix pre-existing bugs found during socket devirtualization review (#14404) 2026-03-02 08:54:54 -10:00
J. Nick Koston a802cbcf47 Merge remote-tracking branch 'upstream/esp8266-wake-loop-any-context' into integration 2026-03-02 08:47:56 -10:00
J. Nick Koston fda0e784d3 switch to forward dec 2026-03-02 08:47:16 -10:00
J. Nick Koston e32adb8633 Merge remote-tracking branch 'upstream/fix-loop-ambiguous-multiple-inheritance' into integration 2026-03-02 08:15:30 -10:00
J. Nick Koston d088c98218 Merge remote-tracking branch 'upstream/esp8266-wake-loop-any-context' into integration 2026-03-02 08:15:26 -10:00
J. Nick Koston 9e4a04b732 Merge branch 'dev' into esp8266-wake-loop-any-context 2026-03-02 08:11:10 -10:00
J. Nick Koston b8e7870115 Rename has_loop_override to HasLoopOverride for clang-tidy naming 2026-03-02 08:09:59 -10:00
J. Nick Koston 8ee800bb35 Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 07:53:19 -10:00
J. Nick Koston 4b11b6b941 Merge remote-tracking branch 'upstream/fix-loop-ambiguous-multiple-inheritance' into integration 2026-03-02 07:53:12 -10:00
J. Nick Koston 5ed3be7b97 [core] Fix compile-time loop() detection for multiple inheritance
The compile-time loop() override detection using decltype(&T::loop)
fails when a component inherits from both Component (via
PollingComponent) and BLEClientNode, as both define loop() methods
making the expression ambiguous.

Add a SFINAE-based has_loop_override<T> trait that gracefully handles
this case: when decltype(&T::loop) is ill-formed due to ambiguity,
it falls back to true (conservatively assuming a loop override exists).
2026-03-02 07:50:34 -10:00
J. Nick Koston 1617da2541 [core] Remove static_asserts for micros_to_millis
Covered by integration test now.
2026-03-02 07:44:43 -10:00
J. Nick Koston 96a564a6e9 [core] Replace Python unit tests with C++ integration test for micros_to_millis
The Python tests were testing a Python reimplementation, not the
actual C++ code. Replace with an integration test that exercises
the real micros_to_millis() on the host platform, covering boundary
values, carry paths, and mod-8 shift edge cases (25 checks).
2026-03-02 07:41:52 -10:00
netixxandJonathan Swoboda b9b1af1c3d [mcp23016] Fix register access to use 16-bit paired transactions (#13676)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
2026-03-02 17:38:28 +00:00
J. Nick Koston 61eb8f3e14 Merge remote-tracking branch 'upstream/cache-lwip-sock-pointers' into integration
# Conflicts:
#	esphome/components/esp32/core.cpp
#	esphome/components/esp8266/core.cpp
#	esphome/components/host/core.cpp
#	esphome/components/libretiny/core.cpp
#	esphome/components/rp2040/core.cpp
#	esphome/components/zephyr/core.cpp
#	esphome/core/application.cpp
#	esphome/core/hal.h
2026-03-02 07:38:28 -10:00
J. Nick Koston 15a792ecce bot review 2026-03-02 07:34:47 -10:00
J. Nick Koston bca46bce81 Merge remote-tracking branch 'upstream/dev' into cache-lwip-sock-pointers
# Conflicts:
#	esphome/components/socket/bsd_sockets_impl.cpp
#	esphome/components/socket/bsd_sockets_impl.h
#	esphome/components/socket/lwip_sockets_impl.cpp
#	esphome/components/socket/lwip_sockets_impl.h
#	esphome/components/socket/socket.cpp
#	esphome/components/socket/socket.h
#	esphome/core/application.h
2026-03-02 07:11:40 -10:00
J. Nick Koston a1d91ac779 [core] Compile-time detection of loop() overrides (#14405) 2026-03-02 06:59:23 -10:00
J. Nick Koston 585e195044 [socket] Devirtualize socket abstraction layer (#14398) 2026-03-02 06:58:31 -10:00
J. Nick Koston 39572d9628 [light] Resolve effect names to indices at codegen time (#14265) 2026-03-02 06:58:15 -10:00
J. Nick Koston f278250740 [core] Deduplicate ControllerRegistry notify dispatch loop (#14394) 2026-03-02 06:57:59 -10:00
J. Nick KostonandClaude Opus 4.6 54f410901f [web_server] Avoid temporary std::string allocations in request parameter parsing (#14366)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 06:57:39 -10:00
J. Nick KostonandClaude Opus 4.6 00242443e1 [light] Replace powf gamma with pre-computed lookup tables (LUT) (#14123)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 06:57:23 -10:00
J. Nick Koston 82da4935b6 [core] Auto-wrap static strings in PROGMEM on ESP8266 via TemplatableValue (#13885) 2026-03-02 06:57:08 -10:00
J. Nick KostonandClaude Opus 4.6 1c5fd8bbd4 [core] Move millis_64 rollover tracking out of Scheduler (#14360)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 06:56:51 -10:00
Copilotcopilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>jesserockz
77a7cbcffd Use cached files on network errors in external_files (#14055)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jesserockz <3060199+jesserockz@users.noreply.github.com>
2026-03-02 11:41:20 -05:00
J. Nick Koston 5041bc06aa Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 00:22:05 -10:00
J. Nick Koston cff32556a2 Add static_asserts and type hints to tests
Add compile-time static_asserts for micros_to_millis correctness.
Add parameter type hints and return annotations to test functions.
2026-03-02 00:21:44 -10:00
J. Nick Koston 696c93ee43 Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 00:16:16 -10:00
J. Nick Koston 1e3f7b3c90 [core] Fix clang-tidy: lowercase function-local constexpr variables
clang-tidy readability-identifier-naming requires lowercase for
function-local variables, even constexpr ones. Rename D/Q/R to d/q/r.
2026-03-02 00:16:02 -10:00
J. Nick Koston 7bed94aa38 Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 00:11:13 -10:00
J. Nick Koston df57c21368 [core] Template micros_to_millis for both 32/64-bit results
Make micros_to_millis a template on return type (default uint32_t).
millis_64() now calls micros_to_millis<uint64_t>() to eliminate
__udivdi3 there too — same Euclidean decomposition, just with a
32x32->64 multiply for hi*Q instead of truncating.

Add 64-bit variant tests (140 total, all passing).
2026-03-02 00:11:02 -10:00
J. Nick Koston a8f8c3753f Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-02 00:10:32 -10:00
J. Nick Koston 99aa5043a3 [core] Add unit tests for micros_to_millis, make constexpr
Add Python unit tests (70 cases) verifying the Euclidean decomposition
matches us // 1000 across edge cases: small values, hi/lo boundaries,
carry-path overflow, realistic uptimes, and shift-boundary mod-8
variations.

Make micros_to_millis constexpr to enable compile-time validation
via static_assert.
2026-03-02 00:05:06 -10:00
J. Nick Koston bb4e34509d Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-01 23:49:32 -10:00
J. Nick Koston 0dc56d7a4d [core] Eliminate __udivdi3 in millis() on ESP32 and RP2040
On 32-bit targets GCC does not optimize 64-bit constant division
into a multiply-by-reciprocal, emitting a call to __udivdi3 instead
(~650-710 ns on Xtensa @ 240 MHz).

Add micros_to_millis() which exploits 1000 = 8 * 125: a free
right-shift by 3 followed by Euclidean decomposition with D=125,
reducing the 64-bit division to a single 32-bit / 125U that GCC
compiles to a multiply-by-reciprocal.

Benchmarked at 258 ns per call on ESP32 classic — a 2.5-2.8x
speedup. With ~21 millis() calls per loop iteration this saves
~9 us per loop.
2026-03-01 23:49:18 -10:00
J. Nick Koston 836a050123 Merge remote-tracking branch 'upstream/esp32-millis-euclidean-decomposition' into integration 2026-03-01 23:48:45 -10:00
J. Nick KostonandClaude Opus 4.6 5f91c96306 [core] Use shift3+div125 for micros_to_millis (1000 = 8 * 125)
Factor 1000 as 8 * 125. The divide-by-8 is a free right-shift,
then Euclidean decomposition with D=125 has a smaller remainder
(R=46 vs R=296), making hi*R cheaper and the safe input range
51x wider (~3.2e18 vs ~6.2e16 microseconds).

Benchmarked ~7% faster than the divide-by-1000 variant on ESP32
classic (257 ns vs 277 ns per call at 240 MHz).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 23:46:34 -10:00
J. Nick Koston bd0ba9ea4b Merge remote-tracking branch 'origin/esp32-millis-euclidean-decomposition' into integration 2026-03-01 23:32:46 -10:00
J. Nick Koston b3e1cbaa31 Merge branch 'dev' into esp32-millis-euclidean-decomposition 2026-03-01 23:31:55 -10:00
J. Nick Koston 7c175dda17 [core] Rename fast_div1000_32 to micros_to_millis 2026-03-01 23:30:06 -10:00
J. Nick Koston bf8990dcb0 [core] Document exact safe input range for fast_div1000_32 2026-03-01 23:27:38 -10:00
J. Nick Koston 263d6c1085 [core] Fix comment to describe input range, not uptime 2026-03-01 23:24:08 -10:00
J. Nick Koston cc3a51562d [core] Document safe range for fast_div1000_32 intermediate 2026-03-01 23:23:34 -10:00