Skip to content

Commit 4ee1510

Browse files
committed
Added stash install script
1 parent 7acb3f8 commit 4ee1510

2 files changed

Lines changed: 68 additions & 0 deletions

File tree

PerftWar/engines/stash-bot.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "stash-bot",
3+
"version": "master",
4+
"owner": "mhouppin",
5+
"repo": "https://github.com/mhouppin/stash-bot",
6+
"language": "C",
7+
"_note": "Stash is a UCI engine; perft is routed through `go perft N` and uses movelist_size as a depth-1 bulk count. Build with NATIVE=yes for movegen speed (per upstream guidance — the default Makefile may pick a sub-optimal arch flag set otherwise).",
8+
"modes": {
9+
"single-no-cache": {
10+
"launch": "bin/stash-bot/src/stash",
11+
"setup": [
12+
"setoption name Threads value 1",
13+
"setoption name Hash value 1"
14+
],
15+
"case": "position fen {fen}\ngo perft {depth}",
16+
"end_re": "^info nodes \\d+",
17+
"quit": "quit"
18+
}
19+
}
20+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/usr/bin/env bash
2+
# Clone, build, and verify stash-bot → bin/stash-bot/src/stash.
3+
#
4+
# Stash (Morgan Houppin) is a UCI engine in C. The repo's README says:
5+
# - Source is under src/
6+
# - Plain `make` autodetects arch flags, BUT
7+
# - `make NATIVE=yes` enables ALL available instruction sets on the host,
8+
# which matters for movegen speed (the README and upstream maintainer
9+
# explicitly call this out).
10+
# We always pass NATIVE=yes here since PerftWar runs the binary on the
11+
# same host that built it.
12+
13+
ENGINE="stash-bot"
14+
REPO="https://github.com/mhouppin/stash-bot"
15+
ENGINE_DIR="bin/stash-bot"
16+
BINARY="$ENGINE_DIR/src/stash"
17+
18+
# shellcheck source=_common.sh
19+
source "$(cd "$(dirname "$0")" && pwd)/_common.sh"
20+
21+
# --- Preflight -------------------------------------------------------------
22+
command -v gcc >/dev/null 2>&1 || command -v clang >/dev/null 2>&1 \
23+
|| die "neither gcc nor clang found"
24+
command -v make >/dev/null 2>&1 || die "make not found"
25+
26+
# --- Clone + build ---------------------------------------------------------
27+
clone_or_keep "$ENGINE_DIR" "$REPO"
28+
29+
HOST=$(detect_host)
30+
log "building (host=$HOST, cd src && make NATIVE=yes)"
31+
(
32+
cd "$ENGINE_DIR/src"
33+
make NATIVE=yes
34+
)
35+
36+
[ -x "$BINARY" ] || die "expected binary at $BINARY but it's missing"
37+
38+
out=$(verify_perft "$BINARY") || die "perft test failed"
39+
40+
version=$(detect_version "$out")
41+
if [ -n "$version" ]; then
42+
log "UCI banner: $version"
43+
log "→ consider setting engines/$ENGINE.json's \"version\" to: $version"
44+
fi
45+
commit=$(git -C "$ENGINE_DIR" rev-parse --short HEAD 2>/dev/null || echo "")
46+
[ -n "$commit" ] && log "stash-bot commit: $commit"
47+
48+
log "done. launch: $BINARY"

0 commit comments

Comments
 (0)