Repository navigation
fix(sv): preserve X/Z in two-state exact comparisons - #2244
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. |
61b4657 to
2d4738e
Compare
Revision history
|
2d4738e to
80fe8ba
Compare
❌ Left the queue ·
|
| Condition | Required by | |
|---|---|---|
| ❌ | check-success = Queue validation |
— |
| ❌ | any of: check-neutral = @github-actions/Lint & Format, check-skipped = @github-actions/Lint & Format, check-success = @github-actions/Lint & Format |
GitHub repository ruleset rule master |
| ❌ | any of: check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU), check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU), check-success = @github-actions/NAPI Build (Linux ARM64 GNU) |
GitHub repository ruleset rule master |
| ❌ | any of: check-neutral = @github-actions/NAPI Build (Windows), check-skipped = @github-actions/NAPI Build (Windows), check-success = @github-actions/NAPI Build (Windows) |
GitHub repository ruleset rule master |
| ❌ | 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 |
| ❌ | any of: check-neutral = @github-actions/JS Test (Ubuntu), check-skipped = @github-actions/JS Test (Ubuntu), check-success = @github-actions/JS Test (Ubuntu) |
GitHub repository ruleset rule master |
| ❌ | any of: check-neutral = @github-actions/JS Test (Windows), check-skipped = @github-actions/JS Test (Windows), check-success = @github-actions/JS Test (Windows) |
GitHub repository ruleset rule master |
| ✅ | check-success = Conventional Commit title |
— |
| ✅ | 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
Two-state lowering converted X/Z operands to zero before ===, !== and ordinary case matching. A parity check against X could therefore accept a known zero and clear an instruction-loader byte (#2136). Retain literal unknowns inside exact-comparison operands and project their value and mask into ordinary two-state SLT expressions before backend lowering. Apply the same rules to combinational/procedural expressions and case matching, including width extension and conditional/arithmetic operands. Storage stays two-state, calls keep their effects, and known-only comparisons reuse their interned graph (IEEE 1800-2023 11.4.5 and 12.5). Preserve actual startup unknowns too: encode default four-state function locals as X rather than Z (6.8, Table 6-7), and keep partially driven nets out of constant-variable inlining when any read touches undriven bits. Merge sparse driver intervals to check coverage without a full-width bit mask. Fully covered constant reads remain eligible for inlining. Test interior gaps, high undriven bits, contiguous fragments and dependency preservation. The existing startup API regressions now explicitly check both state modes and verify that comparison results have no unknown bits. Add five shared regressions for operand order, signed/wide patterns, X versus Z, conversion, FF/timed execution, loaded bytes, call effects and unknown intermediates. Icarus passes all five unchanged cases. Verilator passes the timed effects case and rejects four with unsupported tristate constructs; retain the actual diagnostics, check their named cases, status, phase and diagnostic, and keep them executable without exclusions. Validation: 5,868 SV integration tests passed (20 existing ignored tests), 4,619 Veryl shared executions across native, native-parallel, Cranelift, Cranelift-parallel, WASM and the interpreter passed, as did 186 SLT unit tests, 9 frontend unit tests and all 4 retained-report integration tests. Changed crates/test targets pass clippy, formatting and workspace checks. The native NAPI addon builds and all 116 JS boundary tests pass. The companion performance-stack PR #2233 maintains the correction for the base's CodegenError::message feature gating in host-runtime-disabled SV builds. A pre-existing case-coverage false positive remains: an exhaustive case on {b, 1'bx} with only 2'b0x and 2'b1x labels is diagnosed as a latch. Both reproduce on the unchanged base and are not duplicated or broadened into this patch. The repository-script checks also enumerate the same four SV Verilator tristate compile failures. All 316 Node script tests, three benchmark-shell fixture suites and three updatecli unit tests pass on master 89b46b1. Fixes #2136 Change-Id: I2b96b81844d9977a40668002b257c8bf845a249b
80fe8ba to
1ada59c
Compare
✅ Merged into
|
| 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/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/Conventional Commit title, check-neutral = @github-actions/Conventional Commit title, check-skipped = @github-actions/Conventional Commit title |
GitHub repository ruleset rule master |
| ✅ | any of: check-success = @github-actions/Queue validation, check-neutral = @github-actions/Queue validation, check-skipped = @github-actions/Queue validation |
GitHub repository ruleset rule master |
Times in UTC · dashboard · how the merge queue works
Two-state lowering converted X/Z operands to zero before ===, !== and
ordinary case matching. A parity check against X could therefore accept
a known zero and clear an instruction-loader byte (#2136).
Retain literal unknowns inside exact-comparison operands and project their
value and mask into ordinary two-state SLT expressions before backend
lowering. Apply the same rules to combinational/procedural expressions and
case matching, including width extension and conditional/arithmetic
operands. Storage stays two-state, calls keep their effects, and known-only
comparisons reuse their interned graph (IEEE 1800-2023 11.4.5 and 12.5).
Preserve actual startup unknowns too: encode default four-state function
locals as X rather than Z (6.8, Table 6-7), and keep partially driven nets
out of constant-variable inlining when any read touches undriven bits.
Merge sparse driver intervals to check coverage without a full-width bit
mask. Fully covered constant reads remain eligible for inlining. Test
interior gaps, high undriven bits, contiguous fragments and dependency
preservation. The existing startup API regressions now explicitly check
both state modes and verify that comparison results have no unknown bits.
Add five shared regressions for operand order, signed/wide patterns,
X versus Z, conversion, FF/timed execution, loaded bytes, call effects and
unknown intermediates. Icarus passes all five unchanged cases. Verilator
passes the timed effects case and rejects four with unsupported tristate
constructs; retain the actual diagnostics, check their named cases,
status, phase and diagnostic, and keep them executable without exclusions.
Validation: 5,868 SV integration tests passed (20 existing ignored tests),
4,619 Veryl shared executions across native, native-parallel, Cranelift,
Cranelift-parallel, WASM and the interpreter passed, as did 186 SLT unit
tests, 9 frontend unit tests and all 4 retained-report integration tests.
Changed crates/test targets pass clippy, formatting and workspace checks.
The native NAPI addon builds and all 116 JS boundary tests pass.
The companion performance-stack PR #2233 maintains the correction for
the base's CodegenError::message feature gating in host-runtime-disabled
SV builds. A pre-existing case-coverage false positive remains: an
exhaustive case on {b, 1'bx} with only 2'b0x and 2'b1x labels is diagnosed
as a latch. Both reproduce on the unchanged base and are not duplicated
or broadened into this patch.
The repository-script checks also enumerate the same four SV Verilator
tristate compile failures. All 316 Node script tests, three benchmark-shell
fixture suites and three updatecli unit tests pass on master 89b46b1.
Fixes #2136