• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

djeedai / bevy_hanabi / 27885589619
59%

Build:
DEFAULT BRANCH: main
Ran 20 Jun 2026 10:24PM UTC
Jobs 1
Files 33
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

20 Jun 2026 10:18PM UTC coverage: 58.545% (-0.02%) from 58.561%
27885589619

push

github

web-flow
Grow the sort indirect-dispatch buffer with correct size (#538)

## Problem

With many ribbon effects alive (~260 trailed projectiles), the render
thread crashes:

```
dispatch indirect: buffer uses bytes 3072..3084 which overruns indirect buffer of size 3072
```

(The crash reported in #493.)

## Cause

The sort indirect-dispatch buffer is a growable `GpuBuffer` whose
capacity is tracked in **elements**: `allocate()` may hand out an index
past the current capacity, and `prepare_buffers()` then grows the GPU
buffer to fit.

`GpuBuffer::new_allocated` took the element capacity as a separate
argument, and `SortBindGroups::new` passed the buffer's **byte** size
(3072) there instead of its element count. With 12-byte
`GpuDispatchIndirectArgs` the physical buffer holds 256 elements, while
`GpuBuffer` believed it had 3072 elements of headroom — so
`prepare_buffers()` never grew it. The 257th sort dispatch then read
past the end of the physical buffer (byte 3072 in a 3072-byte buffer),
exactly the reported numbers.

## Fix

Remove the separate capacity argument from `new_allocated` and derive
the element capacity from the physical buffer (`buffer.size() /
item_size`), so the recorded and physical capacities can't disagree.
`new_allocated` has a single caller, which now just sizes the buffer; a
`debug_assert` guards a non-multiple size.

## Testing

Verified in a ribbon-heavy app (every projectile carries a ribbon
trail): pre-fix it crashes reliably once ~256 ribbon sort dispatches are
concurrently active; post-fix it runs well past that as the buffer
grows. `cargo build` passes.

Independent of #537 (stale-buffer overruns in the sort bind-group
*cache*); this is the buffer *growth* bug, #493.

Closes #493

8 of 12 new or added lines in 2 files covered. (66.67%)

5221 of 8918 relevant lines covered (58.54%)

187.85 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
55.91
-1.06% src/render/gpu_buffer.rs
Jobs
ID Job ID Ran Files Coverage
1 27885589619.1 20 Jun 2026 10:24PM UTC 33
58.54
GitHub Action Run
Source Files on build 27885589619
  • Tree
  • List 33
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 32b042c4 on github
  • Prev Build on main (#27884368063)
  • Next Build on main (#27907285110)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc