Repository navigation
Narrow the plain_search_setup rule, check compiled-on-request locations at runtime, and say "plain Python" - #842
Merged
Merged
Conversation
… "plain Python" throughout The plain_search_setup fixture is needed by tests that replace a function that a compiled-on-request function calls, not by every test that replaces a compiled-on-request function, so an oracle test of the coset search runs with compiled set-up code again. The distance README points to the fixture's docstring rather than restating the rule, and no longer lists the files that use compiled_on_request. "Ordinary Python" becomes "plain Python", the term used elsewhere. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ry, not the source The test imports every module in a child process and checks the module of each registered function, so it also catches a function registered by a call rather than by the decorator. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… the location check Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Motivation
These are small leftovers from making the coverage check run qLDPC's compiled functions as plain Python (#836 to #840). The rule for the
plain_search_setupfixture of the distance tests was broader than its reason, so some tests gave up their runs with compiled set-up code without needing to. The test that keeps compiled-on-request functions inqldpc.codes.distancescanned decorators in the source, so it missed a function registered by a call. The distance README restated rules and listed files that are defined elsewhere. The library also used both "ordinary Python" and "plain Python" for the same thing.Changes
plain_search_setupdocstring now says that a test needs the fixture if it relies on a compiled-on-request function calling a function that the test replaces, since compiled callers would not call the replacement. Tests that replace a function that only plain-Python code calls no longer request the fixture, so they run with compiled set-up code again. These are the coset oracle test incoset_leader_search_test, the overlap test inbrouwer_zimmermann_test, and the table-steps test inscan_test._compilation_test.pychecks the location of compiled-on-request functions against the runtime registry, in a child process that imports every module, so it also catchesf = compiled_on_request(f). The import loop is shared with the existing selection oracle, and each of the code strings has its own comment.@compiled_on_request, and points to the fixture's docstring rather than restating its rule._compilation.pyand the docstring ofcompile_search_setup.Testing
The tests that no longer request the fixture pass with compiled and with plain set-up code. The location test fails, naming the module, when a function in
_binary.pyis registered by a call.