Your message dated Sat, 12 Aug 2017 16:17:10 +0000
with message-id <e1dgz66-0008jb...@fasolo.debian.org>
and subject line Bug#870137: fixed in librsb 1.2.0-rc5-3+deb9u1
has caused the Debian Bug report #870137,
regarding please patch buggy librsb-rc5 in stretch
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
870137: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=870137
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: librsb
Version: 1.2.0-rc5-3
Severity: important

librsb-rc5 (shipped in Debian 9) suffers a few severe bugs leading to
numerically wrong results.  These were solved in -rc7. I attach a
program detecting the main bug and a patch to solve it and the others,
by essentially bringing those files to be like in -rc7.
/* This program demonstrates a bug fixed in librsb-1.2-rc7. */

#include <rsb.h>
#include <stdio.h>

int main(const int argc, char * const argv[])
{
        rsb_err_t errval = RSB_ERR_NO_ERROR;
        int i;
        const int N = 2;
        double complex x[N], y[N];
        const double complex alpha = 1.0;
        double complex VA[]={1,1,2};
        int IA[]={0,0,1},JA[]={0,1,1},nnz=3;
        struct rsb_mtx_t * mtxAp;
        // matrix:
        // (1,0) (1,0)
        // (1,0) (1,0)
        // represented as upper hermitian:
        // (1,0) (1,0)
        // (0,0) (1,0)
        // multiplicand vector:
        // (0,1)
        // (0,0)
        // result shall be:
        // (0,1)
        // (0,1)
        errval = rsb_lib_init(RSB_NULL_INIT_OPTIONS);
        if(errval != RSB_ERR_NO_ERROR)
                goto err;
        mtxAp = rsb_mtx_alloc_from_coo_begin(2, 
RSB_NUMERICAL_TYPE_DOUBLE_COMPLEX, N, N, 
RSB_FLAG_DEFAULT_STORAGE_FLAGS|RSB_FLAG_UPPER_HERMITIAN , &errval);
        errval = rsb_mtx_set_vals(mtxAp, VA, IA, JA, nnz, RSB_FLAG_NOFLAGS);
        if(errval != RSB_ERR_NO_ERROR)
                goto err;
        errval = rsb_mtx_alloc_from_coo_end(&mtxAp);
        if(errval != RSB_ERR_NO_ERROR)
                goto err;
        for (i = 0; i < N; i++) x[i] = y[i] = 0.0;
        x[0] = I;
        errval = rsb_spmv(RSB_TRANSPOSITION_N, &alpha, mtxAp, x, 1, NULL, y, 1);
        if(errval != RSB_ERR_NO_ERROR)
                goto err;
        for (i = 0; i < N; i++)
                printf("(%g,%g)\t", creal(y[i]), cimag(y[i]));
        printf("\n");
        if(cimag(y[1])!=1)
                printf("Result seems incorrect -- are you using <  
librsb-1.2-rc7?\n");
        else
                printf("Result seems correct   -- are you using >= 
librsb-1.2-rc7?\n");
        rsb_mtx_free(mtxAp);

        errval = rsb_lib_exit(RSB_NULL_EXIT_OPTIONS);
        if(errval != RSB_ERR_NO_ERROR)
                goto err;
        return 0;
err:
        rsb_perror(NULL,errval);
        return -1;
}
Index: rsb_util.m4
===================================================================
--- rsb_util.m4 (revision 3505)
+++ rsb_util.m4 (revision 3516)
@@ -2708,6 +2708,7 @@
                --ti;
                vT[ti] += vB[bi] + vC[ci];
                ++bi;
+               ++ci;
                ++ti;
                ++onz;
        }
@@ -2715,16 +2716,16 @@
        t0 = ti;
                if   ( bi<nnzB && ci<nnzC && 
RSB_COO_GT(IB[bi],JB[bi],IC[ci],JC[ci]) )
        {
-               IT[ti] = IB[bi];
-               JT[ti] = JB[bi];
-               vT[ti] = vB[bi] + vC[ci];
-               ++bi,++ci,++ti;
+               IT[ti] = IC[ci];
+               JT[ti] = JC[ci];
+               vT[ti] = vC[ci];
+               ++ci,++ti;
        }
 
                while( bi<nnzB && ci<nnzC && 
RSB_COO_GT(IB[bi],JB[bi],IC[ci],JC[ci]) && ti > 0 && 
RSB_COO_EQ(IC[ci],JC[ci],IT[ti-1],JT[ti-1]) )
        {
                --ti;
-               vT[ti] += vB[bi] + vC[ci];
+               vT[ti] += vC[ci];
                ++ci;
                ++ti;
                ++onz;
@@ -2733,6 +2734,8 @@
        if( ci < nnzC && bi < nnzB )
                goto again`_'RSB_M4_CHOPSPACES(mtype);
 
+again`_once_'RSB_M4_CHOPSPACES(mtype):
+
                if   ( bi<nnzB && ci==nnzC )
        {
                IT[ti] = IB[bi];
@@ -2761,14 +2764,14 @@
                while( ci<nnzC && bi==nnzB && ti > 0 && 
RSB_COO_EQ(IC[ci],JC[ci],IT[ti-1],JT[ti-1]) )
        {
                --ti;
-               IT[ti] = IC[ci];
-               JT[ti] = JC[ci];
                vT[ti]+= vC[ci];
                ++ci;
                ++ti;
                ++onz;
        }
 
+       if( ci < nnzC || bi < nnzB )
+               goto again`_once_'RSB_M4_CHOPSPACES(mtype);
        }
        else 
 #endif
@@ -2825,7 +2828,7 @@
                mtypeb*tdst = dst;
 ifelse(RSB_M4_AND(RSB_M4_IS_COMPLEX_TYPE(mtypeb)),1,`dnl
                if(RSB_DOES_CONJUGATE(transA))
-                       for(nzi=0;nzi<nnz;++nzi) 
RSB_M4_ASSIGN(mtypeb,mtypea,`tdst[nzi]',`RSB_M4_CONJ(`(mtypeb)(alpha*tsrc[nzi])',mtypeb,RSB_M4_TRANS_C,RSB_M4_SYMBOL_UNSYMMETRIC)')
+                       for(nzi=0;nzi<nnz;++nzi) 
RSB_M4_ASSIGN(mtypeb,mtypea,`tdst[nzi]',`(mtypeb)(alpha*RSB_M4_CONJ(`tsrc[nzi]',mtypeb,RSB_M4_TRANS_C,RSB_M4_SYMBOL_UNSYMMETRIC))')
                else
 ')dnl
                        for(nzi=0;nzi<nnz;++nzi) 
RSB_M4_ASSIGN(mtypeb,mtypea,`tdst[nzi]',`(mtypeb)(alpha*tsrc[nzi])')
Index: rsb_krnl_bcss_macros.m4
===================================================================
--- rsb_krnl_bcss_macros.m4     (revision 3505)
+++ rsb_krnl_bcss_macros.m4     (revision 3516)
@@ -922,9 +922,9 @@
                        k=fk;
                        if(k==lk)continue;
                        j=bindx[k];
-                       cacc += 
RSB_M4_CONJ(VA[k]*rhs[tcolsu*j*xstride],mtype,ntransposition,k_symmetry);
+                       cacc += 
RSB_M4_CONJ(VA[k],mtype,ntransposition,k_symmetry)*rhs[tcolsu*j*xstride];
                        if(roff!=coff || (j!=i))
-                               
tout[(tcolsu)*(j)*ystride]+=RSB_M4_CONJ(VA[k]*bt,mtype,ttransposition,k_symmetry);
+                               
tout[(tcolsu)*(j)*ystride]+=RSB_M4_CONJ(VA[k],mtype,ttransposition,k_symmetry)*bt;
                        ++k;
 dnl RSB_M4_SIMPLE_LOOP_UNROLL_2S..
 RSB_M4_SIMPLE_LOOP_UNROLL_2S_J(`k',`LI',`fk+1',`lk-1',`dnl
@@ -933,7 +933,7 @@
                        `const mtype 
b_'``''LI`'=rhs[tcolsu*(`j_'``''LI`')*xstride];
                        `const mtype a_'``''LI`'=VA[k+LI];
                        `mtype 
c_'``''LI`'=RSB_M4_CONJ_SYM(mtype,ttransposition,k_symmetry)( `a_'``''LI)*bt;
-dnl                    `mtype c_'``''LI`'=RSB_M4_CONJ(( `a_'``''LI *bt 
),mtype,transposition,k_symmetry);
+dnl                    `mtype c_'``''LI`'=RSB_M4_CONJ(( 
`a_'``''LI),mtype,transposition,k_symmetry) *bt ;
 dnl
 ',`dnl
                        cacc += 
RSB_M4_CONJ_SYM(mtype,ntransposition,k_symmetry)(`a_'``''LI)*b_``''LI;
@@ -942,9 +942,9 @@
                        if(k<lk)
                        {
                                j=bindx[k];
-                               cacc += 
RSB_M4_CONJ(VA[k]*rhs[trowsu*j*xstride],mtype,ntransposition,k_symmetry);
+                               cacc += 
RSB_M4_CONJ(VA[k],mtype,ntransposition,k_symmetry)*rhs[trowsu*j*xstride];
                                if(roff!=coff || (j!=i))
-                                       
tout[(tcolsu)*(j)*ystride]+=RSB_M4_CONJ(VA[k]*bt,mtype,ttransposition,k_symmetry);
+                                       
tout[(tcolsu)*(j)*ystride]+=RSB_M4_CONJ(VA[k],mtype,ttransposition,k_symmetry)*bt;
                                ++k;
                        }
 popdef(`ntransposition')dnl
@@ -1047,7 +1047,7 @@
 dnl    Fixed for Hermitian k_symmetry.
 dnl
 ifelse(is_diag_d_spsv_kernel,1,`dnl
-               
out[trowsu*bri]-=RSB_M4_CONJ(*a*ax_0,mtype,transposition,k_symmetry);
+               
out[trowsu*bri]-=RSB_M4_CONJ(*a,mtype,transposition,k_symmetry)*ax_0;
 ',`dnl
 
{RSB_M4_KERNEL_FUNCTION_BODY(`row',`rows',b_rows,`column',`columns',b_columns,mtype,,mop,unrolling,RSB_M4_SYMBOL_UNSYMMETRIC)}
 ')dnl
Index: rsb_libspblas_handle.c
===================================================================
--- rsb_libspblas_handle.c      (revision 3505)
+++ rsb_libspblas_handle.c      (revision 3516)
@@ -1,6 +1,6 @@
 /*                                                                             
                                               
 
-Copyright (C) 2008-2015 Michele Martone
+Copyright (C) 2008-2017 Michele Martone
 
 This file is part of librsb.
 
@@ -1527,9 +1527,15 @@
         \ingroup gr_internals
         */
        rsb_err_t errval = RSB_ERR_NO_ERROR;
+#if 1
+       struct rsb_blas_sparse_matrix_t * bsm = NULL;
+       if( ( bsm = rsb__BLAS_matrix_retrieve(A)) != NULL && bsm->base == 
blas_one_base ) 
+               i-=1, j-=1;
+       errval = rsb__do_get_coo_element(bsm->mtxAp,v,i,j);
+#else
        struct rsb_mtx_t * mtxAp = rsb__BLAS_inner_matrix_retrieve(A);
-
        errval = rsb__do_get_coo_element(mtxAp,v,i,j);
+#endif
        return RSB_ERROR_TO_BLAS_ERROR(errval);
 }
 

Attachment: signature.asc
Description: PGP signature


--- End Message ---
--- Begin Message ---
Source: librsb
Source-Version: 1.2.0-rc5-3+deb9u1

We believe that the bug you reported is fixed in the latest version of
librsb, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 870...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Rafael Laboissiere <raf...@debian.org> (supplier of updated librsb package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 30 Jul 2017 18:01:10 -0300
Source: librsb
Binary: librsb0 librsb-dev librsb-doc
Architecture: source amd64 all
Version: 1.2.0-rc5-3+deb9u1
Distribution: stretch
Urgency: medium
Maintainer: Debian Science Maintainers 
<debian-science-maintainers@lists.alioth.debian.org>
Changed-By: Rafael Laboissiere <raf...@debian.org>
Description:
 librsb-dev - recursive sparse blocks matrix computations library (development)
 librsb-doc - recursive sparse blocks matrix computations library (documentatio
 librsb0    - recursive sparse blocks matrix computations library
Closes: 870137
Changes:
 librsb (1.2.0-rc5-3+deb9u1) stretch; urgency=medium
 .
   * d/p/fix-numerical-computation.patch: New patch.
     This minimal patch backports the fixes to a few severe bugs leading to
     numerically wrong results.  These bugs are fixed in the upstream
     version 1.2.0-rc7.
     Thanks to Michele Martone for the patch (Closes: #870137)
   * Add unit test for numerical bug fixed in version 1.2.0-rc7.
     Thanks to Michele Martone for the source file
Checksums-Sha1:
 cc13e1381b19d66b4a3878eb2e29d8487a5e6d14 2174 librsb_1.2.0-rc5-3+deb9u1.dsc
 976ae5ffcd1f1e4a012a2f3dff05eb96362fbf17 6876 
librsb_1.2.0-rc5-3+deb9u1.debian.tar.xz
 be385d69a7ac9565ca92e6f020d04c39c45d821b 214156 
librsb-dev-dbgsym_1.2.0-rc5-3+deb9u1_amd64.deb
 1d69bcf66f7636b41bf0b41019bf39a949d7f3c6 202328 
librsb-dev_1.2.0-rc5-3+deb9u1_amd64.deb
 85970ba75733499af4a43d682a94c492eefceb26 167108 
librsb-doc_1.2.0-rc5-3+deb9u1_all.deb
 792fb9f8a18156d4ea1a428fb8a8c825bbd51cc3 2671426 
librsb0-dbgsym_1.2.0-rc5-3+deb9u1_amd64.deb
 ab26bdbc1b8435e4f2c6bd302f8631376b830002 657776 
librsb0_1.2.0-rc5-3+deb9u1_amd64.deb
 41dad5b9e09f1fd50a701204ce6b93d8f83084c6 6260 
librsb_1.2.0-rc5-3+deb9u1_amd64.buildinfo
Checksums-Sha256:
 c1341b46424c5d21a92219ed4c8f1b4aa4b92f883c1345bec9d4692890d19e09 2174 
librsb_1.2.0-rc5-3+deb9u1.dsc
 b8345228a345bdc6415f9c7bfb905e1a3d7efcdbcb109d3d4f61664519bf9bfa 6876 
librsb_1.2.0-rc5-3+deb9u1.debian.tar.xz
 103ea2fce5b59176c07ddb9ed3c0870e628800aced086e8366dbdcd56ec772c6 214156 
librsb-dev-dbgsym_1.2.0-rc5-3+deb9u1_amd64.deb
 e1781819436f11205595ea510d7f7e3a05aa08bc389cc6f8d3c6dce286baa77d 202328 
librsb-dev_1.2.0-rc5-3+deb9u1_amd64.deb
 ad7403c91f30a72b560a0ac864d2cc0a41ac1846a0716aca107d9f11970e90a4 167108 
librsb-doc_1.2.0-rc5-3+deb9u1_all.deb
 b722ce31a121ca8b9f61d6ce845bcd3e06cd5155bf7d7083d6bf37a396d7418e 2671426 
librsb0-dbgsym_1.2.0-rc5-3+deb9u1_amd64.deb
 25a7a18bf9b7a53e586993bc173543ad2419ffb14b05602d67d78afb1f492a9a 657776 
librsb0_1.2.0-rc5-3+deb9u1_amd64.deb
 91788d1dba28079486b9e4ae8764ea881b3319812d505c7262dd8117dab4cc06 6260 
librsb_1.2.0-rc5-3+deb9u1_amd64.buildinfo
Files:
 a71922e848a03655a39dca794336da68 2174 libs optional 
librsb_1.2.0-rc5-3+deb9u1.dsc
 406e2c7cbed3ec8429d83ddbd3fb25a1 6876 libs optional 
librsb_1.2.0-rc5-3+deb9u1.debian.tar.xz
 81f83d36751a49f5f4b2f1efcb7ab56b 214156 debug extra 
librsb-dev-dbgsym_1.2.0-rc5-3+deb9u1_amd64.deb
 95208d0195bb27947404048600a30074 202328 libdevel optional 
librsb-dev_1.2.0-rc5-3+deb9u1_amd64.deb
 4e3c727b66cdc04eb34a6b25a213f69d 167108 doc optional 
librsb-doc_1.2.0-rc5-3+deb9u1_all.deb
 75d49944e786a2b946436aeb717d2a49 2671426 debug extra 
librsb0-dbgsym_1.2.0-rc5-3+deb9u1_amd64.deb
 0ae5d32bc70d57c6dadd3ba12ffae0d7 657776 libs optional 
librsb0_1.2.0-rc5-3+deb9u1_amd64.deb
 01d3f3191ecf69945e631554ff078903 6260 libs optional 
librsb_1.2.0-rc5-3+deb9u1_amd64.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEP0ZDkUmP6HS9tdmPISSqGYN4XJAFAlmK3QYACgkQISSqGYN4
XJAzXg//SofoLnd7F6W513ajbmm5ObWFdwpLHmJbPMMXbOil1WfWf5bLnog5bww4
K60AKx2nFLITZH5G3lLD9QQ74qleefxdMqno+n9rq+KFlEsoEuh4buMNdf97buaa
ef0XU8AcurTovvGO7P44RBgOASKOU3vjyX8gnxj+0fhWRHY8VeJOqIquEV348JcO
SIgtkcTSRRgRYRXZEm0cx9+5xLoei2gNCw9fFTZBQ+jFNSk+eyYYo/n7xoWvsB5Q
KScU8Hmm6X7fp4GdSXPqsbNaEYM0WqpO8KNIHgTjYv/nxxXcfBguTaC5wnmd/FAp
jf8xmu4bWB8XWvfZqOwXD+Vv+bkM+PxUu9qxV6IGLSnzpXu1w0CCPe5YHfFRdSce
I/n+YhJ7yirtJQUgw1WhWN6WNlmSA1AOD6ra+UnQH18fJJflEXsDCiE3E+8coRUC
D+DgVcLF4rlje6fEt4c5R+c4iPu4SVpEcU8XLq+rGDny7wK1288LnxOlzPV17Sgx
tgoMNo8ydL/JObLODOEZx3G0w9Yghth4NZChuUGTmDwzrUpPozAm/CqFfXZeCNim
n6hvjc+HHXB9SnMNvbLb73i4BKTHyI1M+Rq3GTxI7DBLXlPZhk4nx2BKQuzpNlKL
qFAlrnJ8xqTTjcd0JlaK6UaPpyH+emXfbP9rhMTThZKung57ppE=
=Xuys
-----END PGP SIGNATURE-----

--- End Message ---
-- 
debian-science-maintainers mailing list
debian-science-maintainers@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/debian-science-maintainers

Reply via email to