4 ms·
Yes, I've done exactly this with my constraint solver ( https://github.com/minion/minion https://github.com/minion/minion ). Famous last words, almost all bugs
by CJefferson 2y ago
Yes, I've done exactly this with my constraint solver ( https://github.com/minion/minion https://github.com/minion/minion ). Famous last words, almost all bugs that have been reported have been repeatable with 6 variables of domain size at most 6 (maybe even less).
The only exceptions are cases where integer overflow occurs, and those really need seperate tests. I'm mostly handling that by putting fairly conservative bounds on maximum integer values, and asserting if those are ever violated, because (particularly as academic software), an assertion where your solve might work but is undertested is (in my mind) infinitely better than a wrong answer.
- hansvm 2y agoWhat sorts of code normally causes integer overflows in minion? I have to be super cautious of float overflows in most of my code, but usually with integers I'm implementing a bitmask or a 64-bit counter or something similarly not prone to such problems.
- CJefferson 2y agoJust boring old arithmetic, it's quite common for people to write maths problems which end up overflowing a 64-bit integer. Here's one I remember someone writing: There is a 'numbers game' on the UK show countdown, where you are given a series of 6 numbers, and need to add, multiply, subtract and divide them to make a target. They were considering generalisations. They wanted to allow '500' as an input number, and also allow 8 numbers. While their targets were numbers less than 10,000, 500^8 overflows a 64-bit integer, and we often want to find things like upper and lower bounds early on.