Repository navigation
Feature: PHIBF - #348
Feature: PHIBF#348
Conversation
|
Documentation preview available at https://docs.seqan.de/preview/seqan/chopper/348 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #348 +/- ##
==========================================
- Coverage 94.68% 91.68% -3.01%
==========================================
Files 25 28 +3
Lines 1299 1949 +650
Branches 20 67 +47
==========================================
+ Hits 1230 1787 +557
- Misses 69 162 +93 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I can't correctly display the remaining coverage problem. The one in |
Multi-line constructors and such are sometimes wrongly attributed by gcov, so those are bogus. |
lsh_hash_the_sketch and LSH_fill_hashtable move from lsh_distributed_ibf_layout.cpp to the new header lsh.hpp. LSH_fill_hashtable and LSH_find_representative_cluster become templates over the cluster type, such that the partitioned HIBF can use them for clusters of clusters. User bins with invalid MinHash sketches are still skipped, now per user bin. Such a user bin never collides, so it always stays a single cluster, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --number-of-partitions p >= 2, the user bins are distributed onto p partitions, and each partition is laid out as a separate HIBF. The layout file contains one complete layout per partition, one after another: the file names, the configuration and the layout, with partition-local user bin indices. Each of them can be validated and read like a single layout. --partitioning-approach (advanced) selects how the user bins are distributed: blocked, sorted, folded, weighted_fold, similarity, lsh or lsh_sim. lsh and lsh_sim cluster similar user bins with MinHash LSH and need MinHash sketches, which are now also computed for a partitioned HIBF. Without --tmax, the tmax of each partition is chosen based on its number of user bins. The partitioned HIBF cannot be combined with --fast-layout or --determine-best-tmax. Configuration format version 4 stores number_of_partitions and partitioning_approach. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
display_layout general and sizes read the layouts of a layout file one after another and write the statistics of each of them, also one after another. Each layout is validated after reading, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
--number-of-partitions 0 failed an assertion in execute and, with NDEBUG, wrote to the first element of an empty vector of partitions. The CLI now reports a parser error, and execute throws std::invalid_argument. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
execute is documented to throw std::invalid_argument if a partitioned HIBF is combined with
fast_layout, and the CLI rejects this combination. execute instead laid out each partition with
fast_layout, which produced an invalid layout ("User bin 0 occupies zero technical bins").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
execute replaced hibf_config.tmax by next_multiple_of_64(ceil(sqrt(n))) unless tmax_is_set, also for a single HIBF. Only the CLI sets tmax_is_set, so API callers lost their tmax, e.g., 240 user bins with tmax 128 were laid out with 64 technical bins. The CLI was not affected: without --tmax, validate_and_set_defaults() computes the same value. The tmax of each partition is now only chosen per partition for a partitioned HIBF. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
execute laid out every HIBF with a copy of the configuration and added back only the DP, union estimation and rearrangement timers. For the fast layout, the timers of the LSH, the top-level distribution and the small layouts stayed 0 in --timing-output, unlike on main. A single HIBF is again laid out with the configuration itself. The partitions of a partitioned HIBF use copies with their own timers, which start at 0, so that adding them back does not count the input configuration's time twice. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The configuration written for each partition contained the tmax of the input configuration instead of the tmax the partition was laid out with, e.g., 128 instead of 64 for 4200 user bins in two partitions without --tmax. The layout was also validated against that tmax. In addition, execute left the input configuration with the number of user bins of the last partition, which chopper layout then wrote to the sketch file. Each partition now has its own configuration with its tmax and number of user bins, which is used for laying it out, validating it and writing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With --output-verbose-statistics, the statistics of each partition were computed with the sketches and cardinalities of all user bins, indexed by the partition-local user bin indices of its layout. For example, partition 0 of the sorted approach, which holds the largest user bins, was reported with the sketches of the user bins 0, 1, 2, .... Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The folded approach moves on to the next partition once a partition holds half the cardinality per partition. If one user bin holds most k-mers, the remaining user bins may not fill the next partition, so later partitions stayed empty, and partition_user_bins threw. This happened for 16 of 150 random inputs with heavy-tailed cardinalities (2 to 16 partitions, up to 315 user bins). As in the sorted approach, it now also moves on if only as many user bins remain as partitions that were not reached yet. The partitions of all other inputs are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The similarity approach shuffled the blocks of user bins that seed the partitions with a std::random_device seed, so the partitions, and thereby the layout, changed between runs. The blocks are now shuffled by a Fisher-Yates shuffle over std::mt19937_64 with its default seed. Unlike std::shuffle, this gives the same order with every standard library. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
find_best_partition asserted that the union of a user bin and a partition is not estimated smaller than the partition. Near the switch from linear counting to the raw estimate (2.5 * 4096 k-mers for sketch_bits 12), HyperLogLog can estimate a superset smaller, e.g., 10'244 for 10'053 hashes and 10'279 for the first 10'052 of them. This failed the assertion; with NDEBUG, the difference wrapped around in size_t, and the partition got no similarity. The difference is now clamped to 0, as in find_best_technical_bin of the fast layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Documentation preview available at https://seqan.github.io/docs-preview/seqan/chopper/348/ |
With some fixes analysed by CLaude
Depends on seqan/hibf#343