Skip to content

test: add CsCheck property-based fuzz suite (#115) - #228

Merged
Chris-Wolfgang merged 5 commits into
vNextfrom
ci/fuzz
Jul 24, 2026
Merged

test: add CsCheck property-based fuzz suite (#115)#228
Chris-Wolfgang merged 5 commits into
vNextfrom
ci/fuzz

Conversation

@Chris-Wolfgang

Copy link
Copy Markdown
Owner

Correcting another too-quick N/A. I said "no untrusted-input parsing" — but #115 is about property-based testing of methods with meaningful invariants, and the doubles have them: identity round-trips and the SkipItemCount/MaximumItemCount windowing arithmetic (exactly the integer-boundary logic CLAUDE.md warns about).

What it does

tests/Wolfgang.Etl.TestKit.Tests.Fuzz (CsCheck) + a scheduled fuzz.yaml. Four properties:

  • IdentityTestExtractor / TestTransformer / TestLoader move an arbitrary int sequence through unchanged.
  • WindowingSkip=s, Max=m yields exactly Skip(s).Take(m) for arbitrary s/m, deliberately allowed to exceed the item count so the clamping boundaries (skip past end, s+m past end) are hammered.

How it runs

  • Per PR: ~1000 cases/property via the solution test (seconds) — added to ETL-Test-Kit.slnx.
  • Weekly (fuzz.yaml, SHA-pinned): 1,000,000 cases/property; auto-files an issue with CsCheck's replayable seed on falsification, so the failing case can be pinned as a deterministic regression.

Verified

Locally: 200,000 cases/property pass (50K × 4). The windowing semantics (Skip(s).Take(m)) validated against 50K random boundary cases. Ported from ETL-FixedWidth's fuzz pattern.

Closes #115 when the vNext cycle merges to main.

🤖 Generated with Claude Code

Adds tests/Wolfgang.Etl.TestKit.Tests.Fuzz (CsCheck) + a scheduled fuzz.yaml.
Properties over the doubles' public surface: identity round-trips (extractor /
transformer / loader move an arbitrary sequence through unchanged) and the
SkipItemCount/MaximumItemCount windowing arithmetic (== Skip(s).Take(m) for
arbitrary s/m, exercising the clamping boundaries where off-by-one / negative-
width bugs hide).

Per-PR runs ~1000 cases/property via the solution test (seconds); the weekly
fuzz.yaml runs 1,000,000 and auto-files an issue with the replayable seed on
falsification. Verified locally: 200,000 cases/property pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 22, 2026 02:17

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Chris-Wolfgang and others added 3 commits July 22, 2026 20:52
The cross-platform differential (#128) caught ExtractAsync_does_not_allocate_
per_item failing on linux-x64 while passing on linux-arm64 and windows-x64.
GC.GetTotalAllocatedBytes is process-wide, so background allocation landing in
a measurement window could exceed the 4 B/item budget on a shared runner.

Hardened: settle GC/finalizers before each measurement, raise the marginal
denominator (BaseCount 20k -> 50k, so 450k marginal items amortize a stray
1 MB spike to ~2.3 B/item), take the min of 5 attempts instead of 3, and raise
the budget 4 -> 8 B/item — still an order of magnitude below a real per-item
regression (boxing is ~24 B/item).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants