Skip to content

feat(codec): add Zenoh message fuzz target#2591

Open
evshary wants to merge 14 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:add_fuzzy
Open

feat(codec): add Zenoh message fuzz target#2591
evshary wants to merge 14 commits into
eclipse-zenoh:mainfrom
ZettaScaleLabs:add_fuzzy

Conversation

@evshary
Copy link
Copy Markdown
Contributor

@evshary evshary commented May 6, 2026

Description

This PR adds an initial cargo-fuzz setup for zenoh-codec and introduces a focused fuzz target for TransportMessage decoding.

What does this PR do?

The change adds a standalone fuzz crate under commons/zenoh-codec/fuzz, a raw-byte fuzz target for TransportMessage, deterministic seed corpus generation/verification helpers, and a lightweight CI smoke job to keep the fuzz target buildable and exercised

Why is this change needed?

  • Adds a new cargo-fuzz crate at commons/zenoh-codec/fuzz.
  • Implements a shared fuzz harness for TransportMessage decoding.
  • Separates two fuzzing concerns in the harness:
    • decode robustness for arbitrary input
    • codec consistency via decode/encode/decode roundtrip
  • Documents the fuzz workflow in commons/zenoh-codec/README.md.
  • Adds a CI smoke job

Related Issues

#2592


🏷️ Label-Based Checklist

Based on the labels applied to this PR, please complete these additional requirements:

Labels: enhancement

✨ Enhancement Requirements

Since this PR enhances existing functionality:

  • Enhancement scope documented - Clear description of what is being improved
  • Minimum necessary code - Implementation is as simple as possible, doesn't overcomplicate the system
  • Backwards compatible - Existing code/APIs still work unchanged
  • No new APIs added - Only improving existing functionality
  • Tests updated - Existing tests pass, new test cases added if needed
  • Performance improvement measured - If applicable, before/after metrics provided
  • Documentation updated - Existing docs updated to reflect improvements
  • User impact documented - How users benefit from this enhancement

Remember: Enhancements should not introduce new APIs or breaking changes.

Instructions:

  1. Check off items as you complete them (change - [ ] to - [x])
  2. The PR checklist CI will verify these are completed

This checklist updates automatically when labels change, but preserves your checked boxes.

Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary evshary added the enhancement Existing things could work better label May 6, 2026
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
evshary added 2 commits May 13, 2026 20:04
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.99%. Comparing base (0aa7578) to head (e024036).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2591      +/-   ##
==========================================
- Coverage   74.02%   73.99%   -0.03%     
==========================================
  Files         400      400              
  Lines       60864    60864              
==========================================
- Hits        45056    45039      -17     
- Misses      15808    15825      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

evshary added 3 commits May 15, 2026 15:35
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary evshary changed the title feat(codec): add transport message fuzz target feat(codec): add Zenoh message fuzz target May 15, 2026
evshary added 5 commits May 18, 2026 08:45
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@evshary evshary marked this pull request as ready for review May 20, 2026 07:25
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Existing things could work better

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant