Repository navigation
feat(sv)!: solve scalar class constraints during randomize - #2194
Conversation
|
This pull request is part of a Mergify stack:
|
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. |
Revision history
|
7ac70a1 to
2a5c1ce
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2a5c1ced47
ℹ️ 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".
| match serde_json::from_slice::<crate::randomization::Program>( | ||
| self.string(b as Handle), | ||
| ) { |
There was a problem hiding this comment.
Align program deserialization depth with accepted expressions
For sufficiently deep expressions accepted by the binder, the generated program fails at runtime because serde_json::from_slice uses its default 128-level recursion limit. For example, a constraint comparing a left-associated sum of 64 occurrences of an 8-bit field against 32'd0 stays within the binder's 64-level expression limit, but the externally tagged Binary objects and inserted Resize objects exceed the JSON limit. A satisfiable constraint therefore raises ConstraintRandomization before reaching the solver. Align the accepted expression depth with the serialized representation, or deserialize compiler-generated programs using a suitably bounded higher limit.
Useful? React with 👍 / 👎.
| let block_name = block.name.spelling.clone(); | ||
| constraints.retain(|(name, _)| *name != block_name); |
There was a problem hiding this comment.
Normalize constraint names before replacing inherited blocks
When a base constraint and its derived override use escaped and unescaped spellings of the same identifier, this comparison retains both blocks instead of replacing the inherited one. For example, a base block named \bounds requiring x == 1 and a derived block named bounds requiring x == 2 make derived-object randomization incorrectly return UNSAT. The parser preserves the backslash in Name.spelling, while instances::normalize_identifier explicitly handles these equivalent identifiers elsewhere in class binding. Normalize the block name before storing and comparing it.
Useful? React with 👍 / 👎.
2a5c1ce to
e49026c
Compare
Connect named scalar class constraints to Aplite through a serializable heap program. Support 1-64 bit two-state integer comparisons, Boolean and bitwise operators, and addition/subtraction/multiplication with SV context sizing. Inherit constraints and replace same-name blocks in derived classes, including calls through base handles. Read state and random modes after pre_randomize. Apply a complete satisfying assignment atomically; proved UNSAT returns 0 without changing random fields or calling post_randomize. Restore temporary member selections on failure. Check-only calls consume no object random draws. Resource exhaustion raises a heap fault instead of masquerading as UNSAT. Use seeded SAT search for the initial integration. This avoids hash-cell acceptance failures and makes no uniformity claim; distribution work is tracked in #2187. Constrained enums/randc, inside, dist, solve-before, inline with, conditional/soft/foreach constraints and external/static blocks remain diagnosed as unsupported. The publishing consumer requires the independent aplite 0.1.0 release before publishing celox-heap. Validation: 129 randomization regressions across native, Cranelift, Wasm and parallel backends; 25 heap, 832 analyzer and 132 syntax tests plus doctests; focused failure/replay and unsupported-form tests; affected-crate clippy and rustdoc with warnings denied; NAPI cargo check; formatting and package/release guards. Verilator passes scalar mode/selection and width/inheritance cases. Retained evidence records its post_randomize-on-UNSAT disagreement and Icarus unsupported constraint declarations, with narrow tool-specific exclusions and unchanged Celox assertions. No local release build. BREAKING CHANGE: ObjectOp and heap Fault gain constraint randomization variants. Change-Id: I0bbc4db8256385015e506817f5ea46fd3fcdd006
e49026c to
40976fd
Compare
Merge Queue Status
This pull request spent 1 hour 27 minutes 23 seconds in the queue, including 28 minutes 24 seconds running CI. Required conditions to merge
|
Connect named scalar class constraints to Aplite through a serializable heap program. Support 1-64 bit two-state integer comparisons, Boolean and bitwise operators, and addition/subtraction/multiplication with SV context sizing. Inherit constraints and replace same-name blocks in derived classes, including calls through base handles.
Read state and random modes after pre_randomize. Apply a complete satisfying assignment atomically; proved UNSAT returns 0 without changing random fields or calling post_randomize. Restore temporary member selections on failure. Check-only calls consume no object random draws. Resource exhaustion raises a heap fault instead of masquerading as UNSAT.
Use seeded SAT search for the initial integration. This avoids hash-cell acceptance failures and makes no uniformity claim; distribution work is tracked in #2187. Constrained enums/randc, inside, dist, solve-before, inline with, conditional/soft/foreach constraints and external/static blocks remain diagnosed as unsupported. The publishing consumer requires the independent aplite 0.1.0 release before publishing celox-heap.
Validation: 129 randomization regressions across native, Cranelift, Wasm and parallel backends; 25 heap, 832 analyzer and 132 syntax tests plus doctests; focused failure/replay and unsupported-form tests; affected-crate clippy and rustdoc with warnings denied; NAPI cargo check; formatting and package/release guards. Verilator passes scalar mode/selection and width/inheritance cases. Retained evidence records its post_randomize-on-UNSAT disagreement and Icarus unsupported constraint declarations, with narrow tool-specific exclusions and unchanged Celox assertions. No local release build.
BREAKING CHANGE: ObjectOp and heap Fault gain constraint randomization variants.
Depends-On: #2193