Skip to content

refactor(sv)!: pass the analysis session explicitly instead of sharing it through RefCell - #2695

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/refactor/analyzer-explicit-state/pass-analysis-session-explicitly-instead-sharing--45f5bd58
Oct 31, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/refactor/analyzer-explicit-state/pass-analysis-session-explicitly-instead-sharing--45f5bd58

Conversation

@tignear

@tignear tignear commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

An analysis kept its caches and what it reported in an AnalysisState that
its contexts shared through an Rc, mutated behind RefCells and Cells: the
classes and class specializations laid out so far, the class declaration
scopes, the progress of nested specializations, the dimension discovery
caches, the elaboration memo, the semantic type table, the registry of
package class specializations, the call sites, the diagnostics and the
inline randomizations. These are now plain fields of a Session that
analysis owns and passes as &mut Session beside its context. A scope
analyzed on its own starts a session; a package class specialization is
analyzed in a session that takes over the registry, the types and the call
sites and gives them back. Guards that undid state on drop are explicit
steps after the work they bracket, and the constraint budget, the counters
of unnamed generate blocks and the interface expansion cache are owned
values too.

What module analyses add to the packages they use (package class
specializations, semantic types and call sites) was mutated through the
shared &Packages. It is now a Design, which Packages::design starts
from and which every analysis of a module of the design takes as
&mut Design: ParsedSource::analyze_module and its siblings take
(&Packages, &mut Design), and Packages::specialized_state_modules reads
the package state from a Design. The frontend keeps one Design per
elaboration.

Behavior is unchanged: the analyzer and frontend tests, the SystemVerilog
suite and a UVM elaboration (same output, about 11 s and 1.0 GB before and
after) agree.

@tignear

tignear commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 refactor(sv): pass constant functions explicitly instead of installing them #2674
2 refactor(sv): carry interface instances and time scopes in the context #2675
3 refactor(sv)!: pass the analysis session explicitly instead of sharing it through RefCell #2695 👈

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 31, 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-31T08:33:22.498193Z 079afbd 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 31, 2026
@tignear
tignear force-pushed the stack/tignear/refactor/analyzer-explicit-state/pass-analysis-session-explicitly-instead-sharing--45f5bd58 branch from 7fdf30a to e83edf8 Compare October 31, 2026 06:59
@tignear
tignear force-pushed the stack/tignear/refactor/analyzer-explicit-state/carry-interface-instances-time-scopes-context--5b8ff269 branch from a32b2e1 to 5c74b5f Compare October 31, 2026 06:59
@tignear

tignear commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 7fdf30a 2026-10-31 06:59 UTC
2 content 7fdf30a → e83edf8 Rebased on master: the class scope tables and specialization names that #2672 added are Session fields too, and ClassScopes::with hands the session to its callback. 2026-10-31 06:59 UTC
3 content e83edf8 → 4a2353c 2026-10-31 07:12 UTC
4 content 4a2353c → 079afbd 2026-10-31 08:31 UTC

@tignear tignear added merge-ready Request merging through Mergify after required checks and removed merge-ready Request merging through Mergify after required checks labels Oct 31, 2026
@tignear
tignear force-pushed the stack/tignear/refactor/analyzer-explicit-state/pass-analysis-session-explicitly-instead-sharing--45f5bd58 branch from e83edf8 to 4a2353c Compare October 31, 2026 07:12
@tignear
tignear force-pushed the stack/tignear/refactor/analyzer-explicit-state/carry-interface-instances-time-scopes-context--5b8ff269 branch from 5c74b5f to 37cf250 Compare October 31, 2026 07:12
@tignear tignear added merge-ready Request merging through Mergify after required checks and removed merge-ready Request merging through Mergify after required checks labels Oct 31, 2026
@mergify

mergify Bot commented Oct 31, 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 31, 2026
@mergify

mergify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

🚫 Left the queue

12 min in the queue, with no time running CI.

So far

  • ✅ Entered the queue Sat 31 Oct, 07:44 · rule changes · triggered by rule Queue explicitly requested merges
  • 🚫 Left the queue 07:55 · 4a2353c

Reason

The pull request conflicts with master

Conflicting file: crates/celox-sv-analyzer/src/ast/dimensions/discovery.rs

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

Hint

You should update or rebase your pull request. A pull request queued by a rule comes back to the queue once updated, as long as the rule still matches.

If it was queued with a command, post a new @mergifyio queue comment to requeue it.

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

Times in UTC · dashboard · how the merge queue works

Base automatically changed from stack/tignear/refactor/analyzer-explicit-state/carry-interface-instances-time-scopes-context--5b8ff269 to master October 31, 2026 07:55
@mergify mergify Bot added dequeued Mergify stopped this queue entry; investigate before retrying and removed queued Mergify queue entry labels Oct 31, 2026
…g it through RefCell

An analysis kept its caches and what it reported in an AnalysisState that
its contexts shared through an Rc, mutated behind RefCells and Cells: the
classes and class specializations laid out so far, the class declaration
scopes, the progress of nested specializations, the dimension discovery
caches, the elaboration memo, the semantic type table, the registry of
package class specializations, the call sites, the diagnostics and the
inline randomizations. These are now plain fields of a Session that
analysis owns and passes as `&mut Session` beside its context. A scope
analyzed on its own starts a session; a package class specialization is
analyzed in a session that takes over the registry, the types and the call
sites and gives them back. Guards that undid state on drop are explicit
steps after the work they bracket, and the constraint budget, the counters
of unnamed generate blocks and the interface expansion cache are owned
values too.

What module analyses add to the packages they use (package class
specializations, semantic types and call sites) was mutated through the
shared `&Packages`. It is now a `Design`, which `Packages::design` starts
from and which every analysis of a module of the design takes as
`&mut Design`: `ParsedSource::analyze_module` and its siblings take
`(&Packages, &mut Design)`, and `Packages::specialized_state_modules` reads
the package state from a `Design`. The frontend keeps one `Design` per
elaboration.

Behavior is unchanged: the analyzer and frontend tests, the SystemVerilog
suite and a UVM elaboration (same output, about 11 s and 1.0 GB before and
after) agree.

Change-Id: I45f5bd5855e3593db29f801e7ecc65846a9adc24
@tignear
tignear force-pushed the stack/tignear/refactor/analyzer-explicit-state/pass-analysis-session-explicitly-instead-sharing--45f5bd58 branch from 4a2353c to 079afbd Compare October 31, 2026 08:31
@mergify mergify Bot removed the dequeued Mergify stopped this queue entry; investigate before retrying label Oct 31, 2026
@tignear tignear added merge-ready Request merging through Mergify after required checks and removed merge-ready Request merging through Mergify after required checks labels Oct 31, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 31, 2026
@mergify

mergify Bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

✅ Merged into master as 325abf4 at 09:59 UTC

Merged together with #2704, #2703. 56 min in the queue, 17 min of it CI.

So far

9 merge conditions met
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • check-success = Verify workflow lockfile
  • any of · required by 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 · required by 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 · required by 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 · required by 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
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/Queue validation
    • check-neutral = @github-actions/Queue validation
    • check-skipped = @github-actions/Queue validation
  • any of · required by GitHub repository ruleset rule master:
    • check-success = @github-actions/Verify workflow lockfile
    • check-neutral = @github-actions/Verify workflow lockfile
    • check-skipped = @github-actions/Verify workflow lockfile

Times in UTC · dashboard · how the merge queue works

@mergify
mergify Bot merged commit 325abf4 into master Oct 31, 2026
29 checks passed
@mergify
mergify Bot deleted the stack/tignear/refactor/analyzer-explicit-state/pass-analysis-session-explicitly-instead-sharing--45f5bd58 branch October 31, 2026 09:59
@mergify mergify Bot removed the queued Mergify queue entry label Oct 31, 2026
@github-actions github-actions Bot mentioned this pull request Oct 31, 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