New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"query attempted to access archetype unavailable via sub world": Bug or just me? #153
Comments
Not even an hour ago, a patch was committed that fixes some of the access issues with version 0.2.2. Try using the git version instead of 0.2.2 from crates.io, maybe it fixes your issue too. |
@Rua I am using the git version, and I just ran "cargo update" (which I think will reload from git). The above code still produces the error. |
I have just published the latest fixes as v.0.2.3. I can reproduce this issue on the latest version though, so I'll take a look. |
I just noticed #150 appears to be the same issue. |
Further to #150, changing the second system to let health_conscious = SystemBuilder::new("healthy")
.with_query(<(Read<Money>, Read<Health>)>::query())
.read_component::<Money>()
.read_component::<Health>()
.build(|_, world, _, query| {
for (money, health) in query.iter(world) {
info!("So healthy {:?}", health);
}
}); makes the problem go away |
Yea, the issue is caused by the query in the 2nd system somehow reporting that it does not access any archetypes. I am trying to track down how that can possibly happen, given that the query by itself correctly iterates through the entities (and so must be finding the archetype it needs). |
I am also surprised that none of our unit tests caught this. |
Well... I found the problem. The This would have totally broken the scheduler in some situations, where it would have run multiple systems together which should not have run together, but I guess nobody noticed because the potential data race could be quite subtle. The new subworld code was catching this because it now validates archetype accesses from systems. |
Ouch! A good thing you spotted it. |
@ChechyLevas Can you test the latest master commit to see if this is still an issue for you? |
I'm running into this error too now, with the latest master. My code: SystemBuilder::new("texture_animation_system")
.read_resource::<AssetStorage>()
.read_resource::<Duration>()
.with_query(<Write<MapDynamic>>::query())
.build_thread_local(move |_, world, (asset_storage, delta), query| {
for mut map_dynamic in query.iter_mut(world) { It panics on the last line. |
The latest commit fixed the issue for me. Thanks! |
I don't think this is completely fixed yet. https://github.com/chemicstry/legion_transform/runs/849506909 still fails with latest master. |
Here is some code to reproduce (not sure if this is minimal)
If you comment out either of the
world.insert...
statements, it runs without errors.Am I doing something wrong here?
The text was updated successfully, but these errors were encountered: