frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

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

https://github.com/datavorous/sameshi
45•datavorous_•2h ago
I made a chess engine today, and made it fit within 2KB. I used a variant of MinMax called Negamax, with alpha beta pruning. For the board representation I have used a 120-cell "mailbox". I managed to squeeze in checkmate/stalemate in there, after trimming out some edge cases.

I am a great fan of demoscene (computer art subculture) since middle school, and hence it was a ritual i had to perform.

For estimating the Elo, I measured 240 automated games against Stockfish Elo levels (1320 to 1600) under fixed depth-5 and some constrained rules, using equal color distribution.

Then converted pooled win/draw/loss scores to Elo through some standard logistic formula with binomial 95% confidence interval.

Comments

chvid•1h ago
Cool that you could keep it under 2k but it would nice to have a readable version of the source code.

Do you work with it like this or do you have some sort of script you apply to get it down to a single line, single letter variable names?

noutella•1h ago
What you’re describing is the typical output / function of a minifier
alansaber•1h ago
The real fun would be reverse-engineering the minified code (there are loads of tools to do this for chrome extensions)
TZubiri•1h ago
not lossless
GeertB•1h ago
How did you handle games where Stockfish would castle or promote?
datavorous_•1h ago
i forced stockfish to play only non castling, non en passant, non promotion moves by filtering legal moves and passing only those as root_moves

also removed castling/EP rights from FEN

lekevicius•1h ago
Do you think it would be possible to achieve 1:1 ELO:bytes? Even smaller, but can be less smart.
datavorous_•1h ago
maybe for very low ratings it's plausible? 1 elo per byte might happen in a tiny range but at a useful strength it would break fast, that's what i think
TZubiri•1h ago
Codex or Claude Code?
datavorous_•52m ago
none.

scribbling long enough on a piece of paper is more enjoyable than prompting.

haute_cuisine•48m ago
This is amazing! Thanks for sharing. What would be the elo gain for 4KB engine?

P.S. I assume 1200 elo in chess com scale (not lichess / fide elo) and bullet chess variant?

grumpopotamus•46m ago
There is a TCEC category for 4k engines. The top ones are ~3000 Elo.
sigmoid10•28m ago
It's wild to think that 4096 bytes are sufficient to play chess on a level beyond anything humans ever achieved. Makes you think what other difficult tasks are out there that take even highly gifted humans years or decades to master, but a superior algorithm would more or less fit into one of those big QR code formats.

These things always make me think back to Westworld season 2, where the finale revealed that human minds are much simpler than they themselves believe and fit completely into an algorithm that could be printed in an average book.

kevmo314•23m ago
The core search algorithm is very simple though. 4KB engines may not run that fast if they do exhaustive search, but they’ll be quite accurate.

According to TCEC the time control is 30 mins + 3 sec, that’s a lot of compute!

sigmoid10•9m ago
If you look at the current winner [1], it does a lot more than just brute force tree search. The space state for chess is simply too big to cover without good heuristics.

[1] https://github.com/MinusKelvin/ice4

vunderba•15m ago
Well, one of the most fundamental algorithms for building a chess AI is minimax [1] (or variants like negamax), and that’s been around for close to a century. The key difference is that as compute power and available RAM have grown, it’s become possible to search much deeper and evaluate far more plies.

So while 4k is still very impressive for the code base, it comes with a significantly larger runtime footprint.

[1] - https://en.wikipedia.org/wiki/Minimax

falsaberN1•32m ago
Oh my god the source is so tiny! It's really hard to parse because of it being minified but I love it to bits.
burstw0w•26m ago
Good job! I love how you obfuscated your code, really in a spirit of FOSS!
y-curious•20m ago
Coworker: “hey if you have a second, I have a one-liner PR open”

The PR:

datavorous_•20m ago
Oh well, the file initially looked like https://github.com/datavorous/sameshi/blob/7ab4e47144f96becd...

It is hideous now!

The most beautiful collection of science, mathematics, and internet resources

https://abakcus.com/
1•tempodox•43s ago•0 comments

Show HN: We built AI to help bidding teams – mentioned by Kunal Bahl on ET Now

https://www.contravault.com
1•tanmayjuneja8•1m ago•0 comments

New marketplace let's you exchange metals locall

https://metalmoves.app/
1•zekardd•1m ago•0 comments

Data Models

https://datamodels.databases.biz/
1•TheAceOfHearts•3m ago•0 comments

The Untold Story of NotPetya, the Most Devastating Cyberattack in History

https://www.wired.com/story/notpetya-cyberattack-ukraine-russia-code-crashed-the-world/
1•basilikum•4m ago•0 comments

Show HN: A "TLDR for the internet" – curious if this is your problem

https://ondex.co
1•andrevaillant•5m ago•1 comments

As Complexity Grows, Architecture Dominates Material

https://worksonmymachine.ai/p/as-complexity-grows-architecture
1•Stwerner•5m ago•0 comments

Platforms bend over backward to help DHS censor ICE critics, advocates say

https://arstechnica.com/tech-policy/2026/02/platforms-bend-over-backward-to-help-dhs-censor-ice-c...
3•pjmlp•6m ago•0 comments

Show HN: Whisper Money – Open-source, privacy-first personal finance app

https://github.com/whisper-money/whisper-money
1•falcon_•8m ago•0 comments

Why do office chairs have 5 legs? [video]

https://www.youtube.com/watch?v=kKt46Lch2bo
2•throw0101c•9m ago•0 comments

Hare 0.26.0 Released

https://harelang.org/blog/2026-02-13-hare-0.26.0-released/
3•birdculture•9m ago•0 comments

I updated the README and my Benchmarks Regressed

https://codspeed.io/blog/unrelated-benchmark-regression
2•not-matthias•12m ago•1 comments

Switzerland to Vote on Capping Population at 10M

https://www.nytimes.com/2026/02/11/world/europe/switzerland-to-vote-on-capping-population-at-10-m...
7•bookofjoe•14m ago•3 comments

Writing C with indent-based syntax similar to CoffeeScript or Python, via Guile

https://sph.mn/computer/guides/c/c-indent.html
1•fanf2•14m ago•0 comments

A Programmer's Loss of Identity

https://ratfactor.com/tech-nope2
1•zdw•14m ago•0 comments

Code Archaeologists – Kevin.md

https://www.kevin.md/code-archaeologists.md/
1•thekevintang•16m ago•0 comments

Vim 9.2 Released

https://www.vim.org/vim-9.2-released.php
2•tapanjk•17m ago•0 comments

Promises Are Cheap

https://garymarcus.substack.com/p/promises-are-cheap
1•mldev_exe•17m ago•0 comments

Show HN: Musecl-memory – Persistent memory for AI agents in 200 lines of bash

https://github.com/musecl/musecl-memory
2•musecl•19m ago•0 comments

Use YouTube Privately – Materialious

https://github.com/Materialious/Materialious
2•wardpearce•19m ago•1 comments

My smart sleep mask broadcasts users' brainwaves to an open MQTT broker

https://aimilios.bearblog.dev/reverse-engineering-sleep-mask/
6•minimalthinker•21m ago•1 comments

Show HN: Isol8 – An isolated environment for AI agents to execute code

https://github.com/Illusion47586/isol8
1•masterbruce10•22m ago•0 comments

$8K laundry bot knows it has help standing by

https://www.theregister.com/2026/02/12/laundry_folding_robot_8000_dollars_teleoperated/
2•YeGoblynQueenne•23m ago•0 comments

She didn't expect to fall in love with a chatbot – and then have to say goodbye

https://www.bbc.co.uk/news/articles/crl43dxwwy9o
1•headalgorithm•27m ago•0 comments

Ask HN: Are junior devs getting worse?

1•tavro•27m ago•3 comments

AI Hunts for the Next Big Thing in Physics

https://spectrum.ieee.org/particle-physics-ai
3•Brajeshwar•28m ago•0 comments

Where There Is Connectivity There Is Surveillance

https://www.noemamag.com/where-there-is-connectivity-there-is-surveillance/
3•Brajeshwar•28m ago•0 comments

System Prompts Define Agent Behavior

https://www.dbreunig.com/2026/02/10/system-prompts-define-the-agent-as-much-as-the-model.html
2•Brajeshwar•28m ago•0 comments

Show HN: Windows 98½ – fake desktop, real Internet

https://win9-5.com/demo
3•keepamovin•28m ago•6 comments

Show HN: Built and shipped an iOS app from my phone while traveling Japan

https://apps.apple.com/es/app/kotomaji-frases-jap%C3%B3n/id6755911289
2•lordokami•29m ago•0 comments