Skip to content

fix(vpi): expose interface parameters and lexical generate scopes - #2233

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/perf/taxi-memory-runtime/expose-interface-params-lexical-generate-scopes--3d0a6f88
Oct 27, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/perf/taxi-memory-runtime/expose-interface-params-lexical-generate-scopes--3d0a6f88

Conversation

@tignear

@tignear tignear commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Retain instance-local interface value parameters and localparams using declaration provenance, including indexed interface handles and authored dollar identifiers. Preserve package ownership. Build lexical generate scope prefixes for reflection separately from execution and VCD instance paths, inheriting timescales from the nearest real ancestor.

The image container advances to version 49 for serialized lexical scope metadata. Validation covers specialized read-only parameters, escaped identifiers, interface arrays, generate iteration, timescales and native image roundtrips. Frontend, VPI and native library suites, owning-crate lint and formatting pass. This makes the unchanged original board tests discover all actual traffic models instead of passing with an empty MAC list.

Keep the class-specialization depth guard reachable on the default stack:
separate parameter binding, inherited-base resolution and body construction,
with pending specialization metadata owned on the heap. Large temporary
binding frames no longer accumulate across recursive inheritance. Preserve
the existing depth-64 limit and diagnostics; test legitimate deep inheritance
and a nonterminating specialization on an explicit 2 MiB thread stack.

Validation after rebasing onto master 626dc7c: reproduce the CI SIGABRT
with its full comparison-feature configuration, then pass the same test
with the fix. All 842 analyzer unit tests (3 existing ignored), 372 class
integration tests, 57 VPI tests, analyzer clippy and formatting pass.
The host-runtime-disabled SystemVerilog build also passes.

Depends-On: #2232

@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 refactor(native): support state-aware outlined kernel calls #2231
2 perf(native): share large comb kernels and bound compilation memory #2232
3 fix(vpi): expose interface parameters and lexical generate scopes #2233 👈
4 perf(settle): bound estimated partitions and preserve sparse updates #2234
5 perf(sv): evaluate stateless constant functions once #2235

@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-27T09:55:01.633120Z b03076c 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.

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 27, 2026
@tignear
tignear force-pushed the stack/tignear/perf/taxi-memory-runtime/share-large-comb-kernels-bound-compilation-memory--4dad9216 branch from 9282185 to b7ebe76 Compare October 27, 2026 06:19
@tignear
tignear force-pushed the stack/tignear/perf/taxi-memory-runtime/expose-interface-params-lexical-generate-scopes--3d0a6f88 branch from 930f194 to 33a3359 Compare October 27, 2026 06:19
@tignear

tignear commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 930f194 2026-10-27 06:18 UTC
2 rebase 930f194 → 33a3359 (rebase only) 2026-10-27 06:18 UTC
3 content 33a3359 → b03076c Rebase the performance stack after #2229/#2230 merged; fix #2233 CI stack overflow while rejecting recursively parameterized inheritance, and keep the no-host SV build correction covered. 2026-10-27 09:51 UTC

tignear added a commit that referenced this pull request Oct 27, 2026
Two-state lowering converted X/Z comparison operands to zero before ===,
!== and ordinary case matching. As a result, a parity check against X
could accept a known zero and clear an instruction-loader byte (#2136).

Retain literal unknowns within exact-comparison operands and project their
value and mask into ordinary two-state SLT expressions before backend
lowering. Apply the same rules to combinational and procedural graphs and
case matching, including width extension and conditional/arithmetic
operands. Runtime storage remains two-state, calls keep their effects,
and known-only comparisons reuse their original interned graph.

Add five shared regressions covering both operand orders, signed and wide
patterns, X versus Z, explicit conversion, FF and timed execution, byte
loading, call effects and unknown intermediate expressions. IEEE
1800-2023 11.4.5 and 12.5 define the expected exact comparisons.

Validation before rebasing: 4,684 shared SV backend executions passed, including 25 new
regression executions, existing four-state cases and native images.
Frontend: 9 unit tests and clippy; suite: 31 unit tests; Celox: 234 unit
tests and 25 registered regression tests. Formatting and workspace checks
also pass. Icarus passes all five unchanged cases. Verilator passes the
timed effects case and rejects four cases with unsupported tristate
constructs; retain those actual diagnostics without excluding the cases.

After rebasing onto master 07ec9d9, all 330 operator backend tests pass,
including the upstream logical-equivalence cases and all 25 X/Z regressions.
The 9 frontend and 32 shared-suite unit tests, frontend clippy, formatting
and the pre-push workspace check also pass. The five X/Z fixture definitions
are unchanged, so their external verification evidence remains applicable.

The additional no-default-features + systemverilog check encounters the
existing CodegenError::message feature-gating error on master. That
independent error is already fixed in #2233, and is not duplicated here.

A separate 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.
The unchanged baseline reproduces it; this patch does not change that
coverage analysis to infer the selector's restricted value domain.

Fixes #2136

Change-Id: I2b96b81844d9977a40668002b257c8bf845a249b
tignear added a commit that referenced this pull request Oct 27, 2026
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.

Fixes #2136

Change-Id: I2b96b81844d9977a40668002b257c8bf845a249b
Retain instance-local interface value parameters and localparams using declaration provenance, including indexed interface handles and authored dollar identifiers. Preserve package ownership. Build lexical generate scope prefixes for reflection separately from execution and VCD instance paths, inheriting timescales from the nearest real ancestor.

The image container advances to version 49 for serialized lexical scope metadata. Validation covers specialized read-only parameters, escaped identifiers, interface arrays, generate iteration, timescales and native image roundtrips. Frontend, VPI and native library suites, owning-crate lint and formatting pass. This makes the unchanged original board tests discover all actual traffic models instead of passing with an empty MAC list.

Keep the class-specialization depth guard reachable on the default stack:
separate parameter binding, inherited-base resolution and body construction,
with pending specialization metadata owned on the heap. Large temporary
binding frames no longer accumulate across recursive inheritance. Preserve
the existing depth-64 limit and diagnostics; test legitimate deep inheritance
and a nonterminating specialization on an explicit 2 MiB thread stack.

Validation after rebasing onto master 626dc7c: reproduce the CI SIGABRT
with its full comparison-feature configuration, then pass the same test
with the fix. All 842 analyzer unit tests (3 existing ignored), 372 class
integration tests, 57 VPI tests, analyzer clippy and formatting pass.
The host-runtime-disabled SystemVerilog build also passes.

Change-Id: I3d0a6f889f3bc98503bbad44ab3bef8f52cab9c9
tignear added a commit that referenced this pull request Oct 27, 2026
Zero-argument functions that build constant masks with unpacked scratch arrays were lowered into runtime loops, including 8100-bit dynamic shifts in LFSR mask generation. Reuse the bounded constant interpreter and cache results after proving the function has no persistent state, global writes, simulation-state reads or effectful callees. Preserve runtime initialization in both state modes and leave unsupported or unknown-sensitive evaluations to ordinary lowering.

Validation covers wide arrays and cache reuse, persistent/global state and direct/indirect effects, automatic initial values, unknown intermediates, aggregate slices and non-integral locals. A frontend regression bounds emitted runtime instructions in both state modes. Analyzer/frontend unit suites, clippy and formatting pass.

Before rebasing onto current master, the complete stack passed 6169 shared backend variants plus 1814 owning/API tests. Unmodified original MAC_DATA_W=32 board tests passed at O1 with partitioned settle disabled: VCU108 compiled in 69s (1.46 GiB peak), ran in 92s; HTG9200 compiled in 155s (3.15 GiB peak), ran in 85s with all 36 MAC tests and 3456 frames. Final compiled circuit and metadata were byte-identical to the full cocotb passes. After rebasing onto master 5f752a4, all seven commits passed their own focused tests, lint and formatting independently. The final stack passed 6199 shared backend executions, including the six newly merged scalar-constraint and logical-implication cases on all five compiled backend variants, plus VPI tests, no-host checking, workspace check and Biome. No existing exclusions were removed.

After the generated-callee arena review fix in the lower members, all 623 x86 unit tests, 239 native library tests and 41 API tests passed. The final updated stack also passed 3511 affected native/native-parallel/native-image shared executions and workspace check; unchanged Cranelift/WASM coverage remains covered by the earlier 6199-execution run.

After syncing merged #2229/#2230 and rebasing onto master 626dc7c,
#2233 fixes the default-stack class-specialization CI abort, also inherited
by the upper members. The complete stack passes 848 analyzer unit tests
(3 existing ignored), 10 frontend unit tests, the exact CI regression with
all comparison features, formatting and host-runtime-disabled SV checking.
At #2233, all 842 analyzer, 372 class integration and 57 VPI tests pass,
with analyzer clippy and explicit 2 MiB stack coverage.

Change-Id: I268b61b85e35aef99179cb8ca5e7139d787c1924
@tignear
tignear force-pushed the stack/tignear/perf/taxi-memory-runtime/share-large-comb-kernels-bound-compilation-memory--4dad9216 branch from b7ebe76 to b2c02ac Compare October 27, 2026 09:52
@tignear
tignear force-pushed the stack/tignear/perf/taxi-memory-runtime/expose-interface-params-lexical-generate-scopes--3d0a6f88 branch from 33a3359 to b03076c Compare October 27, 2026 09:52
@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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

@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

✅ Merged into master as aea9c6e at 12:01 UTC

Merged together with #2231, #2232. 1 h 18 min in the queue, 22 min of it CI.

So far

Merge conditions: 10 of 10 met

This pull request

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

The batch, tested on draft #2268

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

tignear added a commit that referenced this pull request Oct 27, 2026
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
Base automatically changed from stack/tignear/perf/taxi-memory-runtime/share-large-comb-kernels-bound-compilation-memory--4dad9216 to master October 27, 2026 12:00
@mergify
mergify Bot merged commit aea9c6e into master Oct 27, 2026
27 of 45 checks passed
@mergify
mergify Bot deleted the stack/tignear/perf/taxi-memory-runtime/expose-interface-params-lexical-generate-scopes--3d0a6f88 branch October 27, 2026 12:01
@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