Commit graph

3 commits

Author SHA1 Message Date
tobjend
ea6cac53e3 wip: AST foundation — grammar.py, expr.py→AST, soa.py→AST labels 2026-07-13 01:13:48 +02:00
tobjend
2733840358 feat: add reduce slicing, fix rwr0 timeout, fix sequence format
- Add --slice reduce (Algorithm 4, TODS 2010) for merging similar directories
- Fix rwr0 infinite loop: add max_iterations=1000 limit
- Fix reduce.py: handle tuple sequences (capture_name, text, line)
- Fix minimize_contexts: skip rwr0 on complex SOAs (too slow)
- Result: Reduce finds 0 merges on RAGSAK (SOA distances too high)
- Reduce is not suitable for source code grouping (designed for XML schemas)
2026-07-12 13:13:16 +02:00
tobjend
b516b2985d feat: implement Reduce algorithm (Algorithm 4, TODS 2010)
- bex/reduce.py: Faithful implementation of Reduce with support-weighted
  SOA edit distance, adjunction, iterative merging, and Minimize
- experiments/context_eval.py: Multi-codebase support (RAGSAK + Flask),
  Reduce experiments with thresholds 0.05-0.4
- tests/test_reduce.py: 24 tests covering all Reduce components
- Flask cloned to external_refs/flask for cross-validation

Results:
- RAGSAK: 12.0% coverage (First 3 symbols)
- Flask: 10.7% coverage (First 3 symbols)
- Reduce has minimal impact (1-2 merges per codebase at ε=0.3)
- Coverage ceiling appears to be ~10-12% for prefix-based grouping
2026-07-12 00:11:38 +02:00