Skip to content

feat(sv)!: support integral array reduction methods - #2174

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sv-tests-array-methods/support-integral-array-reduction-methods--ec0f1a95
Oct 27, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/feat/sv-tests-array-methods/support-integral-array-reduction-methods--ec0f1a95

Conversation

@tignear

@tignear tignear commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

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 fix(sv): allow bare zero-argument container methods #2178 and the perf(sv): avoid redundant scope discovery and constant evaluation #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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 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-27T05:10:24.664188Z f3f8a84 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 26, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 26, 2026
@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 34 minutes 37 seconds in the queue, with no time running CI.

Reason

The pull request #2174 has been manually updated

Waiting for
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
    • check-success = @github-actions/Lint & Format
  • any of: [🛡 GitHub repository ruleset rule master]
    • 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)
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
    • check-success = @github-actions/NAPI Build (Windows)
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
    • check-success = @github-actions/Rust Test & NAPI Build
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
    • check-success = @github-actions/JS Test (Ubuntu)
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
    • check-success = @github-actions/JS Test (Windows)
  • any of: [🛡 GitHub repository ruleset rule master]
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title
    • check-success = @github-actions/Conventional Commit title
All conditions

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

@tignear
tignear force-pushed the stack/tignear/feat/sv-tests-array-methods/support-integral-array-reduction-methods--ec0f1a95 branch from 3a640ad to ddedf3e Compare October 26, 2026 18:03
@tignear

tignear commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 3a640ad 2026-10-26 18:02 UTC
2 content 3a640ad → ddedf3e Use operation identities by default and add explicit per-build legacy empty-reduction compatibility, with backend and native-image regressions 2026-10-26 18:02 UTC
3 content ddedf3e → 74ef524 Resolve conflicts with merged optional-parentheses and SV analysis optimization changes by rebasing onto current master 2026-10-26 19:33 UTC
4 content 74ef524 → f3f8a84 Resolve PR 2174 conflicts with merged randomization and operator changes 2026-10-27 05:08 UTC

@tignear

tignear commented Oct 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-26 18:43 UTC · Rule: changes · triggered by @tignear with the @mergifyio queue command
  • 🚫 Left the queue — 2026-10-26 19:07 UTC · at ddedf3e5fa3455a47c427ae10155c331bf2a2e40

This pull request spent 23 minutes 35 seconds in the queue, with no time running CI.

Reason

The pull request conflicts with the base branch

The pull request was held in the queue, conflicting with at least one of 4 pull requests ahead of it. The conflict became a base branch one after #2177, #2178 merged.

Hint

You should update or rebase your pull request.

If you want to requeue this pull request, you can post a @mergifyio queue comment.

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

@mergify mergify Bot added queued Mergify queue entry dequeued Mergify stopped this queue entry; investigate before retrying and removed queued Mergify queue entry labels Oct 26, 2026
@tignear
tignear force-pushed the stack/tignear/feat/sv-tests-array-methods/support-integral-array-reduction-methods--ec0f1a95 branch from ddedf3e to 74ef524 Compare October 26, 2026 19:34
@mergify mergify Bot added queued Mergify queue entry and removed dequeued Mergify stopped this queue entry; investigate before retrying labels Oct 26, 2026
@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

  • ✅ Entered queue — 2026-10-26 20:14 UTC · Rule: changes · triggered by rule Queue explicitly requested merges
  • 🚫 Left the queue — 2026-10-26 21:58 UTC · at 74ef524d0f0fa2f1b28e42e9471eb454b45f1b79

This pull request spent 1 hour 44 minutes 9 seconds in the queue, with no time running CI.

Reason

The pull request conflicts with the base branch

The pull request was held in the queue, conflicting with at least one of 6 pull requests ahead of it. The conflict became a base branch one after #2194, #2201, #2204, #2205 merged.

Hint

You should update or rebase your pull request.

If you want to requeue this pull request, you can post a @mergifyio queue comment.

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

@mergify mergify Bot added dequeued Mergify stopped this queue entry; investigate before retrying and removed queued Mergify queue entry labels 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.

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
@tignear
tignear force-pushed the stack/tignear/feat/sv-tests-array-methods/support-integral-array-reduction-methods--ec0f1a95 branch from 74ef524 to f3f8a84 Compare October 27, 2026 05:08
@mergify mergify Bot added queued Mergify queue entry and removed dequeued Mergify stopped this queue entry; investigate before retrying labels Oct 27, 2026
@mergify

mergify Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as 29e8a36 at 07:20 UTC

1 h 31 min in the queue, 54 min of it CI.

So far

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • 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)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Windows)
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Windows)
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit 29e8a36 into master Oct 27, 2026
23 of 24 checks passed
@mergify
mergify Bot deleted the stack/tignear/feat/sv-tests-array-methods/support-integral-array-reduction-methods--ec0f1a95 branch October 27, 2026 07:20
@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