#The inaugural Unofficial Gleam Chess Bot Tournament!

1 messages Β· Page 2 of 1

formal fiber
#

I tried running my code on JS and it was way slower, but I guess there's a way to speed it up

#

I feel like with FFI on JS, you could commit some real crimes for performance gains

#

But of course that's not allowed in this competition

fierce berry
#

I wonder how different Gleam 1.11 would make the JS version

formal fiber
#

I'm not sure it's really the pattern matching that's the problem tbh

normal latch
#

javascript's whole "you can have any type of int you like as long as it's a float" thing is a pretty big problem for a chess engine

formal fiber
#

I can test though

#

Yeah that makes sense

olive oak
normal latch
#

javascript engines have to do some wacky shit to get around it

normal latch
twin crag
#

i think if we do this again with more standard utils, some debugging functions would be nice. I'm very partial to my generate.display function, made tests super easy

normal latch
#

they automatically promote to a bigint one they're bigger than 60 bits, so 64 bit bitboards are slowwwwww

twin crag
#

wtf? why 60?

#

smh

normal latch
#

60 bits for the number plus a little header :')))

normal latch
twin crag
#

simply remove a row from the chessboard, problem solved

normal latch
#

pfffft yeah perfect haha

#

next gleam tournament is gonna be for 7x7 go

twin crag
twin crag
#

yes I'm partial to my ansi coloring

#

blue for from, yellow for to

normal latch
#

yeah I see it :3

#

very slay

fierce berry
#

I greatly enjoy that it's using the Minecraft font too

#

Not because I particularly like the font. It's just funny

twin crag
#

it's my terminal font!

normal latch
#

also if I were doing it again I'd probably have preferred stockfish style

+-+
| |
+-+

squares

twin crag
#

i only use it because I think it's incredibly readable

olive oak
#

I find it very hard to read which annoys me so much because I love minecraft despair

twin crag
#

i think pixel fonts are amazing

olive oak
#

My favourite fonts all are the opposite of pixely

normal latch
#

I used to be a big bitmap font girlie

twin crag
#

somehow when you only have a few pixels, a font feels more readable to me

formal fiber
#

I probably should have written more tests for my eval function

normal latch
#

fractional scaling go brrrr though :(

twin crag
#

kde solves this :3

formal fiber
#

I tested move generation well but evaluation was all just manual testing and vibes

twin crag
#

(used to be on gnome, I don't miss it)

normal latch
#

ah well though, berkeley mono my beloved

twin crag
#

it has great support for fractional scaling in my experience

normal latch
#

oh yeah the fractional scaling in general is fantastic

#

I thought you meant it did something cool with bitmap fonts in particular

twin crag
#

no no

#

only bad part about kde is how spread out the settings are. dconf was an innovation

normal latch
#

mmm true

#

that's a bit better in plasma 6 at least

twin crag
#

I do like negamax though, eval not being color-dependent made it a lot more intuitive to me

formal fiber
#

Yeah it's pretty cool

formal fiber
twin crag
#

I'm sure it's for better

formal fiber
#

I did find that sometimes adding something new made the bot worse in some situations

fierce berry
#

We'll find out soon enough πŸ‘€
-# Once I write the competition runner

#

I also need to decide on the tournament format and exactly how each match will play out

#

I think there's somewhere between 6-8 entries, so I'm thinking something like a round robin with a grand final for the top two entries

formal fiber
#

6 on CC + girlchesser I think

formal fiber
fierce berry
#

If we had semis, the rr would only be eliminating 2-3 bots

formal fiber
#

Yeah

fierce berry
#

We'll see

formal fiber
#

Maybe it could be top 2 go to a final and 3/4 play to determine 3rd place overall

fierce berry
#

I'm planning on each match basically having a set sequence of starting positions, then two games are played for each position (one white one black) until one bot has an advantage over the other

normal latch
#

it's very much possible to turn an advantage into a loss haha

fierce berry
#

Sorry, I meant advantage as in tennis

normal latch
#

ohhhh gotcha

fierce berry
#

i.e. it has 2 more wins than the other

#

Then for the finals games I'll use a different sequence of starting positions

#

So we're not seeing the same matches twice

normal latch
#

yeah definitely a plan

formal fiber
#

That's good, because I get the impression not many of the bots do much about opening strategy

normal latch
fierce berry
#

Yeah. Just need to decide where to get the moves from

#

Ideally they should all be early game positions

formal fiber
fierce berry
#

So in summary:

  • Round robin
  • Top 2 play for the cup, next 2 play for third and fourth
  • Each match is a sequence of starting positions alternating each side
  • A match is won when one bot has won 2 more games than the other (minimum of four games total)
  • All RR matches will use the same sequence of moves
  • Finals matches will also all use the same sequence, but it'll be a different sequence to RR

If folks could πŸ‘ πŸ‘Ž this that'd be great πŸ™‚

normal latch
#

would it be an idea to have a minimum number of games before advantage wins? feels a bit volatile if a round could be decided by just two games

fierce berry
#

Yeah I've had that in my head too

#

Perhaps four games (2 positions) minimum

#

The first position for RR will be the opening position, I think

#

I do wanna see how bots cope with that

#

There's also gonna be around 30 matches, and if each game could take minutes, the whole process is likely to take me a couple hours to get through

#

Five seconds per move was very generous, but I was trying to account for the fact these are running in Erlang/JS

twin crag
#

"generous" i see you're calling me out

#

you underestimate how bad my code can really be

fierce berry
#

I honestly don't know how these usually run

normal latch
#

usually with fischer time, so both engines have a clock and have to budget their time, plus they get an increment every move

#

what the time is depends on the tournament, tcec uses 30 mins + 3 secs but for a tournament like this you could probably get by with less than a minute main time

eternal basalt
#

we ended up using a dictionary of squares using 0x88 representation to the piece type

#

also turns out that dicts are extra good when they're 32 entries or less

#

and there happens to be a max of 32 chess pieces

normal latch
#

oh neat! yeah similar idea to 16x12 then

eternal basalt
#

yeah

#

i think we did try that type of approach but we couldn't get the board access to be faster

#

there's no real easy mutate-able "array" type unfortunately

normal latch
#

I went for 16x12 because the sentinel value check was a bit faster than doing the & 0x88 check

#

yeah, iv is the next best thing there

eternal basalt
#

yeah, i think our code was a bit too set in stone maybe

#

also: did you know that case statements are generally fast

#

you will see some gleam crimes in here

fierce berry
#

So they're really quick

eternal basalt
#

i think ours measured like, it ended up being faster to do a huge case expression than doing a bit operation

formal fiber
#

Yeah bitwise operations don't seem to be super fast on the BEAM

normal latch
#

they're totally fine as long as your ints aren't bigger than 60 bits

#

otherwise they're horrendous

eternal basalt
# fierce berry So in summary: - Round robin - Top 2 play for the cup, next 2 play for third and...

I think the way a match is won could cause cases where a weaker bot could win against a stronger bot, (it has happened in our testing). This could be solved by having way more games, or.
Each game a win gives +2 points, a draw gives +1 to both, a loss gives +0. Each bot plays round robin where it plays every other bot X times, then the final score is tallied and the bot with the most wins is 1st. This scoring is iirc pretty common way of doing it, and it's not quite the "all or nothing" of the current system

#

and also, you have a fixed # of games you need to actually run, so you can kinda expect approx how long it will take

fierce berry
#

Gotcha, but then what happens in the case of a tie?

eternal basalt
#

if there's a tie in the final rankings, you could look at the tied players' performances against each other directly

#

or run a few tiebreakers if they're still tied there

#

but at that point it's pretty rare

burnt raptor
#

If you want to learn more about the hash I basically just implemented what's described at chessprogramming's Zobrist Hash page. Tbf I kinda forgot about the memory limit, so I can't tell you πŸ˜…

#

Also some things I'd like to do: replace the 2D array with a 1D one for the board (I had a module for this but ended up not using it), switch the dict in the TT to a fixed size array (kinda the point of calculating the hashes πŸ€¦β€β™‚οΈ ) and, obviously, add an opening book

ruby forge
#

When I measured (admittedly not recently), reads were much more of a performance costs than writes for me. Maybe less so for you because you pre-compute the attack info?

#

I got them to add a get_or_default which makes a big difference indeed.

eternal basalt
#

It really depends on the type of data you're holding/manipulating

#

in the right circumstances the BEAM will modify tuples in-place, I'm not sure if glearray is able to

eternal basalt
naive cedar
formal fiber
#

Interestingly, I tried both replacing my 64-bit hashes with 60-bit ones, as well as changing my transposition table from a Dict to an array, and both of them seemed to decrease performance, counter to what I would have expected

normal latch
#

oh wow, super weird

#

I'd love to see your findings if you dig deeper into that

formal fiber
#

Yeah, maybe there's something I missed but I didn't really have time to investigate too much within this competition

#

I'd be interested to have someone else help me try to optimise various things in my code afterwards, because most if it was just trial and error

eternal basalt
#

We also reduced the hash size for the transposition table, but then you definitely get way more collisions

#

there was a whole bit where we had to figure out the strategy of pruning the transposition table

#

incrementally updating the zobrist hashes was also really important

formal fiber
#

Yep that was something I did too

fierce berry
#

(finally) started working on the runner πŸ‘€

fierce berry
fierce berry
#

If anyone's interested, I'm picking openings from a collection called the Silversuite

eternal basalt
#

who's winning

fierce berry
#

No comment

twin crag
#

definitely not me

normal latch
#

not me either

fierce berry
#

Nobody because I haven't started running the actual competition yet

eternal basalt
#

this project has been great for my github contribution history

olive oak
#

work has been great for my github contribution history

eternal basalt
#

being employed is definitely more impressive lolsob

olive oak
#

can you tell when i got employed πŸ˜„

burnt raptor
#

Either end of October or start of January?

#

Or maybe march/april

olive oak
#

Final week of August πŸ˜…

#

the gap in october was holiday

normal latch
#

would be cool if anyone could see it

burnt raptor
fierce berry
#

12 games left before the round robin is complete πŸ‘€

#

We're 450 down

burnt raptor
#

Who’s winning?

fierce berry
#

That's for me to know and you to find out when the video is released πŸ˜„

burnt raptor
#

Lol, fair

naive cedar
#

is it close or not πŸ‘οΈ

grand lodge
#

we should elect 1 (one) person to watch the video and give us the results, lets not play into this blatant viewer manipulation

fierce berry
naive cedar
#

uhhh interesting

olive oak
#

I'm winning and it isn't even close

fierce berry
#

I actually have no idea how close it is

#

I'm not keeping a running total

eternal basalt
#

Are we placing bets

fierce berry
#

Not sure Louis would let us gamble in the server

magic vector
#

what's my cut

formal fiber
#

I was going to say, it can't be that difficult to convince him

fierce berry
#

Awesome

#

Yes, taking bets

#

But I have no idea how to calculate odds

#

So it's gonna be an all-in situation

formal fiber
#

If I bet against my bot then I win even if I lose

fierce berry
#

Nah I'm just taking bets on the winner

#

Big pot, winner(s) take all split according to how much they bet

#

Minus fees, naturally

magic vector
#

Are you open to bribes?

fierce berry
#

Sure

#

Not sure how I influence the outcome of a set of deterministic competitions

#

But sure

grand lodge
#

just lie obviously

fierce berry
#

Aight, betting is open, you can bet on any of the following:

The GearsDatapacks Bot, by Gears
2716 lines of Gleam
96KB of code

Gert's bot, by gertvv
12,034 lines of Gleam
840KB of code

girlchesser, by Hayleigh and Lucy
1784 lines of Gleam
92KB of code

Journeybot, by llakala
1958 lines of Gleam
172KB of code

The mine-tech-oficial bot, by MineTech
1772 lines of Gleam
76KB of code

Pieter's bot, by PieterJanVdb
1203 lines of Gleam
52KB of code

gnomeschesser, by PumpkinMouse and tonyd333
14,877 lines of Gleam
5MB of code

You can place bets at https://ihh.dev/chess

magic vector
#

wow gnomeschesser is big

fierce berry
#

Yes. Whether that's an indication of quality... who knows? πŸ€·β€β™‚οΈ

eternal basalt
#

That's me!

#

No comment...

fierce berry
#

The round robin games have just concluded

formal fiber
magic vector
#

git commit -m 'inline jpg of a chess board to teach code how to chess'

formal fiber
#

Also clearly I missed the part where you could choose the name of your bot

eternal basalt
#

gert also has approx the same loc but way smaller size

#

let's just say we didn't write idiomatic gleam code

fierce berry
#

Nobody is placing bets 😦

#

Smh after y'all asked for it

olive oak
#

Fuck sake πŸ˜‚

fierce berry
#

I know! More people should bet

eternal basalt
#

I'm contemplating how egotistical it would be to bet for my own bot

#

and also how confident I am

formal fiber
#

Wow you put that betting page together hella fast

fierce berry
#

Nah it's just a redirect through to Polar

formal fiber
#

Oh I thought that was your company

#

You're Rover, nvm

fierce berry
#

In all seriousness, if people wanna try and guess the winner, the people who guess right can have brownie points

eternal basalt
#

I'm gonna guess myself for double the disappointment if I lose lolsob

olive oak
#

My money is on Hayleigh and Lucy (Lucy is good at maths and Hayleigh is Hayleigh)

fierce berry
#

Results for the round robin have been calculated πŸ‘€

formal fiber
#

When will the video come out?

fierce berry
#

I'm aiming for the first weekend of July

fathom delta
#

hey nice I got the least amount of code, I'll be amazed if any of my moves don't time out

twin crag
#

me too!

#

my first move will be excellent

#

can't say the same about the rest of them

fathom delta
#

I didn't really continue working on my openings with the negamax algo in place so it's very likely it just times out on the first two moves, while after those it gets pretty speedy

formal fiber
#

My openings are terrible, but hopefully I can checkmate you in the endgame

fierce berry
formal fiber
#

My bot is consistently the slowest because I try to spend as much time computing moves as possible

fierce berry
#

Most of them use a hard 5s calculation time

fathom delta
#

yeah bec I lowered it to 3 plies 2 seconds before committing lmao

fierce berry
#

Or just below 5s

eternal basalt
#

I'm scared that we timed out (we've had issues with this commonly)

fathom delta
#

and didn't properly implement a thing where I can just let it run and where it aborts the calculation to just pick w/e if it's close to 5s

fierce berry
fathom delta
#

well yeah, it's not really doing much I think πŸ₯Έ

#

either way im happy it’s doing something

burnt raptor
fierce berry
#

Third place has been decided πŸ‘€

burnt raptor
fierce berry
#

Sure

formal fiber
fierce berry
#

There's been a lot of threefold repetition, actually

#

No 50 move draws

#

Currently watching the finals play out (slowly)

burnt raptor
twin crag
#

at some point, I think I want to rewrite my bot in rust and see if I can get it to actually be performant

#

maybe I'll also do all the performance optimizations I put off this time (bitboards and true legal move generation, mostly)

formal fiber
burnt raptor
#

That's obviously the reason why I didn't track it
-# definitely not because I didn't have time + didn't want to do it + didn't know how

twin crag
#

my bot constantly went into fifty move draws when I had it play against itself

#

i was just hoping that other people's bots would be smarter and prevent that from hapening

#

which, it seems like they did!

eternal basalt
#

we just passed around a dict of previous game states

twin crag
#

how did you do that? doesn't the bot only respond to a move with the fen data, meaning you can't preserve previous states?

eternal basalt
#

the bot doesn't get restarted per-move afaik right

fierce berry
#

Correct

#

Gets restarted every game

eternal basalt
#

We had a couple actors but nothing really sophisticated

fierce berry
#

I love that you named them

eternal basalt
#

he also implemented all the state monad stuff that I barely understand

#

the word partner has become very ambiguous, i meant like project partner to be clear

#

friend* that's the word

fierce berry
#

What's that

#

Not sure I understand the concept

eternal basalt
#

The tl;dr as I understand it, is that it's a way of replacing functions where you pass in a state, and it returns a state

#

instead the function returns a state monad (which effectively is a function that modifies the state)

grand lodge
#

haskellers cant help themselves

eternal basalt
#

but you can compose it and stuff

#

It ended up being pretty nice once I got the hang of it

#

anything in our repo that is haskelly isn't me lolsob

#

we also did the whole parser combinator thing

eternal basalt
#

which is conveniently encoded in the halfmove clock

#

but there's some edge cases where if you time out and you receive a new request with the exact same position and you'd have to handle that

#

or maybe if you receive a position that's not exactly the next move or whatever

#

and dicts (erlang maps) turned out to be really fast and cheap (especially when 32 entries or below), at least when we measured it

#

I spent like an entire week (many many hours) getting bitboards to work, and it ended up being like 10x slower. Made me so sad

fierce berry
eternal basalt
#

OH

#

my bad

fierce berry
#

This is still cool

eternal basalt
#

i'm incapable of recognising jokes

fierce berry
#

I wanted to look into your interruptable stuff more anyway

eternal basalt
#

yeah that's all my friend

#

i don't understand it at all

#

So who's going to do a UCI parser library and a general chess library lolsob

#

I would do it but I'm so burned out from chess I don't want to look at it for a few months

fierce berry
#

You've got plenty of time πŸ™‚

#

The results are in! Congratulations to ||the winner|| and commiserations to ||my wallet||

formal fiber
#

Prediction: they say "the winner" and "the loser"

#

Close enough

fierce berry
#

This was the penultimate board of the last match

#

(black (lowercase) to move)

burnt raptor
#

I assume Qb3?

#

Or Qa2 I think

fierce berry
#

Qb3

#

Qa2 is not checkmate

burnt raptor
#

oh, true

eternal basalt
#

Wow what a dominant position

#

I mean duh I guess since it's checkmate

fierce berry
#

This is how that game started

formal fiber
#

Time to run that starting position with every combination of bots to figure out which two were in the final

fierce berry
#

I could also be lying on purpose

#

And not all the bots are perfectly deterministic

formal fiber
#

I'm not actually going to do that

fierce berry
#

Oh I'm sure

#

Just saying it'd be pretty futile

formal fiber
#

Fair

fierce berry
#

The position is EC0 E99 if anyone cares

fierce berry
#

Nah that'd be really hard to generalise

#

Nobody could do it

eternal basalt
#

Are you saying that to reverse psychology us

normal latch
#

are you trying to nerd snipe us haha

eternal basalt
#

Because it's sorta working

normal latch
#

ah you beat me

#

I do wanna try that doubled u32 trick, I might try making a library out of that

burnt raptor
#

If you mean bitboards you might wanna take a look at my bot, it already has it

normal latch
#

oh neat

#

yeah I will do

burnt raptor
#

It's quite simple actually

#

-# this reminded me of MumboJumbo (minecraft youtuber)

eternal basalt
#

Did you profile it vs regular ints/what was the result?

burnt raptor
eternal basalt
#

I'll give it a go and measure and see the difference then

normal latch
#

yeah that was me haha

#

doing bitwise operations on ints bigger than 64 bits is very slow

normal latch
burnt raptor
normal latch
#

yeah exactly, there aren't any sized int types in erlang anyway

eternal basalt
#

it'd be nicer to have bitwise operations on bitarrays but I'm not sure if the datatype is suited for that

normal latch
#

I imagine there isn't much control over how those are implemented, bitarrays are an erlang type

#

you'd either have to convert to the appropriate int (which would still have to be 60 bits or less to be fast in erlang), which you can do in gleam anyway, or write the bitwise ops in software which would be just as slow as doing them on bigints

eternal basalt
#

oh wow I profiled it, it's definitely measurably slower to use the bigint rather than 2 smaller ints

#

thought it seems to differ based on the specific operation

formal fiber
#

How so?

normal latch
#

some operations like shifts are a bit more complicated when you use pairs of 32 bit ints, because you have to shift things across the gap, but it's still much faster than doing software shifts on a bigint in my testing

#

in fact even the letterbox movegen in girlchesser is much faster than the bitboard implementation I knocked together with 64 bit ints

eternal basalt
#
##### With input 0 False #####
Name                   ips        average  deviation         median         99th %
bigint get         67.94 M       14.72 ns   Β±208.68%       10.24 ns      102.40 ns
bigint set         42.69 M       23.42 ns  Β±2775.94%           0 ns        1024 ns
two ints set       35.56 M       28.12 ns   Β±200.15%           0 ns      102.40 ns
two ints get       16.93 M       59.08 ns  Β±5145.82%           0 ns       20.48 ns

##### With input 0 True #####
Name                   ips        average  deviation         median         99th %
two ints get       64.41 M       15.53 ns   Β±185.47%       10.24 ns      102.40 ns
bigint set         46.99 M       21.28 ns   Β±230.96%       10.24 ns      102.40 ns
two ints set       35.43 M       28.23 ns   Β±207.25%           0 ns      102.40 ns
bigint get         15.57 M       64.22 ns  Β±5118.82%           0 ns      102.40 ns

##### With input 63 False #####
Name                   ips        average  deviation         median         99th %
bigint get         67.67 M       14.78 ns    Β±34.56%       10.24 ns       20.48 ns
two ints get       64.42 M       15.52 ns   Β±186.70%       10.24 ns      102.40 ns
two ints set       35.39 M       28.25 ns   Β±200.57%           0 ns      102.40 ns
bigint set         15.28 M       65.43 ns   Β±637.00%           0 ns        1024 ns

##### With input 63 True #####
Name                   ips        average  deviation         median         99th %
bigint get         67.83 M       14.74 ns    Β±34.66%       10.24 ns       20.48 ns
two ints get       64.63 M       15.47 ns   Β±213.88%           0 ns      102.40 ns
two ints set       36.43 M       27.45 ns   Β±189.86%           0 ns      102.40 ns
bigint set         17.63 M       56.71 ns   Β±745.25%           0 ns        1024 ns
#

It's pretty hard to measure because of how fast the operation is

normal latch
#

I was benchmarking moves generated per second, that seemed to work well

fierce berry
#

alkyrie

#

iee

magic vector
#

ahaha

fierce berry
#

Fucking Discord

#

Clicked the search bar and it jumped around like mad

magic vector
#

sure thing grandpa

fathom delta
#

Damn i got excited for a sec

fierce berry
#

I've started writing the results video

#

I need to load the game outputs into a database so I can do some analysis on them

#

Interesting stats, etc.

normal latch
#

damnnn yeah I was excited too

fierce berry
#

Hellooooo, just want to apologise for taking so long to get the results video out. I've been doing some consulting work for friends who own a small startup and I've been in the office 9am-8pm most days for the past couple of weeks, so any other free time has been spent on other priorities. I'm trying to make the most of my day off today to get the script finished, though!

I have no plans to contact the winners in advance, so don't worry if you've not heard anything from me by the time the video goes up πŸ™‚

olive oak
#

we're paying you in views, this is unacceptable

#

how dare you help your friends out despair

normal latch
#

think of all the exposure you could be getting!! who needs money

fierce berry
#

I've started editing the video, and it's, uh, super duper boring 😭 I'm not a chess expert so I can't commentate on games, and I feel like the rest of the information I have available to give isn't that interesting.

Would people be okay with not having a results video? Obviously I'll still announce the winners.

#

Also happy to trim it down and release just the audio if folks are interested

magic vector
#

Is a shorter video possible?

fierce berry
#

In theory, but it would probably require reworking from the ground up

#

And I'm really short on time at the moment

magic vector
#

so bad at being unemployed

fierce berry
#

Horrendous, really

grand lodge
#

would be a shame i guess, was excited to hear about other folks' submissions

#

time despair

bold lodge
#

Maybe you could comment on the implementations?

fierce berry
#

The video didn't really go too deep into the implementations. I'll finish cleaning up the audio and A-roll and just release that as an unlisted video so you have something πŸ™‚

fierce berry
#

Video is available here. I would kindly ask that you don't mention the results in this thread for a little while - gives everyone a chance to watch the video first - but feel free to comment on the implementations etc.!

(cc @grand lodge @normal latch @eternal basalt @fluid venture @ruby forge @formal fiber @twin crag @burnt raptor @fathom delta)

#

And if the winners would reach out to me once you've seen the video, that would be great.

formal fiber
#

Well done everyone who submitted! It's certainly no small task making a chess bot from scratch.
I personally think I would have enjoyed watching a fully edited version of this, but maybe that's just because I'm invested in the results of the competition.
I'm interested to read the implementations of all the different bots, now that I know how they did, to see what worked well and what didn't.
The stats are interesting too! There were fewer draws than I expected to be honest. I thought there might have been some pairs of bots which couldn't win against each other, and perpetually drew.

eternal basalt
#

ggs all

#

I'll yap about stuff more once everyone watches the video πŸ™‚

magic vector
#

Maybe someone who is less busy than IHH could do a bit of a dive into the different bots

#

I'd be really interested in what approachs people took!

#

I don't know if the games themselves were released but if anyone is chess savvy maybe they could see if anything interesting happened there

eternal basalt
#

I'd definitely be down to do some type of analysis on the games/bots

olive oak
#

I'd love to have been able to watch the bots play each other (with stockfish(?) analysing each move made)

burnt raptor
#

I have little time today so I could only see my bot, and ||I genuinely thought it would detect all checks lol, guess I should have tested it|| (kinda spoiler but not my position)

olive oak
#

Unfortunately I cannot do videos for the life of me otherwise I'd volunteer

fierce berry
olive oak
#

oh nice

eternal basalt
#

Also thanks for hosting this event it was a lot of fun to participate in πŸ™‚

burnt raptor
#

Yeah, it was really cool! Will have to take a look at the other bots later

rain topaz
#

I’d love to peek at the code but from the video it looks like it’s not public yet?

magic vector
#

It loads for me

rain topaz
#

Link? πŸ‘€

eternal basalt
#

Which code do you mean?

rain topaz
#

The bots’ code

eternal basalt
#

ah

magic vector
#

Oh sorry I thought you meant the video was private

gaunt knoll
fathom delta
#

I’ll upload it to github when i can but it’s very standard stuff I’d imagine πŸ™

#

||Immensely surprised at my results lmao||

fluid venture
fluid venture
# fierce berry I wanted to look into your interruptable stuff more anyway

honestly the interruptable stuff is all smoke and mirrors XD it looks a lot fancier than it actually is because it's done in a pure-ish language. it ends up just translating to javascript code like:

const deadline = seconds_later(Date.now(), 5)
let best_move = null;
function iteratively_deepen(game, depth) {
  if (Date.now() > deadline) return best_move;
  best_move_at_depth = minimax(game, depth)
  best_move = best_move_at_depth || best_move;
  iteratively_deepen(depth + 1)
}

function minimax(...) {
  if (Date.now() > deadline) return null;
  return minimax_actual_implementation(...)
}
fluid venture
formal fiber
fluid venture
#

yeah i assume most ppl did something like that. what was neat about our interruption check was that it didn't actually check the time, and instead checked for a message that was queued with process.send_after, which made sprinkling the interruption checks everywhere super performant

#

it also allowed for arbitrary interruptions through message passing which was nice QOL for the uci stop command

normal latch
#

I didn't get to do much with girlchesser since I started a new job halfway through, plenty of stuff I still wanna try

fluid venture
#

yeah, it would be nice for the next tournament to start us off with pre-existing libraries because scaffolding a chess implementation and utilities like uci can take a while, which gives us unemployed folk a big advantage

#

efficient general chess library seems hard tho, the chess implementation we ended up with was super tightly coupled with our search/evaluation

eternal basalt
#

Could definitely adapt ours to a library that people can use as a starting point

normal latch
eternal basalt
#

would probably end up being less efficient than the optimal one though

#

also i might rewrite some parts now that we can use FFI again lolsob

eternal basalt
#

but you lose out on some transposition table data when you kill the child

normal latch
eternal basalt
#

and i think there was race conditions you had to handle where the process returns a best move after you kill the process

normal latch
eternal basalt
#

ooo

fluid venture
fluid venture
normal latch
#

I'm kinda tempted to do it without ffi though

eternal basalt
#

honestly tony redid a lot of the search by the end so i don't actually remember the exact details lolsob

#

there was a huge grind near the end

normal latch
#

funny thing about neither erlang nor javascript having actual 64 bit ints is that storing bitboards as pairs of u32s is probably the fastest approach on both

eternal basalt
#

i'm tempted to have a board implementation in NIF so you can just use u64

fluid venture
#

yeah i think we considered the u32 pairs at one point too, i forgot why we never tried it

normal latch
#

at that point you may as well just do the whole movegen in another language and pass the results to gleam though

eternal basalt
#

well NIFs would be against the rules cuz it counts as ffi didn't read correctly

normal latch
#

otherwise the FFI overhead might be pretty bad

#

ohhh sorry you mean writing erlang? nah the 60 bit int limitation is an erlang thing :(

normal latch
#

damn this needing to get a job stuff

fluid venture
#

imagine working an actual job when you could be working on the chess bot

#

couldn't be me
(now employed unfortunately)

normal latch
#

I miss writing gleam so much

#

sure beats doing infra stuff in python

eternal basalt
#

clearly we need a gleam->python target

normal latch
#

they don't want to introduce any new languages that they'd have to upskill new hires on :')

#

which does make sense

formal fiber
eternal basalt
#

We're gonna have 5 chess libraries by the end of this

formal fiber
#

Maybe we should just work together on one

#

Not sure if that would work though

eternal basalt
#

Could definitely do that

twin crag
#

mine should absolutely not be a library

#

although I would be happy to contribute the best of my testing framework to a library

#

(also, made a friend request, Isaac!)

twin crag
#

yes, that would be my first rust project

#

but as you can tell by now, I enjoy chess as a means of learning a language

fierce berry
# fierce berry
poll_question_text

Results video?

victor_answer_votes

2

total_votes

4

eternal basalt
#

I think only gertv that doesn't seem to have seen the results

#

but they haven't been active for a month or so

burnt raptor
#

I have now seen the full results, congrats to the winners! I really hope ||I do better the next time lol||

fathom delta
#

should've taken the time to implement that cancellation thing instead of just dropping the depth of the negamax right before submission to keep the movegen under 5s

grand lodge
#

i was quite chuffed with how @normal latch and i handled that

normal latch
#

that was mostly you tbf :)

#

hayleigh writes very pretty gleam, who'd have guessed it

fierce berry
fierce berry
#

Hey folks, the tournament winners should now have CodeCrafters memberships! Make good use of them!

cc. @fluid venture @eternal basalt @formal fiber @grand lodge @normal latch @twin crag

fathom delta
#

congrats to the victors πŸ™

eternal basalt
#

That's some fast shipping

fierce berry
#

Awesome! Enjoy