-
Notifications
You must be signed in to change notification settings - Fork 171
ReferenceSampleTree Random Access #983
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Strilanc
merged 12 commits into
quantumlib:main
from
qec-pconner:reference_sample_tree_random_access
Aug 6, 2025
Merged
ReferenceSampleTree Random Access #983
Strilanc
merged 12 commits into
quantumlib:main
from
qec-pconner:reference_sample_tree_random_access
Aug 6, 2025
Conversation
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
qec-pconner
commented
Aug 2, 2025
* Adding `operator[]` to `ReferenceSampleTree`. * Allows quick access to any reference sample bit within the tree at a given absolute index. * Updating `src/stim/util_top/reference_sample_tree.test.cc` to check bit positions, as applicable.
* Faster random access. * Iterate once for shallow access (if desired index is in first pass), also measures size. * From desired index and size, extrapolate iteration value. * Jump forward to the correct iteration value and iterate through childen (second pass). * Adding `<< "index: " << index` output for `ASSERT_EQ` in `src/stim/util_top/reference_sample_tree.test.cc` for easier test debugging.
…or[]` for a tree of >10^17 bits (encoded into 5 nodes). * Iterates over the beginning, the end, and 1 outer repetition before the end. * Test case finishes in <1ms.
* Helps detect when the size of any node is larger than `ULLONG_MAX` instead of silently overflowing.
c4ba19e to
f9188e2
Compare
qec-pconner
commented
Aug 4, 2025
* Better compat for inconsistent `long` vs `long long` ABIs.
Strilanc
requested changes
Aug 5, 2025
* `unsigned long long` necessary (instead of just `uint64_t`) due to incompatible type usage between ABIs.
… support for BMI2. * Adding windows-specific overflow check, via `_umul128()`. * Adding fallback overflow check in `#else` clause.
Strilanc
approved these changes
Aug 5, 2025
* `_umul128()` not supported on 32-bit windows. * 32-bit windows will then fallback to the `#else`'s general assertion.
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.
operator[]toReferenceSampleTree.src/stim/util_top/reference_sample_tree.test.ccto check bit positions, as applicable.