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

djeedai / bevy_hanabi / 6699592407
58%

Build:
DEFAULT BRANCH: main
Ran 30 Oct 2023 10:55PM UTC
Jobs 1
Files 25
Run time 18s
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

30 Oct 2023 10:45PM UTC coverage: 54.522% (+1.1%) from 53.381%
6699592407

push

github

web-flow
Handle side-effects in expression evaluation (#241)

Ensure that expressions with a side-effect, like `rand()`, are evaluated
only once even if they're referenced multiple times in a module.
Otherwise each evaluation duplicates the side effect, which in the
example of `rand()` yields a different value even though the expression
is the same.

Add `Expr::has_side_effect()` to determine if an expression has any
side effect. Currently only expressions returning a random value have a
side effect.

To ensure a unique evaluation per expression, add an evaluation cache to
the implementations of `EvalContext`, saving the evaluated string
associated with an `ExprHandle`.

Add to `EvalContext` some helpers:
- `make_local_var()` to create a unique variable name, for storing
  intermediate evaluations.
- `push_stmt()` to write the statement which actually stores the
  evaluation of an expression into a local variable before it's
  referenced.

Remove the `module()` and `expr()` from `EvalContext`, and move the
mutable `Module` reference out of that context, passing it explicitly
instead. This allows acquiring a mutable reference to both the context
and the module at the same time, which is not possible if the module
reference is stored as a context field.

Add `EvalContext::make_fn()` to generate a function with a temporary
function-local context. This ensures that functions which use
expressions with side effects have their local statements emitted inside
the body of the function, and not at the call site where they're not
available.

Fix several bugs in some older modifiers which were using hand-crafted
code not properly parenthesized, which could lead to invalid expression
evaluation due to operator priorities in WGSL:
- `SetPositionCircleModifier`
- `SetPositionSphereModifier`
- `SetVelocityCircleModifier`
- `SetVelocitySphereModifier`
- `SetVelocityTangentModifier`

Bug: #240

328 of 328 new or added lines in 10 files covered. (100.0%)

2900 of 5319 relevant lines covered (54.52%)

22.35 hits per line

Jobs
ID Job ID Ran Files Coverage
1 6699592407.1 30 Oct 2023 10:55PM UTC 0
54.52
GitHub Action Run
Source Files on build 6699592407
Detailed source file information is not available for this build.
  • Back to Repo
  • a58475ea on github
  • Prev Build on main (#6442935368)
  • Next Build on main (#6738570213)
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