[{"data":1,"prerenderedAt":450},["ShallowReactive",2],{"project-47014500":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":28,"sentiment":29,"stance_mix":30,"scored_comments":34,"aspects":35,"strip":43,"post_text":45,"what":46,"said":69,"maker_in_thread":209,"shape":218,"grid":222,"attempts":412,"same_week":413,"maker_shows":33,"maker_hidden":443,"reader_version":444,"card":445},"47014500","Sameshi","a ~1200 Elo chess engine that fits within 2KB","title","Show HN: Sameshi – a ~1200 Elo chess engine that fits within 2KB","https:\u002F\u002Fgithub.com\u002Fdatavorous\u002Fsameshi","github.com","datavorous_",1771076864,2026,230,69,224,4366,6,"notable","games","chess engine","cli",[21,24,25,26,27],"negamax","code golf","minified chess","demoscene","debated",0,{"positive":31,"neutral":32,"mixed":33,"critical":31},5,8,1,19,{"design":36,"execution":37,"idea":39,"performance":41,"docs":42},{"positive":29,"critical":29},{"positive":33,"critical":38},4,{"positive":40,"critical":29},2,{"positive":29,"critical":33},{"positive":40,"critical":29},[44,33,29,44,29,29,31,29,29,29,33,29,44,33,44,44,31,44,33,44,29,29,29,31,44,29,29,29,29,31,29,29,29,29,29,29,29,31,29,29],3,"I made a chess engine today, and made it fit within 2KB.\nI 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\u002Fstalemate in there, after trimming out some edge cases.\n\nI am a great fan of demoscene (computer art subculture) since middle school, and hence it was a ritual i had to perform.\n\nFor 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.\n\nThen converted pool",{"problem":47,"audience":53,"pricing":53,"motivation":54,"time_to_build":53,"stack":58,"openness":66,"stage":67,"team_size":68},{"value":48,"source":49,"evidence":50},"Playing chess in an extremely small code size","maker",[51],{"id":52},"post",null,{"value":55,"source":49,"evidence":56},"A demoscene-style ritual; maker is a long-time demoscene fan",[57],{"id":52},[59],{"value":60,"source":61,"evidence":62},"C","inferred",[63],{"id":64,"by":11,"text":65},"47015302","Oh well, the file initially looked like https:\u002F\u002Fgithub.com\u002Fdatavorous\u002Fsameshi\u002Fblob\u002F7ab4e47144f96becdb5ad62c3f15e43f230ba381\u002Ftinychess.c It is hideous now!","open_source","launched","solo",{"praise":70,"objections":98,"requests":142,"questions":162,"alternatives":178},[71,87],{"value":72,"source":73,"evidence":74},"Impressive size for a chess engine","commenter",[75,79,83],{"id":76,"by":77,"text":78},"47015192","falsaberN1","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.",{"id":80,"by":81,"text":82},"47015069","haute_cuisine","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 \u002F fide elo) and bullet chess variant?",{"id":84,"by":85,"text":86},"47020954","wittlesus","There's something clarifying about working under extreme constraints like this. When you only have 2KB, you're forced to discover what the irreducible core of chess actually is —…",{"value":88,"source":73,"evidence":89},"Fun code golf challenge",[90,94],{"id":91,"by":92,"text":93},"47015523","esafak","That's an awesome code golf challenge",{"id":95,"by":96,"text":97},"47014861","lekevicius","Do you think it would be possible to achieve 1:1 ELO:bytes? Even smaller, but can be less smart.",[99,114,124,131],{"value":100,"source":73,"evidence":101},"Missing castling, en passant, promotion, repetition and 50-move rule",[102,106,110],{"id":103,"by":104,"text":105},"47015834","sireat","This is very cool and having stalemate is nice, however how much space would it take to implement the full ruleset? As you write: not implemented: castling, en passant,…",{"id":107,"by":108,"text":109},"47020900","galkk","This is not chess, but something that allows to move chess pieces. > Not implemented: castling, en passant, promotion, repetition, 50-move rule.",{"id":111,"by":112,"text":113},"47021708","Mr_Minderbinder","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…",{"value":115,"source":73,"evidence":116},"Stockfish ratings measured with moves filtered, so Elo is for a constrained variant",[117,120],{"id":118,"by":11,"text":119},"47015860","zero games were thrown away for castling, because i forced stockfish not to castle (and not to play en passant\u002Fpromotion) by filtering legal moves and only giving those filtered…",{"id":121,"by":122,"text":123},"47021022","tzs","Wouldn't that just stop it from considering castling, en passant, and promotion on the first move of the position you are analyzing? It's still going to consider those in the…",{"value":125,"source":73,"evidence":126},"Pawn double-step bug: b6b4 accepted after b7b6",[127],{"id":128,"by":129,"text":130},"47015644","jll29","Cool project. You could also use the front-end of GNU chess to save some lines, and implement only a back-end. Bug report: ``` a b c d e f g h 8 r n b q k b n r 8 7 . . p p p p p…",{"value":132,"source":73,"evidence":133},"Minified code is hard to read or contribute to",[134,138],{"id":135,"by":136,"text":137},"47018170","burstw0w","It's not about being hideous, it's about being useless. Your code is useless to anyone that wants to contribute, or maybe make something better by improving on the idea.",{"id":139,"by":140,"text":141},"47014684","chvid","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…",[143,151,155],{"value":144,"source":73,"evidence":145},"Add a readable source version",[146,147],{"id":139,"by":140,"text":141},{"id":148,"by":149,"text":150},"47020788","mackeye","a readable version seems to have just been added! https:\u002F\u002Fgithub.com\u002Fdatavorous\u002Fsameshi\u002Ftree\u002Fmaster\u002Freadable",{"value":152,"source":73,"evidence":153},"Add full rules support",[154],{"id":103,"by":104,"text":105},{"value":156,"source":73,"evidence":157},"Playable version of the engine",[158],{"id":159,"by":160,"text":161},"47052616","Aachen","Nice initiative! Was hoping the \"play\" button\u002Flink would go to a playable version though",[163,174],{"value":164,"source":73,"evidence":165},"How were games with castling or promotion handled",[166,170],{"id":167,"by":168,"text":169},"47014831","GeertB","How did you handle games where Stockfish would castle or promote?",{"id":171,"by":172,"text":173},"47015725","dfc","How many games did you have to throw away because stockfish wanted to castle? Or did you force stockfish to not castle? Castling seems like such a frequent move it is hard to…",{"value":175,"source":73,"evidence":176},"Is the Elo on chess.com scale",[177],{"id":80,"by":81,"text":82},[179,190,194,205],{"value":180,"source":73,"evidence":181},"ToledoChess tiny chess programs",[182,186],{"id":183,"by":184,"text":185},"47017953","dmurray","ToledoChess [0] has a few implementations of this in different languages. Some highlights: 2KB of JavaScript with castling, en passant, promotion, search and even a GUI 326 bytes…",{"id":187,"by":188,"text":189},"47015500","tromp","https:\u002F\u002Fwww.chessprogramming.org\u002FToledo is a family a moderately strong tiny chess programs.",{"value":191,"source":73,"evidence":192},"Video Chess",[193],{"id":103,"by":104,"text":105},{"value":195,"source":73,"evidence":196},"Ice4 and TCEC 4k engines",[197,201],{"id":198,"by":199,"text":200},"47015383","sigmoid10","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. Deep…",{"id":202,"by":203,"text":204},"47015085","grumpopotamus","There is a TCEC category for 4k engines. The top ones are ~3000 Elo.",{"value":206,"source":73,"evidence":207},"OliThink and Xiphos",[208],{"id":111,"by":112,"text":113},{"comments":18,"answered":38,"key":210},[211,214,217],{"id":212,"text":213},"47015722","Thanks for pointing it out! I will try to patch it. Appreciate you taking the time to test it.",{"id":215,"text":216},"47014979","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",{"id":118,"text":119},{"commenters":219,"max_depth":32,"maker_replies":18,"first_comment_mins":220,"lifespan_hours":221},52,25,78,[223,225,227,229,231,234,236,238,242,244,247,249,251,254,257,259,261,262,264,266,270,273,274,276,277,279,283,286,290,292,295,297,301,306,308,312,316,318,319,322,325,330,335,338,340,342,345,346,349,352,355,358,361,365,370,373,375,378,382,384,386,388,390,393,396,400,402,404,406,409],[103,29,44,224,104,29],"project\u002Fneutral\u002Fdesign",[183,29,29,226,184,29],"other\u002Fneutral\u002Fnone",[128,33,33,228,129,29],"project\u002Fcritical\u002Fexecution",[212,33,29,230,11,33],"maker\u002Fpositive\u002Fexecution",[232,40,29,226,233,29],"47015879","l674",[95,44,44,235,96,29],"project\u002Fneutral\u002Fidea",[215,44,29,237,11,33],"maker\u002Fneutral\u002Fidea",[239,44,29,240,241,29],"47015510","other\u002Fneutral\u002Fidea","iterance",[243,44,29,240,184,29],"47017857",[245,44,29,240,246,29],"47019339","contravariant",[248,44,29,240,184,29],"47022039",[91,44,31,250,92,29],"project\u002Fpositive\u002Fidea",[252,38,29,226,253,29],"47018229","thomasmg",[255,38,29,226,256,29],"47020179","ycombinatrix",[258,38,29,226,253,29],"47021839",[260,38,29,226,256,29],"47045269",[187,31,29,226,188,29],[171,18,33,263,172,29],"project\u002Fcritical\u002Fperformance",[118,18,29,265,11,33],"maker\u002Fneutral\u002Fperformance",[267,18,29,268,269,29],"47018145","commenter\u002Fneutral\u002Fperformance","jsmith99",[271,18,29,268,272,29],"47019461","YawningAngel",[121,18,44,265,122,29],[107,275,33,228,108,29],7,[111,275,33,228,112,29],[139,32,44,278,140,29],"project\u002Fneutral\u002Fdocs",[280,32,29,281,282,29],"47014768","commenter\u002Fneutral\u002Fnone","noutella",[284,32,44,278,285,29],"47014846","alansaber",[287,32,29,288,289,29],"47014970","commenter\u002Fneutral\u002Fdocs","TZubiri",[148,32,31,291,149,29],"maker\u002Fpositive\u002Fdocs",[167,293,44,294,168,29],9,"maker\u002Fneutral\u002Fexecution",[296,293,29,294,11,33],"47014881",[298,293,33,299,300,29],"47016291","maker\u002Fcritical\u002Fexecution","comboy",[302,303,29,304,305,29],"47022054",10,"other\u002Fpositive\u002Fnone","yuppiepuppie",[159,303,44,307,160,29],"project\u002Fneutral\u002Fexecution",[309,310,44,311,136,29],"47015244",11,"project\u002Fmixed\u002Fdocs",[313,310,29,314,315,29],"47015300","commenter\u002Fcritical\u002Fdocs","y-curious",[64,310,29,317,11,33],"maker\u002Fcritical\u002Fdocs",[135,310,29,314,136,29],[320,310,29,288,321,29],"47019995","bstsb",[323,310,29,314,324,29],"47020647","recursive",[326,327,31,328,329,29],"47022240",12,"project\u002Fpositive\u002Fexecution","drev",[331,332,29,333,334,29],"47018444",13,"other\u002Fneutral\u002Fdocs","kachapopopow",[80,336,44,337,81,29],14,"project\u002Fneutral\u002Fperformance",[202,336,29,339,203,29],"other\u002Fneutral\u002Fperformance",[341,336,29,240,199,29],"47015229",[343,336,29,339,344,29],"47015266","kevmo314",[198,336,29,268,199,29],[347,336,29,348,344,29],"47015513","commenter\u002Fneutral\u002Fidea",[350,336,29,240,351,29],"47015336","vunderba",[353,336,29,240,354,29],"47017402","senfiaj",[356,336,29,240,357,29],"47018086","gnramires",[76,359,31,360,77,29],15,"project\u002Fpositive\u002Fdocs",[362,363,29,339,364,29],"47018423",16,"dxxvi",[366,367,29,368,369,29],"47015746",17,"other\u002Fcritical\u002Fidea","oh_my_goodness",[371,367,29,281,372,29],"47015854","jqr-",[374,367,29,240,369,29],"47016341",[376,367,29,240,377,29],"47017008","AlexCoventry",[379,367,29,380,381,29],"47018902","commenter\u002Fcritical\u002Fnone","CyberDildonics",[383,367,29,281,369,29],"47020350",[385,367,29,380,381,29],"47020530",[387,367,29,281,369,29],"47020570",[389,367,29,281,381,29],"47020776",[391,367,29,281,392,29],"47021437","sevg",[394,367,29,281,395,29],"47021532","charles_f",[397,367,29,398,399,29],"47016366","other\u002Fcritical\u002Fnone","vardump",[84,401,31,250,85,29],18,[403,34,29,226,289,29],"47014953",[405,34,29,226,11,33],"47015043",[407,34,29,226,408,29],"47015445","semi-extrinsic",[410,34,29,226,411,29],"47017168","lyu07282",[],[414,419,424,429,434,438],{"id":415,"name":416,"points":417,"category":418},"47031334","Jemini",488,"ai",{"id":420,"name":421,"points":422,"category":423},"47051852","AsteroidOS 2.0",470,"hardware",{"id":425,"name":426,"points":427,"category":428},"47026186","Microgpt",282,"learning_science",{"id":430,"name":431,"points":432,"category":433},"47040375","FreeFlow",277,"productivity",{"id":435,"name":436,"points":437,"category":428},"47008163","Data Engineering Book",251,{"id":439,"name":440,"points":441,"category":442},"47011567","SQL-tap",233,"dev_tools",false,"v2",{"id":446,"name":5,"line":6,"ai":443,"cat":20,"year":13,"points":14,"comments":15,"rec":28,"s":29,"top":18,"kw":447,"maker":11,"domain":10,"tier":19,"attempts":29,"strip":448,"url":9,"mix":449,"praise":72,"objection":100,"sub":21},47014500,[21,24,25,26,27],"3103005000103133531300053000050000000500",[31,32,33,31],1794036693251]