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 serialization of alias analysis graph #8550

Merged
merged 3 commits into from
Dec 15, 2023

Conversation

4e6
Copy link
Contributor

@4e6 4e6 commented Dec 14, 2023

Pull Request Description

close #8431

Fixes the scenario:

  • user sends executionContext/executeExpression
  • program execution is scheduled
  • during the compilation the already compiled IR is loaded from the cache (reading invalid alias analysis graph)
  • during the codegen the local scope with that aliasing graph is propagated to the runtime
  • EvalNode compiles the expression to execute with the local scope containing an invalid aliasing graph
  • compilation fails in the AliasAnalysis pass because of the clashing IDs in the graph

Important Notes

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • All code follows the
    Scala,
    Java,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • All code has been tested:
    • Unit tests have been written where possible.

@4e6 4e6 added the CI: No changelog needed Do not require a changelog entry for this PR. label Dec 14, 2023
@4e6 4e6 self-assigned this Dec 14, 2023
Copy link
Member

@JaroslavTulach JaroslavTulach left a comment

Choose a reason for hiding this comment

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

Change the ID as described in portability & versioning documentation. Otherwise OK - thanks for finding this omission of mine.

@@ -168,6 +172,7 @@ protected Graph readObject(Input in) throws IOException {
protected void writeObject(Graph obj, Output out) throws IOException {
out.writeObject(obj.rootScope());
out.writeInline(scala.collection.immutable.Set.class, obj.links());
out.writeInt(obj.nextIdCounter());
Copy link
Member

Choose a reason for hiding this comment

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

You have to change the id of the persisted object to signal that old caches can no longer be read.

@4e6 4e6 requested a review from JaroslavTulach December 15, 2023 10:10
@4e6 4e6 added the CI: Ready to merge This PR is eligible for automatic merge label Dec 15, 2023
@mergify mergify bot merged commit 56cc956 into develop Dec 15, 2023
31 of 32 checks passed
@mergify mergify bot deleted the wip/db/debug-execute-expression-1 branch December 15, 2023 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

executeExpression sometimes gives Compiler Internal Error: ID 3 defined in multiple scopes.
3 participants