Skip to content
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

Fix 64-bit integer testing #722

Merged
merged 1 commit into from
Dec 12, 2023
Merged

Conversation

argilo
Copy link
Member

@argilo argilo commented Dec 12, 2023

Fixes #681.

As suggested by @jdemel, I've switched to wider integer types in the icompare function.

After this change, errors in the upper 32 bits of 64-bit integers can be detected. For instance, I tried intentionally breaking the volk_64u_byteswap kernel like so:

diff --git a/kernels/volk/volk_64u_byteswap.h b/kernels/volk/volk_64u_byteswap.h
index 2fbf3cc..befde6d 100644
--- a/kernels/volk/volk_64u_byteswap.h
+++ b/kernels/volk/volk_64u_byteswap.h
@@ -128,7 +128,7 @@ static inline void volk_64u_byteswap_generic(uint64_t* intsToSwap,
                    ((output2 << 8) & 0x00ff0000) | ((output2 << 24) & 0xff000000));
 
         *inputPtr++ = output2;
-        *inputPtr++ = output1;
+        *inputPtr++ = output1 ^ 1;
     }
 }
 #endif /* LV_HAVE_GENERIC */

This produces:

    Start 131: qa_volk_64u_byteswappuppet_64u
1/1 Test #131: qa_volk_64u_byteswappuppet_64u ...***Failed    0.04 sec
RUN_VOLK_TESTS: volk_64u_byteswappuppet_64u(131071,1)
generic completed in 0.2203 ms
u_sse2 completed in 0.237667 ms
a_sse2 completed in 0.271871 ms
u_ssse3 completed in 0.181198 ms
a_ssse3 completed in 0.181753 ms
u_avx2 completed in 0.190526 ms
a_avx2 completed in 0.200319 ms
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch u_sse2
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch u_sse2
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch a_sse2
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch a_sse2
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch u_ssse3
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch u_ssse3
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch a_ssse3
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch a_ssse3
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch u_avx2
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch u_avx2
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch a_avx2
offset 0 in1: -3550658270824899496 in2: -3550658275119866792 tolerance was: 0
offset 1 in1: 5423210972539813137 in2: 5423210968244845841 tolerance was: 0
offset 2 in1: -2700414598271073068 in2: -2700414593976105772 tolerance was: 0
offset 3 in1: -5986464964998556999 in2: -5986464960703589703 tolerance was: 0
offset 4 in1: -9045258131378705733 in2: -9045258135673673029 tolerance was: 0
offset 5 in1: -6281652206429556922 in2: -6281652210724524218 tolerance was: 0
offset 6 in1: -8900826562837636964 in2: -8900826558542669668 tolerance was: 0
offset 7 in1: -5897673898479535170 in2: -5897673894184567874 tolerance was: 0
offset 8 in1: 9110348040616628702 in2: 9110348044911595998 tolerance was: 0
offset 9 in1: -51766911722809408 in2: -51766907427842112 tolerance was: 0
volk_64u_byteswappuppet_64u: fail on arch a_avx2
Best aligned arch: generic
Best unaligned arch: generic

Signed-off-by: Clayton Smith <[email protected]>
@jdemel jdemel merged commit af3399f into gnuradio:main Dec 12, 2023
32 checks passed
Alesha72003 pushed a commit to Alesha72003/volk that referenced this pull request May 15, 2024
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.

64-bit integer testing is broken
2 participants