google / google/xls

[enhancement] Unify DSLX predicate annotation syntax across Quickcheck and Fuzz testing

Open
#4,533 0 comments 0 reactions 0 assignees View on GitHub
dslx enhancement formal fuzz
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

> created by a gemini-powered agent

### What's hard to do? (limit 100 words)

Currently, predicate functions in XLS DSLX must be annotated separately as either quickcheck or fuzz tests (they cannot be annotated as both simultaneously). Quickcheck (`qc`) runs via the DSLX interpreter and is faster for checking small domains, while fuzzing requires ahead-of-time (AOT) compilation and uses coverage guidance for broader domain exploration. Because annotations are separate, developers cannot easily switch between quickcheck and fuzz testing on the same predicate function.

### Current best alternative workaround (limit 100 words)

Developers must maintain separate annotations or duplicate predicate wrappers to run both quickcheck and fuzz testing on the same domain properties, or choose one execution mode upfront and forgo the benefits of the other.

### Your view of the "best case XLS enhancement" (limit 100 words)

Unify the annotation syntax for predicate functions so that a single annotation syntax is used for domain predicates, and allow selecting the execution mode/runner (`qc` vs `fuzz`) via test runner options.

Benefits:
* Simplifies DSLX predicate testing and avoids duplicate annotations.
* Allows running either quickcheck or fuzzing on the same predicates.
* Potentially allows collecting fuzz predicates for Z3 formal proofs (`prove_quickcheck_main`).

Contributor guide

Open the contributing guide

Research direction

Start by locating the DSLX predicate annotation handling and the Quickcheck and fuzz test runners. Compare how `qc` and `fuzz` annotations are parsed and selected, then determine how one predicate annotation could support both modes through runner options. Done means the same predicate can be exercised by either runner without duplicate annotations, with the relevant existing behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.