Repository navigation
Conversation
Changed Files
|
makspll
added this pull request to stack #649
October 22, 2026 16:19
Contributor
|
| Project | Bevy Scripting |
| Branch | agent/script-systems-queries |
| Testbed | linux-gha |
🐰 View full continuous benchmarking report in Bencher
⚠️ WARNING: Truncated view!The full continuous benchmarking report exceeds the maximum length allowed on this platform.
- `optional` / `optional_read` retrieve components entities don't need to have (nil when absent), `added` / `changed` filter by ticks since the system's last run (outside systems: since the last update) - queries of a system may share components when bevy considers their accesses disjoint, the archetype filter restricts reads and writes separately so a component written by one query and read by another can't be written on the reading query's entities - fix: script systems never stored their last run tick
makspll
force-pushed
the
agent/script-systems-queries
branch
from
October 23, 2026 12:07
0badd32 to
45f13ec
Compare
…ems-queries # Conflicts: # crates/bevy_mod_scripting_bindings/src/query.rs # crates/bevy_mod_scripting_bindings/src/world_extensions.rs # crates/bevy_mod_scripting_core/src/script_system.rs # crates/bevy_mod_scripting_world/src/archetype_filter.rs
…ems-queries # Conflicts: # crates/bevy_mod_scripting_world/src/archetype_filter.rs
…ems-queries # Conflicts: # docs/src/ReleaseNotes/0.23-to-0.24.md
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #650. Fourth of the script system PRs.
Queries
:optional(C)/:optional_read(C)retrieveCfrom entities that have it; for entities that don't, it isnilinresult:components().ScriptQueryResult::componentsis nowVec<Option<ReflectReference>>.:added(C)/:changed(C)are filters likewith.QueryBuildercan't express change filters dynamically. So the query declares a read ofC(ref_id, which also requiresC, the same asChanged<T>), andScriptQueryBuilder::result_forchecks the ticks of each matched entity.world.query():build(), they're relative to the world's last change tick, likeWorld::query.world.query()and script systems now build results through the sameresult_for.Disjoint queries
get_conflicts_single, socomponent(A):with(B)+component(A):without(B)is allowed. Conflicting params are reported once, and the system doesn't run.Con some archetypes and only read it on others, soArchetypeFilterkeeps separate read and write bitsets per component. Without that, the write permission (per component) would let the script writeCon entities that Bevy thinks this system only reads. The Lua test checks that the write through the read-only query fails.Fix
DynamicScriptSystem::run_unsafeincremented the change tick but never storedlast_run, so "since last run" meant "ever".last_runis now updated whenever the callback runs.Tests
changedrelative tolast_change_tick(only the modified entity matches), and absent optionals areNone.nilscargo check --workspace --all-targetsis clean. The ecs bindings'Namelookup usedcomponents, and is adapted.🤖 Generated with Claude Code