Skip to content

fix(sv): check native module indices and visit Veryl bodies once - #1500

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/mixed-native-index-checks/check-native-module-indices-visit-veryl-bodies--e4a691ac
Oct 18, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/mixed-native-index-checks/check-native-module-indices-visit-veryl-bodies--e4a691ac

Conversation

@tignear

@tignear tignear commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Follow up on review of #1488.

parse_ir_with_external_hierarchy_and_native_modules indexed the IR directly
with each caller-supplied component index, so a stale or out-of-range index
panicked. An index that does not name a module is now reported as an
external hierarchy error.

Collecting the SV instances below each exported Veryl module walked the whole
native subtree again for every exported root, which is quadratic for a chain
of modules. The SV descendants of each analyzed body are now computed once
and shared. They are keyed by body rather than by signature: instances with
equal signatures can carry different aliases for their SV children.

Validation:

  • cargo test -p celox -p celox-frontend-veryl --features celox/systemverilog --lib --test systemverilog
  • cargo clippy -p celox -p celox-frontend-veryl --all-targets --features celox/systemverilog --no-deps
  • cargo fmt --all -- --check
  • New tests: an out-of-range native index is an error, and two instances of
    one Veryl body keep their separately aliased SV leaves

Follow up on review of #1488.

parse_ir_with_external_hierarchy_and_native_modules indexed the IR directly
with each caller-supplied component index, so a stale or out-of-range index
panicked. An index that does not name a module is now reported as an
external hierarchy error.

Collecting the SV instances below each exported Veryl module walked the whole
native subtree again for every exported root, which is quadratic for a chain
of modules. The SV descendants of each analyzed body are now computed once
and shared. They are keyed by body rather than by signature: instances with
equal signatures can carry different aliases for their SV children.

Validation:
- cargo test -p celox -p celox-frontend-veryl --features celox/systemverilog --lib --test systemverilog
- cargo clippy -p celox -p celox-frontend-veryl --all-targets --features celox/systemverilog --no-deps
- cargo fmt --all -- --check
- New tests: an out-of-range native index is an error, and two instances of
  one Veryl body keep their separately aliased SV leaves

Change-Id: Ie4a691acb3bff0ca8d827ceaf1f6015bc4ccd0d4
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 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-18T10:52:39.515651Z b9e0390 PR opened
ℹ️ 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 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 33 minutes 51 seconds in the queue, including 31 minutes 30 seconds running CI.

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

@mergify mergify Bot added the queued Mergify queue entry label Oct 18, 2026
@mergify mergify Bot mentioned this pull request Oct 18, 2026
39 of 71 tasks
@mergify
mergify Bot merged commit 2db8cd2 into master Oct 18, 2026
29 checks passed
@mergify
mergify Bot deleted the stack/tignear/fix/mixed-native-index-checks/check-native-module-indices-visit-veryl-bodies--e4a691ac branch October 18, 2026 12:00
@mergify mergify Bot removed the queued Mergify queue entry label Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant