{"id":19487820,"url":"https://github.com/rictorlome/pupil","last_synced_at":"2026-01-23T07:34:41.271Z","repository":{"id":89897417,"uuid":"153011789","full_name":"rictorlome/pupil","owner":"rictorlome","description":"♟️Chess engine and AI ♟️","archived":false,"fork":false,"pushed_at":"2022-06-26T19:20:08.000Z","size":149,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-25T18:40:05.676Z","etag":null,"topics":["ai","bitboard","chess","chess-engine"],"latest_commit_sha":null,"homepage":"https://pupil.fly.dev/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rictorlome.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-14T19:38:15.000Z","updated_at":"2022-06-26T19:19:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"3d4f0de5-f0dc-4fb4-845a-c26aac038e00","html_url":"https://github.com/rictorlome/pupil","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rictorlome/pupil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rictorlome%2Fpupil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rictorlome%2Fpupil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rictorlome%2Fpupil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rictorlome%2Fpupil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rictorlome","download_url":"https://codeload.github.com/rictorlome/pupil/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rictorlome%2Fpupil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28683453,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","bitboard","chess","chess-engine"],"created_at":"2024-11-10T20:47:38.188Z","updated_at":"2026-01-23T07:34:41.254Z","avatar_url":"https://github.com/rictorlome.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pupil\n\n[Live link](https://pupil.fly.dev/)\n## Overview\n\nPupil is a chess engine written in `Go`. The goal of writing this program was to create an engine capable of beating me in a 10 minute game.\n\n[Perft tests](https://www.chessprogramming.org/Perft) pass for the [initial board state](https://www.chessprogramming.org/Perft_Results#Initial_Position) and for [kiwipete](https://www.chessprogramming.org/Perft_Results#Position_2) up to depths 6 and 5 respectively.\n\nSome of the major optimizations include: [bitboard](https://www.chessprogramming.org/Bitboards) piece representation, [magic bitboards](https://www.chessprogramming.org/Magic_Bitboards) for move generation, multi-threaded perft tests (for development speed), object pooling, and a transposition table keyed via [zobrist hashes](https://www.chessprogramming.org/Zobrist_Hashing).\n\nAlthough nowhere near as complete, the code is heavily inspired by the open-source [Stockfish](https://github.com/official-stockfish/Stockfish) project, whose source code I dipped into heavily.\n\n#### Note to anyone reading the code:\n\nApologies for the weird code style. I began this project before installing a linter in my editor/becoming familiar with the golang style guide. I haven't been able to find a good codemod/script to automatically clean it up. If you know of any, please let me know.\n\n---\n\n## Description\n\n| Feature                | Implementation                                                                                                                                                                                                                                                                                                                            |\n| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Board representation   | [Bitboard](https://www.chessprogramming.org/Bitboards)                                                                                                                                                                                                                                                                                    |\n| Square mapping         | [Little-endian Rank-file Mapping](https://www.chessprogramming.org/Square_Mapping_Considerations#Little-Endian_Rank-File_Mapping)                                                                                                                                                                                                         |\n| Bitboard Serialization | [Forward-scanning](https://www.chessprogramming.org/Bitboard_Serialization#Scanning_Forward)                                                                                                                                                                                                                                              |\n| Move encoding          | [16 bit From-to based](https://www.chessprogramming.org/Encoding_Moves#From-To_Based)                                                                                                                                                                                                                                                     |\n| Move Generation        | [Magic Bitboard approach](https://www.chessprogramming.org/Magic_Bitboards)                                                                                                                                                                                                                                                               |\n| Search                 | [AlphaBeta search](https://www.chessprogramming.org/Alpha-Beta) within the [Negamax](https://www.chessprogramming.org/Negamax) framework. Currently uses [transposition tables](https://www.chessprogramming.org/Transposition_Table) to cache information about the different [node types](https://www.chessprogramming.org/Node_Types). |\n| Evaluation             | [Simplified Evaluation Function](https://www.chessprogramming.org/Simplified_Evaluation_Function): Material value and positional value based on precomputed arrays.                                                                                                                                                                       |\n\n---\n\n## History\n\nThis is my third attempt at a chess engine.\n\n### The predecessors:\n\n1.  [Rhess](https://github.com/rictorlome/rhess) - a command line game written in `Ruby` using a [mailbox](https://www.chessprogramming.org/Mailbox) 8x8 board representation. Styled with 100% unicode and playable via keyboard.\n\n2.  [Gogochess](https://github.com/rictorlome/gogochess) - a chess-move generator written in `Go` with a custom `HashMap` based move-list. Passing [perft tests](https://www.chessprogramming.org/Perft_Results) up to depth 5 and capable of solving `Mate-in-Twos` in less than a minute. Configured with `HTTP` API for browser integration and easy testing.\n\n---\n\n## Todo\n\n- [x] Test alpha-beta against negamax.\n- [x] Update transposition table for non-perft search\n- [x] Cache best move\n- [x] Update alpha-beta to search best move first\n- [x] Limit cache entry size\n- [x] Implement LRU/better cache clearing (simple array)\n- [x] Flesh out frontend for better UX\n- [x] Experiment compiling to WebAssembly\n- [x] Deploy (WebAssembly or no)\n\n## Nice to haves:\n\n- [ ] Quiescence search\n- [ ] Iterative deepening with time limit\n- [ ] Concurrent alpha-beta\n- [ ] Lint\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frictorlome%2Fpupil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frictorlome%2Fpupil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frictorlome%2Fpupil/lists"}