Skip to content

Conversation

@alexet
Copy link

@alexet alexet commented Mar 25, 2025

Graphs use the internal id if semmle.order is not good enough. However the internal id of a newtype depends on evaluation order (and in this case whether TResolved or TUnresolved is evaluated first). It seems the current evaluator is very consistent but RTJO changes it. In theory though the current evaluator could get the wrong result as multiple threads can change scheduling order.

I am looking into making the graph code use the label as an intermediate order. However we end up still needing us to make this test deterministic as the change would break this test.

This just adds the toString as an order when the location is not defined, I have put these first in the order as that matches the existing results better (if semmle.order is not defined then it is treated 0).

I have duplicated this code as it is already duplicated but I am happy to put this in a qll instead as this code has grown in size.

@github-actions github-actions bot added the Ruby label Mar 25, 2025
@alexet alexet force-pushed the alexet/ruby-deterministic branch from 97def4d to 0ccbe3e Compare April 1, 2025 15:18
@alexet alexet marked this pull request as ready for review April 14, 2025 11:31
Copilot AI review requested due to automatic review settings April 14, 2025 11:31
@alexet alexet requested a review from a team as a code owner April 14, 2025 11:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (4)
  • ruby/ql/test/library-tests/modules/ancestors.expected: Language not supported
  • ruby/ql/test/library-tests/modules/ancestors.ql: Language not supported
  • ruby/ql/test/library-tests/modules/superclasses.expected: Language not supported
  • ruby/ql/test/library-tests/modules/superclasses.ql: Language not supported

Copy link
Collaborator

@adityasharad adityasharad left a comment

Choose a reason for hiding this comment

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

I defer to others on how to organise the code, but changes look reasonable.

@alexet alexet merged commit c11ed6d into main Apr 22, 2025
18 checks passed
@alexet alexet deleted the alexet/ruby-deterministic branch April 22, 2025 10:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants