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

djeedai / bevy_hanabi / 28010808750
59%

Build:
DEFAULT BRANCH: main
Ran 23 Jun 2026 07:54AM 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

23 Jun 2026 07:48AM UTC coverage: 58.797% (+0.3%) from 58.545%
28010808750

push

github

web-flow
Fix ribbon sort buffer overruns (#537)

## Problem

When several effects are alive and at least one uses ribbons
(`Attribute::RIBBON_ID`), the app crashes in the render thread on a
frame where spawning a new effect grows the effect metadata buffer:

```
wgpu error: Validation Error
  In a set_bind_group command
    Dynamic binding offset index 1 with offset 128 would overrun the buffer
    bound to BindGroup ... Buffer size is 128 bytes ...
```

## Cause

The ribbon particle sort needs a per-effect fill-dispatch that reads
`GpuEffectMetadata::alive_count` from the global effect metadata buffer
via a dynamic offset. That GPU buffer operation was built in
`batch_effects()` (`EffectSystems::PrepareEffectAssets`), where it
captured the metadata buffer handle and computed its dynamic offset.

But the metadata buffer is only grown to the current frame's effect
count later, in `prepare_effect_metadata()`
(`EffectSystems::PrepareEffectGpuResources`). So on a growth frame,
`batch_effects()` captured last frame's smaller buffer together with an
offset computed for the grown layout. When the cached bind group was
validated at dispatch, the dynamic offset overran the (stale) buffer.

## Fix

Defer building the sort fill-dispatch op to a new
`queue_sort_fill_dispatch_ops()` system that runs **after**
`prepare_effect_metadata()` has (re-)allocated the buffer and **before**
the args buffer is uploaded. This mirrors the existing init
fill-dispatch path (`InitFillDispatchQueue` /
`queue_init_fill_dispatch_ops`):

- `batch_effects()` now only records the intent (metadata table id +
indirect dispatch index) into a new `SortFillDispatchQueue`.
- `queue_sort_fill_dispatch_ops()` captures the now-correctly-sized
buffer and computes in-bounds offsets, then submits.

Also added a `debug_assert` in `GpuBufferOperations::create_bind_groups`
that a dynamic-offset source binding fits its buffer, to surface this
class of mistake as an actionable panic rather than a deep wgpu
vali... (continued)

15 of 84 new or added lines in 3 files covered. (17.86%)

2 existing lines in 2 files now uncovered.

5270 of 8963 relevant lines covered (58.8%)

189.49 hits per line

Uncovered Changes

Lines Coverage ∆ File
62
46.37
1.14% src/render/mod.rs
5
34.02
-0.71% src/plugin.rs
2
27.6
-0.25% src/render/sort.rs

Coverage Regressions

Lines Coverage ∆ File
1
34.02
-0.71% src/plugin.rs
1
46.37
1.14% src/render/mod.rs
Jobs
ID Job ID Ran Files Coverage
1 28010808750.1 23 Jun 2026 07:54AM UTC 33
58.8
GitHub Action Run
Source Files on build 28010808750
  • Tree
  • List 33
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 173027ae on github
  • Prev Build on main (#27907285110)
  • Next Build on main (#28128423775)
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