[kilted] Make the player respect the original messages' order with the same timestamp (backport #2172) #2187
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.
Description
Make the player respect the original messages' order with the same timestamp.
Note: The messages with the same
recv_timestampsare a common situation when doing a recording withsim_timeAdded insertion sequence number to the LockedPriorityQueue to ensure that it can provide a stable runtime sort algorithm.
Fixes Player does not preserve the order of messages with the same timestamp #2173
Is this user-facing behavior change?
Yes. Playback will respect the originally saved messages' order even if messages have the same timestamps.
However, playback from multiple bags can't preserve the original order of messages with the same timestamps in different bags because we don't know which one was first during recording, although the order is at least the same for each playback.
Did you use Generative AI?
Yes, I am using GitHub Copilot, GPT-4.1 in my workflow.
Additional Information
N/A
This is an automatic backport of pull request #2172 done by Mergify.