test(xmtp_mls): randomized bidi delivery fuzz against the live node#3850
test(xmtp_mls): randomized bidi delivery fuzz against the live node#3850tylerhawkes wants to merge 1 commit into
Conversation
|
Claude finished @tylerhawkes's task —— View job Code Review CompleteReview Date: 2026-07-14 09:32 UTC This is high-quality test code with excellent engineering. The fuzz testing approach is comprehensive and well-architected. Here are the key observations: Strengths
Minor Issues1. Potential panic in ground_truth (bidi_fuzz_tests.rs:174) .unwrap_or_else(|_| panic!("ground-truth query failed"))This loses error context. Consider: 2. Magic number without const (bidi_fuzz_tests.rs:183) assert!(ids.len() < 95, ...Should be a named constant like 3. Unbounded retry loop (bidi_fuzz_tests.rs:936-946) assert!(attempts < 40, "lease kept failing: {e} (seed={seed})");Hard limit of 40 attempts * 250ms = 10s max. Consider deriving from 4. Race condition comment (bidi_fuzz_tests.rs:1234-1236) 5. Proptest config could be more visible (bidi_transport_props.rs:701-707) Performance Considerations
Security
Test ConfigurationThe nextest config change (lines 48-54 in Regression TestsThe two checked-in proptest regressions show the tests are working as intended — they found real bugs and captured minimal repro cases. SummaryExcellent work. The architecture is sound, the invariants are well-chosen, and the implementation is thorough. The minor issues are primarily about code clarity rather than correctness. This will be a valuable long-term asset for catching regressions. |
ApprovabilityVerdict: Approved Test-only changes adding fuzz and property-based tests for bidi delivery. All new code is gated behind No code changes detected at You can customize Macroscope's approvability policy. Learn more. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## tyler/bidi-ledger-loss-fixes #3850 +/- ##
================================================================
+ Coverage 85.40% 85.53% +0.12%
================================================================
Files 413 414 +1
Lines 66012 66405 +393
================================================================
+ Hits 56379 56799 +420
+ Misses 9633 9606 -27 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Dismissing prior approval to re-evaluate ef8afbd
ef8afbd to
d23b7aa
Compare
d23b7aa to
cd29038
Compare
4b8388e to
977d84a
Compare
cd29038 to
438a3e9
Compare
Dismissing prior approval to re-evaluate 438a3e9
|
CI triage for the failures on the previous head:
Also rebased onto #3852's latest (the withheld-buffer cap + |
…roptest ledger model Two layers of randomized no-loss checking for XIP-83 bidi delivery: - Live fuzz against the containerized node: up to 10 racing member producers x up to 10 consumers (raw connections in the server-contract test; per-consumer proxied BidiTransports in the transport test), with per-lease strictly-increasing delivery, chain-union completeness, and toxiproxy network faults. Seeded and replayable; schedule telemetry proves every lever fires. - Deterministic proptest model of the transport ledger over the scripted mock wire: generated op schedules (publish/lease/drop/serve/partial- serve/wire-kill) against an in-memory XIP-83 server model, with real shrinking. Found the virgin-topic snapshot loss and the cross-wave watermark gap-jump fixed in the tags commit; regression seeds checked in.
977d84a to
11acadd
Compare
438a3e9 to
b26bf6d
Compare
Randomized no-loss testing for XIP-83 bidi delivery, at three depths. Stacked on #3852 (the ledger fixes this work found).
What's here
1. Live fuzz against the containerized node (
bidi_fuzz_tests.rs), two tests:fuzz_server_honors_the_bidi_wave_contract— up to 10 rawBidiConnections, each with its own frame-by-frame checker of the server guarantees (always-ack, per-topic wave cursor order, live-shield untilCatchUpComplete, completeness above the lowest floor), racing against up to 10 member-client producers publishing concurrent bursts into the same groups.fuzz_transport_delivery_never_loses_above_the_floor— up to 10 realBidiTransports, one per proxied subscriber client on its own toxiproxy-faultable wire, plus the same racing producer pool. Ops: leases at random floors (yank engine), deliberate kills, stalls-to-backpressure-drop, TCP blips (per-consumer and correlated), suspend/resume, mid-run welcome-minting groups. Invariants per lease: strictly increasing above its floor (order + exactly-once + nothing below the floor in one sweep), alive-at-end completeness, and durable-cursor recovery-chain union completeness — all against unary ground truth.Seeded and replayable (
XMTP_BIDI_FUZZ_SEED,XMTP_BIDI_FUZZ_ROUNDS),retries = 0in nextest so flakes can't self-heal, and per-run schedule telemetry so a dead chaos lever is visible. Racing member sends settle their one-time post-join KeyUpdate commits serially at setup, so the races contend as app messages at a stable epoch (join-time epoch churn is MLS-layer behavior with its own tests).2. Deterministic proptest model of the transport ledger (
bidi_transport_props.rs): generated op schedules (publish / lease / drop / serve / partial-serve / wire-kill) drive the realBidiTransportover the scripted mock wire against an in-memory server model of the XIP-83 contract, with a reference model asserting strictly-increasing exactly-once delivery and exact log-suffix completeness — no sentinels, no timing, real shrinking. Regression seeds are checked in.PROPTEST_CASESscales the soak (default 16, CI-friendly).Already earned its keep
retire()sending removes-waves withmutate_id: 0, colliding with the untagged-backend tombstone (fixed in feat(xmtp_api_d14n,xmtp_mls): consume XIP-83 delivery tags on the bidi wire #3845 pre-merge).Testing
just lintgreen.🤖 Generated with Claude Code
https://claude.ai/code/session_017AVuJ7VAgen2fFhtJQ6zid
Note
Add randomized fuzz tests for bidi transport delivery against a live node
bidi_fuzz_tests.rswith two fuzz tests against a live containerized node: one validates XIP-83 server wire contract invariants per rawBidiConnection, and one validates per-lease delivery ordering and completeness across drops, stalls, suspends, and toxiproxy-injected network faults.bidi_transport_props.rswith a proptest-based harness using an in-memory mock wire to assert cursor ordering, exact suffix delivery, andCatchUpCompletesemantics per lease under randomized operation schedules.bidi_fuzztests in both default and CI nextest profiles to prevent masking flaky failures.Macroscope summarized b26bf6d.