Skip to content

Honor --rate for replays without session timestamps - #405

Merged
bneradt merged 1 commit into
yahoo:masterfrom
bneradt:fix-rate-without-timestamps
Oct 13, 2026
Merged

bneradt merged 1 commit into
yahoo:masterfrom
bneradt:fix-rate-without-timestamps

Conversation

@bneradt

@bneradt bneradt commented Oct 12, 2026

Copy link
Copy Markdown
Collaborator

When --rate was given for a replay whose sessions carry no start-time
nodes, the client computed a per session sleep time but stored it in a
variable that shadowed the one the dispatch loop reads. The loop
therefore slept 0us between sessions, so --rate had no effect for such
replays, and the startup log reported a 0 ms per session sleep time.

This patch addresses this by assigning the computed sleep time, still
capped by --sleep-limit, to the variable the dispatch loop uses. This
change also adds a Uranium regression test that replays several
timestamp-less sessions at a low rate and verifies both the logged
sleep time and that the replay takes at least the expected duration.

Co-authored-by: Claude Opus 5.5 (Low reasoning) [email protected]

🤖 Generated with Claude Code

When --rate was given for a replay whose sessions carry no start-time
nodes, the client computed a per session sleep time but stored it in a
variable that shadowed the one the dispatch loop reads. The loop
therefore slept 0us between sessions, so --rate had no effect for such
replays, and the startup log reported a 0 ms per session sleep time.

This patch addresses this by assigning the computed sleep time, still
capped by --sleep-limit, to the variable the dispatch loop uses. This
change also adds a Uranium regression test that replays several
timestamp-less sessions at a low rate and verifies both the logged
sleep time and that the replay takes at least the expected duration.

Co-authored-by: Claude Opus 5.5 (Low reasoning) <[email protected]>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 20:50
@bneradt bneradt added the bug Something isn't working label Oct 12, 2026
@bneradt bneradt self-assigned this Oct 12, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Comment on lines -1093 to -1094
auto sleep_time = microseconds(sleep_time_raw);
sleep_time = std::min(sleep_time, sleep_limit);

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not that the auto sleep_time here accidentally shadowed the outer scope sleep_time we were trying to set.

@bneradt
bneradt merged commit 9fb0839 into yahoo:master Oct 13, 2026
6 checks passed
@bneradt
bneradt deleted the fix-rate-without-timestamps branch October 13, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants