Skip to content

[DSLX Fuzz testing] Unify fuzz test domain validation via constexpr value evaluation to support derived and nested struct domains.#4333

Draft
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_922314923
Draft

[DSLX Fuzz testing] Unify fuzz test domain validation via constexpr value evaluation to support derived and nested struct domains.#4333
copybara-service[bot] wants to merge 1 commit into
mainfrom
test_922314923

Conversation

@copybara-service
Copy link
Copy Markdown

@copybara-service copybara-service Bot commented May 28, 2026

[DSLX Fuzz testing] Unify fuzz test domain validation via constexpr value evaluation to support derived and nested struct domains.

Moved fuzz test domain validation to its own class file.

To support derived and nested struct domains, this CL:

  • Shifts the domain validation paradigm: instead of validating the AST structure before evaluation, ValidateFuzzTestDomain now evaluates the constexpr domain expression to an InterpValue and recursively validates this evaluated value against the parameter's concrete type.
  • Migrates recursive validation of struct domains to the new post-evaluation path, validating evaluated domain tuple elements against StructType members.
  • Relaxes module type-checking constraints during domain struct initialization to allow assigning range and array domains to fields, relying on the post-evaluation validation to ensure type safety.
  • Fixes a bug where empty tuple domains () (which represent an arbitrary domain) were incorrectly rejected for non-tuple/non-struct parameters. Empty tuples are now correctly permitted as arbitrary domains for all parameter types.

…alue evaluation to support derived and nested struct domains.

Moved fuzz test domain validation to its own class file.

To support derived and nested struct domains, this CL:
- Shifts the domain validation paradigm: instead of validating the AST structure before evaluation, `ValidateFuzzTestDomain` now evaluates the constexpr domain expression to an `InterpValue` and recursively validates this evaluated value against the parameter's concrete type.
- Migrates recursive validation of struct domains to the new post-evaluation path, validating evaluated domain tuple elements against `StructType` members.
- Relaxes module type-checking constraints during domain struct initialization to allow assigning range and array domains to fields, relying on the post-evaluation validation to ensure type safety.
- Fixes a bug where empty tuple domains `()` (which represent an arbitrary domain) were incorrectly rejected for non-tuple/non-struct parameters. Empty tuples are now correctly permitted as arbitrary domains for all parameter types.

PiperOrigin-RevId: 922314923
@copybara-service copybara-service Bot changed the title [DSLX Fuzz testing] Refactor ValidateFuzzTestDomain to always evaluate domain expressions to InterpValue using ConstexprEvaluator. Restores early type safety by recursively validating constexpr-evaluated domain values against struct parameter types. [DSLX Fuzz testing] Unify fuzz test domain validation via constexpr value evaluation to support derived and nested struct domains. Jun 4, 2026
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.

1 participant