michiguel wrote:bob wrote:michiguel wrote:bob wrote:Rebel wrote:mvk wrote:bob wrote:One more note. This "you guys searched the wrong version" is a red-herring. Every new version of my chess program, dating ALL the way back to 1968, including major versions, minor versions, or rewrites, had MAJOR parts of the earlier version included. You do not rewrite 30-40-50K lines of code for each version..
VR is not Hyatt. How often do you make that mistake.
My major versions (five times: v0, v1, v2, v3 and mscp) were always 100% rewrites from scratch, no code reuse between them. I'm not the only one.
Reminds me of a Tord quote, something like, you can never rewrite your engine from scratch too many times.
Define "your engine". Only a complete dunderhead would rewrite everything in the engine from scratch. That would imply you did NOTHING right in any of the previous versions...
unlikely in the extreme...
Komodo was rewritten from total scratch (when it was already a top 2).
Glaurung 2.0 was a total rewrite (which lead to Stockfish).
So, the top two engines today, were rewritten from scratch at one point.
And those are not the only two examples.
Miguel
Did you compare first stockfish source to Glaurung? I am not just talking bare search and evaluation when talking about total rewrite. I am talking about EVERYTHING. I'm not going to debate Komodo with no source code to speak of. But we can certainly compare early stockfish to later Glaurungs. I still have 2.2 in my old backups for cluster testing...
You might be surprised what you find when you look. Certainly stockfish 1.8 was nowhere near a complete rewrite. First file I looked at (move.cpp) is almost a perfect match between the two for the first few dozen lines of code, all I felt like looking at...
Please read what I wrote. Glaurung 2.0 is a total rewrite from the previous version of Glaurung.
Don rewrote Komodo. That was Don told said, and I have no reason to doubt him.
Miguel
2 things. Glaurung 1 -> glaurung 2 would be perfectly believable as a rewrite. However comparing 1 to 2 does not suggest g1 was thrown out. It shows g2 was simply g1 refactored and cleaned up and reorganized as much as anything. For example, glaurung22 has a procedure "think" in search.cpp, where it is a separate file think.cpp in glaurung11. That's not what I would call a "complete rewrite". I don't believe anybody does that.
Second, "rewrite" and "write from scratch" are not the same thing. Don posted that he spent a lot of time rewriting Komodo. He did NOT say that he threw everything out and started over. I did 6 completely different versions of Cray Blitz. Starting selective and ending up with something similar to what is done today. And some of those were hugely different. Version 4 was 120K lines of fortran. Version 5, a chess 4.x-like redesign was about 10K lines. But it carried over a lot of code from version 4, including most of the evaluation, just a different search approach. Starting over is a genuine waste of time, and very few do it more than once. Nobody does it a bunch of times unless they just know absolutely nothing about programming and also do not learn from each mistake.
In any case, there are certainly chunks of code from glaurung1 still there in stockfish. No surprise, there are still chunks of code from Crafty version 1 that can be found in version 25.0...
Mark Watkins found eval pieces that matched between R1.0beta and R2.3.2a... Which is not surprising. So please stop with this "not everybody does it that way." So far you haven't given one example of a _complete_ rewrite where nothing is carried from version to version N+1. It just doesn't make good sense to do such, considering all the time that would be lost.
Note: I'll bet that a bit of poking could find some glaurung1 code that is still in stockfish today...