New engine: Inanis

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

Tearth
Posts: 68
Joined: Thu Feb 25, 2021 5:12 pm
Location: Poland
Full name: Pawel Osikowski

Re: New engine: Inanis

Post by Tearth »

Thanks to @bastiball I've found a significant issue with my UCI implementation, present in all Inanis versions - while it works in Arena and cutechess-cli without problems, there's at least one incompatible GUI (Banksia) which leads the engine to crash due to incorrect handling "isready" command during a search. I will release a small update in the upcoming days to fix this.
User avatar
algerbrex
Posts: 596
Joined: Sun May 30, 2021 5:03 am
Location: United States
Full name: Christian Dean

Re: New engine: Inanis

Post by algerbrex »

Hi Pawel, I was playing a couple of blitz games between Ianis and Blunder on lichess and I came across an odd move Ianis made. In the following position:

[fen]3K4/2r5/8/8/2k3P1/2n1Q3/8/8 b - - 20 75[/fen]


Ianis played Nd1 and lost on the spot to Qe6+ which wins the rook. This seems like quite a short tactic that can be seen with a very low depth, and Ianis had 2 minutes on the clock plus a five-second bonus, so I'm not sure why it decided on Nd1. I will say towards the end of the game, despite having a huge time advantage, Ianis was playing all of its moves very quickly. Maybe this contributed?

Either way, it seemed like a bug might be behind the strange choice of move, as Ianis was defending the position well before, even though apparently it was still losing. Here's the lichess game: https://lichess.org/2bDqIGl3#153.
User avatar
Guenther
Posts: 4663
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: New engine: Inanis

Post by Guenther »

algerbrex wrote: Sat Aug 13, 2022 11:51 pm Hi Pawel, I was playing a couple of blitz games between Ianis and Blunder on lichess and I came across an odd move Ianis made. In the following position:

[fen]3K4/2r5/8/8/2k3P1/2n1Q3/8/8 b - - 20 75[/fen]


Ianis played Nd1 and lost on the spot to Qe6+ which wins the rook. This seems like quite a short tactic that can be seen with a very low depth
Well even more, as a lot of other moves than Qe6+ also win the Rook on the spot...(every Q check which doesn't blunder the Q)
https://rwbc-chess.de

trollwatch:
Talkchess nowadays is a joke - it is full of trolls/idiots/wafflers/clone lovers/people stuck in the pleistocene > 70% of the posts fall into this category...
Tearth
Posts: 68
Joined: Thu Feb 25, 2021 5:12 pm
Location: Poland
Full name: Pawel Osikowski

Re: New engine: Inanis

Post by Tearth »

This is sadly the side-effect of using Syzygy tablebases - quoting https://www.chessprogramming.org/Syzygy_Bases (it tells about wins, but behaves exactly the same when the engine is losing):
DTZ50 metric may lead the engines to win in much longer and ugly ways, compared with DTM one
The bot on lichess is connected to the 6-men one, and according to them, the position above is already completely lost for black. The implemented logic works like this:
- if Syzygy tells that the position is winning, choose the move with the smallest DTZ
- if Syzygy tells that the position is losing, choose the move with the biggest DTZ, with the hope that the opponent will make some mistake leading to at least a draw

And that's exactly how it worked in the game, as we can see: https://prnt.sc/u9ef5KEzzkEq

I'm not a fan of DTZ metric exactly because of the situations like this, but also I can't just pick another one (with DTM for example, which is much more pretty) because Inanis is written in Rust, and available probing codes are usually in quite complicated C. I had a bit of luck with Syzygy because someone already translated it and released as a library, so for now I'm stuck with this. Maybe in the future I will decide to do something similar with another tablebase, but it's a big project so have to rethink it.
Tearth
Posts: 68
Joined: Thu Feb 25, 2021 5:12 pm
Location: Poland
Full name: Pawel Osikowski

Re: New engine: Inanis

Post by Tearth »

Version: 1.1.1
Homepage and source code: https://github.com/Tearth/Inanis
Download: https://github.com/Tearth/Inanis/releases/tag/v1.1.1
Estimated strength: 2800 Elo (no change)

Changelog:
- Added support for FEN property in PGN parser and "tunerset" command
- Replaced crossbeam package with native scoped threads
- Fixed invalid handling of "isready" UCI command during a search
- Fixed engine crash when trying to search invalid position
- Fixed incorrect version of toolchain used in GitHub Actions

As I said earlier, a small patch with improved compatibility with some GUIs. If it was already working for you, then there won't be any change, but I recommend using this version instead of 1.1.0.
Tearth
Posts: 68
Joined: Thu Feb 25, 2021 5:12 pm
Location: Poland
Full name: Pawel Osikowski

Re: New engine: Inanis

Post by Tearth »

Version: 1.2.0
Homepage and source code: https://github.com/Tearth/Inanis
Download: https://github.com/Tearth/Inanis/releases/tag/v1.2.0
Estimated strength: 2850 Elo

Changelog:
- Added integration with Fathom library to better support Syzygy tablebases
- Added "tbhits" to the search output
- Added "avg_game_phase" parameter to "tunerset" command
- Added "syzygy" and "bindgen" as switchable Cargo features
- Added information about captures, en passants, castles, promotions and checks in perft's output
- Added attackers/defenders cache
- Added killer moves as separate move generator phase
- Removed unnecessary check detection in null move pruning
- Removed redundant abort flag check
- Removed underpromotions in qsearch
- Reduced binary size by removing dependencies and replacing them with custom implementation
- Renamed "test" command to "testset"
- Simplified evaluation by reducing the number of score taperings
- Improved build process
- Improved benchmark output
- Improved allocation of all hashtables, now their size will always be a power of 2 for better performance
- Improved king safety evaluation by taking a number of attacked adjacent fields more serious
- Improved overall performance by a lot of minor refactors and adjustments
- Improved game phase evaluation
- Improved killer heuristic
- Improved history table aging
- Improved reduction formula in null move pruning
- Fixed a few "tunerset" command bugs related to the game phase
- Fixed PGN parser when there were no spaces between dots and moves
- Fixed invalid evaluation of doubled passing pawns
- Fixed invalid cut-offs statistics
- Fixed qsearch failing hard instead of failing soft

This version is focused on improving codebase and contains a lot of smaller optimizations instead of introducing some big changes. It led to a significant speed increase, and with better Syzygy support it should be about 50 Elo stronger than the v1.1.1. As usual, feel free to report bugs or issues if you find any, here or on GitHub page.
Tearth
Posts: 68
Joined: Thu Feb 25, 2021 5:12 pm
Location: Poland
Full name: Pawel Osikowski

Re: New engine: Inanis

Post by Tearth »

Version: 1.3.0
Homepage and source code: https://github.com/Tearth/Inanis
Download: https://github.com/Tearth/Inanis/releases/tag/v1.3.0
Estimated strength: 2900 Elo

Changelog:
- Added search parameters as UCI options (only if the dev feature is present)
- Added gradient descent tuner in place of local search
- Added internal iterative reduction
- Added bishop pair evaluation
- Removed "avg_game_phase" in "tunerset" command
- Removed "magic", "testset", "tuner" and "tunerset" commands from the release builds
- Improved king safety evaluation
- Improved quality of tunerset output
- Improved search parameters
- Improved pawn structure evaluation
- Improved mobility evaluation by excluding squares attacked by enemy pawns
- Fixed invalid position score when both kings are checked
- Fixed incorrect SEE results for sliding pieces
Tearth
Posts: 68
Joined: Thu Feb 25, 2021 5:12 pm
Location: Poland
Full name: Pawel Osikowski

Re: New engine: Inanis

Post by Tearth »

Version: 1.4.0
Homepage and source code: https://github.com/Tearth/Inanis
Download: https://github.com/Tearth/Inanis/releases/tag/v1.4.0
Estimated strength: 2950 Elo

Changelog:
- Added relative PST
- Added check extensions
- Added countermove heuristic
- Added simplified benchmark when "dev" feature is not enabled
- Added history table penalties and reduced aging divisor
- Added non-standard "fen" command to UCI
- Added crash when the best move is invalid (only in dev version)
- Added pawn attacks cache
- Added support for LZCNT instruction
- Improved evaluation parameters by using a new dataset for tuning
- Improved search parameters
- Improved header, now it also includes LLVM version, target, profile and enabled features
- Renamed "tunerset" command to "dataset"
- Merged "bindgen" and "syzygy" features
- Fixed rare bug with invalid moves when a search was aborted
- Fixed crash when ply is larger than the killer table size
- Fixed performance overhead of setting a new position