Repository navigation
fuzz(datalog_eval): skip inputs whose patterns join to a cross product (#575) - #577
Merged
Merged
Conversation
#575) The executor holds every intermediate binding, so a query whose patterns share no variables builds the whole cross product: 3^k rows over the harness's 3 facts. The nightly found a 21-pattern input that reached 2.1 GB. That is a known limit, fixed by the streaming engine (#473) and the optional query memory limit (#549), not a new bug. The harness now estimates the rows a cross product could yield: it groups the patterns by shared variables (`_` and `?_` are wildcards), counts each group's join against the 3 facts, and multiplies the groups. Inputs above 50,000 rows are skipped. On the main corpus (3,883 inputs) only the #575 input is skipped, so no coverage is lost. The input is added as a seed. Refs #575 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U611mBGbkSqJeSwNz2xd7s
A string such as "[?a ?b ?c] [?d ?f ?g] ..." was read as patterns, so the cross-product estimate could skip a query with one real pattern. The scanner now skips quoted strings, honouring backslash escapes. Refs #575 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U611mBGbkSqJeSwNz2xd7s
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Harness code runs under cargo-fuzz, never under cargo test, so codecov counted the #575 guard as 0% patch coverage. Refs #575 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U611mBGbkSqJeSwNz2xd7s
This was referenced Oct 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stops the nightly
datalog_evalfuzz job from reporting the known cross-product OOM in #575. The engine fix is tracked in #549 (part of #473). This PR changes only the fuzz harness. No library code changes.Why
The executor holds every intermediate binding, so a query whose patterns share no variables builds the whole cross product: 3^k rows over the harness's 3 facts. The nightly found a 21-pattern input that reached 2.1 GB. The streaming engine (#473) bounds this query's memory, and #549's optional
query_memory_limit/QRY-012covers what remains. Run time stays exponential, though, so the harness needs its own guard either way.What
fuzz/fuzz_targets/datalog_eval.rsestimates how many rows a cross product of the input's patterns could produce, and skips the input above 50,000:[...]with at least three tokens counts as a pattern. Brackets inside string literals are ignored (found in Codex review)._and?_…are wildcards and share nothing, as inmatcher.rs.codecov.ymlignoresfuzz/**. Harness code runs under cargo-fuzz, never undercargo test, so Codecov counted it as 0% patch coverage.Verification
-runs=0over the full corpus: only the Nightly fuzz failure (main) #575 seed is skipped (main: 1 of 3,883 inputs), so the guard costs no engine coverage.Refs #575. After this PR and its
v3counterpart merge, #575 will be closed as tracked by #549.🤖 Generated with Claude Code
https://claude.ai/code/session_01U611mBGbkSqJeSwNz2xd7s