Skip to content

Fuzz harness: cache-config sweep with config-invariance and cache-state oracles #28

Description

@zfarrell

Part of #22. Depends on the harness skeleton.

Two oracles that need no reference engine at all: the cache must not change the answer, whatever its configuration or its state.

Config invariance

The same SQL over the same file, run under N cache configurations, must produce identical results. Dimensions:

  • Memory limit, including values small enough to force eviction mid-scan
  • Disk limit at 0, small, and large — 0 disables the liquid disk tier entirely
  • All three squeeze policies (Evict, TranscodeEvict, TranscodeSqueezeEvict)
  • Cache batch size deliberately mismatched against session batch size. This is the Reader batch id counts query batches but addresses cache batches #13/fix(reader): read the cache in cache-sized batches #15 dimension. The builder pins both to the same value (src/datafusion-local/src/lib.rs:186), so the mismatch is produced by SET datafusion.execution.batch_size after build, exactly as batch_size_alignment.rs:58-66 does.

test_runner (tests/mod.rs:170) already does a 3x3 version of this over 6 hand-written queries; this generalizes it to generated queries and adds the batch-size axis.

Cache state invariance

Within one configuration, the same query must return the same rows:

  1. Cold — nothing cached
  2. Warm — immediately after, cache populated
  3. After forced eviction — exercises the squeeze and hydration paths, which no current test reaches through a generated workload

run_sql_with_cache (tests/mod.rs:130) already asserts cold == warm for its six queries; the third run is new.

Why this matters independent of the differential oracle

These catch bugs where vanilla DataFusion is unavailable as a reference — unsupported types, forced-option divergence — and they attribute unambiguously: if two cache configurations disagree, exactly one of them is this repo's bug, with no upstream explanation available.

Acceptance

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions