bevyengine / bevyengine/bevy

`Query::transmute_filtered` doesn't respect the new filters

Open
#14,628 2 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Bug S-Needs-Design
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version

Both 0.14.1 and c1c003d

## What you did

```rs
#[derive(Component)]
struct A;

#[derive(Component)]
struct B;

let mut world = World::new();

world.spawn(A);
world.spawn((A, B));

let mut query = world
.query::<&A>()
.transmute_filtered::<&A, Without>(world.components());

let matched = query.iter(&world).count();
assert_eq!(matched, 1);
```

## What went wrong

I was expecting the assert to pass, since there's only one entity with `A` but not `B`.

Instead the assert failed due to `matched` being 2, meaning both entities matched the new query.

Contributor guide

Open the contributing guide

Research direction

Start at Query::transmute_filtered and reproduce the issue with the Rust example in this report: an A-only entity and an entity with A and B should be filtered by Without. Trace how the new filter is applied, then verify that the assertion reports one matching entity.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.