Skip to content

fix: restore observer state after traversal mismatch - #2241

Closed
ShiroKSH wants to merge 1 commit into
SanderMertens:masterfrom
ShiroKSH:fix/observer-traversal-cleanup
Closed

fix: restore observer state after traversal mismatch#2241
ShiroKSH wants to merge 1 commit into
SanderMertens:masterfrom
ShiroKSH:fix/observer-traversal-cleanup

Conversation

@ShiroKSH

@ShiroKSH ShiroKSH commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Filter traversal-mismatched observers before changing stage or iterator state.
  • Add a regression assertion for batched events propagated through multiple traversable relationships.
  • Regenerate the distribution sources.

Root cause

An expected traversal mismatch returned after setting the root stage's current observer and increasing log nesting. That early return skipped the existing cleanup path, leaving the root stage attributed to the skipped observer.

Testing

  • bake run test/core -- Observer.2_up_terms_w_batched_add
  • bake run test/core -- Observer
  • cmake --build /tmp/flecs-cmake-strict -j 4
  • clang -std=gnu99 -fsyntax-only -Werror -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers distr/flecs.c
  • clang -std=gnu99 -fsyntax-only -Werror -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers distr/flecs_no_addons.c

@SanderMertens

Copy link
Copy Markdown
Owner

The test relies on internal state. To prove this is a real bug, please provide a reproducer that only uses public APIs. Closing this for now.

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