CODA now has a released page.

Discussion of anything and everything relating to chess playing software and machines.

Moderator: Ras

chessica
Posts: 1121
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: CODA now has a released page.

Post by chessica »

Is it possible that the location of the egtb files is not freely selectable? And that it only works under C:?
adamtwiss
Posts: 9
Joined: Mon Jul 06, 2026 9:33 pm
Full name: Adam Twiss

Re: CODA now has a released page.

Post by adamtwiss »

chessica wrote: Sun Jul 12, 2026 1:10 pm Is it possible that the location of the egtb files is not freely selectable? And that it only works under C:?
Thanks for the feedback. I've just tested it and it looks like drive letters are fine, but there's an issue with UCI handling for paths with spaces in their names (my UCI handling was splitting args on spaces). Can you confirm you had a space in the folder name?

I have just pushed a fix for that now. If you build from source (latest head) it should now work. I am intending to do a 0.9.1 release tomorrow (just waiting for a model train to finish). This fix will be included in it and will have pre-built Windows binaries.

One workaround for you (if it's feasible) is to move it to a folder with no spaces in (e.g. "d:\egtb") should work fine.

Really appreciate the bug report, and please let me know if that doesn't work for you.
op12no2
Posts: 571
Joined: Tue Feb 04, 2014 12:25 pm
Location: Gower, Wales
Full name: Colin Jenkins

Re: CODA now has a released page.

Post by op12no2 »

adamtwiss wrote: Sun Jul 12, 2026 4:09 pm (my UCI handling was splitting args on spaces)
our? 😀
chessica
Posts: 1121
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: CODA now has a released page.

Post by chessica »

now it works....

setoption name SyzygyPath value C:\Program Files\arena_3.5.1\TB\syzygy
info string Syzygy tablebases loaded: 6 pieces from C:\Program Files\arena_3.5.1\TB\syzygy, cache 16 MB

but the makefile was wrong. some errors.

Code: Select all

# Coda Chess Engine — Makefile
# Supports: manual builds, OpenBench integration, PGO builds
#
# Usage:
#   make                  Build with native CPU optimizations
#   make EXE=coda-v2      Build with custom output name
#   make pgo              PGO-optimized build (only helps v5 on main branch — see note below)
#   make openbench        OpenBench-compatible build target
#   make net              Download the production NNUE net
#   make clean            Remove build artifacts

# Configuration
EXE := coda
NET_URL := $(shell cat net.txt 2>/dev/null)
# EVALFILE: defaults to the filename from net.txt (e.g. net-v5-768pw-w7-e800s800-filtered-lowestlr.nnue)
# OB overrides this with an absolute path to the network file.
EVALFILE := $(if $(NET_URL),$(notdir $(NET_URL)),net.nnue)
MIN_RUST_VERSION := 1.70.0

# Platform detection
ifeq ($(OS),Windows_NT)
	NAME := $(EXE).exe
	RM := del /q
else
	NAME := $(EXE)
	RM := rm -f
endif

# Rust flags
export RUSTFLAGS := -Ctarget-cpu=native

# Default: build with embedded NNUE net (downloads from net.txt if needed)
# EVALFILE may be overridden by OpenBench with an absolute path to the network
rule: check-rust net
	CODA_EVALFILE=$(abspath $(EVALFILE)) cargo rustc --release --features embedded-net -- --emit link=$(NAME)

# Alias for OpenBench compatibility
openbench: rule

# PGO build (profile-guided optimization).
#
# Status (2026-05-17): builds cleanly with cgu=16 (the v9-era crash that
# the prior comment described is gone), but PGO with bench-13 profile is
# fleet-fragile and not shipped as default. Production-class hardware
# (Lichess host, "fast ionos" cohort) shows ~0 Elo; Zen 5 hosts (zeus)
# regress -18.5 Elo. Older silicon (Coffee Lake Xeon, Zen 1) wins.
#
# See docs/pgo_fleet_finding_2026-05-17.md for the full per-machine data
# and why we're not using PGO by default.
#
# `make pgo` here remains available for one-off local experiments and as
# scaffolding for future profile-strategy work (richer profile, AutoFDO).
#
# Requires: cargo install cargo-pgo; rustup component add llvm-tools-preview
TARGET_TUPLE := $(shell rustc --print host-tuple 2>/dev/null)
pgo: check-rust net
	CODA_EVALFILE=$(abspath $(EVALFILE)) cargo pgo instrument build -- --features embedded-net
	LLVM_PROFILE_FILE=target/pgo-profiles/coda_%m_%p.profraw ./target/$(TARGET_TUPLE)/release/coda bench 13
	CODA_EVALFILE=$(abspath $(EVALFILE)) cargo pgo optimize build -- --features embedded-net
	cp target/$(TARGET_TUPLE)/release/coda $(NAME)

# Download production NNUE net (uses actual filename from net.txt, not generic net.nnue)
net:
	@if [ ! -s "$(EVALFILE)" ] && [ -n "$(NET_URL)" ]; then \
		set -e; \
		tmp="$(EVALFILE).tmp"; \
		trap 'rm -f "$$tmp"' EXIT; \
		echo "Downloading NNUE net from $(NET_URL)..."; \
		curl -fsSL --retry 3 --retry-delay 2 "$(NET_URL)" -o "$$tmp"; \
		test -s "$$tmp"; \
		mv "$$tmp" "$(EVALFILE)"; \
		trap - EXIT; \
		echo "Downloaded $(EVALFILE)"; \
	elif [ -s "$(EVALFILE)" ]; then \
		echo "$(EVALFILE) already exists"; \
	else \
		echo "Warning: no net.txt found and no $(EVALFILE) present"; \
	fi
# Check Rust toolchain version
check-rust:
	@command -v cargo >/dev/null 2>&1 || { echo "Error: cargo not found. Install Rust from https://rustup.rs"; exit 1; }
	@RUST_VERSION=$$(rustc --version | sed 's/rustc \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/'); \
	MIN="$(MIN_RUST_VERSION)"; \
	awk -v min=$$MIN -v cur=$$RUST_VERSION ' \
		function cmp(a,b) { \
			split(a,A,"."); split(b,B,"."); \
			for(i=1;i<=3;i++){ \
				if(A[i]+0 < B[i]+0) return -1; \
				if(A[i]+0 > B[i]+0) return 1; \
				} \
			return 0; \
		} \
		BEGIN { if(cmp(cur,min) < 0) exit 1 }' \


clean:
	cargo clean
	$(RM) $(NAME)

.PHONY: rule openbench pgo net check-rust clean
chessica
Posts: 1121
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: CODA now has a released page.

Post by chessica »

now it works....only in console mode, in arena not

setoption name SyzygyPath value C:\Program Files\arena_3.5.1\TB\syzygy
info string Syzygy tablebases loaded: 6 pieces from C:\Program Files\arena_3.5.1\TB\syzygy, cache 16 MB

but the makefile was wrong. some errors.

My makefile:

Code: Select all

# Coda Chess Engine — Makefile
# Supports: manual builds, OpenBench integration, PGO builds
#
# Usage:
#   make                  Build with native CPU optimizations
#   make EXE=coda-v2      Build with custom output name
#   make pgo              PGO-optimized build (only helps v5 on main branch — see note below)
#   make openbench        OpenBench-compatible build target
#   make net              Download the production NNUE net
#   make clean            Remove build artifacts

# Configuration
EXE := coda
NET_URL := $(shell cat net.txt 2>/dev/null)
# EVALFILE: defaults to the filename from net.txt (e.g. net-v5-768pw-w7-e800s800-filtered-lowestlr.nnue)
# OB overrides this with an absolute path to the network file.
EVALFILE := $(if $(NET_URL),$(notdir $(NET_URL)),net.nnue)
MIN_RUST_VERSION := 1.70.0

# Platform detection
ifeq ($(OS),Windows_NT)
	NAME := $(EXE).exe
	RM := del /q
else
	NAME := $(EXE)
	RM := rm -f
endif

# Rust flags
export RUSTFLAGS := -Ctarget-cpu=native

# Default: build with embedded NNUE net (downloads from net.txt if needed)
# EVALFILE may be overridden by OpenBench with an absolute path to the network
rule: check-rust net
	CODA_EVALFILE=$(abspath $(EVALFILE)) cargo rustc --release --features embedded-net -- --emit link=$(NAME)

# Alias for OpenBench compatibility
openbench: rule

# PGO build (profile-guided optimization).
#
# Status (2026-05-17): builds cleanly with cgu=16 (the v9-era crash that
# the prior comment described is gone), but PGO with bench-13 profile is
# fleet-fragile and not shipped as default. Production-class hardware
# (Lichess host, "fast ionos" cohort) shows ~0 Elo; Zen 5 hosts (zeus)
# regress -18.5 Elo. Older silicon (Coffee Lake Xeon, Zen 1) wins.
#
# See docs/pgo_fleet_finding_2026-05-17.md for the full per-machine data
# and why we're not using PGO by default.
#
# `make pgo` here remains available for one-off local experiments and as
# scaffolding for future profile-strategy work (richer profile, AutoFDO).
#
# Requires: cargo install cargo-pgo; rustup component add llvm-tools-preview
TARGET_TUPLE := $(shell rustc --print host-tuple 2>/dev/null)
pgo: check-rust net
	CODA_EVALFILE=$(abspath $(EVALFILE)) cargo pgo instrument build -- --features embedded-net
	LLVM_PROFILE_FILE=target/pgo-profiles/coda_%m_%p.profraw ./target/$(TARGET_TUPLE)/release/coda bench 13
	CODA_EVALFILE=$(abspath $(EVALFILE)) cargo pgo optimize build -- --features embedded-net
	cp target/$(TARGET_TUPLE)/release/coda $(NAME)

# Download production NNUE net (uses actual filename from net.txt, not generic net.nnue)
net:
	@if [ ! -s "$(EVALFILE)" ] && [ -n "$(NET_URL)" ]; then \
		set -e; \
		tmp="$(EVALFILE).tmp"; \
		trap 'rm -f "$$tmp"' EXIT; \
		echo "Downloading NNUE net from $(NET_URL)..."; \
		curl -fsSL --retry 3 --retry-delay 2 "$(NET_URL)" -o "$$tmp"; \
		test -s "$$tmp"; \
		mv "$$tmp" "$(EVALFILE)"; \
		trap - EXIT; \
		echo "Downloaded $(EVALFILE)"; \
	elif [ -s "$(EVALFILE)" ]; then \
		echo "$(EVALFILE) already exists"; \
	else \
		echo "Warning: no net.txt found and no $(EVALFILE) present"; \
	fi
# Check Rust toolchain version
check-rust:
	@command -v cargo >/dev/null 2>&1 || { echo "Error: cargo not found. Install Rust from https://rustup.rs"; exit 1; }
	@RUST_VERSION=$$(rustc --version | sed 's/rustc \([0-9]*\.[0-9]*\.[0-9]*\).*/\1/'); \
	MIN="$(MIN_RUST_VERSION)"; \
	awk -v min=$$MIN -v cur=$$RUST_VERSION ' \
		function cmp(a,b) { \
			split(a,A,"."); split(b,B,"."); \
			for(i=1;i<=3;i++){ \
				if(A[i]+0 < B[i]+0) return -1; \
				if(A[i]+0 > B[i]+0) return 1; \
				} \
			return 0; \
		} \
		BEGIN { if(cmp(cur,min) < 0) exit 1 }' \


clean:
	cargo clean
	$(RM) $(NAME)

.PHONY: rule openbench pgo net check-rust clean
adamtwiss
Posts: 9
Joined: Mon Jul 06, 2026 9:33 pm
Full name: Adam Twiss

Re: CODA now has a released page.

Post by adamtwiss »

chessica wrote: Sun Jul 12, 2026 6:05 pm now it works....only in console mode, in arena not
but the makefile was wrong. some errors.
Thanks we (or my good friend Claude :D) have fixed the Arena situation. Arena also adds quotes around the path it sends. Which Coda now handles and strips off properly. If you pull it should work in Arena now. LMK if it doesn't.

We've also updated the Makefile based upon your edit (using awk and not relying on GNU Sort, so it works in gitbash). Thanks for your input and happy testing!