Skip to content

perf(tier3): index recovered attempts once per pass summary - #911

Open
Afloat16 wants to merge 1 commit into
NVIDIA:mainfrom
Afloat16:perf/index-recovered-attempts-20261126
Open

Afloat16 wants to merge 1 commit into
NVIDIA:mainfrom
Afloat16:perf/index-recovered-attempts-20261126

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Summary

Each case in a Tier 3 pass summary scans the entire recovered-attempt list to count its recovered timeouts. A case that passes under stop-on-pass scans the list again to identify recovered physical attempt numbers. The work therefore grows with cases multiplied by recovered observations.

Group recovered observations by case once, then use that case's own records for counts and ordinals. Preserve the existing case identity and ordinal rules, pass rates, publication caps, and accounting of recovered, missing, and intentionally skipped attempts.

Verification

  • I am familiar with the Contributing Guidelines.
  • Added deterministic scaling regressions at 128 and 512 cases, plus mixed case-identity and ordinal compatibility coverage.
  • Both scale regressions fail on the base revision. At 512 cases and 4,096 recoveries, the old code reads recovery identities 4,194,304 times; grouping reads each observation once.
  • 142 relevant collector, verdict, metric-truth, and run-statistics tests passed. A focused recovery/stop-on-pass selection also passed all 14 selected tests.
  • A synthetic in-memory benchmark with 2,048 cases and 16,384 recoveries produced byte-identical canonical JSON output before and after (same SHA-256). Across three runs on this host, median collection time was 2.420 seconds before and 0.108 seconds after; this is a collector microbenchmark, not an end-to-end evaluation speed claim.
  • Full-repository Ruff, changed-file formatting, and git diff --check passed.
  • Ran make build; wheel and source distribution built successfully.
  • Required gates passed on Ubuntu 24.04 / Python 3.12 after uv sync --all-extras --locked --python 3.12: make lint, make test, and make build, using the checkout’s .venv/bin/python. Full validation run checked exact contribution head 23b78c6b4dae0f3ba3760921c6fb361a3f3a620c; pytest reported 45,542 passed, 338 skipped, 19 deselected. Skips and marker exclusions are the repository’s existing defaults; no new skips or filters were added.
  • No credentials, private datasets, or proprietary benchmark content were added.

Release Impact

  • Updated CHANGELOG.md.

Signed-off-by: Afloat <ShuffleMonkey@163.com>

@chrisknvidia chrisknvidia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I confirmed the quadratic scan on main: with 512 cases and 4,096 recovered attempts _pass_summary reads every recovery's case_id 4,194,304 times (the new test's counter), and wall time grows from 0.12 s at 512 cases to 1.6 s at 2,048 cases; at this head it is 0.03 s and 0.09 s. The grouping keeps the old semantics: entry_id is always a string in this loop (it comes from _entry_id or the validated expected ids), so skipping non-string case_id values when building the index matches the old == comparison exactly, and the per-case ordinal set still filters on type(...) is int. I ran _pass_summary from both trees over 400 randomized inputs covering duplicate recovery records, None/string/bool/float attempt values, empty and list-valued case ids, recoveries for unknown and extra cases, expected_attempts_by_case and expected_attempt_ordinals_by_case, with and without stop-on-pass, and the serialized summaries are byte-identical; the recovered list is left untouched. The index is built from the list passed in, inside a synchronous function that neither mutates nor re-reads it, and the callers finish collecting recoveries before calling, so it cannot go stale within a pass.

The two scale tests fail on main's source and all three pass here, also under Python 3.13; the counter is a dict subclass, so the assertion does not depend on timing or the interpreter. The collector, verdict, metrics-truth, run-statistics, token-usage and timeout-recovery suites give the same results on both trees.

Not blocking: _case_attempt_coverage in _condition_execution_summary still filters recovered_attempts per case the old way, so the same grouping could be applied there in a follow-up.

CHANGELOG entry is under Unreleased, the commit is signed off, CI is green, and the branch merges cleanly into main. The entry shares a CHANGELOG line with #910 and a few other open PRs, so expect a trivial rebase for whichever lands second.

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.

2 participants