libxml-rs 0.1.0-alpha.49

Native-Rust forensic reimplementation of libxml2+libxslt with C ABI drop-in replacement. Cross-version oracle matrix (libxml2 2.7.8-2.15.3, libxslt 1.1.26-1.1.45) with semantic epochs; full xmllint/xmlcatalog/xsltproc CLIs; differential-court-verified C API closure; three-DSO ELF packaging (libxml2.so.16 core + libxslt.so.1/libexslt.so.0 facades, upstream NEEDED chain); fail-closed oracle-isolated ABI-FUNCTION-SIGNATURE plane (SOURCE_PROTOTYPE + MACHINE_ABI fingerprints, zero silent omissions); Phase-12 real downstream substitution (binary/static/docker substitution, export-surface disposition, ELF version graphs); Phase-13 hostile audit courts (ABI/ownership/allocator/callbacks/failure/threads/oracle-contamination) byte-identical vs the system oracle incl. the upstream thread-local globals model; Phase-14 downstream custodian validation courts (lxml/Nokogiri/PHP/Debian). Test counts live in atlas/TEST_COUNTS.json, residuals in atlas/RESIDUAL_LEDGER.json (generated evidence).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Scalar reference implementation of the §16.7 text-run classification.
//!
//! This is the correctness reference every vector backend must match
//! byte-for-byte, and the fallback on CPUs without AVX2/AVX-512.

/// Length of the leading printable-ASCII content run: bytes in
/// `0x20..=0x7E` excluding `<`, `&`, `]` (§16.5.6 set — never CR/LF, so no
/// line/col bookkeeping applies; every byte is a valid XML Char that
/// decodes to itself).
pub(crate) fn scalar_text_run_len(bytes: &[u8]) -> usize {
    bytes
        .iter()
        .take_while(|&&b| (0x20..=0x7E).contains(&b) && b != b'<' && b != b'&' && b != b']')
        .count()
}