fix[vortex-array]: fix overflow on FSL element take indices#7214
fix[vortex-array]: fix overflow on FSL element take indices#7214robert3005 merged 1 commit intodevelopfrom
Conversation
The take index types used on an FSL might be valid narrow types. This type was used as indices to take the inner elements, which could result in an overflow with long enough lists. Signed-off-by: Alfonso Subiotto Marques <alfonso.subiotto@polarsignals.com>
|
We maybe could use usize for the element indices to avoid the generic type parameter |
Merging this PR will improve performance by 21.68%
Performance Changes
Comparing Footnotes
|
| Validity::from_iter([true, true, false]), 3, | ||
| ), | ||
| )] | ||
| fn test_element_index_overflow( |
There was a problem hiding this comment.
I tried running this on develop and it did not fail, is there something else that happens here?
|
seems like there is a nice perf gain from this, so might as well do this? |
|
um... do we want to write a regression test that actually fails? |
|
We have it. I already merged a change to the macro that exposes the bug |
|
Yeah, sorry it got lost in the rstest parameterization. The take was lazily wrapping the fsl in a dictionary |
The elements were incorrectly refactored by claude when I got it to clean up and parameterize tests. Additionally, this adds a to_fixed_size_list to the take so it actually gets executed and would fail without #7214. Signed-off-by: Alfonso Subiotto Marques <alfonso.subiotto@polarsignals.com>
|
Still couldn't get it to fail without a to_fixed_size_list. Here's a PR with the test changes: #7229 |
The elements were incorrectly refactored by claude when I got it to clean up and parameterize tests. This commit actually makes the elements interesting. Additionally, this adds a to_fixed_size_list to the take so it actually gets executed and would fail without #7214. <!-- Thank you for submitting a pull request! We appreciate your time and effort. Please make sure to provide enough information so that we can review your pull request. The Summary and Testing sections below contain guidance on what to include. --> ## Summary <!-- If this PR is related to a tracked effort, please link to the relevant issue here (e.g., `Closes: #123`). Otherwise, feel free to ignore / delete this. In this section, please: 1. Explain the rationale for this change. 2. Summarize the changes included in this PR. A general rule of thumb is that larger PRs should have larger summaries. If there are a lot of changes, please help us review the code by explaining what was changed and why. If there is an issue or discussion attached, there is no need to duplicate all the details, but clarity is always preferred over brevity. --> Closes: #000 <!-- ## API Changes Uncomment this section if there are any user-facing changes. Consider whether the change affects users in one of the following ways: 1. Breaks public APIs in some way. 2. Changes the underlying behavior of one of the engine integrations. 3. Should some documentation be updated to reflect this change? If a public API is changed in a breaking manner, make sure to add the appropriate label. You can run `./scripts/public-api.sh` locally to see if there are any public API changes (and this also runs in our CI). --> ## Testing <!-- Please describe how this change was tested. Here are some common categories for testing in Vortex: 1. Verifying existing behavior is maintained. 2. Verifying new behavior and functionality works correctly. 3. Serialization compatibility (backwards and forwards) should be maintained or explicitly broken. --> Signed-off-by: Alfonso Subiotto Marques <alfonso.subiotto@polarsignals.com>
The take index types used on an FSL might be valid narrow types. This type was used as indices to take the inner elements, which could result in an overflow with long enough lists.
Summary
Closes: #000
Testing