Skip to content

Add features: dry-run option, lower memory usage - #13

Closed
infinitymdm wants to merge 12 commits into
mainfrom
experimental
Closed

Add features: dry-run option, lower memory usage#13
infinitymdm wants to merge 12 commits into
mainfrom
experimental

Conversation

@infinitymdm

@infinitymdm infinitymdm commented Jul 20, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features
    • Added run --no-sim to skip SPICE simulations while still generating Liberty output.
    • Added optional settings.dry_run (default: false) in config to control simulation skipping.
    • Dry-run now emits placeholder characterization values for delay, leakage power, pin capacitance, and sequential metastability.
    • Debug mode now writes generated SPICE files even when simulations are skipped.
  • Bug Fixes
    • Fixed delay calculation to use the path’s output transition.
    • Improved timing-group construction and corrected Liberty “when” handling for leakage.
  • Changes
    • Removed experimental function-generation command registration.
    • Stopped automatic post-run comparison after writing the Liberty file.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@infinitymdm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 52 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 4dfa5e7b-0c11-4669-9b5c-26d948de75b0

📥 Commits

Reviewing files that changed from the base of the PR and between 7f04314 and 3ed0a03.

📒 Files selected for processing (1)
  • .github/workflows/run-tests.yml
📝 Walkthrough

Walkthrough

The change adds CLI- and configuration-controlled dry-run characterization, propagates sentinel values through measurement procedures, narrows simulation failure handling, updates Liberty group construction, and makes Statement.to_liberty abstract.

Changes

Dry-run characterization

Layer / File(s) Summary
CLI and configuration dry-run entry
charlib/characterizer/characterizer.py, charlib/config/syntax.py, charlib/cli/main.py, charlib/cli/run.py
Adds the dry_run setting and --no-sim flag, removes experimental command registration and post-characterization comparison execution, and configures worker recycling.
Combinational measurement execution and timing output
charlib/characterizer/procedures/combinational/*
Skips simulations in dry-run mode, uses sentinel values, narrows failure handling, and consolidates Liberty timing and leakage output.
Pin capacitance measurement execution
charlib/characterizer/procedures/pin_capacitance/*
Adds dry-run handling for AC and charge-based measurements and updates transient simulation configuration and capacitance calculation flow.
Metastability constraint output
charlib/characterizer/procedures/sequential/constraint/metastability/c2q_contour.py
Adds dry-run paths for setup/hold and C2Q calculations and constructs explicit timing groups with updated lookup-table attributes.
Liberty statement contract
charlib/liberty/liberty.py
Converts Statement into an abstract base class and marks to_liberty as abstract.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant Characterizer
  participant MeasurementProcedures
  participant Simulator
  participant Liberty
  CLI->>Characterizer: pass --no-sim as dry_run
  Characterizer->>MeasurementProcedures: execute characterization
  MeasurementProcedures->>Simulator: run when dry_run is false
  MeasurementProcedures->>Liberty: write measured or sentinel values
Loading

Poem

A rabbit hops through dry-run snow,
No SPICE winds or currents flow.
Liberty tables bloom anew,
With minus-one placeholders too.
“No-sim!” I cheer, and twitch my nose.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the main changes: adding a dry-run option and reducing memory usage during characterization.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch experimental

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charlib/characterizer/procedures/combinational/delay.py`:
- Around line 188-197: Update the delay calculation around delay_measurements so
the -1 sentinel is used only when settings.dry_run is enabled; during real runs,
propagate or raise an error when no measurements are available instead of
writing a fabricated LUT value. Preserve the existing measured-delay conversion
and LookupTable flow for non-empty measurements.

In
`@charlib/characterizer/procedures/sequential/constraint/metastability/c2q_contour.py`:
- Around line 228-234: Update the settings.dry_run branch in the sequential
metastability contour procedure to use -1 @ PySpice.Unit.u_s for both
placeholder timing values in result_per_state[state_str]. Preserve the existing
None third value and continue behavior, matching the -1 sentinel convention used
by the other dry-run stubs.
- Around line 552-556: Reorder the dry_run handling in get_t_stabilizing so
sim_latch(...) is invoked before the early return, matching get_c2q and
preserving generated debug artifacts during dry runs. Keep the existing -1 *
PySpice.Unit.u_s return value and quiet-message behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 84ba5651-074e-4a19-a020-13cb6960277e

📥 Commits

Reviewing files that changed from the base of the PR and between e7060e8 and cd96574.

📒 Files selected for processing (8)
  • charlib/characterizer/characterizer.py
  • charlib/characterizer/procedures/combinational/delay.py
  • charlib/characterizer/procedures/combinational/leakage_power.py
  • charlib/characterizer/procedures/pin_capacitance/ac_sweep.py
  • charlib/characterizer/procedures/pin_capacitance/charge_integration.py
  • charlib/characterizer/procedures/sequential/constraint/metastability/c2q_contour.py
  • charlib/cli/main.py
  • charlib/cli/run.py

Comment thread charlib/characterizer/procedures/combinational/delay.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charlib/characterizer/procedures/combinational/delay.py`:
- Around line 194-196: Update the empty-measurement error path in the
combinational delay procedure to raise a ProcedureFailedException containing the
relevant cell or pin measurement context, consistent with earlier
simulation-failure handling. Also replace the unused meas_path binding in the
name.split('__') unpacking with an ignored variable.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f0a2de6d-bf2c-421c-a2e8-33ac8b3c7a40

📥 Commits

Reviewing files that changed from the base of the PR and between cd96574 and f8be6f9.

📒 Files selected for processing (2)
  • charlib/characterizer/procedures/combinational/delay.py
  • charlib/characterizer/procedures/sequential/constraint/metastability/c2q_contour.py

Comment thread charlib/characterizer/procedures/combinational/delay.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charlib/config/syntax.py`:
- Around line 482-483: Replace the backslash-based multiline string in the
dry_run description near charlib/config/syntax.py:482-483 with parenthesized
adjacent strings, removing the doubled space before “simulations”. Also update
the ProcedureFailedException message near
charlib/characterizer/procedures/combinational/delay.py:195-196 to use
parenthesized string concatenation instead of a backslash.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 73bf934b-44f3-4984-a6fd-8e628dc90fc2

📥 Commits

Reviewing files that changed from the base of the PR and between f8be6f9 and 7fd6222.

📒 Files selected for processing (2)
  • charlib/characterizer/procedures/combinational/delay.py
  • charlib/config/syntax.py

Comment thread charlib/config/syntax.py

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@charlib/characterizer/characterizer.py`:
- Line 89: Update the ProcessPoolExecutor configuration in the characterizer
execution flow to avoid recycling workers after every task: either expose
max_tasks_per_child through the existing settings configuration or increase it
to a workload-appropriate value, while preserving the current behavior only if a
documented resource leak requires it.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d25cae06-9adb-4960-9a0f-35df8427dbb3

📥 Commits

Reviewing files that changed from the base of the PR and between 7fd6222 and 7f04314.

📒 Files selected for processing (3)
  • charlib/characterizer/characterizer.py
  • charlib/characterizer/procedures/combinational/leakage_power.py
  • charlib/liberty/liberty.py
💤 Files with no reviewable changes (1)
  • charlib/characterizer/procedures/combinational/leakage_power.py

Comment thread charlib/characterizer/characterizer.py
This reverts commit 3ed0a03, which didn't seem to have any effect.
@infinitymdm

Copy link
Copy Markdown
Owner Author

Merged upstream in stineje#115

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