ncnn icon indicating copy to clipboard operation
ncnn copied to clipboard

Fix BOF in the last channel handling logic of SSE ShuffleChannel

Open junwha opened this issue 1 year ago • 3 comments

Fix https://github.com/Tencent/ncnn/issues/5734

  • apply SSE logic until size-1
  • apply linear logic for the last n elements

junwha avatar Oct 14 '24 22:10 junwha

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

tencent-adm avatar Oct 14 '24 22:10 tencent-adm

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 90.03%. Comparing base (1c7af00) to head (b2ee3aa).

:exclamation: There is a different number of reports uploaded between BASE (1c7af00) and HEAD (b2ee3aa). Click for more details.

HEAD has 32 uploads less than BASE
Flag BASE (1c7af00) HEAD (b2ee3aa)
33 1
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #5735       +/-   ##
===========================================
- Coverage   95.15%   90.03%    -5.13%     
===========================================
  Files         793      265      -528     
  Lines      270315    77624   -192691     
===========================================
- Hits       257218    69886   -187332     
+ Misses      13097     7738     -5359     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Oct 15 '24 02:10 codecov-commenter

Hi @nihui, Thank you for the fast response and review! I will reflect the unrolling part.

Could I ask why do you think the out-of-bound risk does not exist in pack8/16 codes? As far as I think, it also accesses (start of the channel) + (size-1)*(element size) + (element size)/2 in the same manner, which is beyond the size of the channel.

Thank you for your effort on this issue!

junwha avatar Oct 18 '24 06:10 junwha