Repository navigation
fix(sv): allow bare zero-argument container methods - #2178
Merged
Conversation
Calls such as q.size, q.pop_front and map.delete now bind through the same argument and void-result checks as their parenthesized forms. Handle void-cast statements that discard pop results, including string and class handles. Preserve the declared element type when querying an integral pop result, including packed rank and authored bounds. Type queries validate without executing the pop. Reject unsupported queries on nonintegral pop results instead of treating string/class handles as packed integer values. The upstream queue and associative examples are narrow: all 28 initially selected official case/mode checks passed while a packed-result query still failed on every Celox backend. Add that counterexample alongside ordinary, four-state/default, side-effect, discarded-return and required-argument checks. The fixed packed-result case also passes Verilator. The official runner checked 36 pinned upstream cases containing bare method names in both state modes (72 verdicts). Sixteen simulation cases improve from fail to pass in both modes, including associative allocation and nonexistent reads beyond the initial selection. Update exactly those 32 expectations; preserve the other 3,268 rows. No previously passing candidate regresses. This was a focused run, not a full-corpus conformance measurement. Validation: - Common SV suite: 5,679 passed, 20 existing ignored. Latest container suite: 108 passed, including four new shared cases across five configurations. - Analyzer/frontend units: 833 and 7 passed, with 3 existing analyzer ignores. - Debug NAPI build and JS integration: 435 passed across 16 files. - Affected-crate all-targets Clippy with -D warnings, formatting, diff checks and the five sv-tests aggregate tests passed. Independent checks retain their original assertions and exclusions: - Verilator 5.052: 3 passes, 1 four-state adapter unsupported. - Icarus 13.0: 1 pass, 2 compile errors for unsupported associative arrays and 1 mismatch in the packed-result dimension/bound queries. - xezim 0.11.3: all four compile but mismatch. Standalone probes reproduce queue mutation inside $bits/$size, zero instead of X from an empty logic queue pop, and receiver capture before a nested pop argument. Queue slicing, queue concatenation operands, element-reference persistence, warning diagnostics and nonintegral pop result queries remain outside this change's support contract. Change-Id: Ie020842652d298a923ebb251ce8d4775b3249082
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. |
Contributor
Merge Queue Status
This pull request spent 1 hour 13 minutes 20 seconds in the queue, including 34 minutes 54 seconds running CI. Required conditions to merge
|
This was referenced Oct 26, 2026
mergify
Bot
deleted the
stack/tignear/fix/sv-container-optional-parentheses/allow-bare-zero-argument-container-methods--e0208426
branch
October 26, 2026 19:06
tignear
added a commit
that referenced
this pull request
Oct 26, 2026
Array calls such as values.sum and values.product() now evaluate for one-dimensional fixed integral arrays, dynamic arrays, queues and associative arrays. Preserve element width, signedness, packed query shape and X/Z propagation (IEEE 1800-2023 7.12.3), including overflow before widening to an assignment destination. Accept ordinary and discarded calls. Empty inputs use operation identities: product returns one, bitwise AND returns all bits set at the element width, and sum/OR/XOR return zero. Opt into the legacy all-zero behavior with SimulatorBuilder::legacy_empty_reductions(true) or AnalysisOptions::legacy_empty_reductions. The setting is local to each compilation and is encoded in the generated IR/native image. Nonempty results are identical in both modes. The current TypeScript API has no direct SV source compilation entry, so this option is exposed through Rust/frontend APIs. Use balanced expression trees for fixed arrays and heap traversal loops for dynamic containers. Add six shared cases across native, parallel native, Cranelift, parallel Cranelift and WASM. API regressions alternate identical source between default/legacy/default modes in two/four-state execution, exercise mixed hierarchies and round-trip both modes through native images. with expressions, iterator arguments, multidimensional unpacked receivers, nonintegral elements and array expression receivers remain unsupported. Five unmodified upstream reduction simulation cases pass the official sv-tests runner in both state modes at revision db159ad8e9cbbd62036569d240153f753258f640. Update exactly those ten expectations from fail to pass; preserve the other 3,290 rows. These upstream cases are nonempty and do not validate empty-input semantics. This was a focused run, not a full-corpus rerun. Rebase integration preserves the merged #2178 optional-parentheses support, packed pop-result queries, discarded container calls and existing shared cases. Validation: - Common SV suite: 5,712 passed, 20 existing ignored. Latest container suite: 141 passed, including the six shared cases and compatibility/image API tests. - Analyzer/frontend/simulator units: 839 / 8 / 234 passed, with 3 existing analyzer ignores. Default-feature simulator units: 151 passed. - Debug NAPI build and JS integration: 435 passed across 16 files. - Official upstream reduction cases: 10 simulation passes using the release driver; expectation/runner aggregate tests: 5 passed. - Affected-crate all-targets Clippy with -D warnings, cargo fmt --all -- --check and git diff --check passed. - The full SV suite, affected units and Clippy above were rerun after rebasing onto master with #2178 and the #2171 analyzer optimization. - The optional no-host check (--no-default-features --features systemverilog) fails in the unchanged SV parameter diagnostic: CodegenError::message is host-runtime-only. Host builds and standalone frontend units pass. Independent checks retain their assertions and exclusions: - Verilator 5.052: 1 pass, 2 mismatches, 1 compile error, 2 four-state adapter unsupported. Differences include the default empty identities (its empty product/AND return zero), fixed-array arithmetic widened by assignment or comparison context, and parser rejection of void-cast reduction calls. - Icarus 13.0: all six have compile errors; no independent passes claimed. - xezim 0.11.3: all six compile, 1 passes and 5 mismatch. Standalone probes reproduce negative-range fixed-array reduction, X/Z and packed query differences; its empty product is one but empty AND is zero. BREAKING CHANGE: ContainerOp adds seven reduction variants. AnalysisOptions and SimulatorOptions add a legacy_empty_reductions field; downstream exhaustive matches and full struct literals must account for these additions. Change-Id: Iec0f1a95026120fdb95b50e2eccea9cfc86bed6e
tignear
added a commit
that referenced
this pull request
Oct 27, 2026
Array calls such as values.sum and values.product() now evaluate for one-dimensional fixed integral arrays, dynamic arrays, queues and associative arrays. Preserve element width, signedness, packed query shape and X/Z propagation (IEEE 1800-2023 7.12.3), including overflow before widening to an assignment destination. Accept ordinary and discarded calls. Empty inputs use operation identities: product returns one, bitwise AND returns all bits set at the element width, and sum/OR/XOR return zero. Opt into the legacy all-zero behavior with SimulatorBuilder::legacy_empty_reductions(true) or AnalysisOptions::legacy_empty_reductions. The setting is local to each compilation and is encoded in the generated IR/native image. Nonempty results are identical in both modes. The current TypeScript API has no direct SV source compilation entry, so this option is exposed through Rust/frontend APIs. Use balanced expression trees for fixed arrays and heap traversal loops for dynamic containers. Add six shared cases across native, parallel native, Cranelift, parallel Cranelift and WASM. API regressions alternate identical source between default/legacy/default modes in two/four-state execution, exercise mixed hierarchies and round-trip both modes through native images. with expressions, iterator arguments, multidimensional unpacked receivers, nonintegral elements and array expression receivers remain unsupported. Five unmodified upstream reduction simulation cases pass the official sv-tests runner in both state modes at revision db159ad8e9cbbd62036569d240153f753258f640. Update exactly those ten expectations from fail to pass; preserve the other 3,290 rows. These upstream cases are nonempty and do not validate empty-input semantics. This was a focused run, not a full-corpus rerun. Rebase integration preserves the merged #2178 optional-parentheses support, packed pop-result queries, discarded container calls and existing shared cases. Validation: - Common SV suite: 5,712 passed, 20 existing ignored. Latest container suite: 141 passed, including the six shared cases and compatibility/image API tests. - Analyzer/frontend/simulator units: 839 / 8 / 234 passed, with 3 existing analyzer ignores. Default-feature simulator units: 151 passed. - Debug NAPI build and JS integration: 435 passed across 16 files. - Official upstream reduction cases: 10 simulation passes using the release driver; expectation/runner aggregate tests: 5 passed. - Affected-crate all-targets Clippy with -D warnings, cargo fmt --all -- --check and git diff --check passed. - The full SV suite, affected units and Clippy above were rerun after rebasing onto master with #2178 and the #2171 analyzer optimization. - The optional no-host check (--no-default-features --features systemverilog) fails in the unchanged SV parameter diagnostic: CodegenError::message is host-runtime-only. Host builds and standalone frontend units pass. Independent checks retain their assertions and exclusions: - Verilator 5.052: 1 pass, 2 mismatches, 1 compile error, 2 four-state adapter unsupported. Differences include the default empty identities (its empty product/AND return zero), fixed-array arithmetic widened by assignment or comparison context, and parser rejection of void-cast reduction calls. - Icarus 13.0: all six have compile errors; no independent passes claimed. - xezim 0.11.3: all six compile, 1 passes and 5 mismatch. Standalone probes reproduce negative-range fixed-array reduction, X/Z and packed query differences; its empty product is one but empty AND is zero. BREAKING CHANGE: ContainerOp adds seven reduction variants. AnalysisOptions and SimulatorOptions add a legacy_empty_reductions field; downstream exhaustive matches and full struct literals must account for these additions. Latest master synchronization preserves both reduction and logical-implication conformance notes. Revalidated 141 container tests including compatibility and native-image regressions, 839 analyzer tests (three existing ignores), affected-crate Clippy and formatting. Shared cases and external adapters are unchanged by this synchronization. Change-Id: Iec0f1a95026120fdb95b50e2eccea9cfc86bed6e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calls such as q.size, q.pop_front and map.delete now bind through the same
argument and void-result checks as their parenthesized forms. Handle void-cast
statements that discard pop results, including string and class handles.
Preserve the declared element type when querying an integral pop result,
including packed rank and authored bounds. Type queries validate without
executing the pop. Reject unsupported queries on nonintegral pop results
instead of treating string/class handles as packed integer values.
The upstream queue and associative examples are narrow: all 28 initially
selected official case/mode checks passed while a packed-result query still
failed on every Celox backend. Add that counterexample alongside ordinary,
four-state/default, side-effect, discarded-return and required-argument checks.
The fixed packed-result case also passes Verilator.
The official runner checked 36 pinned upstream cases containing bare method
names in both state modes (72 verdicts). Sixteen simulation cases improve from
fail to pass in both modes, including associative allocation and nonexistent
reads beyond the initial selection. Update exactly those 32 expectations;
preserve the other 3,268 rows. No previously passing candidate regresses.
This was a focused run, not a full-corpus conformance measurement.
Validation:
108 passed, including four new shared cases across five configurations.
and the five sv-tests aggregate tests passed.
Independent checks retain their original assertions and exclusions:
1 mismatch in the packed-result dimension/bound queries.
queue mutation inside $bits/$size, zero instead of X from an empty logic
queue pop, and receiver capture before a nested pop argument.
Queue slicing, queue concatenation operands, element-reference persistence,
warning diagnostics and nonintegral pop result queries remain outside this
change's support contract.