Skip to content

refactor(vpi)!: own runtime state in an explicit VPI session - #1532

Merged
mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/sv-conformance-gaps/own-runtime-state-explicit-vpi-session--64b5892d
Oct 19, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
stack/tignear/fix/sv-conformance-gaps/own-runtime-state-explicit-vpi-session--64b5892d

Conversation

@tignear

@tignear tignear commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Move runtime, forced values, pending writes, callback state and vlog storage out
of thread-local variables into VpiHost owned by VpiSession. The context-free
standard C ABI selects one process host under a synchronized registry and checks
thread ownership before accessing it. No registry lock is held across callbacks.

Retain the host during callback dispatch and defer teardown until dispatch ends.
Reject nested hosts and nested dispatch, clean up on unwind, and reject unbound
pointer-producing calls before allocation. The C loader has an explicit
celox_vpi_clear_runtime lifecycle boundary.

BREAKING CHANGE: install_runtime returns Result<VpiSession, String>. Rust callers
must retain the session guard while using VPI; simultaneous process hosts are
rejected instead of being separated implicitly by thread-local storage.

Validation: backend and VPI all-target Clippy pass; 35 VPI regressions, CLI and
compilation tests, scheduler unwind regression and cocotb end-to-end test pass.

Depends-On: #1531

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 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 ⚠️ Failed 2026-10-19T06:17:17.839130Z 5678bad 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 19, 2026 •

Copy link
Copy Markdown
Contributor Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 docs(sv): separate the getting-started guide from the language reference #1522
2 fix(sv): handle Veryl-emitted interface declarations and calls #1525
3 fix(sv): preserve parameter overrides with explicit analysis state #1526
4 refactor(native): own emission state in the assembler #1530
5 refactor(veryl)!: pass lowering state and dependency collectors explicitly #1531
6 refactor(vpi)!: own runtime state in an explicit VPI session #1532 👈
7 chore(lint): prohibit thread-local state outside unit tests #1533

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 19, 2026
@tignear
tignear force-pushed the stack/tignear/fix/sv-conformance-gaps/own-runtime-state-explicit-vpi-session--64b5892d branch from 5678bad to 9f55e70 Compare October 19, 2026 06:42
@tignear
tignear force-pushed the stack/tignear/fix/sv-conformance-gaps/pass-lowering-state-dep-collectors-explicitly--e622a8fc branch from fcd71e8 to 4aa94ef Compare October 19, 2026 06:42
@tignear

tignear commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Revision history

# Type Changes Reason Date
1 initial 5678bad 2026-10-19 06:42 UTC
2 rebase 5678bad → 9f55e70 (rebase only) Replay unchanged VPI change after the required collector API review fix in #1531. 2026-10-19 06:42 UTC
3 rebase 9f55e70 → f99483e (rebase only) Replay unchanged descendant after the CI catalogue assertion fix in #1525. 2026-10-19 07:08 UTC
4 rebase f99483e → c6c1fcf (rebase only) Replay unchanged descendant after the package call-site identity fix in #1526. 2026-10-19 07:35 UTC
5 rebase c6c1fcf → 4a0c90a (rebase only) Replay unchanged VPI ownership change onto the resolved stack. 2026-10-19 08:34 UTC

@tignear
tignear force-pushed the stack/tignear/fix/sv-conformance-gaps/pass-lowering-state-dep-collectors-explicitly--e622a8fc branch from 4aa94ef to 23b440b Compare October 19, 2026 07:08
@tignear
tignear force-pushed the stack/tignear/fix/sv-conformance-gaps/own-runtime-state-explicit-vpi-session--64b5892d branch 2 times, most recently from f99483e to c6c1fcf Compare October 19, 2026 07:35
@tignear
tignear force-pushed the stack/tignear/fix/sv-conformance-gaps/pass-lowering-state-dep-collectors-explicitly--e622a8fc branch from 23b440b to a6397b5 Compare October 19, 2026 07:35
Move runtime, forced values, pending writes, callback state and vlog storage out
of thread-local variables into VpiHost owned by VpiSession. The context-free
standard C ABI selects one process host under a synchronized registry and checks
thread ownership before accessing it. No registry lock is held across callbacks.

Retain the host during callback dispatch and defer teardown until dispatch ends.
Reject nested hosts and nested dispatch, clean up on unwind, and reject unbound
pointer-producing calls before allocation. The C loader has an explicit
celox_vpi_clear_runtime lifecycle boundary.

BREAKING CHANGE: install_runtime returns Result<VpiSession, String>. Rust callers
must retain the session guard while using VPI; simultaneous process hosts are
rejected instead of being separated implicitly by thread-local storage.

Validation: backend and VPI all-target Clippy pass; 35 VPI regressions, CLI and
compilation tests, scheduler unwind regression and cocotb end-to-end test pass.

Change-Id: I64b5892dd5f7379d7b84c93ce21840573732a447
@tignear
tignear force-pushed the stack/tignear/fix/sv-conformance-gaps/pass-lowering-state-dep-collectors-explicitly--e622a8fc branch from a6397b5 to 87c8f5e Compare October 19, 2026 08:35
@tignear
tignear force-pushed the stack/tignear/fix/sv-conformance-gaps/own-runtime-state-explicit-vpi-session--64b5892d branch from c6c1fcf to 4a0c90a Compare October 19, 2026 08:35
@mergify mergify Bot added the queued Mergify queue entry label Oct 19, 2026
@mergify

mergify Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 3 hours 33 minutes 49 seconds in the queue, including 4 hours 50 minutes 42 seconds running CI.

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • depends-on = celox-sim/celox#1531 [⛓️ refactor(veryl)!: pass lowering state and dependency collectors explicitly #1531]
  • 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

Base automatically changed from stack/tignear/fix/sv-conformance-gaps/pass-lowering-state-dep-collectors-explicitly--e622a8fc to master October 19, 2026 13:37
@mergify
mergify Bot merged commit 3f83255 into master Oct 19, 2026
35 of 56 checks passed
@mergify
mergify Bot deleted the stack/tignear/fix/sv-conformance-gaps/own-runtime-state-explicit-vpi-session--64b5892d branch October 19, 2026 13:53
@mergify mergify Bot removed the queued Mergify queue entry label Oct 19, 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