From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 2LwJGxIBw2SscQAASxT56A (envelope-from ) for ; Fri, 28 Jul 2023 01:43:14 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id eDcNGxIBw2S2/AAA9RJhRA (envelope-from ) for ; Fri, 28 Jul 2023 01:43:14 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DA6EC535CD for ; Fri, 28 Jul 2023 01:43:13 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=twdb.moe header.s=default header.b=HoQ99i5i; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1690501394; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=R3SC5tXU3aRhjeEtrefjscL9vAVHnA12gaDqg3C26dU=; b=YSDP/639aI81/b2scrcZtE2ywhK6DzwcSQijhx4wsa0X3EhtVERK+99ob0xJqhpJ88rC7/ Gs5pVw5fH86PHvj3HD2XyiaKU4MLj1dhKbbwnwEBDBL/P5lKIOQZ5lWaT71QO64zkXWUWR Jppw0CxSTGhFg3Z9J2mGegPlyv7WdZLxg6ZpAlCVuFpGnzTKXLPIwfaMdUEkMet/GmG1/w g82TxlC+asKk1Z2ZeYzQhDCw1tOIpuIKOHSAS6OWkAUF39m5skcVd2wG4H/XtDT646g9JD JSnafuPMrnJ9RxX/LGdXAzlZ6hKKovnlZ5Aj99mOdHV2XZvX+4Pum1eARxxKSw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1690501394; a=rsa-sha256; cv=none; b=nm/0UjGoKDKTC1UgRwe+qS8RQMhvwWcul0Lr1ukY7Bz502+AxBcf0wIC2BPiR8CYmWXhoj XFsgJQN5zejaMULKWErcDZifsGkHJXCLvBm2mXwMguns69bLhQ5qrqLgggPZ/EU+XEoQTM XCAZlTtcaCy13jjL5LVcfa79el5t2222GdrJw2ozaGG5Mp/g6oTh+rlyn6zE+X7H6jS+uA alL6u1IE/yPUblfx/Tgf6xa5sQ8DIdYNAHk4fxGPPLvk9ipP1WDywxnpvAqRRs0ly21VHR GNa0quGRJPE+c62F8WaXLShvCtBP83jNJqTm7OgdWUBWxo0XASY1EVMOhx6slg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none ("invalid DKIM record") header.d=twdb.moe header.s=default header.b=HoQ99i5i; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=none Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qPAVf-0000UV-Qt; Thu, 27 Jul 2023 19:35:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qPAVd-0000Q1-Mp for guix-patches@gnu.org; Thu, 27 Jul 2023 19:35:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qPAVd-0001SR-Ez for guix-patches@gnu.org; Thu, 27 Jul 2023 19:35:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qPAVa-0003oJ-DB; Thu, 27 Jul 2023 19:35:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63088] [PATCH] Add Lc0. References: In-Reply-To: Resent-From: zamfofex Original-Sender: "Debbugs-submit" Resent-CC: liliana.prikler@gmail.com, iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Thu, 27 Jul 2023 23:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63088 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63088@debbugs.gnu.org Cc: zamfofex , zimon.toutoune@gmail.com, Liliana Marie Prikler , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= X-Debbugs-Original-Xcc: Liliana Marie Prikler , =?UTF-8?Q?=E5=AE=8B=E6=96=87=E6=AD=A6?= Received: via spool by 63088-submit@debbugs.gnu.org id=B63088.169050088814622 (code B ref 63088); Thu, 27 Jul 2023 23:35:02 +0000 Received: (at 63088) by debbugs.gnu.org; 27 Jul 2023 23:34:48 +0000 Received: from localhost ([127.0.0.1]:43287 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPAVL-0003nl-ST for submit@debbugs.gnu.org; Thu, 27 Jul 2023 19:34:48 -0400 Received: from mta-09-4.privateemail.com ([198.54.127.118]:26367) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qPAVG-0003nV-J4 for 63088@debbugs.gnu.org; Thu, 27 Jul 2023 19:34:46 -0400 Received: from mta-09.privateemail.com (localhost [127.0.0.1]) by mta-09.privateemail.com (Postfix) with ESMTP id 8242F180007F; Thu, 27 Jul 2023 19:34:36 -0400 (EDT) Received: from smtp.gmail.com (unknown [186.222.85.100]) by mta-09.privateemail.com (Postfix) with ESMTPA id 5BCB91800079; Thu, 27 Jul 2023 19:34:33 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=twdb.moe; s=default; t=1690500876; bh=3wKg9X4GdZG5nSF2AZ3V0tpll1tJ+HLuX5Hf9ZiH4DE=; h=From:To:Cc:Subject:Date:From; b=HoQ99i5iK4KLhnhA2uZGLQx3BeM9ogo+vzJ5E2gQqcIdOpxGMg+cDLHJe8U+PLVvk v3nft7nbu24wYawY1j0+t7MvHZZbbupn+J8KMK7hjyjVGVkypa2ZZab9VoPXXdfBdO 0nHu8J8f1zsY7iJxxSsw4p4YDxlDVfjX/+K5NFgjxoVSS5kemkmHVDry0I8uHBtSGs mQESkK8/h6r+jcZFa59UMm8owqXcxEOFswzOCJx+xAwFJV0CdcMPf1ZYvsHfveoP61 XbMMC7mhwFu9wvMv4ztjdtDVZ6tTP/0eusZri/n+HERKW0nAmfjyYg/kLAvXaZAX2g TbyaoltNh1oSg== From: zamfofex Date: Thu, 27 Jul 2023 20:34:05 -0300 Message-Id: X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.15 X-Spam-Score: -2.15 X-Migadu-Queue-Id: DA6EC535CD X-Migadu-Scanner: mx1.migadu.com X-TUID: 2hZO+QkrRauD Lc0 recently released version 0.30.0, so here is a patch with the updates version (in case the issue regarding the network’s inclusion is ever resolved). Also, I wanted to say: Is it reasonable to include Lc0 without the networks in? People can still download and use them, they just wouldn’t be included in Guix itself. Note that, unlike Stockfish, Lc0 does run without the neural networks, so it would be necessary for the user to download or otherwise acquire one by themself in order to use Lc0. The user can choose an appropriate network in their chess GUI program when configuring Lc0 in it. If this is more desireable, I can submit a patch without the trained neural network, which would allow the user to choose whichever one they might want. Thanks in advance! * gnu/packages/games.scm (lc0): New variable. --- gnu/packages/games.scm | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index cc6bef1114..21aa370701 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -118,6 +118,7 @@ (define-module (gnu packages games) #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages boost) + #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) @@ -171,6 +172,7 @@ (define-module (gnu packages games) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages lua) + #:use-module (gnu packages machine-learning) #:use-module (gnu packages man) #:use-module (gnu packages maths) #:use-module (gnu packages messaging) @@ -10285,6 +10287,62 @@ (define-public stockfish (home-page "https://stockfishchess.org/") (license license:gpl3+)))) +(define lc0-neural-network + (let ((hash + "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34")) + (origin + (method url-fetch) + (uri (string-append "https://storage.lczero.org/files/networks/" + hash)) + (sha256 + (base32 + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi")) + (file-name "lc0-neural-network")))) + +(define-public lc0 + (package + (name "lc0") + (version "0.30.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LeelaChessZero/lc0") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3")))) + (build-system meson-build-system) + (native-search-paths + (list (search-path-specification + (variable "XDG_DATA_DIRS") + (files (list "share"))))) + (inputs + `(("neural-network" ,lc0-neural-network) + ("eigen" ,eigen) + ("oneapi-dnnl" ,oneapi-dnnl) + ("zlib" ,zlib))) + (native-inputs + (list googletest ispc pkg-config python)) + (arguments + '(#:phases (modify-phases %standard-phases + (add-after 'install 'copy-net + (lambda* (#:key outputs inputs #:allow-other-keys) + (mkdir-p (string-append (assoc-ref outputs "out") + "/share/lc0")) + (copy-file (assoc-ref inputs "neural-network") + (string-append (assoc-ref outputs "out") + "/share/lc0/neural-network"))))) + #:configure-flags (list "-Ddnnl=true" + (string-append + "-Ddnnl_dir=" + (assoc-ref %build-inputs "oneapi-dnnl"))))) + (synopsis "Neural network based chess engine") + (description "Lc0 is a chess engine based on neural networks") + (home-page "https://lczero.org") + (license license:gpl3+))) + (define-public barrage (package (name "barrage") base-commit: c7e45139faa27b60f2c7d0a4bc140f9793d97d47 -- 2.40.1