Ethics in chess programming

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ethics in chess programming

Post by hgm »

dangi12012 wrote: Thu Mar 10, 2022 11:32 amWell there was also giraffe. But that turned into Alpha zero so you might be right.
You would have to hand wire your processor too and write your own compiler with that puritan approach.
I did that, in the eighties. My program was running on a 6502-based computer that I built inside a matchbox. Except that I wrote an assembler rather than a compiler, as the program was written in assemby code. I might even do it again: I still have this construction kit for the Gigatron computer lying on the shelf, which implements a processor purely from TTL. And I already designed some changes to its instruction set to make it more suitable for chess programming. I hope to turn it into a dedicated chess machine.

But I was not suggesting there would be anything unethical about standing on the shoulders of giants. Just that it not very original.
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Ethics in chess programming

Post by hgm »

Tearth wrote: Thu Mar 10, 2022 11:18 am I have a pretty simple rule, I just don't look at sources of other engines at all (at least these parts related to search or evaluation, others should be ok) - I accept reading about general ideas, but the implementation itself is always mine. Not the most effective in Elo terms, but feels the most fun.
This is indeed a nice way to do it. But my point was that the number of ideas that you have to include in an engine to get it significantly above 2000 Elo, and would probably never think of yourself, is so large that there is very little originality at that level in most engines. They are just re-implementations of the same standard algorithm.
eligolf
Posts: 114
Joined: Sat Nov 14, 2020 12:49 pm
Full name: Elias Nilsson

Re: Ethics in chess programming

Post by eligolf »

Very interesting discussions! Basically to sum it up, as long as I don't break any copyright laws I should be fine legally. I understand the thing about not re-inventing the wheel which is fine. There is no point in creating everything youself, then you would basically have to invent the universe yourself if you go far enough :P

I guess it is similar to my music making. You take some ideas from here and there and make something original out of it. Which is summed up nicely by Pablo Picasso:
The bad artists imitate, the great artists steal.
User avatar
lithander
Posts: 915
Joined: Sun Dec 27, 2020 2:40 am
Location: Bremen, Germany
Full name: Thomas Jahn

Re: Ethics in chess programming

Post by lithander »

Tearth wrote: Thu Mar 10, 2022 11:18 am I have a pretty simple rule, I just don't look at sources of other engines at all (at least these parts related to search or evaluation, others should be ok) - I accept reading about general ideas, but the implementation itself is always mine. Not the most effective in Elo terms, but feels the most fun.
I do it the same way. But this is only possible for me because of the wealth of information in this forum and the very well curated chessprogramming wiki. My personal goal is to extend my toolbox of algorithms and programming techniques and the chess programming domain allows me to do that in a very fun way. Implementing a technique/algorithm from scratch *after* reading about it on the wiki or forum and then demonstrating the expected Elo gain is how I can prove to myself that I have now understood the concept well enough. In the university you would have had exams but climbing the rankings is of course much more fun.

I would take code that I don't understand into my engine just for the purpose of making it stronger, than it would not align with my primary goal. But that doesn't make it unethical for others to do if the license allows it.
Rebel wrote: Thu Mar 10, 2022 9:53 am Since 10 year I maintain the Programmer code of Honor, 70 engine authors have subscribed to it.

Check out if it is something for you.

http://rebel13.nl/download/programmer-c ... honor.html
That's a cool idea! I made a submission.
Minimal Chess (simple, open source, C#) - Youtube & Github
Leorik (competitive, in active development, C#) - Github & Lichess
Henk
Posts: 7251
Joined: Mon May 27, 2013 10:31 am

Re: Ethics in chess programming

Post by Henk »

Some get mad when you tell them they are not original. Most are totally blind to ethics. They only have some childish personal values.
Uri Blass
Posts: 10793
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Ethics in chess programming

Post by Uri Blass »

hgm wrote: Thu Mar 10, 2022 10:53 am Well, it is clear that virtually no engine with a rating over 2000 can be considered original works in the sense that the author could have written it without knowing that programs to play chess already exist. He would likely not get beyond negamax, and it would already be questionable whether he would discover null-move pruning. (AlphaZero should count as an exception to this.)

I guess an accurate statement would be that all strong engines are often independently written) implementations of an algorithm that is for 99% the same, and are only ~1% original at the algorithmic level.
I agree that virtually no engine with a rating over 2000 can be considered original work in that sense but not because it is so clear that
the author could not do it by himself but because the author usually did not even try.

I think that the natural thinking if you do not know about older engines is basically using some estimate of probability.
I see no logical reason to use depth as the number that you increase in every iteration and for me it is more natural is to use probability as something that you reduce in every iteration when you stop going forward in the search when the probability is below the parameter of the iteration.

The only reason that I did not start engine in that way is that I am not a good programmer and I saw no example of chess engine that is written in this way but I guess some good programmer should have no problem to use the idea that I mention and get something that is at least stronger than alpha beta engine with no pruning and no extensions that seem to be a stupid idea even if you know nothing.
Mike Sherwin
Posts: 965
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Ethics in chess programming

Post by Mike Sherwin »

Uri Blass wrote: Thu Mar 10, 2022 4:21 pm
hgm wrote: Thu Mar 10, 2022 10:53 am Well, it is clear that virtually no engine with a rating over 2000 can be considered original works in the sense that the author could have written it without knowing that programs to play chess already exist. He would likely not get beyond negamax, and it would already be questionable whether he would discover null-move pruning. (AlphaZero should count as an exception to this.)

I guess an accurate statement would be that all strong engines are often independently written) implementations of an algorithm that is for 99% the same, and are only ~1% original at the algorithmic level.
I agree that virtually no engine with a rating over 2000 can be considered original work in that sense but not because it is so clear that
the author could not do it by himself but because the author usually did not even try.

I think that the natural thinking if you do not know about older engines is basically using some estimate of probability.
I see no logical reason to use depth as the number that you increase in every iteration and for me it is more natural is to use probability as something that you reduce in every iteration when you stop going forward in the search when the probability is below the parameter of the iteration.

The only reason that I did not start engine in that way is that I am not a good programmer and I saw no example of chess engine that is written in this way but I guess some good programmer should have no problem to use the idea that I mention and get something that is at least stronger than alpha beta engine with no pruning and no extensions that seem to be a stupid idea even if you know nothing.
Probability controlled iterative depth is a really interesting idea. One of the ways probability can be set for each move from each iteration is to collect statistics from the current iteration like the ratio of enemy checks to friendly checks for each root move. And the ratio of mates. Even just beta cuts. And any other meaningful stat that can be thought of. But I think that I would use the word confidence and have a confidence level for each side. If a position is bad that side reduces the confidence level for its side and decides to continue or just return a low score. I'll have to think more about it when I get that far along in writing my new engine.
eligolf
Posts: 114
Joined: Sat Nov 14, 2020 12:49 pm
Full name: Elias Nilsson

Re: Ethics in chess programming

Post by eligolf »

Uri Blass wrote: Thu Mar 10, 2022 4:21 pm
I think that the natural thinking if you do not know about older engines is basically using some estimate of probability.
I see no logical reason to use depth as the number that you increase in every iteration and for me it is more natural is to use probability as something that you reduce in every iteration when you stop going forward in the search when the probability is below the parameter of the iteration.
Probabilities is what engines like Alpha Zero or other neural networks use if I am not mistaken. Maybe you are thinking of some other concept to use probabilities on though :)

I think it is natural to use depth to iterate over, that is the way I am thinking myself when I am the chessboard. I usually pick 2-3 top candidate moves and go through each one of them as deep as I can, and in each depth thinking of the most logical responses. Which is basically what alpha/beta with different pruning techniques use in some way or another.
Mike Sherwin
Posts: 965
Joined: Fri Aug 21, 2020 1:25 am
Location: Planet Earth, Sol system
Full name: Michael J Sherwin

Re: Ethics in chess programming

Post by Mike Sherwin »

eligolf wrote: Thu Mar 10, 2022 6:18 pm
Uri Blass wrote: Thu Mar 10, 2022 4:21 pm
I think that the natural thinking if you do not know about older engines is basically using some estimate of probability.
I see no logical reason to use depth as the number that you increase in every iteration and for me it is more natural is to use probability as something that you reduce in every iteration when you stop going forward in the search when the probability is below the parameter of the iteration.
Probabilities is what engines like Alpha Zero or other neural networks use if I am not mistaken. Maybe you are thinking of some other concept to use probabilities on though :)

I think it is natural to use depth to iterate over, that is the way I am thinking myself when I am the chessboard. I usually pick 2-3 top candidate moves and go through each one of them as deep as I can, and in each depth thinking of the most logical responses. Which is basically what alpha/beta with different pruning techniques use in some way or another.
That is not at all what Uri is talking about. Uri is thinking to give a probability to each root move. That way each root move with start off searching a different depth. The root move with the highest probability will be searched first and as the probability falls or rises controls the height any particular branch in the search will reach. I think it is a novel idea that is worth investigating.
eligolf
Posts: 114
Joined: Sat Nov 14, 2020 12:49 pm
Full name: Elias Nilsson

Re: Ethics in chess programming

Post by eligolf »

Mike Sherwin wrote: Thu Mar 10, 2022 7:55 pm
That is not at all what Uri is talking about. Uri is thinking to give a probability to each root move. That way each root move with start off searching a different depth. The root move with the highest probability will be searched first and as the probability falls or rises controls the height any particular branch in the search will reach. I think it is a novel idea that is worth investigating.
My bad :) That do sound interesting and what a human chess player is doing at the board.