Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CyberRT's timing wheel uses
Rateto pace its ticks.Ratecurrently measures cycles using wall time and waits on a system-clock deadline, so changing the system clock can disrupt timer execution and produce incorrect cycle durations.Use
Time::MonoTime()in all Rate constructors,Sleep()andReset(), and wait on the correspondingstd::chrono::steady_clockdeadline. Keep the existing cycle-overrun resynchronization behaviour and update its diagnostic.Time::SleepUntil()retains its wall-clock semantics for other callers.Add a
rate_testtarget and seven tests covering constructor periods, successive waits, cycle overruns, and forward/backward one-hour clock jumps before sleeping and resetting. The tests interpose clock reads in the test executable; they do not change the machine's clock or require clock-setting privileges. Include Doxygen documentation and comments explaining the clock domains.Fixes #15763.
Validation
-Wall -Wextra -Werror.-include cstdintto its compilation; no dependency sources or repository build settings were changed.clang-format --dry-run --Werror, Apollo's pinned cpplint 1.5.2, andgit diff --checkpassed for the changed C++ files/diff.Full Apollo/Bazel and timer integration validation remains outstanding: this machine does not have the Apollo development container/Bazel environment configured. The Windows checkout also has CRLF shell scripts, so the attempted
apollo.sh checkcould not run. The results above are direct C++ compilation/tests, not a successful full Apollo build.AI assistance
Codex assisted with implementation, test development, documentation and local validation.