-
Notifications
You must be signed in to change notification settings - Fork 14
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
Move Preprocessed Columns Struct to Preprocessed File #359
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Gali-StarkWare)
6b3c9cc
to
32d6c02
Compare
pub fn packed_at(&self, vec_row: usize) -> PackedM31 { | ||
assert!(vec_row < (1 << self.log_size) / N_LANES); | ||
PackedM31::broadcast(M31::from(vec_row * N_LANES)) | ||
+ unsafe { PackedM31::from_simd_unchecked(SIMD_ENUMERATION_0) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep identified an issue in your code:
Detected 'unsafe' usage, please audit for secure usage
To resolve this comment:
✨ Commit Assistant fix suggestion
+ unsafe { PackedM31::from_simd_unchecked(SIMD_ENUMERATION_0) } | |
// Using `from_simd_unchecked` is necessary here because we are directly converting | |
// a SIMD enumeration to a PackedM31 type. Ensure that `SIMD_ENUMERATION_0` is valid | |
// and correctly aligned for this operation. If the library provides a safe alternative, | |
// consider using it instead. | |
+ unsafe { PackedM31::from_simd_unchecked(SIMD_ENUMERATION_0) } |
View step-by-step instructions
- Review the usage of
unsafe
inPackedM31::from_simd_unchecked(SIMD_ENUMERATION_0)
to understand why it is necessary. Ensure that the operation is safe and does not lead to undefined behavior. - If the
unsafe
block is necessary, document why it is safe in this context. Add a comment above theunsafe
block explaining the reasoning and any assumptions made. - If possible, replace the
unsafe
block with a safe alternative. Check if there is a safe API provided by the library that can be used instead offrom_simd_unchecked
. - If no safe alternative exists and the
unsafe
block is unavoidable, ensure that all inputs and operations within the block are validated to prevent any potential undefined behavior.
💬 Ignore this finding
Reply with Semgrep commands to ignore this finding.
/fp <comment>
for false positive/ar <comment>
for acceptable risk/other <comment>
for all other reasons
Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by unsafe-usage.
You can view more details about this finding in the Semgrep AppSec Platform.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dismissed @semgrep-code-starkware-libs[bot] from a discussion.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @shaharsamocha7)
This change is