krita random_generator failure

Matthew Woehlke mw_triad at users.sourceforge.net
Wed Apr 1 23:23:47 CEST 2009


Matthew Woehlke wrote:
> Cyrille Berger wrote:
>> On Tue, Mar 31, 2009, Matthew Woehlke wrote:
>>> Since producing the same number twice in a row is no less random than 
>>> any other number, 
>> True, the test can be made to check it doesn't happen much. If it only
>> happen once or twice out of a million, then it should be ok.
> 
> Yes, that's probably better. Oddly enough it seems to happen on every 
> seed I've tried (not many, admittedly) :-(, but not in the same place.
> 
> With seed==10000 I see 7 occurrences (with both current svn and your 
> previous variation; I think in the same spots, even, so it seems my 
> latest change didn't have an effect either way on this).

Actually... there's something seriously wrong with the test (or the 
build thereof). My best guess it it's pulling the installed library and 
not the built one. I can change randomAt() to explicitly return 0, and I 
get the same test results!

(On a related note, it's much slower than it needs to be, the 
"neighborhood" iteration should be over [0,3), not [-2,3); otherwise you 
end up testing most pairs twice.)

-- 
Matthew
Please do not quote my e-mail address unobfuscated in message bodies.
-- 
"Lost a planet, Obi Wan has? How embarrassing..."
   -- Yoda (Star Wars II: Attack of the Clones)



More information about the kimageshop mailing list