[dynamic_bitset] CW8 regression, a plea for help!

In running my set of _release_ mode tests I ran into a regression for dynamic_bitset, you can see it here (the RSI results): http://www.meta-comm.com/engineering/boost-regression/developer/dynamic_bits... Boost regression: dynamic_bitset/CVS-HEAD This is a new regression... I just also ran the tests for the dynamic_bitset in 1.31.0, and 1.30.2 (this is the version I currently use in my production code) -- And both of those pass. I'm asking for help in tracking this down. I'm not familiar at all with the dynamic_bitset code so some direction as to likely causes of the problems, or where to start looking are much appreciated. For now I'll just be single stepping through the code, oh fun :-( -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

I'm asking for help in tracking this down. I'm not familiar at all with the dynamic_bitset code so some direction as to likely causes of the problems, or where to start looking are much appreciated. For now I'll just be single stepping through the code, oh fun :-(
Just small note: why do you use BOOST_CHECK instead of BOOST_CHECK_EQUAL? It may clarify some of the errors Regards, Gennadiy.

Gennadiy Rozental wrote:
I'm asking for help in tracking this down. I'm not familiar at all with the dynamic_bitset code so some direction as to likely causes of the problems, or where to start looking are much appreciated. For now I'll just be single stepping through the code, oh fun :-(
Just small note: why do you use BOOST_CHECK instead of BOOST_CHECK_EQUAL? It may clarify some of the errors
I think Gennaro uses it because it's simpler, i.e. he's using test/minimal.hpp. Changing it doesn't help anyway... I've narrowed the error down to a curious situation: When the block type is "unsigned long long" only this sequence passes: Bitset b(lhs); BOOST_CHECK(b.size() == 0); b.resize(2); b.reset(1); b.set(0); BOOST_CHECK(b.size() == 2); BOOST_CHECK(b.test(0) == true); BOOST_CHECK(b.test(1) == false); But this one fails: Bitset b(lhs); BOOST_CHECK(b.size() == 0); b.resize(2); b.set(0); b.reset(1); //NOTE, the different order! BOOST_CHECK(b.size() == 2); BOOST_CHECK(b.test(0) == true); //FAILS! BOOST_CHECK(b.test(1) == false); WHich means the reset() somehow generates bad code when optimized. I've tried manipulating the reset() in various ways to see if anything makes a difference, to the point of complete manual inlining, and nothing makes a difference. Clues anyone?? PS. For those that don't know, I didn't until I looked, dyn_bitset stores the bits in a std::vector<block_type>, and does the usual bit masking manipulations. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Rene Rivera wrote:
But this one fails:
Bitset b(lhs); BOOST_CHECK(b.size() == 0); b.resize(2); b.set(0); b.reset(1); //NOTE, the different order! BOOST_CHECK(b.size() == 2); BOOST_CHECK(b.test(0) == true); //FAILS! BOOST_CHECK(b.test(1) == false);
PS. I've found a workaround which fixes the problem :-) For the curious... reset() is written as: v &= ~mask; The workaround is to do: v |= mask; v ^= mask; Instead for CW8. On to the next problem. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Hi, There is one problem with cw8 in the string algo lib. Can you please have a look? http://tinyurl.com/4qe8k Thanks a lot. Pavol. On Fri, Aug 06, 2004 at 01:05:05AM -0500, Rene Rivera wrote:
Rene Rivera wrote:
But this one fails:
Bitset b(lhs); BOOST_CHECK(b.size() == 0); b.resize(2); b.set(0); b.reset(1); //NOTE, the different order! BOOST_CHECK(b.size() == 2); BOOST_CHECK(b.test(0) == true); //FAILS! BOOST_CHECK(b.test(1) == false);
PS. I've found a workaround which fixes the problem :-)
For the curious... reset() is written as:
v &= ~mask;
The workaround is to do:
v |= mask; v ^= mask;
Instead for CW8.
On to the next problem.
-- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Pavol Droba wrote:
There is one problem with cw8 in the string algo lib. Can you please have a look?
I've already been looking at it for a few hours, while I waited for the dyn_bitset tests to run. It's easy enough to fix, as long as you are willing to *not* use BOOST_PP ;-) The problem is the crappy preprocessor in CW8. Not sure if I'll figure out a workaround for this one. How flexible are you to changes to the "replace_test.cpp" file? -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

On Fri, Aug 06, 2004 at 02:26:03AM -0500, Rene Rivera wrote:
Pavol Droba wrote:
There is one problem with cw8 in the string algo lib. Can you please have a look?
I've already been looking at it for a few hours, while I waited for the dyn_bitset tests to run. It's easy enough to fix, as long as you are willing to *not* use BOOST_PP ;-)
The problem is the crappy preprocessor in CW8. Not sure if I'll figure out a workaround for this one. How flexible are you to changes to the "replace_test.cpp" file?
BOOST_PP helps me a lot in here, however it is not crusial for the library. So if there is no other way to handle this I can rewrite the file to be without the preprocessor. Are you sure, that there is no other way around? Regards, Pavol.

Pavol Droba wrote:
BOOST_PP helps me a lot in here, however it is not crusial for the library. So if there is no other way to handle this I can rewrite the file to be without the preprocessor.
It does help you.. It's saving a lot of typing in this case.
Are you sure, that there is no other way around?
I'm about to try a last one... which is to replace the BOOST_PP_SEQ_ENUM, with some form of BOOST_PP_ARRAY, and possible just a custom ARGn set of macros. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

Rene Rivera wrote:
Pavol Droba wrote:
BOOST_PP helps me a lot in here, however it is not crusial for the library. So if there is no other way to handle this I can rewrite the file to be without the preprocessor.
It does help you.. It's saving a lot of typing in this case.
Are you sure, that there is no other way around?
I'm about to try a last one... which is to replace the BOOST_PP_SEQ_ENUM, with some form of BOOST_PP_ARRAY, and possible just a custom ARGn set of macros.
OK, figured out a fix, with slightly more typing at each test line, but it eliminates the use of BOOST_PP without eliminating the time saving TEST* macro. I checked in the changes, and I'm running a full set of tests now. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

On Fri, Aug 06, 2004 at 11:09:49AM -0500, Rene Rivera wrote:
Rene Rivera wrote:
Pavol Droba wrote:
BOOST_PP helps me a lot in here, however it is not crusial for the library. So if there is no other way to handle this I can rewrite the file to be without the preprocessor.
It does help you.. It's saving a lot of typing in this case.
Are you sure, that there is no other way around?
I'm about to try a last one... which is to replace the BOOST_PP_SEQ_ENUM, with some form of BOOST_PP_ARRAY, and possible just a custom ARGn set of macros.
OK, figured out a fix, with slightly more typing at each test line, but it eliminates the use of BOOST_PP without eliminating the time saving TEST* macro.
I checked in the changes, and I'm running a full set of tests now.
Great, I was thinking about a similar approach, just haven't time to look at it more deeply. Anyway, thanks for help. Regards, Pavol.
participants (3)
-
Gennadiy Rozental
-
Pavol Droba
-
Rene Rivera