Skip to content

0.7 filters - #49

Merged
thygrrr merged 8 commits into
mainfrom
0.7-filters
Aug 4, 2026
Merged

thygrrr merged 8 commits into
mainfrom
0.7-filters

Conversation

@thygrrr

@thygrrr thygrrr commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

feat: splitting the filtering responsibilities between Stream and FilteredStream.
feat: bifurcated runners on FilteredStream to run code on passing and rejected entities and archetypes
feat: dotnet stryker mutation resilience improved with specific tests

thygrrr added 4 commits August 3, 2026 20:20
All Stream filtering now lives in a dedicated FilteredStream<> view,
created fluently via Has(...), Not(...), and Where(...) on any Stream.

- Breaking: init-only Subset/Exclude sets removed from Stream;
  Stream.Where(...) now returns FilteredStream<>.
- Fixed: Has (formerly Subset) uses AND semantics as documented
  (an archetype must have ALL listed expressions; was OR).
- FilteredStream honors all filters in For, Job, Count, enumeration,
  and Despawn; Raw/Blit stay on the unfiltered Stream (.Stream property).
- Two-delegate runners: every For/Job variant gains an
  (included, excluded) overload partitioning the Query in one pass.
- Jobs synchronize per invocation instead of sharing a CountdownEvent
  between Stream copies; per-element Pass overhead removed from
  unfiltered Stream.Job work items.
- Test batteries regenerated (FilteredStream.Tests.tt); refactored
  files at 100% line and branch coverage.
- HasUsesAndSemantics now runs all four single-delegate For variants, so
  the archetype-skip path executes in the entity/uniform overloads too.
- DespawnHonorsPredicates gains a Not clause and a sheltered archetype,
  covering the archetype-skip during predicate collection.

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 57 files

Not reviewed (too large): src/fennecs.tests/Stream/generators/FilteredStream.Tests.generated.cs (~18,292 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread src/fennecs/generators/FilteredStream.tt
Comment thread doc/cookbook/appetizers/Thanos.md
Comment thread src/fennecs.tests/WorldRegistryTests.cs Outdated
Comment thread src/fennecs.tests/Query/FilteredStreamArchetypeTests.cs
Comment thread src/fennecs.tests/CrossTests.cs Outdated
@cubic-dev-ai

cubic-dev-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown

This PR is large and would use a significant portion of your monthly review quota. Comment @cubic-dev-ai review this to confirm that you want cubic to review it.

@cubic-dev-ai cubic-dev-ai Bot 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.

1 issue found across 60 files

Not reviewed (too large): src/fennecs.tests/Stream/generators/FilteredStream.Tests.generated.cs (~18,292 lines) - if these are generated or fixture files, add them to ignored paths to exclude them from future reviews.

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/fennecs/Cross.cs">

<violation number="1" location="src/fennecs/Cross.cs:46">
P3: Join internals now expose mutable pooled arrays/lists assembly-wide, so any internal caller can mutate counters or retain references past Dispose and break iteration/pool invariants. Keeping these fields private (and exposing only needed safe members) avoids that accidental coupling.</violation>
</file>

Tip: instead of fixing issues one by one fix them all with cubic

Re-trigger cubic

Comment thread src/fennecs/World.Registry.cs Outdated
Comment thread src/fennecs/World.Registry.cs Outdated
Comment thread src/fennecs/generators/FilteredStream.generated.cs
Comment thread src/fennecs.tests/Stream/JobExceptionTests.cs Outdated
Comment thread src/fennecs/Cross.cs Outdated
{
private readonly int[] _counter;
private readonly int[] _limiter;
internal readonly int[] _counter;

@cubic-dev-ai cubic-dev-ai Bot Aug 4, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3: Join internals now expose mutable pooled arrays/lists assembly-wide, so any internal caller can mutate counters or retain references past Dispose and break iteration/pool invariants. Keeping these fields private (and exposing only needed safe members) avoids that accidental coupling.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/fennecs/Cross.cs, line 46:

<comment>Join internals now expose mutable pooled arrays/lists assembly-wide, so any internal caller can mutate counters or retain references past Dispose and break iteration/pool invariants. Keeping these fields private (and exposing only needed safe members) avoids that accidental coupling.</comment>

<file context>
@@ -43,10 +43,10 @@ internal static bool FullPermutation(Span<int> counter, Span<int> limiter)
     {
-        private readonly int[] _counter;
-        private readonly int[] _limiter;
+        internal readonly int[] _counter;
+        internal readonly int[] _limiter;
 
</file context>
Fix with cubic

Comment thread src/fennecs.tests/Query/FilteredStreamArchetypeTests.cs
Comment thread src/fennecs/generators/FilteredStream.tt Outdated
Comment thread src/fennecs.tests/WorldRegistryTests.cs Outdated
Comment thread src/fennecs.tests/CrossTests.cs Outdated

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed across 10 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

Fix all with cubic | Re-trigger cubic

Comment thread src/fennecs.tests/WorldRegistryTests.cs
Comment thread src/fennecs.tests/Stream/JobExceptionTests.cs
@thygrrr
thygrrr merged commit 66febda into main Aug 4, 2026
2 checks passed
@thygrrr
thygrrr deleted the 0.7-filters branch August 4, 2026 17:40
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.

1 participant