Skip to content

Take input buffers in list order instead of by timestamp (backport #350) - #353

Merged
David-LP99 merged 1 commit into
humblefrom
mergify/bp/humble/pr-350
Nov 19, 2026
Merged

David-LP99 merged 1 commit into
humblefrom
mergify/bp/humble/pr-350

Conversation

@mergify

@mergify mergify Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes #349.

Input buffers of one entity are ordered by timestamp. Samples that arrive within one clock tick get equal timestamps, and the strict comparison then returns the newest one. This has two effects:

  • rcl_take returns N+1 before N.
  • KEEP_LAST can overwrite a newer sample instead of the oldest.

Main changes

The allocated list is now the only source of order, with the newest item at the head.

  • rmw_uxrce_find_static_input_buffer_by_owner returns the last match instead of comparing timestamps.
  • When an entity reaches its depth, the reused buffer goes through put_memory and get_memory, which moves it to the head. It used to stay in place, so the newest sample could sit at the tail.

timestamp stays because the lifespan check needs it.

This differs from the arrival counter I proposed in #349. It needs no new field and has the same effect. Changing < to <= is not enough, because a buffer reused in place breaks the list order. With depth 2 and arrivals C, D, E sharing one timestamp, <= leaves [D, E] and takes E first.

Testing

Test Code Before After
Board jazzy at e64d79f with this change 76 swaps in 18 rounds of 30 s 0 swaps in 36 rounds of 30 s
Host rolling with this change 8 failed checks 0 failed checks
  • Board: ESP32-C6 on Zephyr 4.1.0, UDP over Wi-Fi through an access point that adds 0-200 ms of random delay in each direction. One node publishes and subscribes to one reliable topic, nominally every 20 ms. The two runs were not simultaneous, so please read this as swaps present or absent rather than as rates.
  • Host: the real memory.c and the functions from types.c, stored and taken the way on_topic and rmw_take do. It covers ties, overwrites, clock jumps, two interleaved owners and a take between stores. It uses subscription-style storage only and is not part of this PR.
  • Not tested: this exact commit on a board, the requests and replies that go through the same search, and the repository's test suite, which needs an Agent.

Backports

Could a maintainer please request backports to kilted and jazzy through Mergify, and to humble if it applies? kilted and jazzy have the same comparison, and I have not checked humble.

🤖 Generated with Claude Code


This is an automatic backport of pull request #350 done by [Mergify](https://mergify.com).

@mergify

mergify Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is merged.

@codecov-commenter

codecov-commenter commented Nov 17, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.69%. Comparing base (b5ad174) to head (210c955).

Additional details and impacted files
@@            Coverage Diff             @@
##           humble     #353      +/-   ##
==========================================
+ Coverage   54.99%   55.69%   +0.70%     
==========================================
  Files          99      100       +1     
  Lines        5899     6008     +109     
  Branches      922      943      +21     
==========================================
+ Hits         3244     3346     +102     
- Misses       2327     2330       +3     
- Partials      328      332       +4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Hao <hao3.li@tu-dortmund.de>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 122383e)
@David-LP99
David-LP99 force-pushed the mergify/bp/humble/pr-350 branch from 6168415 to 210c955 Compare November 19, 2026 08:50
@David-LP99
David-LP99 merged commit 6ebe05c into humble Nov 19, 2026
4 checks passed
@David-LP99
David-LP99 deleted the mergify/bp/humble/pr-350 branch November 19, 2026 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants