Repository navigation
Test that the fault search keeps its map of pairs within its memory limit, and fix two names - #912
Merged
Merged
Conversation
…t is _closing_pairs_fit also holds the cap on the number of pairs, so call it _build_closing_pairs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…he memory No test checked that FaultLister respects its decision not to build the closing map of pairs: building it always changed no result, only the memory used. Record the memory limit of each listing that builds a map of pairs of two or more classes, and correct the comment about listings without memory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
It checks that the counter stays self-dual and exact, not how many basis families it keeps. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Name the decision should_build_pairs, as _table_should_grow names its own, and clarify the recorder's comment and the two tests' docstrings. 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
This pull request gathers three small follow-ups.
certify_bounded_fault_propagationtakesmemory_limit, which bounds the lookup tables of its fault search, and its guide says that the search builds its closing map of pairs of fault classes only if the map fits._split_memory_limitmakes that decision, and a test checks it, but no test checked thatFaultListerobeys it: building the map regardless changed no result, only the memory used, and passed every test.FaultLister._closing_pairs_fitalso holds the cap of2^31pairs, so it says whether to build the map, not whether the map fits.test_a_deformed_self_dual_counter_shares_its_basis_familychecks that a SWEL gate keeps a self-dual counter self-dual and its counts exact, not how many basis families the counter keeps.Changes
test_listing_matches_brute_forcealready wrapped_get_closing_mapwith a pass-through recorder. It now records the memory limit of each lister that builds a nonempty map of pairs, and checks that some listers with memory for the map build it, and that none without memory does. Its comment about listings without memory now allows for the empty map of pairs of fewer than two classes._closing_pairs_fit, and the localpairs_fitof_split_memory_limit, are renamed_should_build_closing_pairsandshould_build_pairs, as_table_should_growin the same module names its decision.test_a_swel_gate_keeps_a_self_dual_counter_self_dual_and_exact, and its docstring says that the gate follows a count. Its assertions are unchanged.Validation
The listing test now fails if
_closing_pairsignores the decision and always builds the map, and if it never builds the map. Two independent reviewers judged this check worth adding rather than over-testing, since it guards the documented effect of a public argument that no result shows. For the counter test, a rename was preferred to an assertion on how many basis families a counter keeps, which is a storage choice rather than a result.