feat(simulate): report repeated-trial runs as pass^1 / pass^k with a 95% interval (TH-8659) by azain-commits · Pull Request #3555 · future-agi/future-agi · GitHub
Skip to content

feat(simulate): report repeated-trial runs as pass^1 / pass^k with a 95% interval (TH-8659) - #3555

Open
azain-commits wants to merge 3 commits into
devfrom
azain/th-8659-report-repeated-trial-runs-as-pass1-passk-with-a-95-interval
Open

azain-commits wants to merge 3 commits into
devfrom
azain/th-8659-report-repeated-trial-runs-as-pass1-passk-with-a-95-interval

Conversation

@azain-commits

Copy link
Copy Markdown
Member

Closes TH-8659.

What

Repeated-trial runs now report reliability and uncertainty instead of a bare pass rate.

Backend (simulate/services/run_reliability_v3.py)

  • scenario_bootstrap_interval replaces the cluster-robust Wilson range. It resamples whole scenarios with their trials nested, never single trials. 2000 resamples, fixed seed so the range is stable across loads. Returns null below 10 conclusive scenarios. Intended for reuse by compare (TH-8657).
  • reliability on GET /simulate/v3/test-executions/{id}/analytics/ gains:
    • pass_hat_1: mean over scenarios of passed ÷ conclusive trials
    • pass_hat_k: share of scenarios that passed all k trials; null unless every scenario ran the same k and k ≥ 2
    • k, inconclusive (error + inconclusive trials, excluded from every denominator), pass_hat_k_scenarios
    • per-row call_ids for drilling into trials
  • Contract change: pass_rate_interval is now {low, high, scenarios, evaluated, resamples}; effective_n and clusters are removed. All in-repo consumers updated. OpenAPI + frontend contracts regenerated.

Frontend

  • Run header: pass^1, pass^k (k > 1 only), 95% range, inconclusive count. Below 10 scenarios it shows counts instead of rates and no range.
  • Reliability table rows: "2/3 trials passed" + inconclusive column; clicking a row opens that scenario's trials in the calls table.
  • Trials picker (both copies) recommends k ≥ 3.

Decisions worth a look

  • A scenario with any inconclusive trial is left out of pass^k (it can't show k of k passing) but still counts toward pass^1.
  • "Same k" compares each scenario's total trial count, inconclusive included.
  • The analytics "Calls passed" tile's ±N pts margin is replaced by the pass^1 range, since the tile's pooled rate can differ from pass^1.
  • Drill-down reuses the existing call-id filter, so the chip reads "N affected calls".

Testing

  • bin/test simulate/tests/test_run_reliability_v3.py simulate/tests/test_analytics_functional.py: pass (reliability tests rewritten before the implementation).
  • Wider simulate run: 1983 passed, 3 errors in test_dashboard_drop_off.py that pass when the file runs alone, with and without this change.
  • vitest run on runs/detail and scenarios: 435/435. ESLint + Prettier clean.
  • Not yet exercised against a live stack.

@JayaSurya-27 JayaSurya-27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The scenario-level resampling is the right idea, but the interval method falls apart at the boundary, and a few header and tile numbers can contradict each other. Details are inline.

Comment thread futureagi/simulate/services/run_reliability_v3.py Outdated
Comment thread futureagi/simulate/services/run_reliability_v3.py
azain-commits added a commit that referenced this pull request Oct 26, 2026
…ader endpoint (TH-8659)

Review follow-ups on #3555:

- Interval: replace the percentile bootstrap, which collapses to zero width
  when scenario rates agree and under-covers near 100%, with a Wilson
  interval on pass^1 whose effective n comes from the spread of
  per-scenario rates (identical rates fall back to n = scenarios). Coverage
  at k=3, true rate 0.99 is ~0.94-0.98 for 10/20/50 scenarios.
- pass^k: send pass_hat_k_passed and pass_hat_k_excluded; the header always
  names pass^k's scenario count, so a smaller set is visible.
- Counts mode: backend sends pooled trials_passed / trials_evaluated and the
  header labels them "Trials passed" rather than pass^1.
- Drop the pass^1 range from the pooled "Calls passed" tile and dashboard
  note, where the headline could sit outside it.
- Add GET v3/test-executions/<id>/reliability/ so the run header no longer
  loads the full analytics payload.
…95% interval (TH-8659)

- Replace the cluster-robust Wilson range with a scenario bootstrap: whole
  scenarios are resampled with their trials nested, never single trials.
  Withheld below 10 conclusive scenarios; fixed seed keeps it stable.
- Reliability block gains pass_hat_1 (mean per-scenario pass rate over
  conclusive trials), pass_hat_k (share of scenarios passing all k trials,
  only when every scenario ran the same k > 1), k, inconclusive, and
  pass_hat_k_scenarios. Rows carry call_ids for trial drill-down.
- Run header shows pass^1, pass^k, the range and inconclusive count; counts
  only below 10 scenarios. Scenario rows read "2/3 trials passed" and open
  their trials in the calls table. Trials picker recommends k >= 3.
- Regenerate OpenAPI and frontend contracts.
…ader endpoint (TH-8659)

Review follow-ups on #3555:

- Interval: replace the percentile bootstrap, which collapses to zero width
  when scenario rates agree and under-covers near 100%, with a Wilson
  interval on pass^1 whose effective n comes from the spread of
  per-scenario rates (identical rates fall back to n = scenarios). Coverage
  at k=3, true rate 0.99 is ~0.94-0.98 for 10/20/50 scenarios.
- pass^k: send pass_hat_k_passed and pass_hat_k_excluded; the header always
  names pass^k's scenario count, so a smaller set is visible.
- Counts mode: backend sends pooled trials_passed / trials_evaluated and the
  header labels them "Trials passed" rather than pass^1.
- Drop the pass^1 range from the pooled "Calls passed" tile and dashboard
  note, where the headline could sit outside it.
- Add GET v3/test-executions/<id>/reliability/ so the run header no longer
  loads the full analytics payload.
@azain-commits
azain-commits force-pushed the azain/th-8659-report-repeated-trial-runs-as-pass1-passk-with-a-95-interval branch from 286ce21 to 26245c5 Compare October 26, 2026 13:02

@JayaSurya-27 JayaSurya-27 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, all five points are fixed. The Wilson interval behaves well at the boundaries, and the header and tile numbers now agree.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants