Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove systems if their parent entity is removed #2232

Merged
merged 53 commits into from
Jul 17, 2024

Commits on Jul 9, 2024

  1. Remove systems if their parent entity is removed

    This commit tries to address #2217.
    
    In particular if a user despawns an entity, the associated plugin gets
    removed. This should prevent issues like #2165. TBH I'm not sure if this
    is the right way forward as a system should technically be able to
    access any entity in a traditional ECS. I also recognize that there may
    be some performance impact. I will need to quantify this.
    
    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    33f47e8 View commit details
    Browse the repository at this point in the history
  2. Fix vector removal routine.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    b932354 View commit details
    Browse the repository at this point in the history
  3. Reduce performace impact by only running when there are entities to

    remove.
    
    This makes sense because for the most part, we will not be removing
    entities very often so it does not make sense to iterate unless there
    are entities which do need removing.
    
    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    45c4910 View commit details
    Browse the repository at this point in the history
  4. style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    0a7c065 View commit details
    Browse the repository at this point in the history
  5. style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    1e7416f View commit details
    Browse the repository at this point in the history
  6. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    453b54b View commit details
    Browse the repository at this point in the history
  7. Stopped things from going 💥

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    4d9809a View commit details
    Browse the repository at this point in the history
  8. Now the PosePublisher system likes to go 💥

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    968c3ac View commit details
    Browse the repository at this point in the history
  9. Debugging inputs

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    862ff3d View commit details
    Browse the repository at this point in the history
  10. Remove "optimization"

    This commit removes an "optimization" in the PosePublisher that was
    causing the system to segfault when an entity was removed. In reality
    this commit is unrelated to the previous few commits. However, without this change
    the previous change would cause removal of an entity to crash demos that
    used pose publishers. I think the crux of the issue is that protobufs takeover
    memory management of objects leading to a scenario where if a reference
    was freed elsewhere, the protobuf would continue to hold said reference.
    When we try to do operations on the protobuf we end up double-freeing
    the memory and hence there is a 💥.
    
    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    b4e07a3 View commit details
    Browse the repository at this point in the history
  11. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    f67db9e View commit details
    Browse the repository at this point in the history
  12. Adds a container to handle system removal better.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    f16bad1 View commit details
    Browse the repository at this point in the history
  13. Add unit tests

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    8294888 View commit details
    Browse the repository at this point in the history
  14. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    53e951a View commit details
    Browse the repository at this point in the history
  15. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    446e816 View commit details
    Browse the repository at this point in the history
  16. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    7ecefdc View commit details
    Browse the repository at this point in the history
  17. Update barrier documentation.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    19b418c View commit details
    Browse the repository at this point in the history
  18. Rework barrier and add test.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    e84d9dc View commit details
    Browse the repository at this point in the history
  19. Use the new simplified drop API.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    b5878e5 View commit details
    Browse the repository at this point in the history
  20. Fixed systemcontainer logic bug.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    3dd4395 View commit details
    Browse the repository at this point in the history
  21. Cleaner version of the fix.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    4d104ec View commit details
    Browse the repository at this point in the history
  22. Rename according to @scpeters feedback.

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    483e19a View commit details
    Browse the repository at this point in the history
  23. Fix spelling error and style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    5ded114 View commit details
    Browse the repository at this point in the history
  24. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    378399d View commit details
    Browse the repository at this point in the history
  25. Remove the use of std::iterator

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    391496f View commit details
    Browse the repository at this point in the history
  26. Fix thread safety concern

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    6114175 View commit details
    Browse the repository at this point in the history
  27. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    f486fb8 View commit details
    Browse the repository at this point in the history
  28. Apply suggestions from code review

    Co-authored-by: Steve Peters <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 and scpeters committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    574ab2d View commit details
    Browse the repository at this point in the history
  29. Rename and update class

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    f5b3878 View commit details
    Browse the repository at this point in the history
  30. Simplified logic using stl algorithms

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    5581525 View commit details
    Browse the repository at this point in the history
  31. Make cpplint happy

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    3a39ff5 View commit details
    Browse the repository at this point in the history
  32. Destroy system immedately

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    9dafb7d View commit details
    Browse the repository at this point in the history
  33. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    6eb2d2f View commit details
    Browse the repository at this point in the history
  34. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    91521b7 View commit details
    Browse the repository at this point in the history
  35. Fix crash and revert pose-publisher changes.

    Thanks @azeey I found the source of the crash. It comes from the fact
    that the PostUpdate system list changes with time. The reference taken
    by the thread to the PostUpdate interface will change over time. Thus we
    copy the interface pointer.
    
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    36ed0ad View commit details
    Browse the repository at this point in the history
  36. Revert debug changes

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    b7a7d8c View commit details
    Browse the repository at this point in the history
  37. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    1e73b05 View commit details
    Browse the repository at this point in the history
  38. style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    e0b3a9e View commit details
    Browse the repository at this point in the history
  39. style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    2d6f115 View commit details
    Browse the repository at this point in the history
  40. Avoid cross-thread communication

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    5e27af8 View commit details
    Browse the repository at this point in the history
  41. stashing temporarily

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    18d122c View commit details
    Browse the repository at this point in the history
  42. Significantly reworked how things work

    Instead of using barriers simply stop all PostUpdate threads. This makes
    the PR much smaller and easier to reason about. Additionally it
    addresses unit test failures caught by @scpeters.
    
    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    ff833ce View commit details
    Browse the repository at this point in the history
  43. Remove unrelated changes

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    33d5d4f View commit details
    Browse the repository at this point in the history
  44. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    e4174c4 View commit details
    Browse the repository at this point in the history
  45. Style

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 9, 2024
    Configuration menu
    Copy the full SHA
    26aa106 View commit details
    Browse the repository at this point in the history
  46. Configuration menu
    Copy the full SHA
    8e12607 View commit details
    Browse the repository at this point in the history

Commits on Jul 10, 2024

  1. Change variable name

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    401e501 View commit details
    Browse the repository at this point in the history
  2. Stylistic feedback

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    21a18cf View commit details
    Browse the repository at this point in the history
  3. Move logical check

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    7b370c2 View commit details
    Browse the repository at this point in the history
  4. Rename Variable

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    b792bfa View commit details
    Browse the repository at this point in the history
  5. Docstring

    Signed-off-by: Arjo Chakravarty <[email protected]>
    arjo129 committed Jul 10, 2024
    Configuration menu
    Copy the full SHA
    00a6e47 View commit details
    Browse the repository at this point in the history

Commits on Jul 12, 2024

  1. Use parentEntity available in systems instead of storing it for eac…

    …h interface (#2473)
    
    
    ---------
    
    Signed-off-by: Addisu Z. Taddese <[email protected]>
    Signed-off-by: Steve Peters <[email protected]>
    Signed-off-by: Arjo Chakravarty <[email protected]>
    Co-authored-by: Steve Peters <[email protected]>
    Co-authored-by: Arjo Chakravarty <[email protected]>
    3 people authored Jul 12, 2024
    Configuration menu
    Copy the full SHA
    7026b57 View commit details
    Browse the repository at this point in the history

Commits on Jul 15, 2024

  1. Configuration menu
    Copy the full SHA
    ed980d9 View commit details
    Browse the repository at this point in the history