Skip to content

test(filters): differential fuzzer vs upstream rsync 3.4.2 (#1291) - #4184

Merged
oferchen merged 1 commit into
masterfrom
test/filter-differential-fuzzer-1291
May 16, 2026
Merged

oferchen merged 1 commit into
masterfrom
test/filter-differential-fuzzer-1291

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Adds a new cargo-fuzz target filter_differential that drives both the oc-rsync filter engine (filters::FilterSet) and a real upstream rsync 3.4.2 binary with the same randomised rule chain and candidate path, asserting that both reach the same include/exclude verdict.
  • Adds tools/ci/run_filter_fuzz.sh for a wrapped invocation with upstream binary discovery ($OC_RSYNC_UPSTREAM_BIN, then the standard target/interop/upstream-install/<v>/bin/rsync paths, then system locations) and a configurable duration (FUZZ_SECONDS, default 60).
  • Updates fuzz/README.md to document the new target and its throughput characteristics.

Why differential?

Reading the rsync man page is not enough. exclude.c has many quirks around anchored vs unanchored patterns, directory-only rules, perishable flags, and modifier interactions that are only visible when both engines see the exact same byte sequence. This target catches the gap between "we agree with upstream's text" and "we agree with upstream's behaviour".

Throughput

Each input spawns a child rsync process. Expect ~200-500 exec/sec on a modern laptop, two orders of magnitude slower than the in-process fuzz targets in this workspace. Documented inline in the target. Pair with protocol_wire and simd_checksum_parity for raw coverage.

CI

Per the task brief, only sanity-level CI integration was in scope; the standalone fuzz workspace remains excluded from the root workspace so cargo build on stable is unaffected. A scheduled 24h soak is tracked separately under #1293.

Test plan

  • bash tools/ci/run_filter_fuzz.sh exits cleanly after the default 60s with no crashes/divergences on a machine that has either a built upstream binary under target/interop/upstream-install/ or a system rsync 3.4.2.
  • OC_RSYNC_UPSTREAM_BIN=/path/to/rsync FUZZ_SECONDS=600 bash tools/ci/run_filter_fuzz.sh produces no findings under fuzz/artifacts/filter_differential/.
  • With no upstream binary discoverable, the harness still exercises the oc-rsync side and never panics (script prints a warning and the target self-skips the differential probe).

@oferchen
oferchen force-pushed the test/filter-differential-fuzzer-1291 branch from b7e4418 to d7bebf8 Compare May 16, 2026 20:44
@github-actions github-actions Bot added the test label May 16, 2026
@oferchen
oferchen force-pushed the test/filter-differential-fuzzer-1291 branch 3 times, most recently from e782817 to 5bd4053 Compare May 16, 2026 22:38
Adds a cargo-fuzz target that builds a FilterSet from a randomised rule
chain, evaluates a candidate path against it, and compares the verdict
to the same rules and path given to a real upstream rsync binary in
--dry-run --recursive --verbose mode. Divergences and panics both fail
the input.

The harness is throughput-limited (200-500 exec/sec) because each input
spawns a child rsync process - documented inline. A companion script,
tools/ci/run_filter_fuzz.sh, wraps the target with binary discovery and
a configurable duration (default 60s smoke run, intended for hours-long
local soaks).
@oferchen
oferchen force-pushed the test/filter-differential-fuzzer-1291 branch from 5bd4053 to 30e0b6d Compare May 16, 2026 23:19
@oferchen
oferchen merged commit 9af70e2 into master May 16, 2026
18 checks passed
@oferchen
oferchen deleted the test/filter-differential-fuzzer-1291 branch May 16, 2026 23:20
oferchen added a commit that referenced this pull request May 18, 2026
…4184)

Adds a cargo-fuzz target that builds a FilterSet from a randomised rule
chain, evaluates a candidate path against it, and compares the verdict
to the same rules and path given to a real upstream rsync binary in
--dry-run --recursive --verbose mode. Divergences and panics both fail
the input.

The harness is throughput-limited (200-500 exec/sec) because each input
spawns a child rsync process - documented inline. A companion script,
tools/ci/run_filter_fuzz.sh, wraps the target with binary discovery and
a configurable duration (default 60s smoke run, intended for hours-long
local soaks).
oferchen added a commit that referenced this pull request May 18, 2026
…4184)

Adds a cargo-fuzz target that builds a FilterSet from a randomised rule
chain, evaluates a candidate path against it, and compares the verdict
to the same rules and path given to a real upstream rsync binary in
--dry-run --recursive --verbose mode. Divergences and panics both fail
the input.

The harness is throughput-limited (200-500 exec/sec) because each input
spawns a child rsync process - documented inline. A companion script,
tools/ci/run_filter_fuzz.sh, wraps the target with binary discovery and
a configurable duration (default 60s smoke run, intended for hours-long
local soaks).
oferchen added a commit that referenced this pull request Aug 24, 2026
…4184)

Adds a cargo-fuzz target that builds a FilterSet from a randomised rule
chain, evaluates a candidate path against it, and compares the verdict
to the same rules and path given to a real upstream rsync binary in
--dry-run --recursive --verbose mode. Divergences and panics both fail
the input.

The harness is throughput-limited (200-500 exec/sec) because each input
spawns a child rsync process - documented inline. A companion script,
tools/ci/run_filter_fuzz.sh, wraps the target with binary discovery and
a configurable duration (default 60s smoke run, intended for hours-long
local soaks).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant