Repository navigation
Inject the timings the discretization chooser ranks on - #308
Merged
Merged
Conversation
The test timed both candidates itself and compared against a second set of timings taken inside _choose_discretization. The two solves cost about the same, so a shared runner reorders them between measurements (scheduled run 40870355232, Python 3.12: test picked spectral, chooser picked fd). Inject the times instead and run each candidate as the winner once, so a chooser ignoring time still fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
test_choose_discretization_returns_the_faster_candidate failed in scheduled run 40870355232 (Python 3.12): the test's own timing picked spectral, _choose_discretization's second timing picked fd. The two solves cost about the same, so runner noise reorders them between measurements. Same class of flake as #307.
The test now monkeypatches
_timedto run the real solve but return fixed seconds, parametrized so each discretization is the faster one once. Adequacy (_smallest_adequate) still runs for real. No library code changes.Checked locally: 30/30 in tests/test_resolution.py pass, ruff clean. Negative control: replacing the chooser's
seconds < best[0]comparison withbest is None(always keep the first candidate) fails the fd case.