Skip to content

Conversation

@jatinchowdhury18
Copy link
Contributor

No description provided.

@jatinchowdhury18 jatinchowdhury18 requested a review from Copilot April 6, 2025 21:13
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Comment on lines +1701 to +1704
for (int i = 0; i < Ncvec; i += 2)
{
vab[i] = _mm_add_ps (va[i], vb[i]);
vab[i + 1] = _mm_add_ps (va[i + 1], vb[i + 1]);
Copy link

Copilot AI Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop processes two SIMD vectors per iteration but only asserts N is a multiple of SIMD_SZ. If Ncvec (i.e. N/SIMD_SZ) is odd, the access to vab[i+1] may be out-of-bounds. Consider iterating over all vectors individually or asserting that Ncvec is even.

Suggested change
for (int i = 0; i < Ncvec; i += 2)
{
vab[i] = _mm_add_ps (va[i], vb[i]);
vab[i + 1] = _mm_add_ps (va[i + 1], vb[i + 1]);
for (int i = 0; i < Ncvec; ++i)
{
vab[i] = _mm_add_ps (va[i], vb[i]);

Copilot uses AI. Check for mistakes.
auto* vb = (const float32x4_t*) b;
auto* vab = (float32x4_t*) ab;

for (int i = 0; i < Ncvec; i += 2)
Copy link

Copilot AI Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The loop processes two SIMD vectors per iteration without ensuring that Ncvec is even. If Ncvec is odd, the access to vab[i+1] could result in out-of-bound memory access. Consider revising the loop to handle an odd number of elements or adding a corresponding assertion.

Copilot uses AI. Check for mistakes.
Comment on lines +2040 to +2043
for (int i = 0; i < Ncvec; i += 2)
{
vab[i] = _mm256_add_ps (va[i], vb[i]);
vab[i + 1] = _mm256_add_ps (va[i + 1], vb[i + 1]);
Copy link

Copilot AI Apr 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Processing two SIMD vectors per iteration assumes that Ncvec (N/SIMD_SZ) is even, which is not enforced by the current assertion. This could lead to out-of-bound access when Ncvec is odd; consider iterating over each vector or assert an even count.

Suggested change
for (int i = 0; i < Ncvec; i += 2)
{
vab[i] = _mm256_add_ps (va[i], vb[i]);
vab[i + 1] = _mm256_add_ps (va[i + 1], vb[i + 1]);
for (int i = 0; i < Ncvec; ++i)
{
vab[i] = _mm256_add_ps (va[i], vb[i]);

Copilot uses AI. Check for mistakes.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 97.05882% with 1 line in your changes missing coverage. Please review.

Project coverage is 77.81%. Comparing base (d7fe226) to head (b097d8b).

Files with missing lines Patch % Lines
chowdsp_fft.cpp 88.88% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   77.57%   77.81%   +0.24%     
==========================================
  Files           5        5              
  Lines        2707     2741      +34     
  Branches      221      227       +6     
==========================================
+ Hits         2100     2133      +33     
- Misses        607      608       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jatinchowdhury18 jatinchowdhury18 merged commit a5072de into main Apr 6, 2025
8 checks passed
@jatinchowdhury18 jatinchowdhury18 deleted the accum branch April 6, 2025 21:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants