Skip to content

Reduce regular graph construction memory and support NFAs - #234

Merged
zayenz merged 5 commits into
mainfrom
feature/improved-regular-construction
Oct 8, 2026
Merged

zayenz merged 5 commits into
mainfrom
feature/improved-regular-construction

Conversation

@zayenz

@zayenz zayenz commented Jul 28, 2026 •

Copy link
Copy Markdown
Member

Build the regular propagator's layered graph from sparse reachable frontiers instead of reserving every automaton state at every position. Temporary state storage becomes O(k + S), where S is the surviving graph size; persistent storage is unchanged. In the measured unfolded size-5,000 case, peak RSS fell from 108,000 to 9,552 KiB.

Add DFA::nfa() for epsilon-free NFAs without determinization or minimization. Ordinary DFA constructors retain their deterministic-transition requirement. Cloning preserves branching NFA paths when removing assigned prefixes.

Regular-constraint tests pass in audited Debug, including differential and cloning cases. The earlier memory measurements were not repeated after the NFA addition.

@zayenz zayenz changed the title Reduce regular layered graph construction memory Reduce regular graph construction memory and support NFAs Sep 5, 2026
@zayenz
zayenz force-pushed the feature/improved-regular-construction branch from c8363ac to c9927cd Compare September 28, 2026 17:53

@zayenz zayenz left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No code style changes needed. The frontier and mapping bookkeeping belongs together because the arrays share an invariant. Region scratch stays local, and persistent graph storage belongs to the Space.

@zayenz zayenz left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actionable findings in regular graph construction, NFA posting, or cloning. All 14 CI checks pass at c9927cd896.

@zayenz
zayenz added this pull request to stack #250 October 5, 2026 13:21
@zayenz
zayenz force-pushed the feature/improved-regular-construction branch from c9927cd to bef9e05 Compare October 8, 2026 15:15
@zayenz
zayenz merged commit 9dc6553 into main Oct 8, 2026
14 checks passed
@zayenz
zayenz deleted the feature/improved-regular-construction branch October 8, 2026 18:34
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.

1 participant