Skip to content

Upgrade sshash to v5.0.0 with API compatibility changes#594

Open
adamant-pwn wants to merge 3 commits intomasterfrom
upgrade-sshash-to-v5
Open

Upgrade sshash to v5.0.0 with API compatibility changes#594
adamant-pwn wants to merge 3 commits intomasterfrom
upgrade-sshash-to-v5

Conversation

@adamant-pwn
Copy link
Contributor

Upgraded sshash from previous version to v5.0.0 (upstream master). This required significant API adaptation due to breaking changes.

API changes handled:

  1. dictionary now requires two template parameters: dictionary<Kmer, Offsets>

    • Added sshash::decoded_offsets as second parameter throughout
  2. Method renames:

    • size() → num_kmers()
    • lookup_advanced() → lookup()
  3. streaming_query template parameter changed:

    • Was: streaming_query<kmer_t, bool>
    • Now: streaming_query<Dict, bool> (takes dictionary type)
  4. Use dictionary::kmer_type instead of template_parameter extraction

    • Replaced get_kmer_t helper with decltype(dict)::kmer_type
    • Cleaner approach using built-in typedef from sshash

Code quality improvements:

  • Removed template_parameter helper struct and get_kmer_t alias
  • Simplified kmer type extraction in lambda expressions

Submodule update:

  • Updated external-libraries/sshash to merge-upstream-master-with-metagraph-compatibility
  • Includes cityhash namespace wrapping and accessor methods
  • Includes pthash fix for multiple definition errors

@adamant-pwn adamant-pwn force-pushed the upgrade-sshash-to-v5 branch 4 times, most recently from 88de71a to 0204128 Compare February 16, 2026 14:11
Upgraded sshash from previous version to v5.0.0 (upstream master).
This required significant API adaptation due to breaking changes.

API changes handled:
1. dictionary now requires two template parameters: dictionary<Kmer, Offsets>
   - Added sshash::decoded_offsets as second parameter throughout

2. Method renames:
   - size() → num_kmers()
   - lookup_advanced() → lookup()

3. streaming_query template parameter changed:
   - Was: streaming_query<kmer_t, bool>
   - Now: streaming_query<Dict, bool> (takes dictionary type)

4. Use dictionary::kmer_type instead of template_parameter extraction
   - Replaced get_kmer_t helper with decltype(dict)::kmer_type
   - Cleaner approach using built-in typedef from sshash

Code quality improvements:
- Removed template_parameter helper struct and get_kmer_t alias
- Simplified kmer type extraction in lambda expressions

Submodule update:
- Updated external-libraries/sshash to merge-upstream-master-with-metagraph-compatibility
- Includes cityhash namespace wrapping and accessor methods
- Includes pthash fix for multiple definition errors
Updates:
1. Bump sshash submodule to include:
   - Fix for sparse index bit budget calculation
   - Conditional verbose output (respects build_config.verbose)

2. Clean integration with sshash verbose flag:
   - Set build_config.verbose = common::get_verbose()
   - Remove stdout/stderr disabling hack (no longer needed)
   - Library now respects its own configuration

This completes the sshash v5.0.0 integration with all bug fixes.
All 150 DBGSSHash tests passing.
- Track only buckets with size > 1 for sparse index encoding
- Renamed m_max_buckets_per_size to m_max_sparse_buckets_per_size
- Size-1 buckets use direct offset encoding
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

Comments