Skip to content

Better heuristics for QPs#789

Merged
marcoeilers merged 3 commits into
masterfrom
meilers_qp_heuristics
Dec 20, 2023
Merged

Better heuristics for QPs#789
marcoeilers merged 3 commits into
masterfrom
meilers_qp_heuristics

Conversation

@marcoeilers

Copy link
Copy Markdown
Contributor

Silicon's heuristics for selecting in what order to use QP chunks when exhaling QPs are somewhat lacking (see issue #788).

This PR adds a much more precise kind of heuristics that should help a lot with performance when QPs of the same "shape" (as in, the same number and types of quantified variables) are inhaled and exhaled repeatedly.
E.g., if the QP we're looking to find or remove has a quantified variable i: Int and receiver term f(a, i), and an existing chunk with quantified variable x: Int has receiver term f(g(), x), where a == g(), then that chunk would be selected first. We use the decider to check for equality, so it can take all knowledge Silicon currently has into account.
If no such chunk exists, the standard hint based heuristics are used.

@marcoeilers marcoeilers requested a review from jcp19 December 20, 2023 15:14
@jcp19

jcp19 commented Dec 20, 2023

Copy link
Copy Markdown
Contributor

For future reference, my quick and dirty measurements in the master branch of SCION (router package):

  • without this PR: 12:14
  • with this PR: 12:30
    image

@marcoeilers

Copy link
Copy Markdown
Contributor Author

Haha :D
For the record, I still think this is a good change. It may cause a tiny bit of additional cost for many cases (but should never be really expensive) and helps massively in some cases.

@jcp19 jcp19 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm not an expert in this code, but the changes look ok to me. Unfortunately, SCION did not get faster with this :'(

@marcoeilers marcoeilers merged commit 9d7abee into master Dec 20, 2023
@marcoeilers marcoeilers deleted the meilers_qp_heuristics branch December 20, 2023 20:35
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.

2 participants