Skip to content

Conversation

@faithokamoto
Copy link
Contributor

Changelog Entry

To be copied to the draft changelog by merger:

  • Random double space in a vg autoindex logging line is now a single space

Description

Running some commands and saw:

[...]
[IndexRegistry] Chunking inputs for parallelism.
[IndexRegistry]  Constructing VG graph from FASTA and VCF input.
[IndexRegistry] Constructing GBWT from VG graph and phased VCF input.
[...]

So I fixed it.

@faithokamoto
Copy link
Contributor Author

Combined with my other CI failure in #4783 where exactly the opposite pair of statuses happened (fail Mac and pass GitLab) I don't think it's my fault. Not that I thought either of those PRs should have an impact on the tests in general.

@adamnovak
Copy link
Member

I think the Mac test failure on the other PR was a dependency Git repo being down; I've restarted that job and it got past that step.

The Gitlab failure here looks like an assertion failure in distance indexing:

https://ucsc-ci.com/vgteam/vg/-/jobs/101653#L318

Distance between 4+0rev and 2+0rev
Tree distance: 24 index distance: 1
With distance limit: 81
vg: src/zip_code_tree.cpp:1321: void vg::ZipCodeTree::validate_seed_distances(const bdsg::SnarlDistanceIndex&, const std::vector<vg::SnarlDistanceIndexClusterer::Seed>*, size_t) const: Assertion `false' failed.
...
#7    Object "/builds/vgteam/vg/bin/vg", at 0x56003e16989f, in vg::unittest::C_A_T_C_H_T_E_S_T_194()
      Source "src/unittest/zip_code_tree.cpp", line 3088, in C_A_T_C_H_T_E_S_T_194 [0x56003e16989f]
#6    Object "/builds/vgteam/vg/bin/vg", at 0x56003e11ced1, in vg::unittest::make_and_validate_forest(std::vector<std::tuple<long long, bool, unsigned long>, std::allocator<std::tuple<long long, bool, unsigned long> > > const&, bdsg::SnarlDistanceIndex const&, unsigned long)
      Source "src/unittest/zip_code_tree.cpp", line 33, in make_and_validate_forest [0x56003e11ced1]
#5    Object "/builds/vgteam/vg/bin/vg", at 0x56003e96cb62, in vg::ZipCodeForest::validate_zip_forest(bdsg::SnarlDistanceIndex const&, std::vector<vg::SnarlDistanceIndexClusterer::Seed, std::allocator<vg::SnarlDistanceIndexClusterer::Seed> > const*, unsigned long) const
    | Source "src/zip_code_tree.cpp", line 1348, in validate_zip_tree
      Source "src/zip_code_tree.cpp", line 1337, in validate_zip_forest [0x56003e96cb62]
#4    Object "/builds/vgteam/vg/bin/vg", at 0x56003e96c7cf, in vg::ZipCodeTree::validate_seed_distances(bdsg::SnarlDistanceIndex const&, std::vector<vg::SnarlDistanceIndexClusterer::Seed, std::allocator<vg::SnarlDistanceIndexClusterer::Seed> > const*, unsigned long) const
      Source "src/zip_code_tree.cpp", line 1321, in validate_seed_distances [0x56003e96c7cf]
#3    Object "/usr/lib/x86_64-linux-gnu/libc-2.31.so", at 0x7f0707d96fd5, in __assert_fail
#2    Object "/usr/lib/x86_64-linux-gnu/libc-2.31.so", at 0x7f0707d85728, in 
#1    Object "/usr/lib/x86_64-linux-gnu/libc-2.31.so", at 0x7f0707d85858, in abort
#0    Object "/usr/lib/x86_64-linux-gnu/libc-2.31.so", at 0x7f0707da600b, in raise

So there might be something genuinely wrong in the test at src/unittest/zip_code_tree.cpp line 3088, even if this PR isn't introducing the bug.

@adamnovak
Copy link
Member

It looks like we're failing a randomized test for the zip code tree, which is seeded with the current time.

TEST_CASE("Random graphs zip tree", "[zip_tree][zip_tree_random]") {
for (int i = 0; i < 10; i++) {
// For each random graph
default_random_engine generator(time(NULL));

This isn't using Catch's seed management and reporting, so we can't get the RNG seed that generates the failing test data. We should be using test_seed_source() from src/unittest/randomness.hpp everywhere we need a random seed, instead.

/**
* Return a random seed for testing purposes.
* Respects catch.hpp --rng-seed option to `vg test`.
*
* USE INSTEAD OF A NEW std::random_device FOR ALL TESTING PURPOSES!
*/
inline unsigned int test_seed_source() {
// TODO: make thread safe
return (unsigned int) rand();
}

(That would be a great candidate for another lint rule/script.)

So if we re-run the test it will probably pass, but we know it can fail, so we should fix the test to use the right seed and run the "Random graphs zip tree" test in a Bash loop with various --rng-seed values until we can get a replicable failure, and then fix it.

@adamnovak
Copy link
Member

We could also consider changing the rand() call there to Catch::rngSeed(), which I think we have, or Catch::getSeed(), which would mean upgrading to Catch2 v3.1.1+.

@faithokamoto
Copy link
Contributor Author

This passed so I'm going to merge it. #4787 has the zip code tree random seed thing changed; I'm going to use that to find a failure.

@faithokamoto faithokamoto merged commit 784d842 into master Jan 5, 2026
2 checks passed
@faithokamoto faithokamoto deleted the boo-bad-space branch January 5, 2026 17:43
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.

3 participants