Skip to content

Conversation

@ttuegel
Copy link
Contributor

@ttuegel ttuegel commented May 5, 2021

Fixes #2570


Review checklist

The author performs the actions on the checklist. The reviewer evaluates the work and checks the boxes as they are completed.

  • Summary. Write a summary of the changes. Explain what you did to fix the issue, and why you did it. Present the changes in a logical order. Instead of writing a summary in the pull request, you may push a clean Git history.
  • Documentation. Write documentation for new functions. Update documentation for functions that changed, or complete documentation where it is missing.
  • Tests. Write unit tests for every change. Write the unit tests that were missing before the changes. Include any examples from the reported issue as integration tests.
  • Clean up. The changes are already clean. Clean up anything near the changes that you noticed while working. This does not mean only spatially near the changes, but logically near: any code that interacts with the changes!

@@ -1,6 +1,6 @@
kore-exec: [233424] Error (ErrorException):
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test must have been silently failing for a long time...

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused, won't this test continue to fail on other runs if its output depends on the timestamp?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The test actually only searches the output for a particular string with grep. I will update the test in another pull request so that this is clearer.

@ttuegel ttuegel force-pushed the overhaul-predicate branch from 02c8574 to 8ebd31f Compare May 14, 2021 19:33
@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-sumTo10.sh -0.011016 -0.010737
test/regression-evm/test-add0.sh -0.004745 0
test/regression-evm/test-straight-line-no-invalid.sh -0.002700 0
test/regression-evm/test-pop1.sh -0.002678 0
test/regression-evm/test-straight-line.sh -0.002925 0
test/regression-evm/test-branching-invalid.sh -0.004472 0.000000
test/regression-evm/test-branching-no-invalid.sh -0.004326 0
test/regression-evm/test-sum-to-n.sh -0.003809 0.002716
test/regression-wasm/test-loops.sh -0.007208 0.000584
test/regression-wasm/test-wrc20.sh -0.001615 -0.015970
test/regression-wasm/test-simple-arithmetic.sh -0.007236 0.000617
test/regression-wasm/test-memory.sh -0.007426 0.000636
test/regression-wasm/test-locals.sh -0.005052 0.000601

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-sumTo10.sh -0.011016 -0.010736
test/regression-evm/test-add0.sh -0.004745 0
test/regression-evm/test-straight-line-no-invalid.sh -0.002700 0
test/regression-evm/test-pop1.sh -0.002678 0
test/regression-evm/test-straight-line.sh -0.002925 0
test/regression-evm/test-branching-invalid.sh -0.004443 0
test/regression-evm/test-branching-no-invalid.sh -0.004326 0.000000
test/regression-evm/test-sum-to-n.sh -0.003808 0.004394
test/regression-wasm/test-loops.sh -0.007255 0.000584
test/regression-wasm/test-wrc20.sh -0.001600 0.021115
test/regression-wasm/test-simple-arithmetic.sh -0.007229 0.000619
test/regression-wasm/test-memory.sh -0.007423 0.000636
test/regression-wasm/test-locals.sh -0.005052 0.000601

@ttuegel ttuegel requested a review from andreiburdusa May 19, 2021 14:46
Comment on lines 55 to 56
Assuming the children of `\or` are in disjunctive normal form, then the clause
is already normalized.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add something like "because or is associative", to anticipate normalizeOr better.


Simplification happens recursively, upward from the bottom. Therefore, we
describe the simplification steps based on the shape of the top-most
unsimplified clause of the predicate.
Copy link
Contributor

Choose a reason for hiding this comment

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

This phrasing is not clear for me. If we start simplifying from the bottom, wouldn't the top look the same until the end? Maybe my intuition of what is a clause is wrong.

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-sumTo10.sh -0.016682 0.002091
test/regression-evm/test-add0.sh 0.019938 -0.000003
test/regression-evm/test-straight-line-no-invalid.sh 0.031347 -0.000003
test/regression-evm/test-pop1.sh 0.032871 -0.000003
test/regression-evm/test-straight-line.sh 0.030016 -0.005673
test/regression-evm/test-branching-invalid.sh 0.020438 -0.000003
test/regression-evm/test-branching-no-invalid.sh 0.021310 -0.000003
test/regression-evm/test-sum-to-n.sh 0.041727 0.019041
test/regression-wasm/test-loops.sh 0.074171 0.000199
test/regression-wasm/test-wrc20.sh 1.175826 0.025907
test/regression-wasm/test-simple-arithmetic.sh 0.065990 -0.000285
test/regression-wasm/test-memory.sh 0.056913 0.000244
test/regression-wasm/test-locals.sh 0.066713 0.000177

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-branching-no-invalid.sh 0.021590 -0.000003
test/regression-evm/test-sumTo10.sh -0.016544 -0.009806
test/regression-evm/test-pop1.sh 0.033157 -0.000003
test/regression-evm/test-add0.sh 0.020210 -0.000003
test/regression-evm/test-straight-line-no-invalid.sh 0.031613 -0.000003
test/regression-evm/test-sum-to-n.sh 0.038221 0.009883
test/regression-evm/test-straight-line.sh 0.030282 -0.000003
test/regression-evm/test-branching-invalid.sh 0.020736 -0.000003
test/regression-wasm/test-memory.sh 0.058482 0.000192
test/regression-wasm/test-simple-arithmetic.sh 0.067964 -0.000277
test/regression-wasm/test-locals.sh 0.066869 0.000281
test/regression-wasm/test-wrc20.sh 0.992747 0.013672
test/regression-wasm/test-loops.sh 0.081123 0.000052

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-branching-no-invalid.sh -0.003499 -0.000004
test/regression-evm/test-sumTo10.sh -0.018711 -0.010734
test/regression-evm/test-pop1.sh 0.001161 -0.000003
test/regression-evm/test-add0.sh -0.004149 -0.000003
test/regression-evm/test-straight-line-no-invalid.sh 0.000754 -0.000003
test/regression-evm/test-sum-to-n.sh -0.009865 0.003137
test/regression-evm/test-straight-line.sh 0.000156 -0.005672
test/regression-evm/test-branching-invalid.sh -0.003821 -0.000003
test/regression-wasm/test-memory.sh 0.003881 0.000452
test/regression-wasm/test-simple-arithmetic.sh 0.013171 0.000285
test/regression-wasm/test-locals.sh 0.016762 0.000374
test/regression-wasm/test-wrc20.sh -0.000150 0.005078
test/regression-wasm/test-loops.sh 0.000272 -0.000027

@ttuegel ttuegel force-pushed the overhaul-predicate branch from 36d5427 to d727b39 Compare May 27, 2021 21:48
@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-branching-no-invalid.sh 0.037169 -0.000003
test/regression-evm/test-sumTo10.sh -0.017083 0.017209
test/regression-evm/test-pop1.sh 0.054084 -0.000003
test/regression-evm/test-add0.sh 0.034997 -0.000003
test/regression-evm/test-straight-line-no-invalid.sh 0.052437 -0.000003
test/regression-evm/test-sum-to-n.sh 0.010233 0.000023
test/regression-evm/test-straight-line.sh 0.050362 -0.000003
test/regression-evm/test-branching-invalid.sh 0.035920 -0.000003
test/regression-wasm/test-memory.sh 0.055015 0.000052
test/regression-wasm/test-simple-arithmetic.sh 0.093022 -0.000297
test/regression-wasm/test-locals.sh 0.108932 0.000147
test/regression-wasm/test-wrc20.sh 0.002452 0.007388
test/regression-wasm/test-loops.sh 0.021952 -0.000191

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-branching-no-invalid.sh 0.037154 -0.000003
test/regression-evm/test-sumTo10.sh -0.017112 0.002211
test/regression-evm/test-pop1.sh 0.054069 -0.000003
test/regression-evm/test-add0.sh 0.034970 -0.000004
test/regression-evm/test-straight-line-no-invalid.sh 0.052434 -0.000003
test/regression-evm/test-sum-to-n.sh 0.010118 0.004075
test/regression-evm/test-straight-line.sh 0.050351 -0.000003
test/regression-evm/test-branching-invalid.sh 0.035878 -0.000003
test/regression-wasm/test-memory.sh 0.054962 -0.000026
test/regression-wasm/test-simple-arithmetic.sh 0.093015 -0.000403
test/regression-wasm/test-locals.sh 0.108972 0.000157
test/regression-wasm/test-wrc20.sh 0.002271 0.014486
test/regression-wasm/test-loops.sh 0.021784 -0.000178

@ttuegel
Copy link
Contributor Author

ttuegel commented May 28, 2021

I tested this locally and found no significant performance difference with master. It's also worth noting that the proofs which show > 5% increased allocation are all very small.

@ttuegel ttuegel force-pushed the overhaul-predicate branch from 3eee5f6 to 79299c2 Compare June 14, 2021 21:40
@ttuegel ttuegel marked this pull request as ready for review June 14, 2021 22:03
Comment on lines +289 to +290
Note: @L@ is carried through to the right-hand side of 'Implies' to maximize
the information content of that branch.
Copy link
Contributor

Choose a reason for hiding this comment

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

In which cases is the L necessary?

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I'm wondering, do we ever simplify \\implies predicates (outside of the tests)?

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 simplify \implies sometimes as the result of \equals simplification, if either side is not a function-like pattern. This isn't very common. Carrying the left-hand side over improves simplification a bit in these cases; it can rule out some branches which were also carrying \not(L) from another part.

@@ -1,6 +1,6 @@
kore-exec: [233424] Error (ErrorException):
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm confused, won't this test continue to fail on other runs if its output depends on the timestamp?

#Equals
Z:MyId in_keys ( MAP
( Y:MyId |-> 2 ) )
( Y:MyId |-> 1 ) )
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look right, we have X ==K Y, and we update the value Y points to, so it should be 2 not 1, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The meaning of the output is unchanged. The Map appears under in_keys, so actually the values are irrelevant.

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-branching-no-invalid.sh 0.041473 0
test/regression-evm/test-sumTo10.sh -0.008029 -0.002031
test/regression-evm/test-pop1.sh 0.056130 -0.000000
test/regression-evm/test-add0.sh 0.041072 0
test/regression-evm/test-straight-line-no-invalid.sh 0.054022 0
test/regression-evm/test-sum-to-n.sh 0.005373 -0.001200
test/regression-evm/test-straight-line.sh 0.052485 -0.000038
test/regression-evm/test-branching-invalid.sh 0.040495 -0.000035
test/regression-wasm/test-memory.sh 0.053015 -0.000230
test/regression-wasm/test-simple-arithmetic.sh 0.089194 -0.000620
test/regression-wasm/test-locals.sh 0.104688 -0.000156
test/regression-wasm/test-wrc20.sh 0.001074 -0.001135
test/regression-wasm/test-loops.sh 0.020097 -0.000117

@github-actions
Copy link

name diff_allocated_bytes diff_max_live_bytes
test/regression-evm/test-branching-no-invalid.sh 0.041473 0
test/regression-evm/test-sumTo10.sh -0.008029 -0.002445
test/regression-evm/test-pop1.sh 0.056119 0
test/regression-evm/test-add0.sh 0.041089 -0.000000
test/regression-evm/test-straight-line-no-invalid.sh 0.054022 0
test/regression-evm/test-sum-to-n.sh 0.005369 -0.000983
test/regression-evm/test-straight-line.sh 0.052485 0
test/regression-evm/test-branching-invalid.sh 0.040527 0
test/regression-wasm/test-memory.sh 0.052926 -0.000211
test/regression-wasm/test-simple-arithmetic.sh 0.089195 -0.000838
test/regression-wasm/test-locals.sh 0.104688 -0.000156
test/regression-wasm/test-wrc20.sh 0.001048 -0.000675
test/regression-wasm/test-loops.sh 0.020008 -0.000091

@rv-jenkins rv-jenkins merged commit 74d28e0 into master Jun 16, 2021
@rv-jenkins rv-jenkins deleted the overhaul-predicate branch June 16, 2021 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Overhaul predicate simplifier

5 participants