From af7df92f4daea8943dce613672da61e0f1ebbb94 Mon Sep 17 00:00:00 2001 From: Daniel Dolezal Date: Mon, 6 Apr 2026 16:48:09 +0200 Subject: [PATCH] cleanup codebase to use the .testing as local folder with test content --- .gitignore | 4 +--- justfile | 14 +++++++------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 9930b5f..04111e8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,12 +5,10 @@ .vscode .venv/ __pycache__/ -data/ .env -.tools/ +.testing/ dbschema/migrations/ *.jsonl /dataset/ -models/ diff --git a/justfile b/justfile index 25ec178..95aa2c2 100644 --- a/justfile +++ b/justfile @@ -12,8 +12,8 @@ set dotenv-required := true # Use zsh set shell := ["bash", "-cu"] -BATTLESNAKE_CLI_DIR := ".tools/battlesnake-cli" -BATTLESNAKE_CLI_BIN := ".tools/battlesnake-cli/battlesnake" +BATTLESNAKE_CLI_DIR := ".testing/tools/battlesnake-cli" +BATTLESNAKE_CLI_BIN := ".testing/tools/battlesnake-cli/battlesnake" # ------------------------------------------------------------------------------ # Default @@ -112,7 +112,7 @@ test-local-4 mode="standard" map="standard" base_port="9101" snake="BestBattleSn set -euo pipefail BATTLESNAKE_CLI="{{justfile_directory()}}/{{BATTLESNAKE_CLI_BIN}}" - LOG_DIR="{{justfile_directory()}}/.tools/snake-logs" + LOG_DIR="{{justfile_directory()}}/.testing/tools/snake-logs" mkdir -p "$LOG_DIR" pids=() @@ -162,17 +162,17 @@ test-local-4 mode="standard" map="standard" base_port="9101" snake="BestBattleSn # Dataset helpers # ------------------------------------------------------------------------------ -export-dataset input="data" output="data/dataset/good_moves.jsonl": +export-dataset input=".testing/data" output=".testing/data/dataset/good_moves.jsonl": python -m server.DatasetExporter --input "{{input}}" --output "{{output}}" -curate-dataset input="good_moves-*.jsonl" output="data/dataset/best_moves.jsonl" min_turn="6" late_turn="20" max_safe_options="2" min_score="3" append="false" archive="false" archive_dir="": +curate-dataset input="good_moves-*.jsonl" output=".testing/data/dataset/best_moves.jsonl" min_turn="6" late_turn="20" max_safe_options="2" min_score="3" append="false" archive="false" archive_dir="": FLAGS=""; if [ "{{append}}" = "true" ]; then FLAGS="$FLAGS --append"; fi; if [ "{{archive}}" = "true" ]; then FLAGS="$FLAGS --archive-input"; fi; if [ -n "{{archive_dir}}" ]; then FLAGS="$FLAGS --archive-dir {{archive_dir}}"; fi; python -m server.DatasetCurator --input "{{input}}" --output "{{output}}" --min-turn "{{min_turn}}" --late-turn "{{late_turn}}" --max-safe-options "{{max_safe_options}}" --min-score "{{min_score}}" $FLAGS analyze-dataset input="good_moves-*.jsonl" output="": if [ -n "{{output}}" ]; then python -m server.DatasetStats --input "{{input}}" --output "{{output}}"; else python -m server.DatasetStats --input "{{input}}"; fi -train-ai input="dataset/best_moves.jsonl" rl_input="dataset/rl_bootstrap.jsonl" output="models/battlesnake_softmax_v2.json" eval_split="0.2" seed="42" epochs="14" lr="0.08": +train-ai input=".testing/data/dataset/best_moves.jsonl" rl_input=".testing/data/dataset/rl_bootstrap.jsonl" output=".testing/models/battlesnake_softmax_v2.json" eval_split="0.2" seed="42" epochs="14" lr="0.08": if [ -f "{{rl_input}}" ]; then python -m server.TrainBattleSnakeAI --input "{{input}}" --input "{{rl_input}}" --output "{{output}}" --eval-split "{{eval_split}}" --seed "{{seed}}" --epochs "{{epochs}}" --lr "{{lr}}"; else python -m server.TrainBattleSnakeAI --input "{{input}}" --output "{{output}}" --eval-split "{{eval_split}}" --seed "{{seed}}" --epochs "{{epochs}}" --lr "{{lr}}"; fi -run-trained model="models/battlesnake_softmax_v2.json" port="8000": +run-trained model=".testing/models/battlesnake_softmax_v2.json" port="8000": TRAINED_SNAKE_MODEL="{{model}}" SNAKE="TrainedBattleSnake" PORT="{{port}}" "{{justfile_directory()}}/main.py"