Skip to content

feat: blast radius, thread cap, edit benchmarks#30

Merged
jahala merged 8 commits into
mainfrom
feat/blast-radius
Mar 11, 2026
Merged

feat: blast radius, thread cap, edit benchmarks#30
jahala merged 8 commits into
mainfrom
feat/blast-radius

Conversation

@jahala

@jahala jahala commented Mar 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Blast radius for tilth_edit — after editing a function signature, shows callers that may need updating (find_callers_batch on touched definitions)
  • Thread parallelism cap — defaults to min(cores/2, 6) for both rayon and ignore walker, override with TILTH_THREADS env var. Fixes High CPU usage #27
  • Tighter EDIT_MODE_EXTRA — ~215 → ~150 tokens, removed redundancy with SERVER_INSTRUCTIONS
  • 12 test-validated edit benchmark tasks — mutation-based across 4 repos (ripgrep, FastAPI, Gin, Express), verified by each repo's own test suite
  • Docs sync — blast.rs in CLAUDE.md project structure, edit mode section in AGENTS.md

Test plan

  • cargo clippy -- -D warnings passes
  • cargo test — 58 tests pass
  • Manual: tilth_edit on a function signature shows blast radius callers
  • Manual: verify CPU usage is reduced on high-core machines (TILTH_THREADS)
  • Benchmark: python benchmark/run.py --models sonnet --tasks rg_edit_line_count,express_edit_json_type --modes tilth

🤖 Generated with Claude Code

jahala and others added 8 commits March 11, 2026 12:04
When an edit touches a function signature region (start_line..=start_line+3),
tilth_edit now appends a blast radius section showing external callers that
may break. Struct/enum/interface edits trigger the heuristic but currently
only detect call-site references (text-based reference search planned next).

Uses existing find_callers_batch with bloom + memchr pre-filter for fast
parallel file walking. Self-references filtered via path canonicalization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Only functions have meaningful blast radius via find_callers_batch (call-site
detection). Struct/enum/interface edits triggered the heuristic but always
returned empty — dead code path. Removed to keep the trigger honest.

Type reference search (tree-sitter type_identifier matching) can be added
later if struct blast radius proves valuable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove redundant "use tilth tools" preamble (already in SERVER_INSTRUCTIONS).
Add blast radius mention. Scope to tilth_edit only.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Default to min(cores/2, 6) threads for both rayon and ignore walker.
Override with TILTH_THREADS env var. On M4 Max this reduces peak CPU
from ~1100% to ~600% during searches.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace string-matching correctness checks with actual repo test suites.
Each task introduces a deliberate bug, the agent fixes it, and the repo's
own tests verify the fix. Tasks cover ripgrep (Rust), FastAPI (Python),
Gin (Go), and Express (JS).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- CLAUDE.md: add blast.rs entry in search/ directory listing
- AGENTS.md: add tilth_edit section matching EDIT_MODE_EXTRA from mcp.rs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jahala jahala merged commit a5776be into main Mar 11, 2026
1 check passed
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.

High CPU usage

1 participant