Skip to content

Per-run results: End-of-Run and drivers as runs finish, one chart rebuild, partial charts (#388) - #399

Open
danyill wants to merge 2 commits into
mainfrom
feat/per-run-results
Open

danyill wants to merge 2 commits into
mainfrom
feat/per-run-results

Conversation

@danyill

@danyill danyill commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Closes #388.

  • Each run's End-of-Run report is built as the run finishes (output byte-identical to main).
  • Downtime drivers are folded run by run, so only the reduction is left at the end. Stop now keeps the drivers of the runs already finished.
  • A result set rebuilds the Charts list once instead of four times.
  • While a background batch runs, the Charts page draws the runs finished so far, marked "Partial: N of M runs" in a label and the chart subtitle. It is throttled to about a tenth of the batch time, and the final results replace it.

Sum and percentile statistics stay batch-computed (Python 3.14's compensated sum()), so the final numbers are unchanged.

run_simulation gains a private _on_run hook (RunDone per kept run, in run order; parallel batches number and hand over rows as each chunk is merged). run_simulation_with_reports writes each run's End-of-Run block from it (_RunFold) instead of looping over every run after the batch; the Final Results report is still built once at the end by the unchanged code. report_progress now only announces the Final results report, and the report date is read when the batch starts. Public on_run hook added.
…charts while a batch runs

Each run's event log is replayed for the downtime drivers as the run
finishes (BatchAttribution/CapacityFold), so only the reduction is left at
the end. Stop keeps the drivers of the runs already finished.

A result set rebuilds the Charts page's list once instead of once per
setter (four times), most of the end-of-batch wait on a big run.

While a background batch runs, the Charts page draws the runs finished so
far, marked "Partial: N of M runs" (label and chart subtitle), throttled
so it costs at most about a tenth of the batch; the final results replace
it.

Closes #388

This branch has not been deployed

No deployments
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.

Process each run's results as it completes, so nothing is left to do at the end

1 participant