Skip to content

BufferMut::zeroed_aligned stores actually allocated length instead of passed length#7979

Merged
robert3005 merged 7 commits into
developfrom
rk/buffermut_check_overflow
May 18, 2026
Merged

BufferMut::zeroed_aligned stores actually allocated length instead of passed length#7979
robert3005 merged 7 commits into
developfrom
rk/buffermut_check_overflow

Conversation

@robert3005

Copy link
Copy Markdown
Contributor

If length * size_of::<T> overflows the length of the buffer is wrong

… passed length

Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 added the changelog/fix A bug fix label May 18, 2026
Signed-off-by: Robert Kruszewski <github@robertk.io>
@codspeed-hq

codspeed-hq Bot commented May 18, 2026

Copy link
Copy Markdown

Merging this PR will improve performance by 18.1%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 4 improved benchmarks
✅ 1217 untouched benchmarks

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation chunked_varbinview_canonical_into[(1000, 10)] 198 µs 162 µs +22.24%
Simulation chunked_varbinview_into_canonical[(100, 100)] 358.5 µs 323.5 µs +10.8%
Simulation chunked_varbinview_opt_canonical_into[(1000, 10)] 225.3 µs 188.6 µs +19.51%
Simulation chunked_varbinview_into_canonical[(1000, 10)] 211.3 µs 175.8 µs +20.17%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing rk/buffermut_check_overflow (fa513af) with develop (d25c33f)

Open in CodSpeed

Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 enabled auto-merge (squash) May 18, 2026 12:03
Signed-off-by: Robert Kruszewski <github@robertk.io>
Signed-off-by: Robert Kruszewski <github@robertk.io>
Comment thread vortex-buffer/src/buffer_mut.rs Outdated
Comment thread vortex-buffer/src/buffer_mut.rs Outdated
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005 robert3005 requested a review from joseph-isaacs May 18, 2026 13:18

@joseph-isaacs joseph-isaacs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I still think our buffer should assert non zst at compile time

@robert3005 robert3005 merged commit faf7e42 into develop May 18, 2026
62 checks passed
@robert3005 robert3005 deleted the rk/buffermut_check_overflow branch May 18, 2026 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants