Skip to content

test(fuzz): fix three flaky generated-data properties - #131

Merged
Makisuo merged 2 commits into
mainfrom
fix/fuzz-flakes
Nov 2, 2026
Merged

Makisuo merged 2 commits into
mainfrom
fix/fuzz-flakes

test: skip ClickHouse 26.2's negative-modulo union bug, and give PGli…

c9c9af4
Select commit
Loading
Failed to load commit list.
Maple Review Bot / Maple / review completed Nov 2, 2026 in 47s

Confidence 6/10 · 1 issue to address

🟡 Confidence 6/10 · needs attention. Held at 6 because a correctness warning is open.
1 warning −1 · tests covered · risk low

Fixes three flaky fuzz properties: the empty ClickHouse fixture source now comes from numbers(0), the model pre-evaluates expressions over orders an inner join drops, and escaped one-character record keys are excluded from the codec property. Test-only and otherwise sound, but the new union known issue does not cover every shape that reaches the 26.2 % bug.

  • Empty ClickHouse fixture sources are built from numbers(0), with a pinned regression
  • evaluate also walks every order when the plan joins
  • clickhouse-26.2-union-negative-modulo added to tests/fuzz/known-issues.ts
  • Codec property excludes one-character escaped record keys; PGlite migrate describe gets a 30s timeout

Findings

🟠 Warning · F1 · negativeModulo misses a negative divisor written as a num expression

correctness · tests/fuzz/known-issues.ts:67

plan.ts:139 builds a mod divisor either as a raw number or as a sub-expression like { k: "num", v: -4 }, and build.ts:92 writes both through the same literal path. The entry only fires on the raw number, so those union plans still run against ClickHouse 26.2 and fail with 3 instead of -1.

Also treat a `{ k: "num" }` divisor as a constant: `const r = value.r; typeof r === "number" ? r < 0 : r.k === "num" && r.v < 0`.
What was checked
  • Non-empty ClickHouse sources still use values(...) (fixtures.ts:81), untouched by the new empty branch
  • evalExpr on an { o } row reads a jcol as the semantics' missing-join value, so the new loop cannot throw
  • Pinned regression's Id % Id never reaches evalExpr over zero model rows, so it does not self-skip

c9c9af4 · Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

Annotations

Check warning on line 67 in tests/fuzz/known-issues.ts

See this annotation in the file changed.

@maple-review-bot maple-review-bot / Maple / review

correctness: `negativeModulo` misses a negative divisor written as a `num` expression

`plan.ts:139` builds a `mod` divisor either as a raw number or as a sub-expression like `{ k: "num", v: -4 }`, and `build.ts:92` writes both through the same literal path. The entry only fires on the raw number, so those union plans still run against ClickHouse 26.2 and fail with `3` instead of `-1`.