#1139981 nanoflann: FTBFS: flaky test: kdtree.L1_vs_bruteforce_rknn

#1139981#5
Date:
2026-06-14 09:50:56 UTC
From:
To:
Hello José Luis.

I'm reporting this as "important" because the failure rate is low compared
with other packages which FTBFS randomly, but as upstream, I would
really worry about the kind of error shown:

The difference [...] is 35.999996185302734, which exceeds 1e-3

I would say this should never happen, but of course I know nothing
about the program internals.

Follows my standard template for FTBFS bugs:
--------------------------------------------------------------------------

Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202606/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

Caveat: The above should be understood as "where the reported randomness happens".

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:nanoflann, so that this is still
visible in the BTS web page for this package.

Thanks.
-------------------------------------------------------------------------------- [...] test 2 Start 2: unit_tests_run 2: Test command: /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/tests/unit_tests 2: Working Directory: /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/tests 2: Test timeout computed to be: 10000000 2: [==========] Running 16 tests from 1 test suite. 2: [----------] Global test environment set-up. 2: [----------] 16 tests from kdtree 2: [ RUN ] kdtree.L1_vs_bruteforce 2: [ OK ] kdtree.L1_vs_bruteforce (765 ms) 2: [ RUN ] kdtree.L1_vs_bruteforce_rknn 2: ./tests/test_main.cpp:291: Failure 2: The difference between it->first and out_dists_sqr[i] is 35.999996185302734, which exceeds 1e-3, where 2: it->first evaluates to 2.1019476964872256e-44, 2: out_dists_sqr[i] evaluates to 35.999996185302734, and 2: 1e-3 evaluates to 0.001. 2: For: numToSearch=19 out_dists_sqr[i]=35.999996185302734 2: 2: 2: unknown file: Failure 2: C++ exception with description "map::at" thrown in the test body. 2: 2: [ FAILED ] kdtree.L1_vs_bruteforce_rknn (454 ms) 2: [ RUN ] kdtree.L2_vs_L2_simple 2: [ OK ] kdtree.L2_vs_L2_simple (0 ms) 2: [ RUN ] kdtree.robust_empty_tree 2: [ OK ] kdtree.robust_empty_tree (0 ms) 2: [ RUN ] kdtree.L2_vs_bruteforce 2: [ OK ] kdtree.L2_vs_bruteforce (765 ms) 2: [ RUN ] kdtree.box_L2_vs_bruteforce 2: [ OK ] kdtree.box_L2_vs_bruteforce (53 ms) 2: [ RUN ] kdtree.L2_vs_bruteforce_rknn 2: [ OK ] kdtree.L2_vs_bruteforce_rknn (335 ms) 2: [ RUN ] kdtree.SO3_vs_bruteforce 2: [ OK ] kdtree.SO3_vs_bruteforce (0 ms) 2: [ RUN ] kdtree.SO2_vs_bruteforce 2: [ OK ] kdtree.SO2_vs_bruteforce (0 ms) 2: [ RUN ] kdtree.L2_dynamic_vs_bruteforce 2: [ OK ] kdtree.L2_dynamic_vs_bruteforce (0 ms) 2: [ RUN ] kdtree.robust_nonempty_tree 2: [ OK ] kdtree.robust_nonempty_tree (0 ms) 2: [ RUN ] kdtree.add_and_remove_points 2: [ OK ] kdtree.add_and_remove_points (0 ms) 2: [ RUN ] kdtree.L2_concurrent_build_vs_bruteforce 2: [ OK ] kdtree.L2_concurrent_build_vs_bruteforce (2 ms) 2: [ RUN ] kdtree.L2_concurrent_build_vs_L2 2: [ OK ] kdtree.L2_concurrent_build_vs_L2 (3 ms) 2: [ RUN ] kdtree.L2_static_vs_dynamic 2: [ OK ] kdtree.L2_static_vs_dynamic (0 ms) 2: [ RUN ] kdtree.same_points 2: [ OK ] kdtree.same_points (0 ms) 2: [----------] 16 tests from kdtree (2385 ms total) 2: 2: [----------] Global test environment tear-down 2: [==========] 16 tests from 1 test suite ran. (2385 ms total) 2: [ PASSED ] 15 tests. 2: [ FAILED ] 1 test, listed below: 2: [ FAILED ] kdtree.L1_vs_bruteforce_rknn 2: 2: 1 FAILED TEST 2/2 Test #2: unit_tests_run ...................***Failed 2.39 sec [==========] Running 16 tests from 1 test suite. [----------] Global test environment set-up. [----------] 16 tests from kdtree [ RUN ] kdtree.L1_vs_bruteforce [ OK ] kdtree.L1_vs_bruteforce (765 ms) [ RUN ] kdtree.L1_vs_bruteforce_rknn ./tests/test_main.cpp:291: Failure The difference between it->first and out_dists_sqr[i] is 35.999996185302734, which exceeds 1e-3, where it->first evaluates to 2.1019476964872256e-44, out_dists_sqr[i] evaluates to 35.999996185302734, and 1e-3 evaluates to 0.001. For: numToSearch=19 out_dists_sqr[i]=35.999996185302734 unknown file: Failure C++ exception with description "map::at" thrown in the test body. [ FAILED ] kdtree.L1_vs_bruteforce_rknn (454 ms) [ RUN ] kdtree.L2_vs_L2_simple [ OK ] kdtree.L2_vs_L2_simple (0 ms) [ RUN ] kdtree.robust_empty_tree [ OK ] kdtree.robust_empty_tree (0 ms) [ RUN ] kdtree.L2_vs_bruteforce [ OK ] kdtree.L2_vs_bruteforce (765 ms) [ RUN ] kdtree.box_L2_vs_bruteforce [ OK ] kdtree.box_L2_vs_bruteforce (53 ms) [ RUN ] kdtree.L2_vs_bruteforce_rknn [ OK ] kdtree.L2_vs_bruteforce_rknn (335 ms) [ RUN ] kdtree.SO3_vs_bruteforce [ OK ] kdtree.SO3_vs_bruteforce (0 ms) [ RUN ] kdtree.SO2_vs_bruteforce [ OK ] kdtree.SO2_vs_bruteforce (0 ms) [ RUN ] kdtree.L2_dynamic_vs_bruteforce [ OK ] kdtree.L2_dynamic_vs_bruteforce (0 ms) [ RUN ] kdtree.robust_nonempty_tree [ OK ] kdtree.robust_nonempty_tree (0 ms) [ RUN ] kdtree.add_and_remove_points [ OK ] kdtree.add_and_remove_points (0 ms) [ RUN ] kdtree.L2_concurrent_build_vs_bruteforce [ OK ] kdtree.L2_concurrent_build_vs_bruteforce (2 ms) [ RUN ] kdtree.L2_concurrent_build_vs_L2 [ OK ] kdtree.L2_concurrent_build_vs_L2 (3 ms) [ RUN ] kdtree.L2_static_vs_dynamic [ OK ] kdtree.L2_static_vs_dynamic (0 ms) [ RUN ] kdtree.same_points [ OK ] kdtree.same_points (0 ms) [----------] 16 tests from kdtree (2385 ms total) [----------] Global test environment tear-down [==========] 16 tests from 1 test suite ran. (2385 ms total) [ PASSED ] 15 tests. [ FAILED ] 1 test, listed below: [ FAILED ] kdtree.L1_vs_bruteforce_rknn 1 FAILED TEST 50% tests passed, 1 tests failed out of 2 Total Test time (real) = 2.46 sec The following tests FAILED: 2 - unit_tests_run (Failed) Errors while running CTest make[1]: *** [Makefile:74: test] Error 8 make[1]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu' dh_auto_test: error: cd obj-x86_64-linux-gnu && make -j2 test ARGS\+=--verbose ARGS\+=-j2 returned exit code 2 make: *** [debian/rules:7: binary] Error 25 dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2 --------------------------------------------------------------------------------
#1139981#10
Date:
2026-06-14 19:49:50 UTC
From:
To:
If I recall right, this was fixed in a recent upstream release, updating
the release should mark this as solved (this bug should be in the changelog
as fixed upstream).

Cheers


/**
 * Jose Luis Blanco-Claraco
 * Universidad de Almería - Departamento de Ingeniería
 * [Homepage]( https://w3.ual.es/~jlblanco/ )
 * [GH profile]( https://github.com/jlblancoc )
 */

El dom, 14 jun 2026, 11:53, Santiago Vila <sanvila@debian.org> escribió:

#1139981#15
Date:
2026-06-14 21:53:34 UTC
From:
To:
Version: 1.10.1+ds-1
and I could not find the test name in CHANGELOG.rst.

But I see this in the git history:

commit 4a24515c8c129ce73331a19eebbfd77809f17858
Author: Julien Schueller <schueller@phimeca.com>
Date:   Fri May 29 13:43:34 2026 +0200

    fix flaky kdtree.L1_vs_bruteforce_rknn test

    Three related issues caused random failures:
    - Brute force used hardcoded double while the kd-tree used NUM (float),
      causing nFound > bf_nn.size() at the radius boundary.
    - Brute force used <= (non-strict) but the kd-tree uses < (strict).
    - No bounds check: the comparison loop walked past bf_nn.end() and
      called map::at with indices missing from the brute-force set.


so yes, I believe it's fixed.

(I also built it 100 times right now with zero failures, but I did not
measure accurately the failure rate of the previous version. If I'm wrong
and the failure rate is just below 1/100, we can always reopen later...).

Thanks.

#1139981#16
Date:
2026-06-14 22:07:07 UTC
From:
To:
Yes, I think it's safe to mark as fixed.

And thanks for the quick and intense testing, Santiago!

JL