-
Notifications
You must be signed in to change notification settings - Fork 22
Better test coverage for 256-bit and 512-bit vectors #192
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
Conversation
|
Github Actions are down right now: https://www.githubstatus.com/incidents/xwn6hjps36ty But the newly added tests pass for me locally on x86 and in WASM. |
|
I guess there is no harm in having them, but would like to hear the opinion of someone else, too. |
raphlinus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the main question is whether we allow LLM generated code, then I think the answer is yes. The size is a bit daunting, but probably that's what it takes to test the functionality, as the surface area is large.
Skimming it, it seems reasonable – most of the tests just supply arguments to methods, then do assert_eq! on the answer. It's possible the sheer number of lines of code could be reduced by iterating over argument/result tuples, but on the other hand that would make control flow more complex.
So yes, I approve.
The newly added tests were generated by Claude Code with Opus 4.5 backend, since there's way too many of them to hand-write.
In the future we might want to add a more rigorous automatic generation of test cases for various vector sizes using an approach along the lines of
fearless_simd_gen, but this is a simple first step towards increased test coverage.I kept the newly added tests separate and the original handwritten tests intact to so that this extra code could be easily scrapped if it ever becomes a liability.
The 512-bit test file contains more tests than the 256-bit one because mod.rs already includes some handwritten tests for 256-bit vectors, so they don't have to be duplicated in the 256-bit tests file.