You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Two of RefreshFull's three branches are unreachable, and the EcsView ctor that would reach one has no callers #668
(2) requires a field reader with no cached plan. The only constructor producing that shape — EcsView.cs:40, (query, evaluators, componentTable, fieldReader, bufferCapacity, …) — has no callers. EcsQuery constructs views at exactly three sites: ToPullView (allocator ctor, :91), ToIncrementalView (plan ctor, :54), ToOrView (plans ctor, :69).
(3) requires _fieldReader == null, i.e. a pull view. But Refresh returns for pull mode at EcsView.cs:245-252 (Evaluators.Length == 0 → RefreshPull) before the overflow check that calls RefreshFull.
Why it matters beyond dead code
The unreachable branch (2) was the correct one for cluster-backed archetypes — it went through EcsQuery.Execute(), which knew about the per-archetype index home — while the reachable branch (1) did not. #663's issue text described the site as "correct or broken depending on whether a cached plan exists"; in fact it was always broken, because the correct branch cannot be reached. Dead code that looks like a fallback hides how narrow the live path really is.
Proposed
Delete the unused EcsView.cs:40 constructor and branch (2).
Delete branch (3), or replace it with a Debug.Assert recording that pull views never reach RefreshFull.
Confirm no reflection / test-only construction depends on the removed ctor first.
Folding this into the #722 / #790 / #791 change — same method, and that work rewrites the pull path this issue is about.
One correction to the analysis above, found while measuring #790. Branch (3) is described here as unreachable because Refresh returns for pull mode at EcsView.cs:245-252 before the overflow check. That is still true, but the reason it matters has changed: the pull path is about to stop being "re-query and diff" and become an occupancy-delta path, so branch (3) is not merely dead — it encodes a fallback that will no longer be the correct shape for a pull view at all.
Plan for this issue inside that PR:
Delete the EcsView.cs:40 constructor and branch (2) as proposed (confirmed no callers, including tests).
Replace branch (3) with a Debug.Assert rather than deleting it silently, since the new pull path makes "a pull view reached RefreshFull" a real invariant violation worth catching rather than an impossible state.
Done in PR #795 (rides with #722's visibility-gate work, since both touch EcsView).
Both unreachable branches are gone, along with the EcsView constructor that produced the only shape one of them handled — it had no callers, confirmed against all three new EcsView<> sites. The surviving branch is now asserted rather than selected, so a pull view reaching RefreshFull fails loudly instead of silently rebuilding a predicate-filtered set without evaluating the predicate.
Worth recording why this was more than tidying: one of the dead branches was the correct one for cluster-backed archetypes. That is what made #663 read as "correct or broken depending on whether a plan exists" when it was always broken — dead code shaped like a fallback hid how narrow the live path actually was.
Activity
nockawa commentedon Aug 12, 2026
Folding this into the #722 / #790 / #791 change — same method, and that work rewrites the pull path this issue is about.
One correction to the analysis above, found while measuring #790. Branch (3) is described here as unreachable because
Refreshreturns for pull mode atEcsView.cs:245-252before the overflow check. That is still true, but the reason it matters has changed: the pull path is about to stop being "re-query and diff" and become an occupancy-delta path, so branch (3) is not merely dead — it encodes a fallback that will no longer be the correct shape for a pull view at all.Plan for this issue inside that PR:
EcsView.cs:40constructor and branch (2) as proposed (confirmed no callers, including tests).Debug.Assertrather than deleting it silently, since the new pull path makes "a pull view reachedRefreshFull" a real invariant violation worth catching rather than an impossible state.nockawa commentedon Aug 13, 2026
Done in PR #795 (rides with #722's visibility-gate work, since both touch
EcsView).Both unreachable branches are gone, along with the
EcsViewconstructor that produced the only shape one of them handled — it had no callers, confirmed against all threenew EcsView<>sites. The surviving branch is now asserted rather than selected, so a pull view reachingRefreshFullfails loudly instead of silently rebuilding a predicate-filtered set without evaluating the predicate.Worth recording why this was more than tidying: one of the dead branches was the correct one for cluster-backed archetypes. That is what made #663 read as "correct or broken depending on whether a plan exists" when it was always broken — dead code shaped like a fallback hid how narrow the live path actually was.
Log2n-io#722 Log2n-io#668 The cluster visibility summary latched perm…