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

Ruby: Make module graph queries avoid relying on evalaution order. #19116

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexet
Copy link
Contributor

@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 using the label as an intermediate order. However we end up still needing us to make this deterministic as an intermediate step as we can't fix the ruby tests and make the result processing change atomically.

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 0).

I have duplicated this 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
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.

1 participant