Skip to content

Commit

Permalink
Minor optimization to search (#1170)
Browse files Browse the repository at this point in the history
In the final version of the ULM, we want to enforce that semantics are
deterministic. We do this using the search feature and the
`--execute-to-branch` option which treats all states with more than one
successor as final states and does not rewrite them further.

I tested this by running the ethereum test suite with this option and
all the tests passed (with a few trivial changes to the semantics). A
minor change resulted from this effort: if only a single state is active
at a given time, we do not need to do the expensive equality check
performed by `erase`. It is sufficient to simply clear the hash set.
  • Loading branch information
dwightguth authored Dec 2, 2024
1 parent 3a0b23d commit 1d701f5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion runtime/util/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ std::unordered_set<block *, hash_block, k_eq> take_search_steps(
while (!states.empty() && depth != 0) {
state = states.front();
states.pop_front();
states_set.erase(state);
if (states.empty()) {
states_set.clear();
} else {
states_set.erase(state);
}

if (depth > 0) {
depth--;
Expand Down

0 comments on commit 1d701f5

Please sign in to comment.