Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
6c6d985
Initial plan
Copilot Jan 24, 2026
0786d8c
Implement neural network infrastructure for MCTS
Copilot Jan 24, 2026
4de5a4d
Address code review issues
Copilot Jan 24, 2026
1f471ef
Implement full policy tables with 1858 move mappings
Copilot Jan 25, 2026
a3973d6
Implement full position encoder with 8-position history and canonical…
Copilot Jan 25, 2026
d382173
Implement Metal/MPSGraph backend for transformer neural network infer…
Copilot Jan 25, 2026
6fe652c
Add Metal backend documentation and fix memory management
Copilot Jan 25, 2026
6dc2713
Implement Metal/MPSGraph transformer backend for NN inference
Copilot Jan 25, 2026
d3d1b38
Complete MCTS integration with neural network backend
Copilot Jan 25, 2026
68cc845
Address code review: Extract magic numbers to named constants
Copilot Jan 25, 2026
05311a1
Complete verification tests with all 15 benchmark positions and updat…
Copilot Jan 26, 2026
bfb3fcf
Merge main into copilot/implement-lc0-neural-network-inference-again
NripeshN Jan 26, 2026
b3f7f9f
Fix PR review issues: remove build artifacts and map knight promotion…
Copilot Jan 26, 2026
7106b13
Update Elo tournament workflow to support manual trigger with optiona…
NripeshN Jan 26, 2026
686ed6c
Enhance CI workflows by adding dependency installation steps for macO…
NripeshN Jan 26, 2026
9000926
Refactor MCTS source files in CMakeLists.txt by removing unused files
NripeshN Jan 26, 2026
74b84d3
Enhance CMake configuration and CI workflows for protobuf and absl in…
NripeshN Jan 26, 2026
e0a6f37
Update CMake and CI workflows to improve absl library handling
NripeshN Jan 26, 2026
6593b74
Fix critical bugs: recalculate max_score after NN blending and use re…
Copilot Jan 26, 2026
c63ee6c
Fix castling plane order consistency and invalid move policy index
Copilot Jan 26, 2026
b43f2a6
Add MetalFish transformer inference
NripeshN Feb 7, 2026
cae7dd8
Fix multiple bugs in NN encoder and policy map
cursoragent Feb 7, 2026
919a924
Update src/nn/metal/metal_network.mm
NripeshN Feb 7, 2026
d21e4ca
Add Lc0 compatible Metal inference
NripeshN Feb 7, 2026
3e73645
Implement MetalFish inference for Lc
NripeshN Feb 7, 2026
a322040
Implement MetalFish neural inference
NripeshN Feb 7, 2026
a2483e8
Add transform support and network factory improvements
NripeshN Feb 7, 2026
a419df0
Add Metal backend Lc0 inference
NripeshN Feb 7, 2026
ecccdd0
Add MetalFish Metal NN inference
NripeshN Feb 7, 2026
75c6e00
Add lc0_ref submodule config
NripeshN Feb 7, 2026
5d533e8
Fix CMake build issues: add missing NN_SOURCES to CUDA tests and remo…
cursoragent Feb 7, 2026
c48b4e0
Implement MetalFish Lc0-style nn
NripeshN Feb 7, 2026
a9dde74
Handle missing NN history states
NripeshN Feb 7, 2026
db792a8
Implement MetalFish Lc0 inference
NripeshN Feb 7, 2026
2a6621d
Fix neural network policy and encoding bugs
cursoragent Feb 7, 2026
1e18020
Fix NN comparison mismatch initial
NripeshN Feb 7, 2026
0de7f97
Fix policy map transform bugs and add missing Accelerate framework link
cursoragent Feb 8, 2026
53ab23a
Add policy softmax temperature and simplify transform logic
NripeshN Feb 8, 2026
54459a3
delete ref
NripeshN Feb 8, 2026
2e2f68f
Fix NN policy logit filtering and redundant NN evaluations
cursoragent Feb 8, 2026
9695b8d
Refactor CMake configuration and add new source files for benchmarks
NripeshN Feb 9, 2026
d77a7f6
Fix three bugs: Metal batch size, NNUE paths, encoder flip
cursoragent Feb 9, 2026
1121bde
refactor codebase
NripeshN Feb 9, 2026
f97b5cd
Update README to reflect restructured codebase
NripeshN Feb 9, 2026
1051d59
fast operations
NripeshN Feb 9, 2026
0b93f6b
remove cuda tests
NripeshN Feb 9, 2026
498a7a8
UCI clean up
NripeshN Feb 9, 2026
94538b2
clean tests
NripeshN Feb 9, 2026
fad6356
Refactor Metal and MCTS components for improved performance and clarity
NripeshN Feb 9, 2026
e61c002
Add GatherBatchEvaluator for cooperative batching in MCTS
NripeshN Feb 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 65 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ jobs:
echo ""
echo "Available Metal devices:"
system_profiler SPDisplaysDataType | grep -A 5 "Metal" || echo "Metal info not available in CI"
echo ""
echo "Installing dependencies..."
brew install protobuf zlib abseil

- name: Setup environment (Ubuntu)
if: runner.os == 'Linux'
Expand All @@ -99,6 +102,10 @@ jobs:
else
echo "No NVIDIA GPU detected (nvidia-smi not found)"
fi
echo ""
echo "Installing dependencies..."
sudo apt-get update
sudo apt-get install -y libprotobuf-dev protobuf-compiler zlib1g-dev
shell: bash

- name: Setup environment (Windows)
Expand All @@ -118,11 +125,23 @@ jobs:
}
shell: pwsh

- name: Install dependencies (Windows)
if: runner.os == 'Windows'
run: |
# Install vcpkg and protobuf
git clone https://github.com/Microsoft/vcpkg.git C:\vcpkg
C:\vcpkg\bootstrap-vcpkg.bat
C:\vcpkg\vcpkg install protobuf:x64-windows zlib:x64-windows
echo "CMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake" >> $env:GITHUB_ENV
shell: pwsh

- name: Download NNUE files
run: |
mkdir -p src
cd src
mkdir -p networks
cd networks
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-c288c895ea92.nnue
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-37f18f62d772.nnue
ls -la
shell: bash
Expand All @@ -135,7 +154,8 @@ jobs:
restore-keys: |
${{ runner.os }}-${{ matrix.os }}-cmake-

- name: Configure CMake
- name: Configure CMake (Unix)
if: runner.os != 'Windows'
run: |
cmake -S . -B build \
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \
Expand All @@ -144,6 +164,17 @@ jobs:
-DBUILD_TESTS=ON
shell: bash

- name: Configure CMake (Windows)
if: runner.os == 'Windows'
run: |
cmake -S . -B build `
-DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} `
-DUSE_METAL=${{ matrix.use_metal }} `
-DUSE_CUDA=${{ matrix.use_cuda }} `
-DBUILD_TESTS=ON `
-DCMAKE_TOOLCHAIN_FILE=C:\vcpkg\scripts\buildsystems\vcpkg.cmake
shell: pwsh

- name: Build (Unix)
if: runner.os != 'Windows'
run: |
Expand All @@ -159,14 +190,14 @@ jobs:
if: runner.os == 'Windows'
shell: bash
run: |
cp src/*.nnue build/${{ env.BUILD_TYPE }}/ 2>/dev/null || true
cp networks/*.nnue build/${{ env.BUILD_TYPE }}/ 2>/dev/null || true
ls -la build/${{ env.BUILD_TYPE }}/

- name: Copy NNUE files into build output (Unix)
if: runner.os != 'Windows'
shell: bash
run: |
cp src/*.nnue build/ 2>/dev/null || true
cp networks/*.nnue build/ 2>/dev/null || true
ls -la build/

- name: Run C++ Tests (Unix)
Expand Down Expand Up @@ -246,11 +277,19 @@ jobs:
nvcc --version
shell: bash

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libprotobuf-dev protobuf-compiler zlib1g-dev
shell: bash

- name: Download NNUE files
run: |
mkdir -p src
cd src
mkdir -p networks
cd networks
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-c288c895ea92.nnue
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-37f18f62d772.nnue
ls -la
shell: bash
Expand All @@ -271,7 +310,7 @@ jobs:

- name: Copy NNUE files into build output
run: |
cp src/*.nnue build/ 2>/dev/null || true
cp networks/*.nnue build/ 2>/dev/null || true
ls -la build/
shell: bash

Expand Down Expand Up @@ -354,11 +393,17 @@ jobs:
with:
submodules: recursive

- name: Install dependencies
run: brew install protobuf zlib abseil
shell: bash

- name: Download NNUE files
run: |
mkdir -p src
cd src
mkdir -p networks
cd networks
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-c288c895ea92.nnue
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-37f18f62d772.nnue
shell: bash

Expand Down Expand Up @@ -412,11 +457,19 @@ jobs:
method: "network"
sub-packages: '["nvcc", "cudart", "cudart-dev"]'

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libprotobuf-dev protobuf-compiler zlib1g-dev
shell: bash

- name: Download NNUE files
run: |
mkdir -p src
cd src
mkdir -p networks
cd networks
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-c288c895ea92.nnue
# NNUE weight files (hosted externally)
curl -L --retry 3 --retry-delay 2 -O https://tests.stockfishchess.org/api/nn/nn-37f18f62d772.nnue
shell: bash

Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/elo-tournament.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name: Elo Tournament

on:
pull_request:
branches: [main]
types: [opened, synchronize, reopened]
workflow_dispatch: # Allow manual trigger
workflow_dispatch: # Manual trigger only
inputs:
pr_number:
description: "PR number to run tournament on (leave empty for current branch)"
required: false
default: ""
games_per_match:
description: "Number of games per match (should be even for color swap)"
required: false
Expand All @@ -15,9 +16,9 @@ on:
required: false
default: "600+0.1"

# Cancel in-progress runs for the same PR when a new push occurs
# Cancel in-progress runs when a new run is triggered
concurrency:
group: elo-tournament-${{ github.event.pull_request.number || github.run_id }}
group: elo-tournament-${{ github.event.inputs.pr_number || github.run_id }}
cancel-in-progress: true

env:
Expand All @@ -43,7 +44,7 @@ jobs:

- name: Install build dependencies
run: |
brew install cmake ninja meson qt@6 coreutils
brew install cmake ninja meson qt@6 coreutils protobuf zlib abseil
pip3 install meson ninja chess
# coreutils provides gtimeout which we alias to timeout
echo "alias timeout=gtimeout" >> ~/.bashrc
Expand Down Expand Up @@ -942,20 +943,20 @@ jobs:
cat results/pr_comment.md

- name: Find existing comment
if: github.event_name == 'pull_request'
if: github.event.inputs.pr_number != ''
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.pull_request.number }}
issue-number: ${{ github.event.inputs.pr_number }}
comment-author: "github-actions[bot]"
body-includes: "🏆 MetalFish Elo Tournament Results"

- name: Post or update PR comment
if: github.event_name == 'pull_request'
if: github.event.inputs.pr_number != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
issue-number: ${{ github.event.inputs.pr_number }}
body-path: ${{ steps.aggregate.outputs.comment_file }}
edit-mode: replace

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -391,4 +391,6 @@ TSWLatexianTemp*
#*Notes.bib
*.pyc
.DS_Store
_codeql_build_dir/
_codeql_detected_source_root
networks/BT4-1024x15x32h-swa-6147500.pb
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "lc0_ref"]
path = lc0_ref
url = https://github.com/LeelaChessZero/lc0
branch = master
Loading
Loading