StefanSalewski / rust-chess

Port of salewski-chess from Nim to Rust
MIT License
0 stars 1 forks source link

Rust chess modules #5

Open tissatussa opened 2 months ago

tissatussa commented 2 months ago

[ this is not real Issue, it just gives some info and poses questions about Rust chess programming ]

hi, i just found Liberty-Chess, see https://github.com/Mathmagician8191/Liberty-Chess , a complete chess application in Rust, with own GUI and even sound .. compiling on Linux went flawless .. it comes with the engine Oxidation (v0.6.2 now) which is UCI about 2200 ELO .. it has good code i guess, and uses a lot of modules, i've never seen that many .. also some specific chess / UCI related stuff .. maybe you'll get inspired or even contact the author for questions ?!

happy programming ! (i might dive into Rust myself, it seems nice..)


~/Compiled/Liberty-Chess-0.6.2$ cargo build --release -p liberty_chess_gui
Updating crates.io index
Updating git repository `https://github.com/Mathmagician8191/array2d`
Downloaded accesskit_winit v0.14.4
Downloaded piper v0.2.1
Downloaded parking_lot_core v0.9.9
Downloaded pico-args v0.5.0
Downloaded ordered-stream v0.2.0
Downloaded png v0.17.13
Downloaded percent-encoding v2.3.1
Downloaded parking v2.2.0
Downloaded ab_glyph_rasterizer v0.1.8
Downloaded accesskit_unix v0.5.2
Downloaded symphonia-utils-xiph v0.5.4
Downloaded waker-fn v1.1.1
Downloaded ab_glyph v0.2.24
Downloaded rctree v0.5.0
Downloaded sha1 v0.10.6
Downloaded simd-adler32 v0.3.7
Downloaded symphonia v0.5.4
Downloaded unicode-bidi-mirroring v0.1.0
Downloaded scoped-tls v1.0.1
Downloaded zvariant_utils v1.0.1
Downloaded xdg-home v1.1.0
Downloaded xcursor v0.3.5
Downloaded wayland-cursor v0.29.5
Downloaded accesskit_consumer v0.15.2
Downloaded accesskit v0.11.2
Downloaded serde_repr v0.1.19
Downloaded roxmltree v0.18.1
Downloaded toml_datetime v0.6.5
Downloaded symphonia-metadata v0.5.4
Downloaded siphasher v0.3.11
Downloaded svgfilters v0.4.0
Downloaded simplecss v0.2.1
Downloaded smithay-clipboard v0.6.6
Downloaded rgb v0.8.37
Downloaded symphonia-format-ogg v0.5.4
Downloaded zvariant_derive v3.15.2
Downloaded web-time v0.2.4
Downloaded wayland-scanner v0.29.5
Downloaded vec_map v0.8.2
Downloaded ahash v0.8.11
Downloaded zbus_names v2.6.1
Downloaded wayland-commons v0.29.5
Downloaded raw-window-handle v0.5.2
Downloaded wayland-sys v0.30.1
Downloaded wayland-sys v0.29.5
Downloaded strict-num v0.1.1
Downloaded svgtypes v0.10.0
Downloaded tracing-attributes v0.1.27
Downloaded unicode-ccc v0.1.2
Downloaded svgtypes v0.9.0
Downloaded socket2 v0.4.10
Downloaded polling v2.8.0
Downloaded xmlparser v0.13.6
Downloaded unicode-vo v0.1.0
Downloaded webbrowser v0.8.15
Downloaded rosvgtree v0.1.0
Downloaded symphonia-codec-vorbis v0.5.4
Downloaded ringbuf v0.3.3
Downloaded tiny-skia-path v0.8.4
Downloaded serde_derive v1.0.197
Downloaded roxmltree v0.19.0
Downloaded unicode-script v0.5.6
Downloaded zbus_macros v3.15.2
Downloaded xml-rs v0.8.20
Downloaded tracing-core v0.1.32
Downloaded slotmap v1.0.7
Downloaded dlib v0.5.2
Downloaded weezl v0.1.8
Downloaded enum-iterator v1.5.0
Downloaded glutin_egl_sys v0.5.1
Downloaded unicode-general-category v0.6.0
Downloaded ron v0.8.1
Downloaded zvariant v3.15.2
Downloaded x11-dl v2.21.0
Downloaded wayland-client v0.29.5
Downloaded glutin-winit v0.3.0
Downloaded url v2.5.0
Downloaded unicode-bidi v0.3.15
Downloaded unicode-normalization v0.1.23
Downloaded wayland-protocols v0.29.5
Downloaded zerocopy v0.7.32
Downloaded zbus v3.15.2
Downloaded atomic-waker v1.1.2
Downloaded ttf-parser v0.20.0
Downloaded x11rb v0.13.0
Downloaded home v0.5.9
Downloaded futures-sink v0.3.30
Downloaded rustix v0.37.27
Downloaded usvg-text-layout v0.29.0
Downloaded resvg v0.29.0
Downloaded winit v0.28.7
Downloaded x11rb-protocol v0.13.0
Downloaded libloading v0.8.3
Downloaded fdeflate v0.3.4
Downloaded event-listener v4.0.3
Downloaded enumn v0.1.13
Downloaded enumflags2 v0.7.9
Downloaded futures-lite v1.13.0
Downloaded crc32fast v1.4.0
Downloaded byteorder v1.5.0
Downloaded async-trait v0.1.80
Downloaded lock_api v0.4.11
Downloaded atspi v0.10.1
Downloaded async-lock v3.3.0
Downloaded async-lock v2.8.0
Downloaded async-io v1.13.0
Downloaded fontdb v0.12.0
Downloaded calloop v0.10.6
Downloaded log v0.4.21
Downloaded event-listener v5.3.0
Downloaded fontconfig-parser v0.5.6
Downloaded getrandom v0.2.14
Downloaded miniz_oxide v0.7.2
Downloaded bytemuck v1.15.0
Downloaded futures-lite v2.3.0
Downloaded arboard v3.3.2
Downloaded egui_glow v0.23.0
Downloaded derivative v2.2.0
Downloaded glutin v0.30.10
Downloaded symphonia-core v0.5.4
Downloaded alsa-sys v0.3.1
Downloaded regex-automata v0.4.6
Downloaded kurbo v0.8.3
Downloaded base64 v0.21.7
Downloaded flate2 v1.0.28
Downloaded mio v0.8.11
Downloaded kira v0.8.7
Downloaded cpal v0.15.3
Downloaded kurbo v0.9.5
Downloaded eframe v0.23.0
Downloaded aho-corasick v1.1.3
Downloaded glow v0.12.3
Downloaded alsa v0.9.0
Downloaded mint v0.5.9
Downloaded imagesize v0.11.0
Downloaded gl_generator v0.14.0
Downloaded fastrand v2.0.2
Downloaded emath v0.23.0
Downloaded downcast-rs v1.2.1
Downloaded data-url v0.2.0
Downloaded async-task v4.7.0
Downloaded async-executor v1.10.0
Downloaded egui-winit v0.23.0
Downloaded usvg v0.29.0
Downloaded rustix v0.38.32
Downloaded regex-syntax v0.8.3
Downloaded form_urlencoded v1.2.1
Downloaded float-cmp v0.9.0
Downloaded fastrand v1.9.0
Downloaded event-listener-strategy v0.4.0
Downloaded ecolor v0.23.0
Downloaded bytemuck_derive v1.6.0
Downloaded concurrent-queue v2.4.0
Downloaded event-listener-strategy v0.5.1
Downloaded event-listener v2.5.3
Downloaded errno v0.3.8
Downloaded enumflags2_derive v0.7.9
Downloaded dasp_sample v0.11.0
Downloaded rustybuzz v0.7.0
Downloaded directories-next v2.0.0
Downloaded blocking v1.5.1
Downloaded egui v0.23.0
Downloaded async-recursion v1.1.0
Downloaded async-fs v1.6.0
Downloaded async-channel v2.2.0
Downloaded tiny-skia v0.8.4
Downloaded regex v1.10.4
Downloaded idna v0.5.0
Downloaded async-broadcast v0.5.1
Downloaded nix v0.25.1
Downloaded ttf-parser v0.18.1
Downloaded atomic-arena v0.1.1
Downloaded async-channel v1.9.0
Downloaded arrayref v0.3.7
Downloaded smithay-client-toolkit v0.16.1
Downloaded glutin_glx_sys v0.4.0
Downloaded instant v0.1.12
Downloaded enum-iterator-derive v1.3.0
Downloaded tracing v0.1.40
Downloaded color_quant v1.1.0
Downloaded owned_ttf_parser v0.20.0
Downloaded sctk-adwaita v0.5.4
Downloaded atspi-macros v0.2.0
Downloaded glam v0.25.0
Downloaded gif v0.12.0
Downloaded khronos_api v3.1.0
Downloaded jpeg-decoder v0.3.1
Downloaded epaint v0.23.0
Downloaded encoding_rs v0.8.34
Downloaded linux-raw-sys v0.4.13
Downloaded image v0.24.9
Downloaded 191 crates (25.9 MB) in 3.60s (largest was `image` at 9.3 MB)
Compiling proc-macro2 v1.0.79
Compiling unicode-ident v1.0.12
Compiling cfg-if v1.0.0
Compiling libc v0.2.153
Compiling autocfg v1.2.0
Compiling bitflags v1.3.2
Compiling log v0.4.21
Compiling pkg-config v0.3.30
Compiling version_check v0.9.4
Compiling serde v1.0.197
Compiling quote v1.0.36
Compiling xml-rs v0.8.20
Compiling syn v2.0.58
Compiling once_cell v1.19.0
Compiling smallvec v1.13.2
Compiling lazy_static v1.4.0
Compiling crossbeam-utils v0.8.19
Compiling arrayvec v0.7.4
Compiling pin-project-lite v0.2.14
Compiling memoffset v0.6.5
Compiling wayland-scanner v0.29.5
Compiling futures-core v0.3.30
Compiling parking v2.2.0
Compiling concurrent-queue v2.4.0
Compiling libloading v0.8.3
Compiling crc32fast v1.4.0
Compiling dlib v0.5.2
Compiling simd-adler32 v0.3.7
Compiling syn v1.0.109
Compiling wayland-sys v0.29.5
Compiling adler v1.0.2
Compiling miniz_oxide v0.7.2
Compiling getrandom v0.2.14
Compiling hashbrown v0.14.3
Compiling float-cmp v0.9.0
Compiling equivalent v1.0.1
Compiling typenum v1.17.0
Compiling indexmap v2.2.6
Compiling flate2 v1.0.28
Compiling rand_core v0.6.4
Compiling wayland-client v0.29.5
Compiling nix v0.24.3
Compiling generic-array v0.14.7
Compiling lock_api v0.4.11
Compiling bytemuck_derive v1.6.0
Compiling serde_derive v1.0.197
Compiling winnow v0.5.40
Compiling bytemuck v1.15.0
Compiling parking_lot_core v0.9.9
Compiling khronos_api v3.1.0
Compiling thiserror v1.0.58
Compiling cfg_aliases v0.1.1
Compiling toml_datetime v0.6.5
Compiling ppv-lite86 v0.2.17
Compiling futures-io v0.3.30
Compiling wayland-commons v0.29.5
Compiling rand_chacha v0.3.1
Compiling toml_edit v0.19.15
Compiling thiserror-impl v1.0.58
Compiling strict-num v0.1.1
Compiling event-listener v4.0.3
Compiling memmap2 v0.5.10
Compiling slotmap v1.0.7
Compiling slab v0.4.9
Compiling ttf-parser v0.20.0
Compiling downcast-rs v1.2.1
Compiling scoped-tls v1.0.1
Compiling scopeguard v1.2.0
Compiling event-listener v2.5.3
Compiling bitflags v2.5.0
Compiling proc-macro-crate v1.3.1
Compiling event-listener-strategy v0.4.0
Compiling rand v0.8.5
Compiling owned_ttf_parser v0.20.0
Compiling zvariant_utils v1.0.1
Compiling wayland-protocols v0.29.5
Compiling fdeflate v0.3.4
Compiling event-listener v5.3.0
Compiling memchr v2.7.2
Compiling io-lifetimes v1.0.11
Compiling ab_glyph_rasterizer v0.1.8
Compiling fastrand v2.0.2
Compiling ab_glyph v0.2.24
Compiling gl_generator v0.14.0
Compiling aho-corasick v1.1.3
Compiling event-listener-strategy v0.5.1
Compiling png v0.17.13
Compiling parking_lot v0.12.1
Compiling async-lock v3.3.0
Compiling enumflags2_derive v0.7.9
Compiling tracing-attributes v0.1.27
Compiling nix v0.25.1
Compiling futures-lite v2.3.0
Compiling tracing-core v0.1.32
Compiling smithay-client-toolkit v0.16.1
Compiling x11-dl v2.21.0
Compiling memoffset v0.7.1
Compiling polling v2.8.0
Compiling rustix v0.37.27
Compiling fastrand v1.9.0
Compiling regex-syntax v0.8.3
Compiling atomic-waker v1.1.2
Compiling xcursor v0.3.5
Compiling async-task v4.7.0
Compiling arrayref v0.3.7
Compiling vec_map v0.8.2
Compiling waker-fn v1.1.1
Compiling byteorder v1.5.0
Compiling futures-lite v1.13.0
Compiling calloop v0.10.6
Compiling regex-automata v0.4.6
Compiling tiny-skia-path v0.8.4
Compiling wayland-cursor v0.29.5
Compiling piper v0.2.1
Compiling tracing v0.1.40
Compiling enumflags2 v0.7.9
Compiling async-channel v2.2.0
Compiling zvariant_derive v3.15.2
Compiling block-buffer v0.10.4
Compiling crypto-common v0.1.6
Compiling async-lock v2.8.0
Compiling enumn v0.1.13
Compiling async-io v1.13.0
Compiling async-fs v1.6.0
Compiling base64 v0.21.7
Compiling linux-raw-sys v0.3.8
Compiling static_assertions v1.1.0
Compiling percent-encoding v2.3.1
Compiling zvariant v3.15.2
Compiling accesskit v0.11.2
Compiling digest v0.10.7
Compiling blocking v1.5.1
Compiling regex v1.10.4
Compiling tiny-skia v0.8.4
Compiling symphonia-core v0.5.4
Compiling socket2 v0.4.10
Compiling ahash v0.8.11
Compiling encoding_rs v0.8.34
Compiling pin-utils v0.1.0
Compiling tinyvec_macros v0.1.1
Compiling cpufeatures v0.2.12
Compiling futures-sink v0.3.30
Compiling futures-task v0.3.30
Compiling unicode-bidi v0.3.15
Compiling futures-util v0.3.30
Compiling sha1 v0.10.6
Compiling tinyvec v1.6.0
Compiling symphonia-metadata v0.5.4
Compiling nix v0.26.4
Compiling zbus_macros v3.15.2
Compiling zbus_names v2.6.1
Compiling async-executor v1.10.0
Compiling async-broadcast v0.5.1
Compiling derivative v2.2.0
Compiling winit v0.28.7
Compiling async-recursion v1.1.0
Compiling serde_repr v0.1.19
Compiling async-trait v0.1.80
Compiling ordered-stream v0.2.0
Compiling xdg-home v1.1.0
Compiling alsa-sys v0.3.1
Compiling rustix v0.38.32
Compiling zerocopy v0.7.32
Compiling hex v0.4.3
Compiling siphasher v0.3.11
Compiling raw-window-handle v0.5.2
Compiling symphonia-utils-xiph v0.5.4
Compiling unicode-normalization v0.1.23
Compiling sctk-adwaita v0.5.4
Compiling glutin_glx_sys v0.4.0
Compiling zbus v3.15.2
Compiling glutin_egl_sys v0.5.1
Compiling ecolor v0.23.0
Compiling emath v0.23.0
Compiling atspi-macros v0.2.0
Compiling kurbo v0.8.3
Compiling mio v0.8.11
Compiling wayland-sys v0.30.1
Compiling instant v0.1.12
Compiling nohash-hasher v0.2.0
Compiling linux-raw-sys v0.4.13
Compiling xmlparser v0.13.6
Compiling unicode-general-category v0.6.0
Compiling roxmltree v0.18.1
Compiling epaint v0.23.0
Compiling atspi v0.10.1
Compiling svgtypes v0.9.0
Compiling idna v0.5.0
Compiling accesskit_consumer v0.15.2
Compiling ron v0.8.1
Compiling form_urlencoded v1.2.1
Compiling async-channel v1.9.0
Compiling glutin v0.30.10
Compiling enum-iterator-derive v1.3.0
Compiling kurbo v0.9.5
Compiling num-traits v0.2.18
Compiling simplecss v0.2.1
Compiling roxmltree v0.19.0
Compiling color_quant v1.1.0
Compiling ttf-parser v0.18.1
Compiling x11rb-protocol v0.13.0
Compiling cpal v0.15.3
Compiling x11rb v0.13.0
Compiling fontconfig-parser v0.5.6
Compiling rosvgtree v0.1.0
Compiling enum-iterator v1.5.0
Compiling accesskit_unix v0.5.2
Compiling url v2.5.0
Compiling egui v0.23.0
Compiling alsa v0.9.0
Compiling symphonia-format-ogg v0.5.4
Compiling symphonia-codec-vorbis v0.5.4
Compiling glutin-winit v0.3.0
Compiling libloading v0.7.4
Compiling mint v0.5.9
Compiling unicode-script v0.5.6
Compiling unicode-ccc v0.1.2
Compiling dasp_sample v0.11.0
Compiling rctree v0.5.0
Compiling data-url v0.2.0
Compiling home v0.5.9
Compiling unicode-bidi-mirroring v0.1.0
Compiling imagesize v0.11.0
Compiling array2d v0.2.0 (https://github.com/Mathmagician8191/array2d?branch=mutable_iteration#91233b56)
Compiling usvg v0.29.0
Compiling liberty_chess v0.17.1 (/home/roelof/Compiled/Liberty-Chess-0.6.2/liberty_chess)
Compiling rustybuzz v0.7.0
Compiling webbrowser v0.8.15
Compiling glam v0.25.0
Compiling symphonia v0.5.4
Compiling accesskit_winit v0.14.4
Compiling fontdb v0.12.0
Compiling arboard v3.3.2
Compiling smithay-clipboard v0.6.6
Compiling rgb v0.8.37
Compiling ringbuf v0.3.3
Compiling dirs-sys-next v0.1.2
Compiling atomic-arena v0.1.1
Compiling unicode-vo v0.1.0
Compiling weezl v0.1.8
Compiling glow v0.12.3
Compiling web-time v0.2.4
Compiling egui-winit v0.23.0
Compiling gif v0.12.0
Compiling usvg-text-layout v0.29.0
Compiling egui_glow v0.23.0
Compiling kira v0.8.7
Compiling directories-next v2.0.0
Compiling svgfilters v0.4.0
Compiling image v0.24.9
Compiling ulci v0.4.2 (/home/roelof/Compiled/Liberty-Chess-0.6.2/ulci)
Compiling svgtypes v0.10.0
Compiling pico-args v0.5.0
Compiling jpeg-decoder v0.3.1
Compiling eframe v0.23.0
Compiling oxidation v0.6.2 (/home/roelof/Compiled/Liberty-Chess-0.6.2/oxidation)
Compiling resvg v0.29.0
Compiling sound v0.6.0 (/home/roelof/Compiled/Liberty-Chess-0.6.2/sound)
Compiling liberty_chess_gui v0.20.1 (/home/roelof/Compiled/Liberty-Chess-0.6.2/liberty_chess_gui)
Finished release [optimized] target(s) in 10m 01s
StefanSalewski commented 2 months ago

I am sure that Rust has already good chess support -- but I was not aware of this project.

But generally I am not really interested in computer chess that much.

I ported my salewski-chess to Rust as a tiny exercise -- my larger project https://github.com/StefanSalewski/SDT would be much more effort to port unfortunately.

I have still to learn a lot about Rust, and still I am not sure if I will really seriously continue using Rust. Julia and Mojo are options too, perhaps even Kotlin or Zig. Rust is the most difficult, so I think it is a good idea to learn it now, than the other languages will appear easy. But perhaps Rust is just good enough. I recently heard that MicroSoft and Google are using Rust now also, and soon we should get the fine Xilem GUI, which might further increase the Rust popularity.

tissatussa commented 2 months ago

..Julia and Mojo are options too, perhaps even Kotlin or Zig..

i also wondered which new language to learn .. i came upon Nim and i like it -- we discussed some .. i know Julia a little, it resembles Python but its logic is special and somewhat awkward, also Julia can do many rather complicated 'structures' .. Zig seems a good choice also, i'm not familiar with Kotlin .. maybe stick to a language with many users and thus info for answers .. the Xilem thing sounds good!

StefanSalewski commented 2 months ago

Yes, deciding about a computer languages is difficult. Some say just learn many -- but for languages like C++, Haskel, or Rust the effort is really large. Even learning all the details of Nim was some effort, and Nim changed over time (e.g. new ARC and ORC memory management with destructors.). For Rust, the official Book is by far not sufficient, it is more an instructional tutorial. The book of Blandy, "Programming Rust" has 700 pages. And then remains much more to learn. Xilem might become really a large step forward, Raph Levien and others have done already a lot of great work. I saw a video about Vello, the drawing kit they are using. It is very fast because of GPU usage. Xilem and Vello might be a good reason to stick with Rust. Bevy, the game engine, and Redox, the OS, are great too. And there is much more to learn. Zig has become popular, but I am not a friend of fully manual memory management. For embedded stuff it might be OK. Kotlin is not usable for low level systems programming. Julia is nice for fast scientific computing. Finally, Mojo was hyped a lot one year ago, but I have doubts that it will be ever fully open source. Swift, with some similarity to Rust, is unfortunately mostly used for Apple only. (I also should learn more Python, as it is the most popular language currently. 15 years ago I decided to use Ruby instead of Python, at that time it was not that clear that Python would win.)

So Rust remains my best candidate for now.

tissatussa commented 2 months ago

so, you're not into chess like me .. i'm a clubplayer for years, but simple programmer .. JS and PHP were my pets, but i learned Python and do most (fun) projects with it .. but trying to write a fast binary, preferably a single binary (for multi OS), i found and learned some Julia, which can be compiled and runs fast, but compared by running a (original) Python script by Pypy gives same speed .. i don't know how fast Rust chess engines can operate, but it's critical when evaluating many nodes .. in general i like to keep things simple, only learning complex things when needed - and i learn by examples, often combining code parts i don't fully understand ..

can you tell me a bit about the HCE of your engine ? Are Piece-Square-Tables used etc. Did you ever consider implementing the (simple) TuroChamp rules ? I think they're genius and it can be a great exercise for you. And i have another little programming idea - related to chess though ..

tissatussa commented 2 months ago

https://github.com/StefanSalewski/rust-chess/assets/1109281/2a9e3f24-697a-403f-a406-9115cbfb3d49

StefanSalewski commented 2 months ago

so, you're not into chess like me .. i'm a clubplayer for years,

I think I have spent about 150 hours totally with playing chess, most of it as a small boy playing against my grandma. Some years later, when I got an Amiga computer, I created my first computer chess engine with a nice GUI. But it played very weak, as I was not able to invent alpha-beta-prunning myself, so it had to evaluate the complete search tree, which limited dept to about 4 plys. Later, when I begun to study physics at hamburg university, I got Internet access for the first time, and learned about alpha-beta-prunning, the idea of a transposition table to reuse results, and the move generation by pre-calculated tables as done in GnuChess. Maybe a year later, I also heard about the bitboard chess representation, which became popular when we got the first 64-bit CPUs. But I did no chess coding for about 20 years. Then, in 2014, I started learning Nim, comming from Modula/Oberon/Ruby/C. And I thought it would be some fun to create a tiny chess engine from scratch.

You can study my engine yourself, it is very simple. The Nim or the Rust one. Board is an array of 64 integers, with indices from 0 to 63. For move generation I use a precalculated array similar as GnuChess did it. I Guess GnuChess used linked lists, but an array is simpler and faster, now that we have a of lot memory available. Then we generate the search tree full width up to a specified dept, followed by full capture sequence , doing megamax evaluation with alpha-beta-prunning to cut of most branches. The actual evaluation occurs when there are no more possible captures possible. The evaluation is very simple, taking account only the values of the figures (100 for a pawn, 300 for a bishop, ...) and the value of the position. The position value is determined by the possibility of a figure to move -- the theoretical one, determined by the actual position, plus the actual one, as it may be blocked by figures. Finally, I am using a custom hash table as transposition table to reuse positions that have already been evaluated.

So the engine is really very simple. But for most human players it should be a strong opponent, and I like its playing: It is not too boring in my view.

For a more complicated engine, with a detailed position evaluation, very good chess knowledge would be necessary, which I do not have. And actually this kind of "knowledge" can be questionable. Using bitboards might be useful, but it needs a lot of ugly and boring coding for all the bit fiddling. What I could do: Better GUI (Xilem), saving/loading games, opening library, setting up a position, and some more. Well, not difficult, but not really interesting. I might do it as an Xilem exercise later.

Note that AI can already learn to play strong chess without any actually programming, just by getting the rules, observing games of humans, and playing against itself. That is how Alpha-Go learned to win against the best human players. And AI makes currently such a fast progress, that many experts believe that in a few years AI will be smarter than the brightest humans. Then the AI will improve itself further, and can do all our mental work including writing computer programs. Perhaps then, when there is no more labor to do, I will spent some time playing chess again. Actually, I have the idea of asking an AI to create a chess engine from scratch. Current AI can generate already simple programs, like a snake or pong game. I assume that GPT-4 or Claude-3 would be already able to create the skeleton of a chess engine, but I will wait at least for GPT-5. Then I might ask it also to port my rust-chess back to Nim, so that we have identical code then. Currently, the Rust engine is cleaner, as it uses a Game struct instead of a global board representation, and the Rust code contains a few fixes and improvements. Actually, I might delete the old Nim version soon.

tissatussa commented 2 months ago

nice written info .. just what i imagined to know about you and the engine .. i also did some own projects with GUI building and managing settings with buttons etc. .. it's tedious .. i think understand the components of the HCE engines, yuo described well .. not reaching a high depth but getting the full tree, mmmm .. but with simple eval : what about the pruning : i guess HCE engines will never play very strong without specific factors, depending on position types & other ? Anyhow, your program plays chess rather good, and programming must be fun, not by perfection

what happens to the eval when introducing a 'factor' like consider positions which can be reached by [#] variations ? Tho hard to say how to define such 'aspect' ..

tissatussa commented 2 months ago

About asking AI to write code eg. a chess engine .. could we ask it to determine the underlaying magic square ? Probably having multi dimensions ? Some construct without the variations, in time :)