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

Add --always-allocate Flag to Reduce Branching #58

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

Conversation

bbyalcinkaya
Copy link
Member

During symbolic execution, allocObject introduces branching for ScVals that have both small and host object representations (e.g., small/big I64s, symbols). The prover must explore both representations, leading to exponential branching (2^N branches for N arguments), which significantly impacts performance for tests with multiple such arguments.

This PR adds the --always-allocate flag to the komet prove command. When enabled, the flag forces all eligible ScVals to be allocated as host objects, eliminating the branching caused by symbolic ambiguity.

  • The --always-allocate flag sets a configuration cell (<alwaysAllocate>) that modifies the behavior of allocObject.
  • Only ScVal types with both small and host object representations are affected (e.g., small/big I64s, symbols). Types like void, error, and bool, which are always small, remain unaffected.
  • By reducing branching, this change improves prover performance and simplifies symbolic execution.

This feature is optional, ensuring the default behavior remains unchanged unless explicitly enabled.

@bbyalcinkaya bbyalcinkaya marked this pull request as ready for review January 23, 2025 14:26
@bbyalcinkaya bbyalcinkaya requested a review from gtrepta January 23, 2025 14:26
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.

1 participant