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

Reset interpreter env after lambda call #728

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

kettlebell
Copy link
Collaborator

@kettlebell kettlebell commented Oct 12, 2023

Close #730.

@coveralls
Copy link

coveralls commented Oct 12, 2023

Pull Request Test Coverage Report for Build 6503468789

  • 78 of 90 (86.67%) changed or added relevant lines in 10 files are covered.
  • 11 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.01%) to 80.817%

Changes Missing Coverage Covered Lines Changed/Added Lines %
ergotree-interpreter/src/eval/coll_exists.rs 5 6 83.33%
ergotree-interpreter/src/eval/coll_filter.rs 5 6 83.33%
ergotree-interpreter/src/eval/coll_fold.rs 5 6 83.33%
ergotree-interpreter/src/eval/coll_forall.rs 5 6 83.33%
ergotree-interpreter/src/eval/coll_map.rs 5 6 83.33%
ergotree-interpreter/src/eval/scoll.rs 5 6 83.33%
ergotree-interpreter/src/eval/apply.rs 10 12 83.33%
ergotree-interpreter/src/eval/block.rs 24 26 92.31%
ergotree-interpreter/src/eval/soption.rs 10 12 83.33%
Files with Coverage Reduction New Missed Lines %
ergo-merkle-tree/src/merkletree.rs 2 97.39%
ergo-merkle-tree/src/batchmerkleproof.rs 3 90.48%
ergotree-ir/src/serialization/types.rs 6 83.28%
Totals Coverage Status
Change from base Build 6481852424: 0.01%
Covered Lines: 10604
Relevant Lines: 13121

💛 - Coveralls

@@ -11,14 +12,31 @@ use crate::eval::Evaluable;

impl Evaluable for BlockValue {
fn eval(&self, env: &mut Env, ctx: &mut EvalContext) -> Result<Value, EvalError> {
let mut existing_variables = HashMap::new();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This code breaks the diag_on_reduced_to_false test. We might need to make an exception for the global BlockValue of a script, and do not delete introduced ValIds?

Copy link
Member

Choose a reason for hiding this comment

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

Thank you for taking care of this! Ideally, yes. If not, feel free to make the test ignored/commented.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No problem! Made the change so ValDefs in global block persist.

@kettlebell kettlebell marked this pull request as ready for review October 13, 2023 03:25
@kettlebell kettlebell requested a review from greenhat October 13, 2023 03:25
Copy link
Member

@greenhat greenhat left a comment

Choose a reason for hiding this comment

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

Looking great! Thank you!

@greenhat greenhat merged commit 1135472 into develop Oct 13, 2023
@greenhat greenhat deleted the reset_env_after_lambda_call branch October 13, 2023 04:38
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.

Env needs resetting after Lambda calls and BlockValue
3 participants