-
Notifications
You must be signed in to change notification settings - Fork 260
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 not without dependencies #613
Conversation
This fixes the issue reported on the mailing list here. |
// variable that this scan cares about. | ||
if((!prejoin || this.args.length) | ||
&& (!force && !this.internalVars[solvingFor.id] && this.internalVars.length) | ||
|| !fullyResolved(this.args, prefix)) return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this conditional to be pretty hard to parse due to its density. It might be worth commenting about the other early acceptance cases or trying to refactor it to split it up.
This is subjective so I don't know that it's blocking.
// if we haven't presolved anything, we still need to do a single prejoin pass | ||
// to make sure that any nots that may have no external dependencies are | ||
// given a chance to end this evaluation | ||
if(presolved === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if variables have been presolved, doesn't this pass need to happen? Or is it invoked when those variables are solved? I assumed presolved variables were the set of variables known prior to solving.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the loop above will call our not guy with prejoin = true in those cases, so it's handled there. We could just always do this pass and not send the prejoin flag in the loop above. Maybe I'll do that so the not doesn't get re-evaluated over and over again.
// given a chance to end this evaluation | ||
if(presolved === 0) { | ||
for(let provider of providers) { | ||
if(provider instanceof NotScan && !provider.accept(multiIndex, prefix, {id: "0"}, false, true)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the shape of solvingFor
exactly? Why is an object allocation required for each provider?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a variable, I can lift the creation.
Signed-off-by: Chris Granger <[email protected]>
// nots won't get evaluated during Generic Join since we're never solving for a | ||
// variable that this scan cares about. | ||
if((!prejoin || this.args.length) | ||
// if we are forcing and not solving for the current variable, then we just accept |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we aren't forcing... we just accept as it is, right?
🔢 🥚 🇪🇬 |
Currently nots that have no dependencies never get an opportunity to run since they are never solving for a variable. This PR adds a prejoin flag to accept and changes NotScan to force an accept check in the case when prejoin is true and the scan has no args. It also adds an extra step to the preJoinAccept function to check nots if they would otherwise not be.