Last I heard, Crafty was able to play as many games as you want, not mysteriously getting weaker as the games are played. So it does what I wanted it to do. The log-file issue is beyond tiny, although I have fixed it in the current code.Zach Wegner wrote:Perhaps you should re-read the first post in this thread then.bob wrote:Which is my point. During development, I try to use my time as efficiently as possible, because it is a limited resource. Remembering to restore every value to its starting point requires effort that can be used elsewhere. And I have elected to do so. I'm not aware of any issues in Crafty with the "new" command. I simply pointed out that _I_ prefer to do all testing of _all_ engines without depending on this so that I don't introduce a little unexpected bias to the results.
Depends. If this application runs one time and dies, I will initialize the data in the most resource-friendly way. If I initialize at run-time, it takes execution time to deal with this. If I initialize at compile time, it takes way more disk space and thus may take more time to load on a slow disk machine. I once had a version of Crafty that didn't need to initialize the EGTB decompression indices, which is what takes so very long. I just hard-coded those. But ran into trouble when not everyone had _every_ file for reasons of their own choosing, and found it easier to continue doing this at run-time since the egtb file set can be changed at any point in time.Sure there are. Say your board representation is based on an array int board[64]; (ignore the fact that this is bad design in itself). Do you want to instantiate it at compile time, or have a function to set up the initial position? If you do the former, then you're going to need to duplicate the data to do the latter. Much better is to simply call said function to initialize it in the first place.Idea occurs in no programming book I own, and shouldn't. There are reasons for run-time initialization vs compile-time initialization. And they don't have anything to do with whether the value is modified during execution or not.
For chess, if I were going to play one game, I would initialize the board at compile time. If I were going to play more than one game, I would initialize at run time. I initialized read-only data in Crafty at compile-time for some things, at run-time for others.
So the decision has nothing to do with whether or not the data is modified, it is simply which way of initialization is the easiest or most efficient way of doing it.
Likewise, if you have a variable, say "use_log", that should persist across games, you probably don't want to initialize it in the same function you use to start a game. Set a default either at compile time or at startup and don't touch it until the user says so. Doing otherwise is simply a bug.