Live data from Hacker News

Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

github.com

71–78 of 78 posts

Re: Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

#71

Earlier quoted context omitted.

We know that, that's what the article is about. The things you said are vague and contain no information. What does 2KB have to do with "what we think counts as human" ?

I said something very specific. You can refuse to compare 2kB to the size of the human brain, but that has nothing to do with me.

"I am in, you are out, you couldn't understand"

Thanks for your contribution. The goal here is to enlighten each other, not expose ownership of knowledge that one has but doesn't want to share.

Re: Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

#72
post #67

This is not chess, but something that allows to move chess pieces. > Not implemented: castling, en passant, promotion, repetition, 50-move rule.

I have been into computer chess for many years and I was fully expecting those concessionary statements. I have seen enough programs in this lucrative genre where a lot of attention can be gained by fraudulently claiming you implemented chess in a seemingly impossibly small size. When confronted, the charlatans will often claim senselessly that those omissions were in fact superfluous. This is a behaviour I have unfortunately also observed in other areas of computing.

If anyone reading this is interested in small and efficient chess programs that are still reasonably strong, there was a x86 assembly port of Stockfish called asmFish from a couple of years ago (the Win64 release binary was about 130KiB). Also see OliThink (~1000 LOC) and Xiphos which has some of the simplest C code for an engine of its strength that I have seen. I have not investigated the supposedly 4K sized engines that participated in TCEC too closely but from what I have seen so far it would seem that there are a few asterisks to be attached to those claims.

Re: Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

#73

Cool! I just recently implemented a chess engine in ~400 (readable) lines, with all rules, first in Java and then ported to my own programming language "Bau" [1]. This is including a terminal UI. I'll measure the ELO, but I was never able to beat it :-) The castling moves are specially tricky to implement I think. I enjoyed the challenge as well. [1] https://github.com/thomasmueller/bau-lang/blob/main/src/test...

How come there's no unsigned numeric types in Bau?

I tried to describe this in [1]: "Unsigned integer are intentionally not supported to simplify learning and using the language, to avoid surprising behavior and edge cases, and to reduce security issues and error-handling pitfalls. When needed, unsigned behavior is available through explicit operations. This design does not affect performance or memory usage."

I understand this may not sound very convincing yet... it is hard to describe... basically, unsigned types sound simple, but they are not.

[1] https://thomasmueller.github.io/bau-lang/features.html

Re: Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

#74
post #46

Earlier quoted context omitted.

The program that resigns every time unfortunately does a lot worse than random. But it depends on the population it's pitted against - it should at least pick up a few points against copies of itself.

Don't resign, just offer a remise after moving a pawn. Only resign if no pawns are left. I'd claim it would work on human opponents, but I think it would get banned from chess tournaments.

Perhaps playing 1. e4 2. Bc4 3. Qh5 4. Qf7 (and resigning or offering a draw if some move isn't legal) would minmax this further

The problem isn't really well defined. Elo rating is assumed to be determinable independent of what opponents you face, so scoring 50% against opponents rated 1800 gives you the same information as scoring 26% against opponents rated 2000. In practice that's obviously not completely true, and for degenerate examples like the ones we are discussing it completely falls apart.

Re: Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB

#77

Earlier quoted context omitted.

How come there's no unsigned numeric types in Bau?

I tried to describe this in [1]: "Unsigned integer are intentionally not supported to simplify learning and using the language, to avoid surprising behavior and edge cases, and to reduce security issues and error-handling pitfalls. When needed, unsigned behavior is available through explicit operations. This design does not affect performance or memory usage." I understand this may not sound very convincing yet... it…

Hmm, I don't quite follow. For usages like counters or version numbers, it seems like allowing negatives makes things more complicated rather than less.

Like, what if you're getting a u32 over the wire? I feel like using an i32 to represent that data makes it more error-prone. Numbers will unexpectedly appear to be negative?

Post reply on HN