Skip to content

fix(bootstrap): cap how long one replicate may run - #34

Merged
seanthimons merged 1 commit into
mainfrom
fix/bootstrap-replicate-time-limit
Oct 23, 2026
Merged

seanthimons merged 1 commit into
mainfrom
fix/bootstrap-replicate-time-limit

Conversation

@seanthimons

Copy link
Copy Markdown
Owner

Some exact beta-Poisson bootstrap resamples (for example every dose above a point responds and every dose below does not) send the optimiser searching for minutes, which stalled the whole run. This adds replicate_time_limit (seconds, default 30, Inf for none) to bootstrap_dose_response(), bootstrap_dose_response_async(), bootstrap_dose_response_models() and analyze_dose_response(). A replicate that overruns is recorded as not converged with the reason in its error column. The limit travels to mirai workers with each batch.

Measured on the Ward data, exact model, 200 replicates, seed 1, 8 workers: before, replicate 182 never finished; now the run finishes in 41 s with 194 converged and 1 timed out.

Notes for review:

  • The limit is wall time, so a heavily loaded machine could time out a replicate that would finish elsewhere; documented on the argument.
  • A finite limit replaces any setTimeLimit() already set in the process that runs the refit (R has no way to read and restore it); documented too.
  • replicate_time_limit is the last parameter of every function it was added to, so positional callers are unaffected.

A perfectly separated resample can send the exact beta-Poisson optimiser
searching for minutes, which held up the whole bootstrap indefinitely. Add
replicate_time_limit (default 30 seconds, Inf for none) to the bootstrap and
analysis functions. A replicate that overruns is recorded as not converged
with the reason in its error column. The limit is passed to mirai workers with
each batch.
@seanthimons
seanthimons merged commit 4eea23b into main Oct 23, 2026
11 of 12 checks passed
@seanthimons
seanthimons deleted the fix/bootstrap-replicate-time-limit branch October 27, 2026 19:44
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