Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Add parameter to advance_proof to split into subproofs after enough branches have been created #638

Open
wants to merge 54 commits into
base: master
Choose a base branch
from

Conversation

nwatson22
Copy link
Member

In #524 @ehildenb suggested that we would want to have an option to split proofs off as subproofs if too much branching (too many pending nodes) happens in one proof. This would also be used to facilitate parallelization of a single proof, by allowing it to split itself into subproofs which could be executed independently.

@nwatson22 nwatson22 self-assigned this Sep 6, 2023
@nwatson22 nwatson22 marked this pull request as ready for review September 6, 2023 21:40
_LOGGER.info(f'Delegating node {node.id} to a new proof.')
subproof = self.construct_node_subproof(node)
self.proof.add_subproof(subproof)
self.proof.kcfg.add_stuck(node.id)
Copy link
Member

Choose a reason for hiding this comment

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

Hmmmm, adding stuck to this node will make it marked as failing, won't it? Maybe instead ew should treat it the same way we treat refutations, by tracking a list of subproof_nodes or something, and linknig that node to the subproof. That way we are correctly reporting pass/fail state of the overall proof.

@ehildenb
Copy link
Member

ehildenb commented Sep 6, 2023

The main purpose of splitting to subproofs was to make parallelism easier. So we need to see if that will actually accomplish that goal. If not, do we need to do this? I guess we also get benefit of focusing on the subproblem, and being able to pass that around with less data?

@nwatson22
Copy link
Member Author

@ehildenb What do we need to see with regard to whether or not it will make parallelism easier?
I implemented this side-by-side with a branch in KEVM: runtimeverification/evm-semantics@master...noah/branches-parallelization which uses the max_branches parameter and creates new threads for any new subproofs of a proof once it's finished. It still needs work but I'm hoping this makes more clear what my idea for this change was.

As you say, adding delegate_to_subproof would also allow the user to call it and focus in on subsections of the proof, but I'm less sure about the practical usefulness of this, so it's more of a secondary benefit.

@ehildenb
Copy link
Member

ehildenb commented Sep 6, 2023

Ohhhh, nice. That looks good. Please discuss with Tamas in yoru meeting, see if it's an appropriate solution. Thanks for making an example with KEVM!

src/pyk/kcfg/show.py Outdated Show resolved Hide resolved
@nwatson22 nwatson22 requested a review from ehildenb September 21, 2023 19:50
src/pyk/kcfg/kcfg.py Outdated Show resolved Hide resolved
)
for pending_node in self.proof.pending:
self.delegate_to_subproof(pending_node)
break
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can delegate_to_subproof result in new pending nodes for self.proof?

Copy link
Member Author

Choose a reason for hiding this comment

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

It shouldn't create any new nodes in self.proof, no.

@nwatson22
Copy link
Member Author

Blocked on runtimeverification/evm-semantics#2094

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants