Repository navigation
Weigh connected-cluster states with fewer mispredicted branches - #1065
Merged
Merged
Conversation
A state of the connected-cluster search that forbids variables that are not viable summed the weights of the unsatisfied checks of each available symbol in turn, in loops whose branches the processor often mispredicted. It now adds the weight of each unsatisfied check to the repair of each of its symbols, and allows the viable symbols by selects. A state whose unsatisfied checks have more entries than there are symbols also takes the overlaps of all symbols at once, and clears all repairs at once. The searches visit the same states and find the same witnesses. On one thread, distance searches of a quantum Tanner code and of the [[276, 98, 14]] pair-partition code take about 1.2 to 1.3 times less time, and those of the [[71, 1, 11]] quadratic-residue code and of the [63, 30, 13] BCH code about 1.45 times less. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Memos of a connected-cluster state now hold overlaps only: a state that restricts its subtree sums the repairs of all its symbols check by check, in distance searches and syndrome queries alike, and its branches reuse them. The guide and the docstrings now say so, and state the rule by which a state takes the overlaps of all symbols in one pass: its number of unsatisfied checks times the average number of entries of a check exceeds the number of symbols. A new test pads binary and symplectic syndrome queries with variables in no check, which makes every state compute the overlap of each entry, and checks that the returned symbols and counts of states match those of the one-pass route, with and without memos. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep one Golay search per route to overlaps, and check through a wrapper that only the dense one takes the overlaps of variables in no check. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Compiled code cannot inline a wrapper, so installing it failed when no compiled code was cached. 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
A state of the connected-cluster search that forbids variables that are not viable summed the weights of the unsatisfied checks of each available symbol in turn. The processor often mispredicted the branches of those loops. On codes with dense checks or wide syndromes, such as quadratic-residue and BCH codes, this weighing took most of the search, at 1.0-1.8 µs per state.
Changes
A state now adds the weight of each unsatisfied check to the repair of each of its symbols, and allows the viable symbols by selects instead of branches. A state whose unsatisfied checks have more entries in total than there are symbols takes the overlaps of all symbols in one pass, and clears all repairs at once. Memos of a state now hold overlaps only. A state that restricts its subtree sums the repairs of all its symbols check by check, in distance searches and syndrome queries alike.
connected_cluster.md(Sections 2, 3.8 and 4) describes the new weighing and the rule for the one-pass overlaps.Validation
The searches visit the same states and find the same witnesses. Per-limit state counts and witnesses are identical on 8 codes. On 39 small and medium codes, distances equal the baseline, the literature and the other methods, and every witness is checked to be a valid logical operator of the reported weight. A new test pads the checks of the Golay code with variables that are in no check: with one such variable, many states take overlaps in one pass; with as many as the checks have entries, none does. It checks that both searches visit the same states and find no witness of weight 6, and, as plain Python, that only the first takes the overlaps of the padded variables.
Connected-cluster distance searches, 1 thread, warm:
Syndrome queries of the coset-leader searches, which share this kernel, run at the same speed.