Repository navigation
Conversation
makspll
added this pull request to stack #649
October 22, 2026 13:33
Changed Files
|
Contributor
|
| Project | Bevy Scripting |
| Branch | agent/script-systems-read-access |
| 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.
- `resource_read` / `component_read` declare read access to bevy and to the guard, `resource` / `component` stay read and write - the guard's AccessBitField gets a write forbidden bit (count: 5 bits) and claims fail at the max count instead of overflowing to 0 - fix: query components were declared to bevy as reads while scripts could write them, resources as accessing nothing (never conflicting) - fix: get_all_access_ids reported every access as a write
…rite claims The write forbidden bit in AccessBitField made field get/set 4-8% slower, the bitset leaves read claims untouched and keeps the max claim count at 63.
makspll
force-pushed
the
agent/script-systems-read-access
branch
from
October 23, 2026 12:07
ef09487 to
ee5f700
Compare
… read only and read write accesses are disjoint
makspll
marked this pull request as ready for review
October 23, 2026 15:00
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 #647. Second of the script system PRs.
Feature
system_builder(..):resource_read(R)andworld.query():component_read(C)are declared to Bevy as reads, so readers can run in parallel.resource/componentstay read + write.AccessByteSet(from_allowed_lists(read_write, read_only)), checked only by component write claims, so read claims pay nothing.Fixes found on the way (all pre-existing)
ref_id) while scripts could write them, so two script systems writingCran in parallel. Written components now usemut_id.as_query_statetakesdeclare_writes, becauseworld.query()builds anEntityRefquery, which can't mix with writes.FilteredAccess::matches_nothing()+ write. An access matching nothing is compatible with everything, so two script systems writing the same resource ran in parallel. They now useadd_resource_read/add_resource_write, likeRes/ResMut.get_all_access_idsreported every access as a write: the read and write sets were swapped. The flag was unused until now.Tests
release_all_accesses, and claims stop at the max count.read_only_parameters_cannot_be_written.lua.Perf
A/B against #647, medians of 6 interleaved rounds:
field get418 → 387 ns,field set454 → 450 ns,component/access2514 → 2417 ns,resource/access2185 → 2145 ns, i.e. no regression. A first version put a write-forbidden bit intoAccessBitField, which madefield get8% slower andfield set4% slower, so it was replaced by the bitset.🤖 Generated with Claude Code