DEFAULT_MAX_SUBJECT_LENGTH
The longest subject regex will match against.
This is a stack-depth bound wearing a length's clothing, which is why it is so much smaller than a string a renderer might plausibly validate. A backtracking engine recurses roughly once per input character for a quantified group, so an ordinary pattern — (a|b)*, nothing pathological — raises StackOverflowError on a long enough subject. Measured on a JVM at its default stack size, (a|b)* survives 4096 characters and dies at 8192; this bound leaves a factor of two under the lower figure, because a renderer's UI thread has less stack than a test runner and Kotlin/Native does not raise StackOverflowError at all — it aborts the process.
A renderer that knows its own stack may raise this through EvaluationLimits. Nothing here catches the overflow: an Error is not the kind of failure to resume from, so the bound is placed where it prevents one instead.