Skip to main content

fuzz_parallel_dataframe_bytes

Function fuzz_parallel_dataframe_bytes 

Source
pub fn fuzz_parallel_dataframe_bytes(input: &[u8]) -> Result<(), String>
Expand description

Concurrency-oriented fuzz entrypoint: exercise an Arc<DataFrame> shared across multiple reader threads.

Per br-frankenpandas-bahw Phase 1 + br-frankenpandas-i3t8 (Sync contract fix). /testing-fuzzing Rule 6 + Rule 7 (concurrency archetype, TSan campaign). As of br-i3t8, Index’s internal caches switched from std::cell::OnceCell (!Sync) to std::sync::OnceLock (Sync), so DataFrame is now Send + Sync. This harness exercises the shared-Arc pattern directly — any hidden race in the lazy cache initialization surfaces as a TSan report or as a divergent observed shape across threads.

Shape:

  • Project bytes into a small frame via the existing helper.
  • Wrap in Arc and clone the Arc into 4 reader threads.
  • Each thread does a read-only traversal (index len, column_names len, has_duplicates, is_sorted — the last two trigger OnceLock init) in a hot loop and returns the observed shape.
  • Join all threads; assert all four observed shapes match.

Under TSan (RUSTFLAGS="-Zsanitizer=thread" cargo +nightly fuzz run fuzz_parallel_dataframe) this harness detects races in the OnceLock init path or in any other shared-state that future Sync work might introduce.