Skip to content

feat(sv): support per-call inline class constraints - #2240

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sv-constraint-extensions/support-per-call-inline-class-constraints--6ae71869
Oct 27, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sv-constraint-extensions/support-per-call-inline-class-constraints--6ae71869

Conversation

@tignear

@tignear tignear commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Lower randomize() with blocks into call-specific solver methods. Inline predicates add to named constraints without persisting across calls, retain static receiver property lookup under dynamic dispatch, and preserve selection, check-only calls, hooks and UNSAT value preservation. Package methods and separate generated instances get distinct methods.

This initial subset accepts unqualified receiver properties; caller-local captures, local::, qualified this/super and restricted with-name lists remain unsupported. Bound nested inline parsing before recursion. IEEE 1800-2023 18.6.3 and 18.7.

Validation: 133 syntax tests, 840 analyzer tests (three existing ignored), 356 class backend tests and 20 final inline backend tests pass; affected all-target Clippy and formatting pass. Verilator passes the basic and package/instance cases. Retain observed Icarus compile limitations and standalone Verilator evidence for failed-call post hooks and hidden-property static scope, without weakening assertions.
Retain bound inline requests in exported scope symbols, deduplicate them across imports and regenerate helper dispatch in the consumer scope. A package method called through a base handle now reaches module-defined subclasses, including their constraints and hooks. The package/multiple-instance regression covers this import boundary. Validation: 60 constrained backend tests, 841 analyzer tests (three existing ignored), Verilator and analyzer all-target Clippy pass; Icarus retains its known inline-syntax exclusion.

@tignear

tignear commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 feat(sv): support per-call inline class constraints #2240 👈
2 feat(heap): accept per-call scalar constraint inputs #2250
3 feat(sv): bind caller scalar inputs in inline constraints #2251

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T08:32:55.389130Z a39a4ec New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6777cdf97b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +425 to +427
let dims = &inline.dimensions;
let mut classes = vec![inline.class.clone()];
for name in classes::visible_classes(tree) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Extend imported inline helpers for consumer-defined subclasses

When a package class defines a method containing an inline randomization call and a consuming module defines a subclass, calling that inherited method on the subclass fails instead of randomizing it. For example, pkg::Base::pick() returning randomize() with { x == 1; } gets its helper generated while analyzing the package, when the module's Derived extends pkg::Base is not visible. The imported helper is never rebuilt with the consumer's subclasses (unlike imported virtual dispatchers in subroutines_with_symbolic_parameters), so its class-dispatch case misses Derived and the subsequent ObjectOp::Check(Base.id) raises RandomizationClassMismatch. Preserve the inline request metadata across scope imports and extend these helpers for subclasses visible in the consuming scope.

Useful? React with 👍 / 👎.

@tignear
tignear force-pushed the stack/tignear/feat/sv-constraint-extensions/solve-conditional-class-constraints--726d3ce3 branch from a973e8a to 32021e5 Compare October 27, 2026 06:31
@tignear
tignear force-pushed the stack/tignear/feat/sv-constraint-extensions/support-per-call-inline-class-constraints--6ae71869 branch from 6777cdf to 0536d6c Compare October 27, 2026 06:31
@tignear

tignear commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 6777cdf 2026-10-27 06:30 UTC
2 rebase 6777cdf → 0536d6c (rebase only) Address #2238 review: membership-wide sizing and bounded nested expansion 2026-10-27 06:30 UTC
3 content 0536d6c → 03d5b30 Fix review 4385704812: retain inline predicates through scope imports and regenerate helpers for consumer subclasses 2026-10-27 07:27 UTC
4 rebase 03d5b30 → a39a4ec (rebase only) 2026-10-27 08:29 UTC

@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@tignear
tignear force-pushed the stack/tignear/feat/sv-constraint-extensions/support-per-call-inline-class-constraints--6ae71869 branch from 0536d6c to 03d5b30 Compare October 27, 2026 07:28
@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 27, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 27, 2026
@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

34 min in the queue, with no time running CI.

So far

Reason

The pull request #2240 has been manually updated

Merge conditions: 8 of 10 met

This pull request

Condition
✅ depends-on = celox-sim/celox#2239

The batch, tested on draft #2252

Condition Required by
❌ check-success = Queue validation —
❌ any of: check-neutral = @github-actions/Rust Test & NAPI Build, check-skipped = @github-actions/Rust Test & NAPI Build, check-success = @github-actions/Rust Test & NAPI Build GitHub repository ruleset rule master
✅ check-success = Conventional Commit title —
✅ any of: check-success = @github-actions/Lint & Format, check-neutral = @github-actions/Lint & Format, check-skipped = @github-actions/Lint & Format GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/NAPI Build (Linux ARM64 GNU), check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU), check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/NAPI Build (Windows), check-neutral = @github-actions/NAPI Build (Windows), check-skipped = @github-actions/NAPI Build (Windows) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/JS Test (Ubuntu), check-neutral = @github-actions/JS Test (Ubuntu), check-skipped = @github-actions/JS Test (Ubuntu) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/JS Test (Windows), check-neutral = @github-actions/JS Test (Windows), check-skipped = @github-actions/JS Test (Windows) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Conventional Commit title, check-neutral = @github-actions/Conventional Commit title, check-skipped = @github-actions/Conventional Commit title GitHub repository ruleset rule master

Requeued — the merge queue status continues in this comment ↓.

Times in UTC · dashboard · how the merge queue works

Base automatically changed from stack/tignear/feat/sv-constraint-extensions/solve-conditional-class-constraints--726d3ce3 to master October 27, 2026 08:10
Lower randomize() with blocks into call-specific solver methods. Inline predicates add to named constraints without persisting across calls, retain static receiver property lookup under dynamic dispatch, and preserve selection, check-only calls, hooks and UNSAT value preservation. Package methods and separate generated instances get distinct methods.

This initial subset accepts unqualified receiver properties; caller-local captures, local::, qualified this/super and restricted with-name lists remain unsupported. Bound nested inline parsing before recursion. IEEE 1800-2023 18.6.3 and 18.7.

Validation: 133 syntax tests, 840 analyzer tests (three existing ignored), 356 class backend tests and 20 final inline backend tests pass; affected all-target Clippy and formatting pass. Verilator passes the basic and package/instance cases. Retain observed Icarus compile limitations and standalone Verilator evidence for failed-call post hooks and hidden-property static scope, without weakening assertions.
Retain bound inline requests in exported scope symbols, deduplicate them across imports and regenerate helper dispatch in the consumer scope. A package method called through a base handle now reaches module-defined subclasses, including their constraints and hooks. The package/multiple-instance regression covers this import boundary. Validation: 60 constrained backend tests, 841 analyzer tests (three existing ignored), Verilator and analyzer all-target Clippy pass; Icarus retains its known inline-syntax exclusion.

Change-Id: I6ae718696957044ae716f778092c6106488086d6
@tignear
tignear force-pushed the stack/tignear/feat/sv-constraint-extensions/support-per-call-inline-class-constraints--6ae71869 branch from 03d5b30 to a39a4ec Compare October 27, 2026 08:30
@mergify mergify Bot added queued Mergify queue entry and removed queued Mergify queue entry labels Oct 27, 2026
@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as e30a87f at 11:05 UTC

Merged together with #2250, #2251. 1 h 39 min in the queue, 46 min of it CI.

So far

Merge conditions: 11 of 11 met

This pull request

Condition
✅ depends-on=celox-sim/celox#2240
✅ depends-on=celox-sim/celox#2250

The batch, tested on draft #2261

Condition Required by
✅ check-success = Conventional Commit title —
✅ check-success = Queue validation —
✅ any of: check-success = @github-actions/Lint & Format, check-neutral = @github-actions/Lint & Format, check-skipped = @github-actions/Lint & Format GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/NAPI Build (Linux ARM64 GNU), check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU), check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/NAPI Build (Windows), check-neutral = @github-actions/NAPI Build (Windows), check-skipped = @github-actions/NAPI Build (Windows) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Rust Test & NAPI Build, check-neutral = @github-actions/Rust Test & NAPI Build, check-skipped = @github-actions/Rust Test & NAPI Build GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/JS Test (Ubuntu), check-neutral = @github-actions/JS Test (Ubuntu), check-skipped = @github-actions/JS Test (Ubuntu) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/JS Test (Windows), check-neutral = @github-actions/JS Test (Windows), check-skipped = @github-actions/JS Test (Windows) GitHub repository ruleset rule master
✅ any of: check-success = @github-actions/Conventional Commit title, check-neutral = @github-actions/Conventional Commit title, check-skipped = @github-actions/Conventional Commit title GitHub repository ruleset rule master

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot deleted the stack/tignear/feat/sv-constraint-extensions/support-per-call-inline-class-constraints--6ae71869 branch October 27, 2026 11:05
@mergify mergify Bot removed the queued Mergify queue entry label Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant