PureXML/Tests
Mihaela Mihaljevic 2f8ca9b289
perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275)
Keep the reader on its byte fast path through dispatch and name/attribute
scanning so plain-ASCII documents avoid the per-Character String machinery
(String.Iterator.next, string comparison, small-string materialization,
bridge-object ARC) that a profile indicted as the parse bottleneck.

The root cause was that a single buffered lookahead Character defeated every
existing byte path, each of which requires an empty buffer, and the content,
markup, and attribute dispatch each peeked a Character before scanning. Add a
non-buffering peekByte for dispatch, a byte-mode skipSpace, an all-ASCII
takeASCIIName, and an attributeRunBytes bulk scanner (with the 3.3.3
whitespace-to-space transform, deferring any carriage return to the Character
path so CRLF is not double-counted). Detect a text run's closing '<' via
peekByte instead of buffering it, which had cascaded the next element's whole
dispatch and name scan onto the slow path. Skip reference decoding for
ampersand-free text. The Character path remains the exact fallback for a
streaming source, spliced entity text, and any non-ASCII byte; the two paths
share scanContentMarkup so they cannot diverge.

Measured parse 20.1x -> 9.5x slower than libxml2 on the 20k-item generated
corpus, roughly a 53 percent wall-clock reduction. A differential oracle pins
the byte and Character paths to identical event streams and error marks over
an adversarial corpus, alongside boundary tests. Verified against the full
local suite, the Apache Xalan XSLT gold-output corpus, the W3C XML conformance
corpora, the RELAX NG spec suite, and the WASM build. No spec behavior changed.
2026-06-24 18:46:58 +02:00
..
Fixtures fix(xslt): xsl:namespace-alias keeps the literal prefix, remapping only the URI (closes namespace19/23/24/35/113) (#273) 2026-06-24 15:43:02 +02:00
AdversarialCriticTests.swift
ByteFastPathTests.swift perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275) 2026-06-24 18:46:58 +02:00
C14NSpecExampleTests.swift
CanonicalC14N11Tests.swift
CanonicalPrefixRewriteTests.swift
CanonicalSelectionTests.swift
CanonicalSubsetTests.swift
CanonicalTests.swift
CatalogBaseURITests.swift
CatalogGroupPreferTests.swift
CatalogSGMLTests.swift
CatalogSuffixPreferTests.swift
CatalogTests.swift
ConformanceCanonicalModesTests.swift
ConformanceCatalogTests.swift
ConformanceCorpusTests.swift
ConformanceDTDTests.swift
ConformanceEmittingTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
ConformanceHTMLDepthTests.swift
ConformanceRegexTests.swift
ConformanceSchematronTests.swift
ConformanceXIncludeTests.swift
ConformanceXPathAxisTests.swift
ContentMatcherDifferentialTests.swift
ContentMatcherWorstCaseTests.swift fix(schema): saturate effectively-unbounded content-model counters (#192, partial) 2026-06-21 13:16:24 +02:00
ContentModelDeterminismTests.swift fix(schema): reject a redefine whose self-reference duplicates a particle (UPA) (#253) 2026-06-24 00:06:23 +02:00
ContentNFAStateBudgetTests.swift
CoverageGateValueTypeTests.swift test(ci): add an opt-in coverage gate; close the 0% value types it surfaces 2026-06-22 16:38:30 +02:00
DTDAttributeTests.swift
DTDConditionalNotationTests.swift
DTDDefaultingTests.swift
DTDEntityDeclaredTests.swift
DTDIdentifierTests.swift
DTDLocatedContentTests.swift
DTDParameterEntityDepthTests.swift
DTDStandaloneTests.swift
DTDSubsetStrictnessTests.swift
DTDTests.swift
DTDValidationTests.swift
DTDValidityConstraintTests.swift
EncodingMismatchTests.swift
EncodingTests.swift
EntityBaseURITests.swift
EntityResolverTests.swift
EntitySplicingTests.swift
ErrataValidityTests.swift
EXSLTTests.swift
HTMLAdoptionTests.swift
HTMLDocumentTests.swift
HTMLForeignContentTests.swift
HTMLFramesetTests.swift
HTMLSelectTests.swift
HTMLTests.swift
HTMLTokenizerTests.swift
HTMLValidationTests.swift
LineEndingTests.swift
LintTests.swift
ModelTests.swift
NamespaceConstraintTests.swift
NamespaceTests.swift
OutputEncodingTests.swift
ParityEdgeTests.swift
ParserPathDifferentialTests.swift perf(parsing): byte-level scanning fast paths halve parse time vs libxml2 (#275) 2026-06-24 18:46:58 +02:00
ParsingTests.swift
PatternTests.swift
PullPushDifferentialTests.swift
PushParserTests.swift
QuickFixTests.swift
RecoveringReaderTests.swift
RegexCategoryTests.swift fix(schema): negated character-class subtraction excludes the subtrahend (#249) 2026-06-23 03:10:45 +02:00
RegexTests.swift fix(schema): reject an unknown \p{...} category or block name (#248) 2026-06-23 02:15:26 +02:00
RelaxNGCombineTests.swift
RelaxNGCompactAnnotationTests.swift
RelaxNGCompactConcatTests.swift
RelaxNGCompactFollowAnnotationTests.swift
RelaxNGCompactParamTests.swift
RelaxNGCompactTests.swift
RelaxNGDataParamTests.swift
RelaxNGDatatypeLibraryTests.swift
RelaxNGIncludeTests.swift test(relaxng): cover include and externalRef resolution 2026-06-22 17:01:15 +02:00
RelaxNGLocatedErrorTests.swift
RelaxNGNameClassTests.swift
RelaxNGQNameTests.swift
RelaxNGSchemaCorrectnessTests.swift
RelaxNGSpecSuiteTests.swift
RelaxNGStreamingTests.swift
RelaxNGTests.swift
RelaxNGValueSpaceTests.swift
SaveOptionsTests.swift
SAXTests.swift
ScalarLexingTests.swift
SchemaAbstractXsiTypeTests.swift
SchemaAllGroupMinOccursTests.swift fix(schema): optional xs:all group requires its members when present 2026-06-22 18:29:09 +02:00
SchemaAllGroupPlacementTests.swift
SchemaAllGroupReferenceTests.swift fix(schema): a reference to an all group must have maxOccurs 1 2026-06-20 19:14:33 +02:00
SchemaAnySimpleTypeFacetTests.swift
SchemaAnyTypeLaxTests.swift
SchemaAttributeDefaultUseTests.swift
SchemaAttributeLocatedDiagnosticsTests.swift feat(schema): locate attribute-pass schema diagnostics 2026-06-21 16:28:10 +02:00
SchemaAttributeRefTests.swift
SchemaAttributeRestrictionTests.swift
SchemaAttributeUniquenessTests.swift
SchemaAttributeWildcardIntersectionTests.swift
SchemaBlockDefaultTests.swift
SchemaCircularDerivationTests.swift
SchemaComposingTests.swift test(schema,xslt,parsing): standing coverage for the gaps a coverage run found 2026-06-22 16:16:32 +02:00
SchemaCompositionLocatedDiagnosticsTests.swift feat(schema): locate composition/redefine-pass schema diagnostics 2026-06-21 19:41:31 +02:00
SchemaConformanceTests.swift
SchemaContainerTopLevelFormTests.swift fix(schema): reject global form in included/imported documents 2026-06-22 17:50:53 +02:00
SchemaContentDerivationLocatedTests.swift feat(schema): locate content-derivation-pass schema diagnostics 2026-06-21 17:29:41 +02:00
SchemaContentOrderTests.swift
SchemaDerivationControlTests.swift
SchemaDerivationLocatedDiagnosticsTests.swift feat(schema): locate derivation/cycle-pass schema diagnostics 2026-06-21 16:53:02 +02:00
SchemaDeterminismGroupBlowupTests.swift perf(schema): memoize group expansion in the compiled content model 2026-06-22 23:24:19 +02:00
SchemaDifferentialHarness.swift
SchemaDifferentialTests.swift
SchemaDurationFacetTests.swift
SchemaElementBlockTests.swift
SchemaElementRefApplicabilityTests.swift
SchemaExtensionAllGroupTests.swift
SchemaExtensionSubstitutionLocatedTests.swift feat(schema): locate extension/substitution-pass schema diagnostics 2026-06-21 18:35:38 +02:00
SchemaFacetApplicabilityTests.swift
SchemaFacetDefinitionTests.swift
SchemaFixedElementChildrenTests.swift
SchemaForeignNamespaceReferenceTests.swift fix(schema): reject references into never-imported namespaces 2026-06-20 13:50:55 +02:00
SchemaFuzzTests.swift test(schema): harden the streaming/tree differential over deep group chains (#246) 2026-06-23 00:09:36 +02:00
SchemaGroupRedefineRestrictionTests.swift
SchemaIDAttributeTests.swift
SchemaIdentityDefaultValueTests.swift
SchemaIdentityFieldTypeTests.swift fix(schema): reject identity field whose declared target is a non-simple complex type 2026-06-22 13:10:30 +02:00
SchemaIdentityValueEqualityTests.swift
SchemaIdentityXPathTests.swift
SchemaIDIDREFTests.swift
SchemaIDREFDefaultTests.swift fix(schema): resolve defaulted/fixed IDREF attributes against IDs 2026-06-22 18:56:36 +02:00
SchemaIDValueConstraintTests.swift
SchemaIncludeTests.swift
SchemaListFacetTests.swift
SchemaListUnionXsiTypeTests.swift
SchemaLocalElementBlockKeyTests.swift
SchemaLocatedDiagnosticsTests.swift feat(schema): locate value-constraint type errors 2026-06-21 14:37:29 +02:00
SchemaMixedEmptyTests.swift
SchemaMultiDocumentTests.swift
SchemaNamespacedDerivationTests.swift fix(schema): streaming xsi:type and type resolution match the tree path 2026-06-20 16:38:56 +02:00
SchemaNamesUPANotationLocatedTests.swift feat(schema): locate names/UPA/notation-pass schema diagnostics 2026-06-21 19:16:54 +02:00
SchemaNameUniquenessTests.swift
SchemaNestedDefinitionTests.swift
SchemaNilFixedTests.swift fix(schema): reject a nilled element with a fixed value constraint 2026-06-22 18:05:23 +02:00
SchemaNotationValidityTests.swift
SchemaParticleTypeRestrictionTests.swift fix(schema): restriction may not narrow an element to an extension-derived type 2026-06-20 18:34:50 +02:00
SchemaPatternFacetTests.swift fix(schema): reject an unknown \p{...} category or block name (#248) 2026-06-23 02:15:26 +02:00
SchemaProhibitedAttributeTests.swift
SchemaQNameLengthTests.swift
SchemaRedefineAttributeGroupTests.swift fix(schema): flatten redefine self-reference and exclude prohibited uses in attribute uniqueness 2026-06-22 03:52:13 +02:00
SchemaReferenceLocatedDiagnosticsTests.swift feat(schema): locate reference-resolution schema diagnostics 2026-06-21 18:09:20 +02:00
SchemaReferenceTests.swift fix(schema): an unprefixed type ref to a target-namespace type is undeclared 2026-06-21 23:17:14 +02:00
SchemaRestrictionMixedTests.swift feat(schema): locate content-derivation-pass schema diagnostics 2026-06-21 17:29:41 +02:00
SchemaSimpleContentChainTests.swift
SchemaSimpleContentFixedTests.swift fix(schema): compare simpleContent fixed value in value space 2026-06-20 18:08:32 +02:00
SchemaSimpleContentListTests.swift
SchemaSimpleContentRestrictionInlineTypeTests.swift
SchemaSimpleTypeFinalTests.swift
SchemaSimpleTypeLocatedDiagnosticsTests.swift feat(schema): locate simple-type-pass schema diagnostics 2026-06-21 15:55:59 +02:00
SchemaSimpleTypeRestrictionTests.swift
SchemaSimpleTypeVarietyTests.swift
SchemaStreamingValueConstraintTests.swift fix(schema): streaming validator applies default/fixed value constraints 2026-06-20 17:38:45 +02:00
SchemaStreamingXsiTypeGateTests.swift fix(schema): streaming xsi:type and type resolution match the tree path 2026-06-20 16:38:56 +02:00
SchemaStringWhitespaceTests.swift
SchemaStructureDerivationTests.swift
SchemaStructureLocatedDiagnosticsTests.swift feat(schema): locate structure-pass schema diagnostics 2026-06-21 15:23:13 +02:00
SchemaStructureTests.swift
SchemaSubstitutionBlockTests.swift
SchemaSubstitutionListUnionTests.swift
SchemaSubstitutionTypeBlockTests.swift
SchemaSubstitutionTypeTests.swift fix(schema): apply substitution-group block to a member with an inline type 2026-06-22 06:21:23 +02:00
SchemaTopLevelAttributeGroupTests.swift
SchemaTopLevelAttributeTests.swift
SchemaTopLevelElementTests.swift
SchemaTopLevelGroupTests.swift
SchematronAbstractPatternTests.swift
SchematronAbstractTests.swift
SchematronDiagnosticTests.swift
SchematronDynamicTests.swift
SchematronFunctionTests.swift
SchematronLetTests.swift
SchematronScopedLetTests.swift
SchematronTests.swift
SchemaTwoIDAttributesTests.swift
SchemaTypeExclusivityTests.swift
SchemaUnionFacetTests.swift
SchemaUserTypeValueConstraintTests.swift
SchemaValueConstraintExclusionTests.swift
SchemaValueConstraintTests.swift
SchemaValueConstraintValidityTests.swift
SchemaWhiteSpaceRestrictionTests.swift
SchemaWildcardNamespaceTests.swift
SchemaWildcardUnionExpressibilityTests.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
SchemaXSIAttributeTests.swift fix(schema): an unprefixed type ref to a target-namespace type is undeclared 2026-06-21 23:17:14 +02:00
SchemaXSTSDiagnosticTests.swift
SchemaXSTSRegressionTests.swift
SerializationEscapeTests.swift
SerializationOptionsTests.swift
SerializerTests.swift fix(emit): split ?> in processing-instruction data with a space (#262) 2026-06-24 03:14:01 +02:00
SourceSpanTests.swift
StreamingDecoderJPTWTests.swift test(parsing): cover streaming ISO-2022-JP and EUC-TW decode 2026-06-22 17:11:58 +02:00
StreamingDecoderTests.swift test(schema,xslt,parsing): standing coverage for the gaps a coverage run found 2026-06-22 16:16:32 +02:00
StreamingDTDValidationTests.swift
StreamingXSDTests.swift
StrictRecoveringDifferentialTests.swift
StrictSubsetProfileTests.swift
TextReaderBreadthTests.swift
TextReaderTests.swift
TreeNodeEditingTests.swift
TreeNodeIdentityTests.swift
TreeNodeTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
ValidationConfigurationTests.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
ValidationFieldCoverageTests.swift
ValidationFrameworkTests.swift
ValidationRuleDTDTests.swift
ValidationRuleMiscTests.swift
ValidationRuleRegistryTests.swift
ValidationRuleStructuralTests.swift
ValidationRuleTestSupport.swift
ValidationRuleXSDTests.swift
ValidationTests.swift
ValidationWarningsTests.swift
W3CEduniSuiteTests.swift
W3CIBMSuiteTests.swift
W3CJapaneseSuiteTests.swift
W3COasisSuiteTests.swift
W3CSunSuiteTests.swift
W3CXMLSuiteTests.swift
WriterTests.swift
XalanConfSuiteTests.swift test(xslt): decode non-UTF-8 conformance sources via the library's encoding detection (#261) 2026-06-24 03:04:45 +02:00
XIncludeNegotiationTests.swift
XIncludeTests.swift
XMLCharacterTests.swift
XMLDeclarationTests.swift
XPathAxisTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XPathContextTests.swift
XPathExpressionTests.swift fix(xpath): format a large integer-valued number with no decimal point (#268) 2026-06-24 04:31:19 +02:00
XPathFunctionTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XPathNamespaceTests.swift
XPathTests.swift
XPointerRangeTests.swift
XPointerTests.swift
XSDCategoryTests.swift fix(schema): a non-nillable element must carry no xsi:nil at all (cvc-elt.3.1) 2026-06-20 03:22:05 +02:00
XSDCompletionTests2.swift
XSDComplexTypeTests.swift
XSDCompositionTests.swift
XSDDatatypeTests.swift
XSDDerivationControlTests.swift
XSDIdentityTests.swift fix(schema): reject identity field whose declared target is a non-simple complex type 2026-06-22 13:10:30 +02:00
XSDImportTests.swift
XSDLocatedContentTests.swift
XSDNamespaceTests.swift
XSDParticleReferenceRestrictionTests.swift
XSDParticleRestrictionTests.swift fix(schema): a content-bearing derived group cannot restrict a base element 2026-06-22 19:40:57 +02:00
XSDRestrictionContentFreeOrderTests.swift
XSDSchemaTests.swift
XSDSchemaValidationTests.swift
XSDTypeResolutionTests.swift
XSDValueConstraintTests.swift
XSDWildcardTests.swift
XSLTApplyImportsTests.swift
XSLTAttributeSetTests.swift
XSLTCallTemplatePrecedenceTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTCDATASectionTests.swift
XSLTCollationTests.swift test(schema,xslt,parsing): standing coverage for the gaps a coverage run found 2026-06-22 16:16:32 +02:00
XSLTCompositionTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTCreatedNamesTests.swift
XSLTDecimalFormatTests.swift
XSLTDoctypeOutputTests.swift fix(xslt): name the html output method doctype HTML, not the element name (closes output40/48/60) (#259) 2026-06-24 02:29:26 +02:00
XSLTDocumentBaseURITests.swift fix(xslt): resolve string-form document() against the stylesheet element's base URI (closes mdocs12/13) (#257) 2026-06-24 02:03:32 +02:00
XSLTDocumentFunctionTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTExpandedQNameTests.swift fix(xslt): match template, key, attribute-set, decimal-format names by expanded QName (#255) 2026-06-24 00:44:27 +02:00
XSLTFallbackTests.swift
XSLTFunctionTests.swift
XSLTGlobalVariableTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTHTMLOutputTests.swift fix(html): percent-escape non-ASCII characters in URI-valued attributes (closes output32) (#263) 2026-06-24 03:27:49 +02:00
XSLTKeyNodeSetTests.swift fix(xslt): distribute // over union branches in an xsl:key match pattern (#272) 2026-06-24 15:27:36 +02:00
XSLTMatchCacheTests.swift
XSLTMessageTests.swift
XSLTNamespaceAliasTests.swift fix(xslt): xsl:namespace-alias keeps the literal prefix, remapping only the URI (closes namespace19/23/24/35/113) (#273) 2026-06-24 15:43:02 +02:00
XSLTNumberingTests.swift fix(xslt): count the from boundary node in xsl:number level=single when it matches count (#270) 2026-06-24 10:47:49 +02:00
XSLTOutputMethodTests.swift fix(xslt): ignore disable-output-escaping for attribute, comment, and PI values (#264) 2026-06-24 03:41:56 +02:00
XSLTParityTests.swift
XSLTParserTests.swift
XSLTPatternPriorityTests.swift fix(xslt): give an axis-prefixed match pattern its node-test default priority (#266) 2026-06-24 04:08:00 +02:00
XSLTResultFragmentTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTSortCaseOrderTests.swift
XSLTTests.swift XSLT/XPath conformance: close 68 Apache Xalan cases (#254) 2026-06-24 00:13:14 +02:00
XSLTWhitespaceTests.swift fix(xslt): honor xml:space=preserve when stripping stylesheet whitespace (#271) 2026-06-24 10:57:47 +02:00
XSTSDifferentialTests.swift
XSTSSuiteTests.swift fix(schema): reject a redefine whose self-reference duplicates a particle (UPA) (#253) 2026-06-24 00:06:23 +02:00