Re: [eigen] any remaining issues blocking beta1, speak up! |

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]

*To*: eigen@xxxxxxxxxxxxxxxxxxx*Subject*: Re: [eigen] any remaining issues blocking beta1, speak up!*From*: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>*Date*: Mon, 5 Jul 2010 09:43:49 -0400*Dkim-signature*: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=3HlZJ7chQ9X5xx/rTBJtpG5gqOvAC43fPwN5DimoeFQ=; b=XuN8aG3p5HO5YWguT8cEwGEardoKBWNernhRTblrzqE0Mamoy9LdIj/NhbXBeVyg4J hYFgzot1LvcYu4/t0k4pW8o2vd+9gSIvzn8Djbz7IXH/uUfBuNEnlIqBwUy0icC2A2+A cr5Vm5iLxedFOuoIxh6u5YULBZN3+2VBgX2+8=*Domainkey-signature*: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=dBbYyMEWA4f6gXpIJrDNs9htb5T4Ud8p4/FL/VpOmwrseCVAftlhlurECLsvX7x84n 0EjdhDbrSZvlwKhZ23Tz6CetERXoXkSF8UhqOLiRTnXSAPsZ1OgAPOQfQPdSZr0TY+wx qJDbL7NANgPr2PwxtZARM2PHzGlKMwrFtbBjQ=

So, it looks like we're ready to release beta1. The -fstrict-aliasing issue with gcc 4.3 is something we'll mention as a caveat. I have to go to work now but can release it tonight. Alternatively, if Gael or someone else wants to do it, you're very welcome. Benoit 2010/7/4 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>: > 2010/7/4 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>: >> On Sun, Jul 4, 2010 at 5:42 AM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote: >>> Besides the -fstrict-aliasing issue, is there anything else blocking beta1 ? > > This question is still unanswered :) > > I am going to prepare the release material and will be waiting for the > green light from people who reported issues in this thread and others. > > Benoit > > >>> >>> For the -fstrict-aliasing issue, do I understand correctly that it is >>> ONLY with gcc 4.3, and not any other version? >> >> yes this is really specific to this version of GCC. I spent almost a >> day on it, and my intuition is that gcc gets confused by the deep >> hierarchy and the static cast from the top level expression to, e.g., >> DenseBase, and back to expression via derived(). But that's only an >> intuition. >> >>> >>> If yes, do you want us to go forward and just release beta1 with a >>> "caveat", "exposes what seems to be a bug in gcc 4.3" ? >> >> yes, and the solution is to compile with -O2 -fno-strict-aliasing.... >> >> gael >> >>> >>> Benoit >>> >>> >>> >>> 2010/7/3 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>: >>>> Gael: could you add your 1st example as a unit test? I understand that >>>> other tests catch the issue already, but having this simple test case >>>> can help in the future. >>>> >>>> 2010/7/3 Benoit Jacob <jacob.benoit.1@xxxxxxxxx>: >>>>> I really can't reproduce on linux x86-64 with GCC 4.3. >>>>> >>>>> I tried compiling with -fstrict-aliasing and also with -O2 >>>>> I tried both your versions, reading the program's return value like this: >>>>> >>>>> ##### 10:53:39 ~/build/eigen$ g++-4.3 z.cpp -o z -I ~/eigen -O2 && ./z >>>>> && echo "zero" >>>>> zero >>>>> >>>>> Benoit >>>>> >>>>> >>>>> >>>>> 2010/7/3 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>: >>>>>> no warning. >>>>>> >>>>>> >>>>>> here is an simpler version: >>>>>> >>>>>> #include <iostream> >>>>>> #include <Eigen/Dense> >>>>>> >>>>>> int main() >>>>>> { >>>>>> Eigen::Matrix<float,1,1> v; >>>>>> v.setOnes(); >>>>>> return (v.cwiseAbs()-v).sum(); >>>>>> } >>>>>> >>>>>> I have also simplified CwiseBinaryOp, such that the coeff(int) >>>>>> function is directly implemented in CwiseBinaryOp (not in the base >>>>>> class CwiseBinaryOpImpl) and such that it simply does: >>>>>> >>>>>> return m_rhs.coeff(0); >>>>>> >>>>>> which, in this example, should return v.coeff(0) == 1; >>>>>> >>>>>> (so the left hand side and the functor are not used, but I remove >>>>>> them then the issue disappear). >>>>>> >>>>>> I've also changed the functor by an object of type: >>>>>> >>>>>> struct foo { >>>>>> foo() : x(1) {} >>>>>> int x; >>>>>> }; >>>>>> >>>>>> just be sure the issue does not come from our empty functors. No success. >>>>>> >>>>>> If the left hand side (here v.cwiseAbs(), which is not used) is nested >>>>>> by reference, then the issue disappear. >>>>>> >>>>>> Also, m_rhs().data() is wrong. >>>>>> >>>>>> ... >>>>>> >>>>>> gael >>>>>> >>>>>> On Sat, Jul 3, 2010 at 3:55 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote: >>>>>>> Can you try compiling with >>>>>>> >>>>>>> -Wstrict-aliasing=1 >>>>>>> >>>>>>> indeed, the default value is 3, and 1 is the most aggressive warning >>>>>>> level. It could however report a lot of false positives. According to >>>>>>> `man gcc`. >>>>>>> >>>>>>> Benoit >>>>>>> >>>>>>> 2010/7/3 Gael Guennebaud <gael.guennebaud@xxxxxxxxx>: >>>>>>>> here is a simplified version: >>>>>>>> >>>>>>>> #include <iostream> >>>>>>>> #include <Eigen/Dense> >>>>>>>> >>>>>>>> template<typename A, typename B> EIGEN_DONT_INLINE int foo(const A& a, >>>>>>>> const B& b) >>>>>>>> { >>>>>>>> return (a - b).sum() <= 0; >>>>>>>> } >>>>>>>> >>>>>>>> int main() >>>>>>>> { >>>>>>>> Eigen::Matrix<float,1,1> v; >>>>>>>> v.setOnes(); >>>>>>>> return foo(v.colwise().maxCoeff(),v); >>>>>>>> } >>>>>>>> >>>>>>>> which, again, fails with gcc-4.3 + strict-aliasing only.... >>>>>>>> investigating to see if I can find a workaround. >>>>>>>> >>>>>>>> gael >>>>>>>> >>>>>>>> On Sat, Jul 3, 2010 at 1:03 PM, Jitse Niesen <jitse@xxxxxxxxxxxxxxxxxx> wrote: >>>>>>>>> On Sat, 3 Jul 2010, Benoit Jacob wrote: >>>>>>>>> >>>>>>>>>> All is in the title. Can we release beta1 this Saturday? >>>>>>>>> >>>>>>>>> There is also the stable_norm_1 test that is failing on gcc 4.3. This seems >>>>>>>>> to be a mistake in Eigen itself. >>>>>>>>> >>>>>>>>> See the previous email I wrote: >>>>>>>>> >>>>>>>>> On Thu, 1 Jul 2010, Jitse Niesen wrote: >>>>>>>>>> >>>>>>>>>> Date: Thu, 1 Jul 2010 11:02:51 +0100 (BST) >>>>>>>>>> From: Jitse Niesen <jitse@xxxxxxxxxxxxxxxxx> >>>>>>>>>> To: Eigen mailinglist <eigen@xxxxxxxxxxxxxxxxxxx> >>>>>>>>>> Subject: Failing stable_norm_1 test >>>>>>>>>> >>>>>>>>>> Hello, >>>>>>>>>> >>>>>>>>>> I just spent some time on the stable_norm_1 test, which fails on both my >>>>>>>>>> computer and Gael's computer when using gcc 4.3. It looks similar to the >>>>>>>>>> issue >>>>>>>>>> which you solved by the empty struct magic (well done!). >>>>>>>>>> >>>>>>>>>> The details are as follows. I constructed the following (fairly) minimal >>>>>>>>>> test >>>>>>>>>> example: >>>>>>>>>> >>>>>>>>>> #include <iostream> >>>>>>>>>> #include <Eigen/Dense> >>>>>>>>>> >>>>>>>>>> int main() >>>>>>>>>> { >>>>>>>>>> Eigen::Matrix<float,1,1> v; >>>>>>>>>> v(0,0) = 0.1; >>>>>>>>>> std::cerr << "blue norm = " << v.colwise().blueNorm() << "\n"; >>>>>>>>>> std::cerr << "status = " << >>>>>>>>>> v.colwise().hypotNorm().isApprox(v.colwise().norm(), 1e-4) << "\n"; >>>>>>>>>> } >>>>>>>>>> >>>>>>>>>> When compiling with g++ (version 4.3.3) -O2 -g and running under valgrind, >>>>>>>>>> this >>>>>>>>>> produces: >>>>>>>>>> >>>>>>>>>> Use of uninitialised value of size 4 >>>>>>>>>> at 0x8048F28: bool >>>>>>>>>> Eigen::DenseBase<Eigen::PartialReduxExpr<Eigen::Matrix<float, 1, 1, 0, 1, >>>>>>>>>> 1>, >>>>>>>>>> Eigen::ei_member_hypotNorm<float>, 0> >>>>>>>>>> >::isApprox<Eigen::PartialReduxExpr<Eigen::Matrix<float, 1, 1, 0, 1, 1>, >>>>>>>>>> Eigen::ei_member_norm<float>, 0> >>>>>>>>>> >(Eigen::DenseBase<Eigen::PartialReduxExpr<Eigen::Matrix<float, 1, 1, 0, >>>>>>>>>> > 1, 1>, >>>>>>>>>> Eigen::ei_member_norm<float>, 0> > const&, float) const (in >>>>>>>>>> /scratch/1/users/jitse/work/c/eigen/eigenfoo) >>>>>>>>>> by 0x8048AF5: main (in /scratch/1/users/jitse/work/c/eigen/eigenfoo) >>>>>>>>>> >>>>>>>>>> and the same error with the same stack trace a bit later, at 0x8048F2A. >>>>>>>>>> >>>>>>>>>> The result of the program is also wrong: it should print status = 1, but >>>>>>>>>> it >>>>>>>>>> says status = 0. >>>>>>>>>> >>>>>>>>>> The error goes away when compiling with -fno-strict-aliasing. >>>>>>>>>> I tried compiling with -Wstrict-aliasing=2 but that does not produce any >>>>>>>>>> warnings. >>>>>>>>>> >>>>>>>>>> Over to the gurus! >>>>>>>>>> >>>>>>>>>> Cheers, >>>>>>>>>> Jitse >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >>> >>> >> >> >> >

**References**:**[eigen] any remaining issues blocking beta1, speak up!***From:*Benoit Jacob

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Jitse Niesen

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Gael Guennebaud

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Benoit Jacob

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Gael Guennebaud

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Benoit Jacob

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Benoit Jacob

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Benoit Jacob

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Gael Guennebaud

**Re: [eigen] any remaining issues blocking beta1, speak up!***From:*Benoit Jacob

**Messages sorted by:**[ date | thread ]- Prev by Date:
**Re: [eigen] Re: Eigen beta test errors** - Next by Date:
**Re: [eigen] Re: Eigen beta test errors** - Previous by thread:
**Re: [eigen] any remaining issues blocking beta1, speak up!** - Next by thread:
**[eigen] again a unit test precision question**

Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |