[Push] RANDOM-SEED parameter

Lee Spector lspector at hampshire.edu
Wed Jun 30 10:49:11 EDT 2010


This has always been murky and should indeed be fixed/clarified in some way in various places.

You are basically right about the behavior of the Common Lisp version -- it only actually seeds the random number generator when setting up (or configuring) an interpreter. There's an ENV instruction but that just sets the value of a global variable *RANDOM-SEED* without actually using it to seed the RNG. That's a bug, which I don't think ever bit me because I don't think I ever tried to set the seed this way. I think the right behavior would be to re-seed immediately when executing the ENV instruction.

FWIW not only has RNG seeding been poorly standardized/documented (and doing it *really* right might get complex, since different platforms have different default RNGs, etc.) but also in general ENV instructions are another point of wide divergence among implementations. For example I haven't implemented any of them in Clojush and didn't even think to mention this in the docs! :-(. To me this underlines the need for an overhaul of the docs from the ground up, in a way that somehow sensibly deals with the inevitable differences between implementations... a project that Tom Helmuth is beginning to scope out.

I've made a note to fix this particular bug in push3.lisp.

 -Lee


On Jun 29, 2010, at 1:08 PM, PerPlex Ed wrote:

> Is the random seed updated only when the interpreter is setup?
> 
> As far as I understand this is what the lisp Push interpreter does.
> 
> When I first wrote my implementation, I followed only the specification. When describing the initialization files, it lists all possible parameters including RANDOM-SEED.
> 
> Then it says that that an alternative method of setting those parameters is running initialization code, specifically the ENV instructions.
> 
> To me that means that there is an Env.RandomSeed instruction.
> On the other hand (random::seed-state *RANDOM-SEED* *RANDOM-SEED*) is called only in "configure-push-from-file" and "complete-push-pre-configuration". In any case, even if you implemented an Env.RandomSeed instruction it seems that it won't have any effect at runtime.
> 
> Could you clarify this?
> 
> Details like this one can make a significant difference when implementing Push from scratch. Thanks.
> 
> PerPlexEd.
> 
> 
> 
> 
> _______________________________________________
> Push mailing list
> Push at lists.hampshire.edu
> https://lists.hampshire.edu/mailman/listinfo/push

--
Lee Spector, Professor of Computer Science
School of Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspector at hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438

Check out Genetic Programming and Evolvable Machines:
http://www.springer.com/10710 - http://gpemjournal.blogspot.com/



More information about the Push mailing list