PureXML/Sources/Validation
Mihaela Mihaljevic a77ffbd952
perf(model): make the TreeNode tree type depth-safe (#343)
Building a TreeNode from a value Node, projecting it back via `node`, and
releasing it each recursed one native frame per tree level, so a deeply
nested document overflowed the call stack (signal 10 around 30-60k deep,
and far shallower on a constrained stack such as a Swift Task). None of
these is fixed by the serializer, which was already iterative.

- `TreeNode(_:)` and `node`/`projectedChildren` now drive explicit
  post-order work stacks (entity-reference splicing, doctype/namespace
  dropping, and the root special-cases are unchanged).
- `deinit` flattens the subtree into a heap worklist before releasing, so
  each node frees with empty children and the teardown stays flat. Only a
  node the teardown solely owns (isKnownUniquelyReferenced) is flattened,
  so a child still referenced elsewhere keeps its subtree.
- The validator walk and the XPath descendant axis were made iterative for
  the same reason.

A 60000-deep tree now releases in well under 0.1s; 1778 tests pass and no
accepted output changes. Part of #341; the value Node's own recursive
release and XPath result ordering/dedup remain depth-bounded and tracked
there.
2026-06-26 16:39:08 +02:00
..
AttributeDeclaration.swift feat(validation): add DTD attribute (ATTLIST) validation 2026-06-08 02:07:01 +02:00
AttributeDefault.swift feat(validation): add DTD attribute (ATTLIST) validation 2026-06-08 02:07:01 +02:00
AttributeListParser.swift feat(dtd): conditional sections, notations, NDATA, external parameter entities 2026-06-08 14:39:42 +02:00
AttributeType.swift feat(dtd): conditional sections, notations, NDATA, external parameter entities 2026-06-08 14:39:42 +02:00
BuiltinValidation.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
Conformance.swift feat(validation): conformance-corpus harness via the validation framework 2026-06-09 19:08:17 +02:00
ContentModel.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
ContentModelMatcher.swift feat(dtd): located content-model errors with recovery hints 2026-06-09 00:59:25 +02:00
ContentModelParser.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
DTDDeclarationValidity.swift refactor(validation): located structured validity findings 2026-06-10 10:45:17 +02:00
DTDDefaults.swift feat(dtd): attribute defaulting, tokenized types, value normalization 2026-06-08 14:31:42 +02:00
DTDSchema.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
DTDStandaloneValidity.swift feat(validation): standalone validity constraints and entity WFC 2026-06-10 07:13:30 +02:00
DTDValidationHelpers.swift feat(validation): eduni errata behaviors, 3.3.3 attribute normalization 2026-06-10 07:50:47 +02:00
DTDValidations.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
HasWarnings.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
HTMLValidations.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
Occurrence.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
Particle.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
Schematron.swift feat(schema): locate compile diagnostics with validation coding paths (#169) 2026-06-16 10:26:11 +02:00
SchematronModel.swift feat(schematron): support key(), document(), and current() in tests 2026-06-09 03:30:43 +02:00
SchematronParser.swift feat(schematron): support key(), document(), and current() in tests 2026-06-09 03:30:43 +02:00
Severity.swift chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
StreamingDTDValidator.swift feat(validation): streaming DTD ID/IDREF integrity 2026-06-09 10:21:20 +02:00
StructuralValidations.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
Validation.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
ValidationCombinators.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
ValidationCore.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
ValidationOutcome.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
Validator.swift perf(model): make the TreeNode tree type depth-safe (#343) 2026-06-26 16:39:08 +02:00