This bugzilla service is closed. All entries have been migrated to

Bug 1719

Summary: sparseqr test fails with seed of 1
Product: Eigen Reporter: Philipp Schrader <philipp>
Component: SparseAssignee: Nobody <eigen.nobody>
Status: CONFIRMED ---    
Severity: Failed Unit Test CC: chtz, gael.guennebaud, jacob.benoit.1
Priority: Normal    
Version: 3.3 (current stable)   
Hardware: x86 - 64-bit   
OS: All   
Bug Depends on:    
Bug Blocks: 1608    

Description Philipp Schrader 2019-05-25 00:09:33 UTC
In our test infrastructure we happen to be using a random seed of 1 for eigen tests.
I'm trying to upgrade to 3.3.7 (latest stable AFAICT), but am running into the following failure.
Everything else appears to work fine:

$ rm -f split_test_helper.h
$ for i in $(seq 1 999); do cat <<END >> split_test_helper.h
#define EIGEN_TEST_PART_${i}
$ g++ -o foo -isystem. test/sparseqr.cpp -DEIGEN_TEST_FUNC=sparseqr
$ ./foo 
Initializing random number generator with seed 1558638101
Repeating each test 10 times
$ EIGEN_SEED=1 ./foo                                               
Initializing random number generator with seed 1
Repeating each test 10 times
Difference too large wrt tolerance 1e-06, relative error is: 8701.87
Test test_sparseqr_scalar<std::complex<double> >() failed in test/sparseqr.cpp (95)
    verifyIsApprox(A * x, b)
  - test_sparseqr_scalar<std::complex<double> >()
  - sparseqr
  - Seed: 1

I am not familiar enough with matrix operations to figure out if this is just an issue with the randomness generation or an actual bug.

I've switched our random seed to 100 and everything appears happy once again.
Comment 1 Christoph Hertzberg 2019-06-05 08:26:50 UTC
Related: Bug 899.

Unfortunately, it is not easy to have a stable sparse QR decomposition (at least not with reasonable effort). And it is indeed quite unfortunate that it fails for seed=1 ...

To make it pass for seed=1, we probably could do some "random changes" (it would still fail occasionally).

The better solution would be to make it really robust, of course. This needs some investigation.
Comment 2 Nobody 2019-12-04 18:39:56 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: