Add dedicated sanity test program #821
Labels
No labels
announcement
bug
build
CI
dependencies
documentation
duplicate
enhancement
experience feedback
feature request
github_actions
help wanted
install
invalid
Long-term
optimization
portability
question
target-specific
test issue
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-Cyan4973/xxHash#821
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
To detect a bug like #816 , we need more complete and dedicated sanity test program.
In addition, this could be an opportunity to make the quick bench more lightweight by decreasing the initial number of iterations to something low like 10 MB/s which can greatly improve performance if the target cannot reach high speeds, and automatically adjusts on faster targets. This is easy to notice when using
qemu,-O0, or sanitizers.As an extreme example, using my pretty crappy 1.5 GHz Cortex-A53 tablet with
s390xin QEMU with-O0 -mzvector,./xxhsum -b99i0took 38 minutes, as the combination of the unoptimized code and the emulation layer brought it to 3 MB/s, meaning each iteration was about 100 seconds.For the more accurate and thorough benchmarks, we have benchHash, and the same should be for the self tests.
I updated test vector generator and sanity test program.
We can test them with the following commands:
If it seems okay as a version 0, TODOs are
make check.xsum_sanity_check.c(should we care about it?)Yes, this is pretty good @t-mat !
I'm not sure if that's necessary.
What kind of compatibility seems desirable ?
Sorry, I didn't express what I think.
So far, test functions of
sanity_test.care copied (but slightly modified) fromxsum_sanity_check.c.But I think we can re-use
XSUM_test*()functions to avoid to copy relatively complex functions.To reuse them, I think the following changes are needed.
(1) Avoid pseudo global-mutable variables. These variables should be provided from test driver (
XSUM_sanityCheck()).XSUM_checkResult*().nbTestsXSUM_rand().seed(2) Tweak error message. It should avoid "global" test number. It may look like this
Yes, this is definitely a good idea.
I think we can close it for now. We may revisit this issue (duplicated code). But I belive we'll do it after new release and speratation/simplified code base.
Setup: OS Windows 7 x64, xxhsum v0.8.3.
I'm confused with this sanity check. Please, give me a hand.
From https://github.com/Cyan4973/xxHash/blob/dev/tests/sanity_test_vectors.h
{ 14, 0x00000000U, 0x1208E7E2U }, /* XSUM_XXH32_testdata[28] */Ok, I create zero-filled 14 bytes file, then calculate its xxh32 hash and…
Mismatch! What am I doing wrong?
cc: @Cyan4973