# GameBuilder Evaluation Scripts This directory contains evaluation scripts for analyzing the GameBuilder project results across different LLM models. ## Scripts ### 1. analyze_retry_patterns.py Analyzes RETRY patterns in GameBuilder project execution paths. **Features:** - Extracts error information from execution paths - Counts RETRY attempts and locations - Calculates error rates and RETRY rates per model - Generates detailed statistics by agent and node type **Output:** - `retry_analysis.json` - Detailed JSON results - `retry_summary.csv` - Summary statistics - `error_by_agent.csv` - Error statistics by agent **Usage:** ```bash python3 analyze_retry_patterns.py ``` ### 2. evaluate_success.py Calculates success rates for each model in GameBuilder tasks. **Features:** - Analyzes validation results from test sessions - Computes success/failure rates per model - Tracks individual session outcomes **Output:** - `success-finish_detailed_results.json` - Detailed results - `success-finish_rate.csv` - Success rate summary **Usage:** ```bash python3 evaluate_success.py ``` ### 3. evaluate_trajectory.py Evaluates trajectory metrics for GameBuilder project. **Features:** - Parses execution paths and extracts trajectories - Evaluates 6 trajectory metrics: - Exact match - In-order match - Any-order match - Precision - Recall - Single-tool use - Calculates path diversity and entropy **Output:** - CSV file with evaluation results **Usage:** ```bash python3 evaluate_trajectory.py --config reference_trajectory.yaml --output evaluation_results.csv ``` **Arguments:** - `--config` - Reference trajectory config file (YAML format) - `--base-dir` - RESULTS directory path (defaults to two levels up) - `--output` - Output CSV file path - `--format` - Output format (csv only) ## Configuration ### reference_trajectory.yaml Defines the reference trajectory (ground truth) for evaluation. **Key sections:** - `project_name` - Project identifier (GameBuilder) - `extract_types` - Node types to extract (SPAN, Chain, AGENT, LLM, Tool) - `reference_trajectory` - Expected execution sequence - `target_tools` - Tools to track for single-tool use metric (Python Code Validator) - `models` - List of models to evaluate ## Project Overview GameBuilder is a code generation project where: 1. **Senior Software Engineer** generates game code 2. **Software Quality Control Engineer** reviews and validates the code 3. **Chief Software Quality Control Engineer** performs final evaluation The reference trajectory represents the ideal execution path with: - 5 LLM calls (1 for code generation, 2 for review, 2 for evaluation) - 2 tool calls (Python Code Validator used by both QA agents) ## Models Evaluated - GPT-5 - GPT-4o-mini - DeepSeek-V3-1 - DeepSeek-R1 - Gemini-2.5-flash - Gemini-2.5-flash-nothinking - Qwen3-235b ## Requirements - Python 3.7+ - pandas - PyYAML ## Notes - All scripts automatically process test results from the configured base directory - Results are saved in the same directory as the scripts - Execution paths are parsed from `execution_path.md` files in test session directories - Validation results are read from `validation_result.json` files - The Python Code Validator tool is the primary tool tracked for this project