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 for illegal instruction #13

Merged
merged 16 commits into from Dec 8, 2021
Merged

Fix for illegal instruction #13

merged 16 commits into from Dec 8, 2021

Conversation

bigcat88
Copy link
Contributor

@bigcat88 bigcat88 commented Dec 1, 2021

Good time of a day.
I was wrong that we dont need a check for SSE CPU capabilities. I got many bug reports, some people got Illegal instruction immediately after install, during import of module and two persons had that problem during run.
I Didn't know that time that Proxmox software by default uses kvm64 type of CPU(Pentium 4), and some people uses docker with qemu with custom CPU flags. My bad.

This pull request fixes that situations, i reverted calculation of popcount for bytes to your old code that uses SSE4, removed all static const vars of SSE init, added check for SSE support, and added function set_algo to change algorithms. That new func we might be used for test of algorithms(i suppose it is only for internal use).
Made some small code refactor(mostly moved functions in different order for further development of arm algo version).

I added you name and email to setup.py file, some paranoic people check this fields during manual install.

Bumped version to 2.1.1 cause nothing new was added, only refactoring and bug fixes.

Made full tests that i was able to, on proxmox(qemu) / macos intel 8xxx / linux Intel 10xxx.

Waiting for this fixes appear on pypi =)

bigcat88 and others added 16 commits August 24, 2021 20:32
Also `hamming_distance_sse41_byte_max_dist` and `hamming_distance_loop_byte_max_dist` added as underlying functions.
Added 2 tests(for input args checks and calculations check) and 1 benchmark(with result check too).
Version changed from 1.4 to 2.1
remove `result` from `test_check_bytes_arrays_within_dist_bench`
need to check how it will compile on MVSC.
later will write why i rewrited what was a;ready written..
…n `int`(this is a high cost operation for CPU) during distance calculation, and store it only at end.
- Fixes: Illegal instruction on Docker+qemu during usage.
- Rollback old SSE4.1 popcount.
- Added new function `set_algo` for internal testing and further developing, to see if all algorithms are correct.
- +Refactor
moved author/email to right location.
`test_hamming_distance_byte`,`test_check_hexstrings_within_dist`,
`test_check_bytes_arrays_within_dist_calculation`
to use `set_algo` function to test all algorithms.
will need some changes in future to be able to build/pass on arm.
@bigcat88
Copy link
Contributor Author

bigcat88 commented Dec 2, 2021

@mrecachinas thats all, maybe a two-three weeks later i will add github actions and building for arm.

@bigcat88 bigcat88 mentioned this pull request Dec 8, 2021
@mrecachinas mrecachinas merged commit 6ff779e into mrecachinas:master Dec 8, 2021
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.

None yet

2 participants