Repository navigation
Unify stock collection storage contracts - #5487
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
The source-breaking storage changes affect COM marshaling, ownership, and final release, while unavailable Windows runtime validation and unverified WinUI, Reactor, and Miri checks leave key guarantees requiring maintainer review.
No open issues 🎉
What changed in this PR
This PR unifies storage contracts across all seven stock collection families in windows-collections
and updates Reactor consumers. The tighter From bounds are source-breaking; the change does not
resolve #5469 or guarantee arbitrary clone/comparison reentrancy.
Changes:
- Require
Send + Syncfor safe direct storage, with unsafe direct and marshaled alternatives. - Share immutable vector reads and iteration while preserving interface surfaces, and release retired
entries outside structural locks. - Expand storage, lifetime, concurrency, interop, and WinUI coverage, including Linux Miri checks.
| File | Description |
|---|---|
crates/tests/libs/reactor/tests/ui/main.rs |
Runs the trusted read-only storage fixture. |
crates/tests/libs/reactor/src/lib.rs |
Registers the trusted collection fixture. |
crates/tests/libs/reactor/src/collections/mod.rs |
Adds trusted mode and marshaled mutable construction. |
crates/tests/libs/reactor/src/collections/live.rs |
Exercises all four collection source modes. |
crates/tests/libs/reactor/readme.md |
Documents expanded live collection coverage. |
crates/tests/libs/collections/tests/storage.rs |
Tests batching, allocations, capacity reuse, and platform limits. |
crates/tests/libs/collections/tests/stock_vector.rs |
Makes direct interface-storage safety assumptions explicit. |
crates/tests/libs/collections/tests/stock_observable_map.rs |
Compares stock map behavior with native PropertySet. |
crates/tests/libs/collections/tests/stock_iterable.rs |
Adapts construction tests to the storage contracts. |
crates/tests/libs/collections/tests/runtime_class_name.rs |
Uses explicit unsafe storage for a scalar box. |
crates/tests/libs/collections/tests/interface_storage.rs |
Expands marshaling, interface, failure, and lifetime coverage. |
crates/tests/interop/fixtures/collections/read_only.h |
Shares vector contract tests and adds map resolution checks. |
crates/tests/interop/fixtures/collections/component.rs |
Exposes marshaled collection factories to interop tests. |
crates/tests/interop/fixtures/collections/client.cpp |
Runs contracts against marshaled vectors and maps. |
crates/tests/interop/fixtures/collections/api.rdl |
Declares the new interop factory methods. |
crates/libs/reactor/src/native/winui/relations.rs |
Preserves read errors and marshals replacement data maps. |
crates/libs/reactor/src/native/winui/objects.rs |
Constructs data objects with marshaled map storage. |
crates/libs/reactor/src/native/winui/dependency.rs |
Uses trusted immutable storage for stock string boxes. |
crates/libs/collections/src/vector.rs |
Adopts shared storage policies and explicit constructors. |
crates/libs/collections/src/vector_view.rs |
Shares immutable reads and adds storage alternatives. |
crates/libs/collections/src/vector_tests.rs |
Checks reentrant retirement and notification ordering. |
crates/libs/collections/src/storage.rs |
Implements storage policies, batching, and unlocked retirement. |
crates/libs/collections/src/read_only_vector.rs |
Shares immutable operations and adds unchecked direct storage. |
crates/libs/collections/src/observable_vector.rs |
Applies shared storage while retaining change notifications. |
crates/libs/collections/src/observable_map.rs |
Adds storage choices and releases entries before notifications. |
crates/libs/collections/src/map.rs |
Adds storage choices and unlocked entry retirement. |
crates/libs/collections/src/map_view.rs |
Shares map iteration and preserves storage in snapshots. |
crates/libs/collections/src/map_tests.rs |
Tests reentrant key/value retirement and notifications. |
crates/libs/collections/src/lib.rs |
Registers shared implementation and test modules. |
crates/libs/collections/src/key_value_pair.rs |
Retains the selected storage policy in derived pairs. |
crates/libs/collections/src/iterable.rs |
Adds storage choices and shared immutable iteration. |
crates/libs/collections/src/immutable_vector.rs |
Centralizes immutable vector reads and iteration. |
crates/libs/collections/readme.md |
Explains constructors, safety obligations, and error behavior. |
.github/workflows/miri.yml |
Adds Linux Miri checks for storage and retirement. |
.github/copilot-instructions.md |
Documents collection invariants and unresolved limitations. |
Review effort: Balanced
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.
Give all seven stock collection families the same storage choices:
FromrequiresSend + Syncstored values, unsafefrom_uncheckedkeeps direct storage for caller-proven ownership, andfrom_marshaledhandles interface values through agile references. The tighterFrombounds are a source-breaking change.Share immutable vector reads and iteration without changing QI surfaces, release retired map/vector entries outside their locks, and update Reactor to use the appropriate storage paths.
This does not close #5469 or promise arbitrary clone/comparison reentrancy.