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

planner: adjust check introduced in #5839 #5965

Merged
merged 1 commit into from Jun 3, 2023

Conversation

srenatus
Copy link
Contributor

@srenatus srenatus commented Jun 2, 2023

So the check introduced before was too broad: it aborted optimizations at the wrong spot -- the resulting plan didn't add up: path lengths used in CallDynamicStmt didn't match path lengths that the planned funcs had.

So, while this change looks like over-fitting (also to me), we're really trying to make test previous fix more specific.

Generally looking at that section of the planner, it feels like the intro of general refs would be a good moment to nuke and start over: the way that refs-with-vars are put into the ruletrie seems like the root cause of our trouble here.

Fixes #5964.

@netlify
Copy link

netlify bot commented Jun 2, 2023

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 24bb477
🔍 Latest deploy log https://app.netlify.com/sites/openpolicyagent/deploys/6479d77221700d00081873a4
😎 Deploy Preview https://deploy-preview-5965--openpolicyagent.netlify.app/docs/edge/cli
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

// a.d := "y"
// since the length doesn't add up. Even if input.x was "d", the second
// rule (a.d) wouldn't contribute anything to the result, since we cannot
// "dot it".
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We're leaning a bit onto the compiler's restrictions wrt overlapping rules here... it's also a bit of a mess 😬

@srenatus srenatus marked this pull request as ready for review June 2, 2023 14:03
So the check introduced before was too broad: it aborted optimizations
at the wrong spot -- the resulting plan didn't add up: path lengths used
in CallDynamicStmt didn't match path lengths that the planned funcs
had.

So, while this change looks like over-fitting (also to me), we're really
trying to make test previous fix more specific.

Generally looking at that section of the planner, it feels like the intro
of general refs would be a good moment to nuke and start over: the way
that refs-with-vars are put into the ruletrie seems like the root cause of
our trouble here.

Fixes open-policy-agent#5964.

Signed-off-by: Stephan Renatus <stephan@styra.com>
@srenatus srenatus merged commit a808056 into open-policy-agent:main Jun 3, 2023
27 checks passed
@srenatus srenatus deleted the sr/planner-bug-ref-heads branch June 3, 2023 14:39
ashutosh-narkar pushed a commit to ashutosh-narkar/opa that referenced this pull request Jun 5, 2023
…cy-agent#5965)

So the check introduced before was too broad: it aborted optimizations
at the wrong spot -- the resulting plan didn't add up: path lengths used
in CallDynamicStmt didn't match path lengths that the planned funcs
had.

So, while this change looks like over-fitting (also to me), we're really
trying to make test previous fix more specific.

Generally looking at that section of the planner, it feels like the intro
of general refs would be a good moment to nuke and start over: the way
that refs-with-vars are put into the ruletrie seems like the root cause of
our trouble here.

Fixes open-policy-agent#5964.

Signed-off-by: Stephan Renatus <stephan@styra.com>
(cherry picked from commit a808056)
ashutosh-narkar pushed a commit that referenced this pull request Jun 6, 2023
So the check introduced before was too broad: it aborted optimizations
at the wrong spot -- the resulting plan didn't add up: path lengths used
in CallDynamicStmt didn't match path lengths that the planned funcs
had.

So, while this change looks like over-fitting (also to me), we're really
trying to make test previous fix more specific.

Generally looking at that section of the planner, it feels like the intro
of general refs would be a good moment to nuke and start over: the way
that refs-with-vars are put into the ruletrie seems like the root cause of
our trouble here.

Fixes #5964.

Signed-off-by: Stephan Renatus <stephan@styra.com>
(cherry picked from commit a808056)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CallDynamic regression
2 participants