You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HermitCrab FST: deduplicate traversal instances by (State, AnnotationIndex) (rejected in general form: 112 of 20,000 fuzz cases differ) #594
Proposed in #511. Inside Traverse, skip a new traversal instance whose (State, AnnotationIndex) was already pushed, on the grounds that only registers differ. TraversalMethodBase.Advance forks an instance per Optional annotation, so instance count grows exponentially in optional annotations, and the skip bounds it at N * |States|. A 2-state FSA popped 2,097,150 instances at 20 optional annotations.
Measured. A differential fuzz of 20,000 random pattern/input pairs found 112 cases where Match() differs from production: 108 from variable bindings and 4 from capture registers that shorten the range. AllMatches().First() was identical in all 20,000. Gated on the deterministic method and no capture groups, divergences fell 112 to 0. Environment matchers are 0.20% (Amharic) and 1.18% (Mbugwe) of instances. In the analysis rules, 93.95% of Amharic pushes look collapsible, but 99.7% have differing registers, so only 0.28% to 4.11% of collapses are free.
Why rejected. The key omits variable bindings and registers, which AllSubmatches callers read. The sound narrowed form (deterministic, no capture groups) needs no more evidence, but it was not shipped. It is not a cache and adds no memory.
Activity