PureXML/Sources/Regex
Mihaela Mihaljevic 85d435d035 fix(schema,regex): bound NFA state explosion and class-subtraction crash; land XSTS baseline
Running the full W3C XSTS archive to completion exposed three crash and hang
classes, now fixed with regression tests, which unblocked the #129 first
measurement.

- Content-model and regex NFA builders now cap total state count (2^20),
  degrading further occurrence/quantifier repetition to star, so nested
  high-maxOccurs schemas no longer OOM (was 8 GB on the MS Particles set).
- Content-model validation advances one active state-set per child instead of
  re-walking the prefix each time, removing the O(children^2) spin.
- Regex class subtraction [abc-[b]] no longer traps on a reversed range, and a
  reversed range such as [z-a] is rejected cleanly.

XSTS first measurement baselined: 75 valid schemas rejected, 2467 invalid
schemas accepted, 604 valid instances rejected, 582 invalid instances accepted
across 14383 groups. The suite runs green in 8s, opt-in via XSTS_ROOT.

Refs #129, #122.
2026-06-13 18:04:25 +02:00
..
RegexAutomaton.swift fix(schema,regex): bound NFA state explosion and class-subtraction crash; land XSTS baseline 2026-06-13 18:04:25 +02:00
RegexCategory.swift feat(regex): Unicode category escapes and character-class subtraction 2026-06-08 15:15:46 +02:00
RegexParser.swift fix(schema,regex): bound NFA state explosion and class-subtraction crash; land XSTS baseline 2026-06-13 18:04:25 +02:00
RegexSyntax.swift feat(regex): Unicode category escapes and character-class subtraction 2026-06-08 15:15:46 +02:00