Repository navigation
feat(sv)!: support unconstrained class randomization - #1767
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 20f2212e3f
ℹ️ 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".
20f2212 to
d18dd9d
Compare
Revision history
|
d18dd9d to
97c87d2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 97c87d2bdc
ℹ️ 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".
| self.heap_call(ops::encode(ops::OBJECT_NEW, u64::from(*class)), &[size]); | ||
| // Object seeding consumes the creating process's RNG once, | ||
| // before the constructor body (IEEE 1800-2023 18.14.3). | ||
| let seed = self.urandom(None)?; |
There was a problem hiding this comment.
Register constructor seeding as an FF state target
When new executes in an edge-triggered process, this reaches urandom_state() only while exec_block lowers the body, but Ff::lower_process has already frozen its target ranges and Ff::scan skips all Callee::Object calls. The hidden process RNG therefore remains in working scratch instead of being committed to stable state; for example, after creating an object, checkpointing, creating another, and restoring, the next object's seed continues from the post-checkpoint scratch value rather than replaying the saved stream. Have the scan recognize ObjectOp::New as a process-RNG consumer before FF targets are computed.
Useful? React with 👍 / 👎.
|
Queued — the merge queue status continues in this comment ↓. |
97c87d2 to
d0001c2
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0001c2e15
ℹ️ 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".
da2f9e7 to
4b459d1
Compare
|
This pull request is part of a Mergify stack:
|
Merge Queue Status
This pull request spent 1 hour 15 minutes 58 seconds in the queue, with no time running CI. ReasonThe pull request conflicts with the base branch The pull request was held in the queue, conflicting with at least one of 3 pull requests ahead of it. The conflict became a base branch one after #1776, #1783 merged. HintYou should update or rebase your pull request. If you want to requeue this pull request, you can post a Requeued — the merge queue status continues in this comment ↓. |
4b459d1 to
f301ea0
Compare
Calling object.randomize() randomizes 2-state, non-enum integral rand properties up to 64 bits and returns signed int success. Invoke pre_randomize and post_randomize around updates, preserve non-rand properties, and support srandom(seed) with independent per-object random streams seeded by the creating process. Register constructor seeding as a process RNG consumer before computing FF state targets, so checkpoint/restore replays object seeds from edge-triggered processes. Reject invalid receivers before hooks, random draws or property writes: a null or mismatched runtime class records a runtime fault and returns failure without those side effects. Retain rand/randc and constraint metadata so unsupported randomization is rejected explicitly. Constraints, randc, static random properties, randomize argument lists, non-integral random properties and inheritance remain outside this first subset. Preserve master's static properties, constructor chaining, virtual methods and interface classes when integrating this subset. Differential scheduler checks compare live class objects, including RNG state and future object allocation handles, so divergent random draws are detected before a subsequent property update. Add portable shared cases, backend and rejection regressions, and English/Japanese reference documentation. Record Icarus 13.0's missing randomize/srandom methods with original compile diagnostics and exact case exclusions. Validation on master d7bb5a3: - Reproduced the constructor checkpoint mismatch and rejected-receiver property mutation on all four applicable backend variants before their fixes. - Class integration tests: 110 passed, including checkpoint replay, null receiver hooks and base-handle mutation guards. - Existing urandom integration tests: 81 passed. - Syntax, analyzer, heap and SV frontend unit tests: 931 passed, 3 existing ignores. - Retained-report consistency tests: 3 passed. - NAPI debug build and JS tests: 432 passed across 15 files. - Formatting, diff checks and Clippy for the four changed implementation crates and SystemVerilog integration target. - Shared executable cases and external adapters are unchanged from their earlier validation: Verilator randomize filter passed 4 cases; Icarus rejected the two class cases for unsupported methods, recorded as limitations rather than passes. Additional P2 validation: heap tests (16), differential scheduler tests (5), and class integration tests in differential mode (110) pass. New tests reproduce RNG-only and object-content comparison omissions before the fix. Heap and Celox Clippy, formatting and diff checks pass. BREAKING CHANGE: Public SystemVerilog syntax structs gain constraint/randc metadata, and ObjectOp and heap Fault gain enum variants. Downstream struct literals and exhaustive matches must be updated. Change-Id: If4e53d32f02e495546c1154f9f0aad3897e71e9b
f301ea0 to
ea71f96
Compare
Merge Queue Status
This pull request spent 1 hour 13 minutes 8 seconds in the queue, including 1 hour 11 minutes 18 seconds running CI. Required conditions to merge
|
Calling object.randomize() randomizes 2-state, non-enum integral rand properties up to 64 bits and returns signed int success. Invoke pre_randomize and post_randomize around updates, preserve non-rand properties, and support srandom(seed) with independent per-object random streams seeded by the creating process.
Register constructor seeding as a process RNG consumer before computing FF state targets, so checkpoint/restore replays object seeds from edge-triggered processes. Reject invalid receivers before hooks, random draws or property writes: a null or mismatched runtime class records a runtime fault and returns failure without those side effects.
Retain rand/randc and constraint metadata so unsupported randomization is rejected explicitly. Constraints, randc, static random properties, randomize argument lists, non-integral random properties and inheritance remain outside this first subset. Preserve master's static properties, constructor chaining, virtual methods and interface classes when integrating this subset.
Differential scheduler checks compare live class objects, including RNG state and future object allocation handles, so divergent random draws are detected before a subsequent property update.
Add portable shared cases, backend and rejection regressions, and English/Japanese reference documentation. Record Icarus 13.0's missing randomize/srandom methods with original compile diagnostics and exact case exclusions.
Validation on master d7bb5a3:
Additional P2 validation: heap tests (16), differential scheduler tests (5), and class integration tests in differential mode (110) pass. New tests reproduce RNG-only and object-content comparison omissions before the fix. Heap and Celox Clippy, formatting and diff checks pass.
BREAKING CHANGE: Public SystemVerilog syntax structs gain constraint/randc metadata, and ObjectOp and heap Fault gain enum variants. Downstream struct literals and exhaustive matches must be updated.