Repository navigation
Conversation
Signed-off-by: Afloat <ShuffleMonkey@163.com>
chrisknvidia
left a comment
There was a problem hiding this comment.
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.
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
git diff --checkpassed.make build; wheel and source distribution built successfully.uv sync --all-extras --locked --python 3.12:make lint,make test, andmake build, using the checkout’s.venv/bin/python. Full validation run checked exact contribution head23b78c6b4dae0f3ba3760921c6fb361a3f3a620c; 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.Release Impact
CHANGELOG.md.