grammar-inference-engine/tests
tobjend 52f286a073 fix: restore memoization on _count_concat to stop count_words explosion
During the AST migration, _count_concat lost its @lru_cache (it was
replaced by an uncached recursive version). Distributing a length L
across concat parts then revisited the same (remaining_parts, length)
states exponentially -> 16M function calls for a single 4-method group,
and several RAGSAK groups took 18-52s (looked hung at the tail).

Restore memoization: _count_concat is now @lru_cache-keyed on
(tuple(parts), length). Also fix a stray blank line between the
@lru_cache decorator and count_words.

Impact (RAGSAK, --slice package --min-structure 0.5):
  straggler groups 18-52s -> <0.5s; full run 54.9s -> 6.7s.
Adds a regression test asserting a length-20 (a|b)* string counts in <2s.
2026-07-13 01:13:48 +02:00
..
test_analyze.py feat: iDRegEx refinement for CRX flat bags (Round 16) 2026-07-12 16:54:40 +02:00
test_bex.py test: update tests for AST representation 2026-07-13 01:13:48 +02:00
test_crx_dotted.py wip: AST foundation — grammar.py, expr.py→AST, soa.py→AST labels 2026-07-13 01:13:48 +02:00
test_crx_refined.py test: update tests for AST representation 2026-07-13 01:13:48 +02:00
test_decompose.py Phase 2: decomposition forest for complex sequences 2026-07-12 17:49:35 +02:00
test_distributional.py feat: distributional clustering for better grouping (Phase 1) 2026-07-12 17:37:36 +02:00
test_ensemble.py test: update tests for AST representation 2026-07-13 01:13:48 +02:00
test_gbnf.py test: update tests for AST representation 2026-07-13 01:13:48 +02:00
test_grammar.py fix: restore memoization on _count_concat to stop count_words explosion 2026-07-13 01:13:48 +02:00
test_grammar_index.py fix: YAML expansion bug and add GBNF to output 2026-07-12 19:53:24 +02:00
test_kore.py test: update tests for AST representation 2026-07-13 01:13:48 +02:00
test_reduce.py feat: implement Reduce algorithm (Algorithm 4, TODS 2010) 2026-07-12 00:11:38 +02:00
test_scoring.py test: update tests for AST representation 2026-07-13 01:13:48 +02:00