Freesteel Blog » Boxset bug

Boxset bug

Wednesday, December 21st, 2005 at 11:54 am Written by:

A not so fun long evening getting pressure from Denmark about why the adaptive roughing is so much slower on their examples than it was last September.

I’ve done a lot of coding in the intervening period, so it could be anything. Rene started doing a binary search of the different versions, pulling them out of the SVN repository from different dates, compiling and running them, and isolated the point at being sometime between September 30 and October 10, when a job which used to complete in 6 minutes suddely went up to 17 minutes.

I think there’s something useful here about regression testing. Should we do it cross-versions, not only cross-examples? Rather than throw a whole set of archived examples at the newest version, we should throw the newest example at a whole set of archived executable versions.

Versions of the software are harder to archive because by its very nature its interface can change. Although, if you have lots of examples to work against, this is not so likely.

The bug in the end turned out to be in the following two lines:

boxesxrg = boxesxrg.Inflate(15.0);
boxesyrg = boxesxrg.Inflate(15.0);

That’s the danger of using cut-and-paste when writing your code. The implementation of the algorithm is robust enough that it gave out exactly the same result, only taking more time over it because it was falling outside the XY region of optimization.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>