Commit Graph
26213 Commits
Author SHA1 Message Date
J. Nick Koston 02660b1ad4 merge 2026-03-29 16:09:16 -10:00
J. Nick Koston e5e85b010c merge 2026-03-29 16:08:43 -10:00
J. Nick Koston b392f14684 merge 2026-03-29 16:08:01 -10:00
J. Nick Koston 20a60c119a merge 2026-03-29 16:07:34 -10:00
J. Nick Koston 5c7d4d3941 Merge branch 'peel_plus_short_float' into integration 2026-03-29 16:05:04 -10:00
J. Nick Koston ae66c7c7e7 Merge remote-tracking branch 'upstream/dev' into peel_plus_short_float 2026-03-29 16:01:02 -10:00
J. Nick Koston 4beeaff6f6 Merge branch 'float-to-raw-optimization' into peel_plus_short_float 2026-03-29 15:59:29 -10:00
J. Nick Koston 3205ab39d9 Merge branch 'api-sint32-short-varint' into peel_plus_short 2026-03-29 15:49:22 -10:00
J. Nick Koston 4abe29436a merge 2026-03-29 15:44:59 -10:00
J. Nick Koston e97cc8cc3e merge 2026-03-29 15:43:54 -10:00
J. Nick Koston cf7b92b275 merge 2026-03-29 15:42:27 -10:00
J. Nick Koston 067cdb2ca2 fix 2026-03-29 15:40:30 -10:00
J. Nick Koston 7bc8edcf3e fix 2026-03-29 15:39:04 -10:00
J. Nick Koston 5a4056f12b reverts 2026-03-29 15:38:36 -10:00
J. Nick Koston 71a6f876cf reverts 2026-03-29 15:38:05 -10:00
J. Nick Koston 46918addf7 reverts 2026-03-29 15:37:40 -10:00
J. Nick Koston fd06aa3f8b reverts 2026-03-29 15:37:21 -10:00
J. Nick Koston 3caf1436ff reverts 2026-03-29 15:37:01 -10:00
J. Nick Koston 9b3b251053 Merge remote-tracking branch 'upstream/dev' into integration 2026-03-29 15:33:29 -10:00
J. Nick Koston f28084d464 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-03-29 15:33:19 -10:00
J. Nick Koston 18168ad7fd [sensor] Use std::array in CalibrateLinearFilter (#15263) 2026-03-29 15:07:15 -10:00
J. Nick Koston a308b8993e Merge branch 'dev' into api/peel-first-write-iteration 2026-03-29 15:06:57 -10:00
J. Nick Koston 3ad35a1b60 fix refactoring error 2026-03-29 15:06:23 -10:00
J. Nick Koston 17afbeb87b [binary_sensor] Use std::array in MultiClickTrigger (#15267) 2026-03-29 14:57:15 -10:00
J. Nick Koston d51b047f63 [sensor] Use std::array in CalibratePolynomialFilter (#15264) 2026-03-29 14:56:04 -10:00
J. Nick Koston 508ec295a4 [sensor] Use std::array in OrFilter (#15262) 2026-03-29 14:55:46 -10:00
J. Nick Koston 2e68b89fff [api] Use HEADER_PADDING directly instead of local alias 2026-03-29 14:34:29 -10:00
J. Nick Koston adf0ce7fbd [api] Remove redundant frame_header_padding arg from write_plaintext_header
It's always HEADER_PADDING (constexpr 6). Using it directly inside
the function eliminates an argument and lets the compiler constant-fold.
2026-03-29 14:33:51 -10:00
J. Nick Koston ccafd442a7 [api] Use static constexpr HEADER_PADDING instead of loading member field
The header padding is a compile-time constant per protocol (6 for
plaintext, 7 for noise). Using constexpr eliminates memory loads
on the hot path. The value is defined once per class with the
component breakdown in the comment.
2026-03-29 14:32:47 -10:00
J. Nick Koston a19a6f2a0e [api] Return header length from write_plaintext_header instead of pointer
Returning total_header_len lets callers compute msg_len directly
(header_len + payload_size) instead of reloading frame_header_padding_
from memory and doing pointer subtraction after encode_varint calls
clobber registers. Saves ~10 bytes in write_protobuf_packet.
2026-03-29 14:26:50 -10:00
J. Nick Koston 66754fa376 [text_sensor] Use std::array in SubstituteFilter (#15266) 2026-03-29 14:24:32 -10:00
J. Nick Koston a84d36cb37 preen 2026-03-29 14:18:01 -10:00
J. Nick Koston d91484c19f [api] Swap sentinel values: WRITE_FAILED=-1 matches write() return
WRITE_FAILED=-1 matches the socket write() return value directly,
so the fast path can pass sent through without remapping. Simplifies
both the inline fast path and the slow path errno check.
2026-03-29 14:12:31 -10:00
J. Nick Koston 5f2ad82a67 [api] Use named sentinels to avoid redundant syscall on write failure
WRITE_NOT_ATTEMPTED (-1): cold path, no write tried yet — try write
WRITE_FAILED (-2): fast path write() returned -1 — skip retry, check errno

This avoids a redundant write() syscall when the fast path already
got EWOULDBLOCK and fell through to the slow path.
2026-03-29 14:10:11 -10:00
J. Nick Koston 2e1d6e4d58 [api] Move HELPER_LOG_PACKETS logging to call sites before fast path
LOG_PACKET_SENDING was in write_raw_iov_ which is only called on
the slow path. Moved to write_protobuf_packet and write_protobuf_messages
so all packets are logged regardless of which write path is taken.
2026-03-29 13:52:29 -10:00
J. Nick Koston 4da7f5ecc2 [binary_sensor] Use std::array in AutorepeatFilter (#15268) 2026-03-29 23:50:46 +00:00
J. Nick Koston 1c1ddf463b [api] Fix write_raw_iov_ not attempting write when called directly with empty overflow
When called from cold paths (write_raw_buf_, write_frame_) with
sent=-1 and empty overflow, the function would skip the write and
read a stale errno. Now always attempts the write when overflow is
empty, matching the original write_raw_ behavior.
2026-03-29 13:49:47 -10:00
J. Nick Koston b4de015706 [api] Use buf_start directly in noise write_protobuf_packet, add flow comment 2026-03-29 13:42:57 -10:00
J. Nick Koston 6ff0d33ca4 [api] Add safety check for full write in write_raw_iov_ before enqueue
When called directly (not via write_raw_fast_iov_), sent could equal
total_write_len. Check before enqueueing to avoid a no-op enqueue.
2026-03-29 13:40:24 -10:00
J. Nick Koston 29419d9d97 [automation] Use std::array in And/Or/Xor conditions (#15282) 2026-03-29 13:36:08 -10:00
J. Nick Koston 99e9d274a4 Merge remote-tracking branch 'origin/api-sint32-short-varint' into integration 2026-03-29 13:30:16 -10:00
J. Nick Koston 3520ef7480 [text_sensor] Use std::array in MapFilter (#15269) 2026-03-29 22:38:04 +00:00
J. Nick Koston 85529ee518 Merge remote-tracking branch 'upstream/api/peel-first-write-iteration' into integration 2026-03-29 12:36:30 -10:00
J. Nick Koston 8d495a9931 Merge branch 'dev' into api-sint32-short-varint 2026-03-29 12:24:04 -10:00
J. Nick Koston 41f770a624 Merge branch 'dev' into api/peel-first-write-iteration 2026-03-29 12:23:43 -10:00
J. Nick Koston d6475eaeed [binary_sensor] Remove redundant optional<bool> state_, save 8 bytes per instance (#15095) 2026-03-29 12:15:18 -10:00
J. Nick Koston f57468109b [api] Split write_raw_fast_ into write_raw_fast_buf_ and write_raw_fast_iov_
No overloads — every method has a unique name matching its data type:
  write_raw_fast_buf_ / write_raw_buf_  — single contiguous buffer
  write_raw_fast_iov_ / write_raw_iov_  — iovec array
2026-03-29 12:14:54 -10:00
J. Nick Koston 048636d6c3 [api] Use explicit names: write_raw_fast_, write_raw_buf_, write_raw_iov_
Avoids ambiguous overload resolution between const void* and const iovec*
and makes each call site's intent clear.
2026-03-29 12:13:36 -10:00
J. Nick Koston a9aaf29d83 [core] Shrink Component from 12 to 8 bytes per instance (#15103) 2026-03-29 12:09:21 -10:00
J. Nick Koston 38fa8925da [ai] Add automation, callback manager, and test grouping docs (#15243) 2026-03-29 12:02:47 -10:00