Skip to content

Commit dfb0be4

Browse files
Stevengreehildenb
andauthored
kevm-pyk: thread step_timeout through run_prover (#2867)
Adds a `step_timeout: int | None = None` parameter to `run_prover` and forwards it to the `APRProver` constructor, which enforces the per-step wall-clock budget (interrupt + halve `execute_depth` + retry). `step_timeout` is only honored on the sequential `advance_proof` path; `parallel_advance_proof` does not wrap steps with the timeout budget. So when `step_timeout` is set, `run_prover` runs sequentially regardless of `force_sequential`, warning if `max_frontier_parallel > 1` that frontier parallelism is being dropped. Default `None` keeps the prior behavior (no per-step timeout, parallel path unchanged). Co-authored-by: Everett Hildenbrandt <everett.hildenbrandt@gmail.com>
1 parent 30983ea commit dfb0be4

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

kevm-pyk/src/kevm_pyk/utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def run_prover(
117117
assume_defined: bool = False,
118118
extra_module: KFlatModule | None = None,
119119
optimize_kcfg: bool = False,
120+
step_timeout: int | None = None,
120121
) -> bool:
121122
prover: APRProver | ImpliesProver
122123
try:
@@ -134,12 +135,23 @@ def create_prover() -> APRProver:
134135
assume_defined=assume_defined,
135136
extra_module=extra_module,
136137
optimize_kcfg=optimize_kcfg,
138+
step_timeout=step_timeout,
137139
)
138140

139141
def update_status_bar(_proof: Proof) -> None:
140142
if progress is not None and task_id is not None:
141143
progress.update(task_id, summary=_proof.one_line_summary)
142144

145+
# step_timeout is only enforced on the sequential `advance_proof` path;
146+
# `parallel_advance_proof` does not wrap steps with the timeout budget.
147+
if step_timeout is not None and not force_sequential:
148+
if max_frontier_parallel > 1:
149+
_LOGGER.warning(
150+
f'Proof {proof.id}: step_timeout is only enforced when running sequentially; '
151+
f'ignoring max_frontier_parallel={max_frontier_parallel} and running sequentially.'
152+
)
153+
force_sequential = True
154+
143155
if force_sequential:
144156
prover = create_prover()
145157
prover.advance_proof(

0 commit comments

Comments
 (0)