Skip to main content

Crate wa_wire_conformance

Crate wa_wire_conformance 

Source
Expand description

Replaying recorded stanzas through every engine and requiring them to agree.

This is the property that makes wa-wire more than a wrapper:

Given the same traffic, every conforming engine must produce the same L1.

Four independent implementations reading one input find bugs that no single implementation’s own tests can, because a bug and its test are usually written by the same person on the same afternoon. Divergence is the signal.

§What is compared

Two layers, and they fail differently:

  • L0 — the frame bytes each engine forwarded. Byte-identical frames mean the engines saw the same stanza; different ones do not necessarily mean a bug, because two encodings of one stanza are both valid.
  • L1 — the events derived from those frames, compared by meaning. Two engines that encode a value differently and derive the same event agree. This is the layer where a divergence is a finding.

That split matters: reporting every L0 difference would bury the L1 ones, and L1 is where correctness lives.

use wa_wire_conformance::{ComparisonProfile, Recording, Tables, Verdict, compare};
use wa_wire_codec::TokenTable;

let report = compare(&engine_a, &engine_b, Tables::shared(table));
if report.evaluate(ComparisonProfile::Interop) == Verdict::Pass {
    // Same traffic, same events.
} else {
    for divergence in report.divergences() {
        eprintln!("{divergence}");
    }
}

Re-exports§

pub use comparability::Comparability;
pub use divergence::Divergence;
pub use divergence::Layer;
pub use profile::ComparisonProfile;
pub use profile::Incomparable;
pub use profile::Verdict;
pub use recording::Recording;
pub use report::Report;
pub use report::Tables;
pub use report::compare;
pub use report::replay;

Modules§

comparability
Whether two recordings may be compared at all.
divergence
What it means for two engines to disagree.
profile
Which findings count as failures, and who decides.
recording
What one engine saw.
report
Running the comparison.