Skip to content

Configurable RepoMap (--map-tokens) + faster, thread-safe runs#25

Merged
dwash96 merged 2 commits intocecli-dev:v0.87.8from
cryptekbits:Benchmark-Repomap
Sep 21, 2025
Merged

Configurable RepoMap (--map-tokens) + faster, thread-safe runs#25
dwash96 merged 2 commits intocecli-dev:v0.87.8from
cryptekbits:Benchmark-Repomap

Conversation

@cryptekbits
Copy link
Copy Markdown

Summary

  • Adds --map-tokens to control RepoMap token budget in benchmarks (set 0 to disable).
  • Initializes a per-test git repo and enables use_git=True so RepoMap is available during runs.
  • Uses an in-memory RepoMap cache for threaded runs to avoid contention and speed up builds.
  • Scopes RepoMap cache to each test directory and reduces tree size for faster benchmarks.
  • Records and prints map_tokens in saved results and summaries.

Key Changes

  • CLI: Add --map-tokens option and wire through to the Coder.
  • Repo setup for tests: Initialize a local git repo if missing, set identity, and run with use_git=True (no auto/dirty commits).
  • RepoMap tuning for benchmarks:
    • Per-test cache dir: map_cache_dir=str(testdir)
    • In-memory tags cache when threads > 1: repomap_in_memory=True
    • Smaller map for speed: map_mul_no_files=4
    • benchmark.py
  • Reporting: Persist and display map_tokens in results and summarize_results.
  • Library support (used by benchmark):
    • Coder exposes repomap_in_memory and passes repo_root and use_memory_cache to RepoMap.
    • RepoMap accepts repo_root and use_memory_cache; Coder filters .meta/.docs from map inputs.
    • base_coder.py, repomap.py

Usage

# Enable RepoMap with a budget
./benchmark/benchmark.py --map-tokens 1024 …

# Disable RepoMap
./benchmark/benchmark.py --map-tokens 0 …

Notes

  • Threaded runs default to in-memory RepoMap caching; single-threaded runs use the standard on-disk cache.
  • Defaults are backward compatible; if --map-tokens is omitted, behavior remains unchanged for typical runs.

Files Touched

  • benchmark/benchmark.py
  • benchmark/README.md
  • aider/coders/base_coder.py
  • aider/repomap.py

@dwash96 dwash96 changed the base branch from main to v0.87.8 September 21, 2025 14:14
@dwash96 dwash96 merged commit b131728 into cecli-dev:v0.87.8 Sep 21, 2025
7 of 8 checks passed
@dwash96 dwash96 mentioned this pull request Sep 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants