Skip to content

make MutableVec and MutableBTreeMap lock-free and more ECS-native, removing the need to flush, plus some misc. - #10

Merged
databasedav merged 10 commits into
mainfrom
auto_flush
Oct 28, 2025
Merged

databasedav merged 10 commits into
mainfrom
auto_flush

Conversation

@databasedav

Copy link
Copy Markdown
Owner

No description provided.

@databasedav databasedav changed the title auto flush MutableVec and MutableBTreeMap make MutableVec and MutableBTreeMap lock-free and more ECS-native, removing the need to flush Aug 8, 2025
@databasedav
databasedav requested a review from Copilot October 27, 2025 10:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transforms MutableVec and MutableBTreeMap from lock-based structures requiring manual flushing into ECS-native components that automatically propagate changes through the signal graph.

Key Changes:

  • Replaced Arc<RwLock<State>> with entity-based storage using MutableVecData/MutableBTreeMapData components
  • Introduced MutableVecBuilder/MutableBTreeMapBuilder for initialization with spawn() methods
  • Eliminated manual flush() calls - changes now propagate automatically via ECS change detection
  • Added reference counting with automatic entity cleanup on drop

Reviewed Changes

Copilot reviewed 15 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/utils.rs Added Deref implementation for LazyEntity and constant for error message
src/signal_map.rs Converted MutableBTreeMap to ECS-based storage with builder pattern, removed flush methods, updated examples
src/signal.rs Renamed SignalClone to SignalDynClone, updated LazyEntity usage to use Deref, simplified doc examples
src/lib.rs Made #![no_std] test-conditional, refactored plugin systems, added cleanup systems for stale entities
src/graph.rs Renamed cleanup-related identifiers from CLEANUP_ to STALE_
src/builder.rs Added on_spawn_with_system, observe, and on_signal_with_entity methods
rustfmt.toml Enabled format_code_in_doc_comments
repo_prompt.ncl Added reference to new examples/letters.rs file
examples/test.rs Updated to use builder pattern and removed flush calls
examples/lifetimes.rs Updated to use builder pattern and removed flush calls
examples/letters.rs Updated to use builder pattern and removed flush calls
examples/filters.rs Updated to use builder pattern and removed flush calls
examples/counter.rs Updated comment for clarity
README.md Updated documentation examples
Cargo.toml Added dev dependencies for testing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/builder.rs Resolved
@databasedav databasedav changed the title make MutableVec and MutableBTreeMap lock-free and more ECS-native, removing the need to flush make MutableVec and MutableBTreeMap lock-free and more ECS-native, removing the need to flush, plus some misc. Oct 28, 2025
@databasedav
databasedav marked this pull request as ready for review October 28, 2025 06:12
@databasedav
databasedav merged commit 1889b0e into main Oct 28, 2025
7 of 8 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 28, 2025
@github-actions

Copy link
Copy Markdown

commit: 4ddd67b
deployed: 2025-10-28T06:34:00Z
previews:

@databasedav
databasedav deleted the auto_flush branch November 19, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants