@Discord guys: What is modern chess programming about?

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

Viz
Posts: 108
Joined: Tue Apr 09, 2024 6:24 am
Full name: Michael Chaly

Re: @Discord guys: What is modern chess programming about?

Post by Viz »

chrisw wrote: Mon Apr 29, 2024 4:00 pm
Viz wrote: Mon Apr 29, 2024 3:54 pm Also note that despite me coding correction history looking at seer code implementation of it in stockfish that eventually passed looks nothing like seers or literally any other engine in details - normal stats instead of running average, filtering out positions with captures, using it as a quadratic function and not linear, etc.
What is correction history?
It's an idea originated by author of Caissa engine, more or less collects history for pawn structures about how actual search results were different from static evaluations and in further searches for this pawn structure adds an adjustment to static evaluation based on this history.
Ofc since there are too many pawn strtuctures instead of actual bitboard you use some last bits of pawn hash key for it.
https://github.com/Vizvezdenec/Stockfis ... 1d21070cd8
https://github.com/Vizvezdenec/Stockfis ... ad15b7a694
chrisw
Posts: 4359
Joined: Tue Apr 03, 2012 4:28 pm

Re: @Discord guys: What is modern chess programming about?

Post by chrisw »

Viz wrote: Mon Apr 29, 2024 4:15 pm
chrisw wrote: Mon Apr 29, 2024 4:00 pm
Viz wrote: Mon Apr 29, 2024 3:54 pm Also note that despite me coding correction history looking at seer code implementation of it in stockfish that eventually passed looks nothing like seers or literally any other engine in details - normal stats instead of running average, filtering out positions with captures, using it as a quadratic function and not linear, etc.
What is correction history?
It's an idea originated by author of Caissa engine, more or less collects history for pawn structures about how actual search results were different from static evaluations and in further searches for this pawn structure adds an adjustment to static evaluation based on this history.
Ofc since there are too many pawn strtuctures instead of actual bitboard you use some last bits of pawn hash key for it.
https://github.com/Vizvezdenec/Stockfis ... 1d21070cd8
https://github.com/Vizvezdenec/Stockfis ... ad15b7a694
Ah, ok, thanks, that sounds useful.
chrisw
Posts: 4359
Joined: Tue Apr 03, 2012 4:28 pm

Re: @Discord guys: What is modern chess programming about?

Post by chrisw »

connor_mcmonigle wrote: Mon Apr 29, 2024 3:39 pm
chrisw wrote: Mon Apr 29, 2024 2:27 pm
connor_mcmonigle wrote: Sun Apr 28, 2024 1:41 am It's entirely unclear why a search idea being unrelated to chess somehow diminishes said idea. Most search ideas have little to do with chess and generalize quite well to other chess-like games.
Of course chess search ideas generalise to Chinese Chess and Japanese Chess. Apart from drop pieces the games are more or less identical but with specifically minor different move maps. Chess search ideas are mostly specific to chess (material, mobility, alternating play). Anything pruning/extending against alpha or beta (which is a major part of search) involves material concept and check king safety concept, including null move and probcut. SEE is very chess specific. Hanging pieces/forks/new attacks/mate threats likewise. LMR rules contain material elements and check/activity elements. Historical statistics in search are dependent on things not changing too much if a few different moves get played and that is going to be a function of the game type. Chess succumbs, but just try it with Othello.
Transfer to other two player games is problematic, and transfer to other chess forms requires rewrites of the testing criteria.
Certainly we used and thought about chess when developing all this stuff. Hash and minimax (ab) algorithm don’t require chess thoughts and calculations, but the other stuff surely does.

Anyway, we’re not trying to diminish ideas, but it’s worth pointing out that the original chess based ideas were based on human thinking power, while many of the 0.5 Elo “ideas” and just the result of getting lucky on the occasional random 50 monkey shot. Actually the why of any one working to 0.5 Elo is not even human explainable. It just luckily does, based on a trillion other interactions.
So there’s the difference, you either think the idea up, based on chess and knowledge, in which case the change is explicable, or you get lucky with a random monkey strike. Increasingly the latter.
That's why I said chess-like games. However, late move pruning, late move reductions, static null move pruning, singular extensions, etc are not specific to chess - they're far more abstract and even applicable to relatively "non-chess-like" two player board games such as ataxx. The most impactful ideas in chess engine programming are those that are entirely decoupled from chess.

Developers are not a monolith, though I agree that the "0.5 Elo monkey patches" you refer to are a real phenomenon. For example, here's a recent Seer patch where I use an online learning scheme to dynamically adjust the evaluation based on a semantic hash of the internal NN representation of the position state (where the dynamic adjustment is updated based on search results):

https://github.com/connormcmonigle/seer ... 9ba4f5ac1f

This passed on the first try, following a fair bit of qualitative analysis of different semantic hashing schemes. I'd argue this has nothing to do with chess.
As bare abstracted concepts, late move pruning, late move reductions, static null move pruning, singular extensions could be applied to some other games, though not all. NMP depends on NM eval being almost always less than eval, which happens to be true mostly in chess but not in other games (Othello eg). LMP, LMR both require a move sort that more or less works (and chess move sort works heavily because chess knowledge). All require chess specific position factors to be calculated and plugged into the formula. So, you have to know your chess to be able to theorise up the hand crafted algorithms which are applicable.
Why are we arguing about this, btw?
connor_mcmonigle
Posts: 543
Joined: Sun Sep 06, 2020 4:40 am
Full name: Connor McMonigle

Re: @Discord guys: What is modern chess programming about?

Post by connor_mcmonigle »

chrisw wrote: Mon Apr 29, 2024 11:24 pm ...
Why are we arguing about this, btw?
I possibly misinterpreted what you were saying. I interpreted your claim as (paraphrasing):

"Modern engine dev is bad because it has nothing to do with chess. Modern engine developers just try random monkey patches"

I disagree with this and as a "modern engine developer" take some offense at this notion. Firstly, the majority of search heuristics are pretty disconnected from chess and, additionally, most novel search heuristics are grounded in actual reasoning about the search tree. I provided a recent counterexample of a novel search heuristic I implemented in Seer, building on an earlier idea contributed by the author of Caissa (which I hope we agree does not constitute as a "monkey patch").
chrisw
Posts: 4359
Joined: Tue Apr 03, 2012 4:28 pm

Re: @Discord guys: What is modern chess programming about?

Post by chrisw »

connor_mcmonigle wrote: Mon Apr 29, 2024 11:55 pm
chrisw wrote: Mon Apr 29, 2024 11:24 pm ...
Why are we arguing about this, btw?
I possibly misinterpreted what you were saying. I interpreted your claim as (paraphrasing):

"Modern engine dev is bad because it has nothing to do with chess. Modern engine developers just try random monkey patches"

I disagree with this and as a "modern engine developer" take some offense at this notion. Firstly, the majority of search heuristics are pretty disconnected from chess and, additionally, most novel search heuristics are grounded in actual reasoning about the search tree. I provided a recent counterexample of a novel search heuristic I implemented in Seer, building on an earlier idea contributed by the author of Caissa (which I hope we agree does not constitute as a "monkey patch").
Yes, you did misinterpret. Unless one has to be Gen-Z, I’m both “modern chess programmer” and “historical chess programmer”, btw. Paraphrasing is always red flag territory. I’ll avoid it.

Search heuristics grounded in reasoning, chess or otherwise are neither good nor bad, they just are. Decades ago that was generally the thinking and it took the low lying fruit. Tendency (note use of qualifying word) nowadays is more to throw some random idea in and maybe it works (most fail and Elo gain is down near 0.5). Neither good nor bad, but I don’t find doing it very satisfying.
Your pawn hash idea I already congratulated elsewhere, it’s a chess idea (imo) because it depends on similar position structures behaving at least a bit parallel, plus the static nature of pawns.
Viz
Posts: 108
Joined: Tue Apr 09, 2024 6:24 am
Full name: Michael Chaly

Re: @Discord guys: What is modern chess programming about?

Post by Viz »

It's actually surprising how much you can get with slowly grinding it with +0.5 elo patches.
During stockfish 10 days (long time before NNUE) we had average passed being worth this exact 0.5 elo, so sf10->11 was like 100 passers (with elo gaining bounds) for 50 elo.
Sure there are some groundbreaking concepts that shift thigs by a lot but in general it's collecting really high hanging fruits that are also really small. Well, this is life.
Also for me it increases satisfaction when smth actually passed, you kinda feel like you worked for it.