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

Fix non-deterministic ECS stress test failures #1367

Merged
merged 2 commits into from
Nov 23, 2024

Conversation

RiscadoA
Copy link
Member

@RiscadoA RiscadoA commented Nov 17, 2024

Description

I made two fixes on this PR. I added long explanations to the commit messages, if you're curious.

Checklist

  • Self-review changes.
  • Ensure test coverage.
  • Add entry to the changelog's unreleased section.

@RiscadoA RiscadoA added this to the 0.5 milestone Nov 17, 2024
@RiscadoA RiscadoA self-assigned this Nov 17, 2024
@RiscadoA RiscadoA linked an issue Nov 17, 2024 that may be closed by this pull request
Copy link
Contributor

github-actions bot commented Nov 17, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://GameDevTecnico.github.io/cubos/preview/pr-1367/
on branch gh-pages at 2024-11-23 13:00 UTC

Copy link

codecov bot commented Nov 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.36%. Comparing base (0a8fd95) to head (4265115).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1367      +/-   ##
==========================================
+ Coverage   54.22%   54.36%   +0.13%     
==========================================
  Files         438      438              
  Lines       25341    25376      +35     
  Branches     2347     2346       -1     
==========================================
+ Hits        13741    13795      +54     
+ Misses      11600    11581      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

@RiscadoA RiscadoA force-pushed the 1363-ecs-stress-test-fails-non-deterministically branch 3 times, most recently from 413a5e9 to 6a68ec3 Compare November 17, 2024 11:52
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

core/src/ecs/world.cpp Show resolved Hide resolved
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

⚠️ Clang-Tidy found issue(s) with the introduced code (1/1)

core/src/ecs/world.cpp Outdated Show resolved Hide resolved
@RiscadoA RiscadoA force-pushed the 1363-ecs-stress-test-fails-non-deterministically branch from 6a68ec3 to e13e362 Compare November 17, 2024 17:07
@RiscadoA RiscadoA marked this pull request as ready for review November 17, 2024 17:19
@RiscadoA RiscadoA requested a review from a team as a code owner November 17, 2024 17:19
@RiscadoA RiscadoA requested review from Dageus and SrGesus and removed request for a team November 17, 2024 17:19
@RiscadoA RiscadoA enabled auto-merge (rebase) November 17, 2024 17:20
Copy link
Contributor

@SrGesus SrGesus left a comment

Choose a reason for hiding this comment

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

LGTM, we need one more reviewer though

@RiscadoA RiscadoA requested review from a team and diogomsmiranda and removed request for a team November 19, 2024 09:02
Copy link
Contributor

@diogomsmiranda diogomsmiranda left a comment

Choose a reason for hiding this comment

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

Nice changes! LGTM

Copy link
Contributor

@Dageus Dageus left a comment

Choose a reason for hiding this comment

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

lgtm!

Previously the behavior queries had with symmetric relations on entities was not consistent.
For example, if we had a symmetric relation R, and an entity 0, with a relation from 0 to 0, then, when querying over relation R, we would get (0, 0) twice!

This only happened when the query was asymmetric, i.e, when the requirements on both targets were different. If they were the same, we would only get (0, 0).

This lead to some inconsistencies between the tests and the query code.
I also think it was a bit confusing, so I changed it to always return only one match in these cases.
This was causing undefined behavior, as within the table iteration loop, new tables could be created with calls to propagateDepth
@RiscadoA RiscadoA force-pushed the 1363-ecs-stress-test-fails-non-deterministically branch from e13e362 to 4265115 Compare November 23, 2024 12:58
@RiscadoA RiscadoA merged commit ce15432 into main Nov 23, 2024
9 checks passed
@RiscadoA RiscadoA deleted the 1363-ecs-stress-test-fails-non-deterministically branch November 23, 2024 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECS stress test fails non-deterministically
4 participants