File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
BitFaster.Caching.UnitTests/Lfu Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,8 @@ public void WhenSampleSizeExceededCountIsReset()
7676
7777 if ( sketch . Size != i )
7878 {
79+ i . Should ( ) . NotBe ( 1 , "sketch should not be reset on the first iteration. Resize logic is broken" ) ;
80+
7981 reset = true ;
8082 break ;
8183 }
Original file line number Diff line number Diff line change @@ -257,7 +257,8 @@ private unsafe void IncrementAvx(T value)
257257 * ( tablePtr + indexes . GetElement ( 2 ) ) + = inc . GetElement ( 2 ) ;
258258 * ( tablePtr + indexes . GetElement ( 3 ) ) + = inc . GetElement ( 3 ) ;
259259
260- bool wasInc = Avx2. MoveMask ( masked . AsByte ( ) ) != 0 ; // _mm256_movemask_epi8
260+ Vector256 < byte > result = Avx2. CompareEqual ( masked . AsByte ( ) , Vector256 . Create ( 0 ) . AsByte ( ) ) ;
261+ bool wasInc = Avx2 . MoveMask ( result . AsByte ( ) ) == unchecked ( ( int ) ( 0b1111_1111_1111_1111_1111_1111_1111_1111 ) ) ;
261262
262263 if ( wasInc && ( ++ size == sampleSize ) )
263264 {
You can’t perform that action at this time.
0 commit comments