Number benchmark jobs sequentially in river bench - #1379
Merged
Merged
Conversation
bgentry
force-pushed
the
bg/bench-job-numbers
branch
2 times, most recently
from
September 28, 2026 16:40
52b3880 to
50a3e51
Compare
bgentry
marked this pull request as ready for review
September 28, 2026 16:45
`river bench` assigns every inserted job `num: 0` because its insert loops update copies of the args values. This hides each job's intended sequence number in both fixed-count and continuous modes. Write a numbered `BenchmarkArgs` directly into each reused insert parameter in both loops. Carry the counter between batches, and trim the final fixed-count batch before numbering so only prepared jobs advance it. Check persisted args across a real batch boundary, including a short final batch. The assertions report the first incorrect number without dumping thousands of values.
bgentry
force-pushed
the
bg/bench-job-numbers
branch
from
September 28, 2026 16:49
50a3e51 to
9531245
Compare
brandur
approved these changes
Sep 29, 2026
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.
river benchis meant to give each inserted job a uniquenumarg, but its insert loops update a copy of each args value, so every job is inserted withnum: 0.Both insert paths now write numbered args directly into each reused insert parameter and carry the count between batches. The fixed-count path trims its final batch before numbering it, so the counter advances only for jobs it prepares.
The database test checks persisted args across a real batch boundary, including a shorter final batch. A short comment explains how this catches the original copy-by-value bug.