Fix 32-bit build: derive transpose_bit_tile masks from word width - #214
Merged
Conversation
`transpose_bit_tile` used a hardcoded 64-bit mask table, whose constants overflow a 32-bit `usize` under `#[deny(overflowing_literals)]` and broke the `armv7-unknown-linux-gnueabihf` release build. Make the kernel const-generic over the native word width `W` and derive each delta-swap mask from `W` in-function, so no literal ever exceeds `usize`. On 64-bit the generated masks are identical to before; on 32-bit it is a genuine 32x32 transpose. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014wgBvihvs17T57UiTrG2bJ
Contributor
Merging this PR will degrade performance by 3.48%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| 👁 | Simulation | test_benchmark_decode_zbasis_ensemble[128-JKMN] |
205.8 ms | 212.3 ms | -3.06% |
| 👁 | Simulation | test_benchmark_decode_zbasis_ensemble[32-JordanWigner] |
51.1 ms | 53.2 ms | -3.85% |
| 👁 | Simulation | test_benchmark_decode_zbasis_ensemble[32-Parity] |
50.9 ms | 52.9 ms | -3.79% |
| 👁 | Simulation | test_benchmark_decode_zbasis_ensemble[64-BravyiKitaev] |
96.1 ms | 99.3 ms | -3.24% |
Comparing claude/transpose-bit-tile-usize-ci-4coy6d (de98d2f) with main (2f633b2)
Footnotes
-
100 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
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.
transpose_bit_tileused a hardcoded 64-bit mask table, whose constants overflow a 32-bitusizeunder#[deny(overflowing_literals)]and broke thearmv7-unknown-linux-gnueabihfrelease build.