Skip to content

perf(sv): follow transparent copies to sensitivity probes through an index - #2057

Merged
mergify[bot] merged 1 commit into
masterfrom
perf/sv-probe-copy-index
Oct 25, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
perf/sv-probe-copy-index

Conversation

@tignear

@tignear tignear commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

What

schedule_symbolic_rtl_reporting_loops (crates/celox-frontend-core/src/symbolic/assembly.rs) collects the sensitivity atoms whose occurrences it counts, then follows transparent wire/port copies upstream from each probe. For every probe it scanned all combinational logic paths of the design for a copy into the probe's variable (O(probes × paths)), and it deduplicated probes with Vec::contains (O(probes²)).

  • The probe collection moves into sensitivity_probes, and the copy propagation into add_copied_probes, which indexes the transparent Var-target paths by target variable once and visits only the copies into a probe's variable, in their original order.
  • A HashSet beside the probe list replaces Vec::contains.

The probes and their order are unchanged, so the instrumented SIR is the same.

Why

rtlmeter C906 (45k combinational blocks): schedule_symbolic_rtl_reporting_loops was 8.7% self of the run up to the first testbench output, nearly all in this scan (perf annotate).

Closes #2052

Validation

  • Equivalence test symbolic::assembly::tests::copied_probes_match_path_scan: 50 randomized designs of 60 logic paths (transparent and non-transparent copies, overlapping ranges, width mismatches, non-input expressions, mixed four-/two-state variables) compared against the previous scan of every path; probes and order must match. Removing the overlap check makes it fail.
  • cargo fmt --all -- --check, cargo clippy -p celox-frontend-core --all-targets -- -D warnings: clean.
  • cargo nextest run -p celox -p celox-frontend-core -p celox-frontend-sv -p celox-test-suite --features celox/systemverilog,celox/cranelift,celox/wasm-runtime,celox/wasm-component,celox/veryl-reference,celox-test-suite/runtime-cases: 14819 passed, 313 skipped.
  • Order fix: no benchmark run.

…index

Design assembly follows the transparent wire and port copies upstream
from each sensitivity probe, so that a copy carries occurrences as well
as its value. For each probe it scanned every combinational logic path of
the design for a copy into the probe's variable, and it checked probe
membership with a linear search, which on rtlmeter C906 took about a
tenth of the run up to the first testbench output.

The copies are now indexed by their target variable once, and a set
holds the probes found so far. The probes, and their order, are the same.

Closes #2052

Change-Id: I95e3ca3bb72b5ee15190faf623a7bcfa777f8c00
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T18:20:18.636379Z 698b54d 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 added the merge-ready Request merging through Mergify after required checks label Oct 25, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 25, 2026
@mergify

mergify Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 33 minutes 50 seconds in the queue, including 31 minutes 38 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 merged commit 9127d00 into master Oct 25, 2026
23 checks passed
@mergify
mergify Bot deleted the perf/sv-probe-copy-index branch October 25, 2026 19:16
@mergify mergify Bot removed the queued Mergify queue entry label Oct 25, 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.

Sensitivity probe propagation scans every logic path for each probe

1 participant