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

Introducing ShortSeq192, the successor to ShortSeq128 #10

Merged
merged 11 commits into from
Mar 24, 2024
Merged

Conversation

AlexTate
Copy link
Owner

ShortSeq128 has been superceded by ShortSeq192, which adds an additional block to the fixed length array for storing packed nucleotides. The new object size is the same as it was when bases were being encoded into a uint128_t, so it effectively accommodates an extra 32 bases "for free." Compared to the current object size of ShortSeq128, it is 8 bytes larger but with the benefit of keeping 33-96 nt sequences the same fixed size.

Additional changes in this PR:

  • Significantly refined logic, readability, and performance of the encoding routine now shared by ShortSeq192 and ShortSeqVar.
  • Bugfix for equality checks between ShortSeqVar objects. Previously a larger than necessary memory region was used for comparison.
  • Benchmarks were measured in a cleaner testing environment providing less variance in measurements, and plots have been updated accordingly.

… logscale ticks thicker to emphasize that these plots do not use a linear scale like the others (affects test_hamming_distance() only)
… as it was when bases were being encoded into a uint128_t, so it effectively accommodates an extra 32 bases for free. Compared to the current object size, it is 8 bytes larger but with the benefit of keeping 33-96 nt sequences the same fixed size.

This commit also fixes a bug that was introduced in the last PR. During equality checks, memcmp() was being called with an improper length (length in nucleotides rather than length in encoded bytes). This resulted in comparisons between memory regions that were much larger than necessary I still have no idea how this didn't segfault.
…eq marshalling methods. The logic for this task has been SIGNIFICANTLY refined and will be shared by the two array-type ShortSeqs: ShortSeq192 and ShortSeqVar. Benchmarks show a healthy improvement in encoding runtime and consistency.

This commit also updates the benchmark plot for construction from PyBytes. I cleaned up my testing environment so the measurements have less variance. Curiously the Numpy task is consistently taking a couple microseconds longer and I don't yet have an explanation for why.
This commit also:
- Fixes a bug in equality checks between two ShortSeqVars. Previously, the comparison sampled a memory region much larger than it should have been. I still have no idea how this didn't segfault.
- Updates the constant MIN_VAR_NT
- Removes the duplicate constant NT_PER_BLOCK
# Conflicts:
#	doc/plots/mem_by_length.svg
… a cleaner testing environment. Also making y-axis ticks thicker to emphasize the log scale
@AlexTate
Copy link
Owner Author

This failed test is because, for some reason, some of the macOS runners have a Xenon E5-1650 v2 CPU.

  • v2 lacks BMI2 support because it was released in 2013 and uses Ivy Bridge microarchitecture.
  • v3 was released a year later and uses Haswell microarchitecture, which meets our minimum requirements.

@AlexTate AlexTate merged commit b11f270 into main Mar 24, 2024
7 of 8 checks passed
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.

1 participant