Files
DomiStream/docs/MUTATION.md
T
mnovak 8125949db2 [domistream] Tests: mutation pass, 24 of 24 caught
docs/MUTATION.md: each mandatory area's bug put back into src and caught by
its tests (parser caps off by one or removed for XML, RTSP, ENet, input,
video, audio; lying lengths; the ENet 0xFFFF wrap; the control replay
check; the nonce direction byte; ignored GCM tags, control and video; a
video parity index off by one; a rebuilt video shard's header trusted;
audio parity keyed by RTP sequence; a skipped pairing step; unchecked host
signatures; Instant::now and getrandom in src). No mutation survived, so no
test was added.

tools/mutation/mutate.py: the exact edits, so the pass can be rerun
through the resource gate.

Also: pairing_session fuzzed 10 min, 574 761 runs, no crash.
2026-11-26 03:59:58 +01:00

4.8 KiB

Mutation pass

Each row puts back one bug a test is meant to guard against (an exact edit to crates/domistream/src), runs the test binary that should catch it, and reverts the edit. "Caught by" lists the tests that failed. All 24 rows were caught; none failed to compile, so every row is a real behaviour change the tests saw.

  • When: 2026-11-26, QA, on feature/client at d62aa8f. The baseline was 242/242 tests passing.
  • Driver: tools/mutation/mutate.py holds the exact edits, so the pass can be rerun: python tools/mutation/mutate.py [M1 ...]. Every cargo run goes through the resource gate (CPU, RAM and drives below 90 %, -j 2).
# Area Mutation Test binary Caught by Result
M1 XML cap size cap off by one (refuses exactly MAX_XML_BYTES) http xml_size_boundaries, applist_caps caught
M2 XML cap depth cap off by one (allows depth 9) http xml_depth_cap, xml_depth_bomb_does_not_recurse caught
M3 RTSP cap header cap off by one (allows 65 headers) rtsp response_header_flood caught
M4 ENet cap command cap off by one (allows 33 commands) enet hostile_sizes caught
M5 Input cap message size cap removed input hostile_sizes caught
M6 Video cap packet size cap off by one (accepts 4097 bytes) media video_packet_hostile_sizes caught
M7 Audio cap packet size cap removed media audio_packet_hostile caught
M8 Lying length control frame: a length field that claims less is accepted control frame_parser_lying_lengths caught
M9 Lying length RTSP: bytes after Content-Length kept instead of refused rtsp response_lying_content_length caught
M10 Lying length INPUT_DATA: the big-endian size field not checked input lying_length_and_size_fields caught
M11 ENet wrap reliable delivery does not wrap at 0xFFFF (saturating "next") enet reliable_sequence_wraps_at_0xffff caught
M12 Control replay a repeated sequence number accepted (< instead of <=) control replayed_and_old_host_frames_are_dropped caught
M13 Control replay the replay check removed control replayed_and_old_host_frames_are_dropped, host_sequence_at_u32_wrap caught
M14 Nonce direction bytes swapped ('H' client to host) control nonce_layout, nonce_matches_the_definition, seal_matches_dotnet_vectors, wrong_direction_and_wrong_key_are_refused caught
M15 GCM tag control open ignores a failed tag check control tampering_is_refused, tampered_and_reflected_frames_are_dropped, open_never_accepts_random_frames, wrong_direction_and_wrong_key_are_refused caught
M24 GCM tag video decrypt ignores a failed tag check media video_decrypt_refuses caught
M16 FEC index a video parity shard stored one index too high video 12 tests, e.g. random_loss, all_data_lost_but_recoverable, recovered_shard_headers_are_not_trusted, generated_patterns caught
M17 Video header bytes 0-31 of a rebuilt shard trusted (whole-packet shards, start-of-frame flag read from a rebuilt shard) video 9 tests, e.g. recovered_shard_headers_are_not_trusted, all_data_lost_but_recoverable, random_loss caught
M18 Audio parity parity keyed by its own RTP sequence instead of the FEC header's base audio 9 tests, e.g. every_loss_pattern_of_a_block, sequence_wraps, hostile_parity_never_corrupts caught
M19 Pairing skip no pairingsecret: proof and signature skipped, straight to step 4 pairing a_bare_paired_answer_cannot_skip_any_step, out_of_order_answers_fail, replaying_the_same_answer_twice_fails caught
M20 Signature the host's signature over its secret not checked pairing bad_host_signatures caught
M21 Signature ServerCert::verify accepts any signature pairing bad_host_signatures, server_cert_verify_refuses caught
M22 Sans-I/O std::time::Instant::now() added in src/time.rs hygiene src_is_sans_io caught
M23 OS randomness getrandom added as a dependency and used in src/entropy.rs hygiene src_is_sans_io caught

Notes

  • M17. The video receiver keeps only the payloads (bytes 32 on) of each shard and rebuilds from those, so as written it cannot read a rebuilt shard's header. The mutation therefore first switches it to whole-packet shards, then makes it trust one header field of a rebuilt shard. recovered_shard_headers_are_not_trusted and the other loss tests catch it.
  • M23. The mutation compiled, against the cached getrandom 0.4.3, and the guard caught the source use. Since 27b26a9 the dependency tree has no getrandom at all.
  • Missing tests. No mutation got through, so none were added.