Skip to content

rsz: Model side paths in the Mt delay estimator - #11797

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-estimator-side-models
Oct 17, 2026
Merged

maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-estimator-side-models

Conversation

@jhkim-pii

@jhkim-pii jhkim-pii commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Part 4 of 12 of the PARALLEL_EVAL setup repair stack. It builds on #11796, which is merged, so it shows its own commit only.

Summary

  • Teach the Mt delay estimator the side effects of a cell swap, and charge them in SizeUpMt and VtSwapMt.

Problem

  • The Mt moves scored a swap on the selected path only. A larger input pin also slows the other loads of each fanin net, a stronger rise can come with a weaker fall, and a flip-flop swap changes the setup and hold checks of its own data input. A scored gain could turn into a loss after the timing update.
flowchart LR
  F["fanin driver"] --> T["target cell<br/>(candidate)"]
  F --> S["other loads of the fanin net:<br/>slower with a larger input pin"]
  T --> L["selected path"]
  T -.-> O["opposite output transition"]
  T -.-> Q["flip-flop setup and hold"]
Loading

Changes

  • Side models in DelayEstimator: the fanin side loads, the opposite output transition and the D-side driver of a latch at the path start; SequentialTimingEstimator ranks the flip-flop setup and hold change from the Liberty check tables.
  • SizeUpMt and VtSwapMt subtract these losses from the gain and keep the raw gain and the reject reason; dual_rf_drive_guard can drop cells that are weaker on rise or fall.
  • Input cap budgets let a worker thread screen a candidate cell against the fanin max-cap limits without STA calls.
  • ArcDelayState becomes EstimatorContext.
  • The side models are off by default, and no policy runs SizeUpMt or VtSwapMt until PARALLEL_EVAL turns both on in rsz: Add the experimental PARALLEL_EVAL setup repair policy #11799; unit tests cover them here.

Follow-ups from the #11796 review

  • The RepairSetupProfiler constructor takes a RepairSetupProfiler::Mode instead of an int; Optimizer::run() converts -profile_mode once, where it makes the profiler.
  • CRIT_VT_SWAP records WNS and TNS at the phase_before point of timing.csv before its sweep. With -phases CRIT_VT_SWAP, the profile had only the final_progress row.
  • The Bazel TestResizerMt target drops --gtest_filter=TestResizerMtThreadPool.*, which ran only the 5 thread pool tests; all 35 tests, the 4 profiler tests among them, now run in CI.
  • Not changed: hierarchical edits in events.csv. OpenDB raises no callback when a dbITerm connects to a dbModNet, so tracing them needs a new OpenDB callback first.

Stack

  1. test: Add LEGACY repair setup path regressions #11794 test: Add LEGACY repair setup path regressions
  2. rsz: Remove MT1, MEASURED_VT_SWAP, LEGACY_MT and the RSZ_* knobs #11795 rsz: Remove MT1, MEASURED_VT_SWAP, LEGACY_MT and the RSZ_* knobs
  3. rsz: Add the setup repair profiler #11796 rsz: Add the setup repair profiler
  4. rsz: Model side paths in the Mt delay estimator #11797 rsz: Model side paths in the Mt delay estimator (this PR)
  5. rsz: Add the RebufferMt buffer-tree move #11798 rsz: Add the RebufferMt buffer-tree move
  6. rsz: Add the experimental PARALLEL_EVAL setup repair policy #11799 rsz: Add the experimental PARALLEL_EVAL setup repair policy
  7. rsz: Add SplitLoadMt to PARALLEL_EVAL #11800 rsz: Add SplitLoadMt to PARALLEL_EVAL
  8. rsz: Add SwapPinsMt to the PARALLEL_EVAL WNS tail #11801 rsz: Add SwapPinsMt to the PARALLEL_EVAL WNS tail
  9. rsz: Add UnbufferMt to the PARALLEL_EVAL WNS tail #11802 rsz: Add UnbufferMt to the PARALLEL_EVAL WNS tail
  10. rsz: Add SizeDownFanoutMt to the PARALLEL_EVAL WNS tail #11803 rsz: Add SizeDownFanoutMt to the PARALLEL_EVAL WNS tail
  11. rsz: Add the per-move analysis and the rebuffer accuracy report #11804 rsz: Add the per-move analysis and the rebuffer accuracy report
  12. doc: Update the rsz setup repair architecture #11805 doc: Update the rsz setup repair architecture

@jhkim-pii jhkim-pii self-assigned this Oct 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request refactors the setup repair optimization flow in the rsz tool by removing several experimental policies and introducing a setup repair profiler (RepairSetupProfiler) and a sequential timing estimator (SequentialTimingEstimator). It also updates the delay estimator to support caching, fanin side load evaluations, and dual rise/fall checks. The code review identifies several critical issues, including potential null pointer dereferences in DelayEstimator.cc and SequentialTimingEstimator.cc, an incorrect pointer comparison instead of a string comparison, unsafe usage of std::string_view where a null-terminated string is expected, and a missing Boost hash header in DelayEstimator.hh.

Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/SequentialTimingEstimator.cc
Comment thread src/rsz/src/SequentialTimingEstimator.cc
Comment thread src/rsz/src/DelayEstimator.hh
Comment thread src/rsz/src/SequentialTimingEstimator.cc
@jhkim-pii

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 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-17T06:06:44.593989Z 116f5af Manual request
ℹ️ 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jhkim-pii

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Something went wrong. Try again later by commenting “@codex review”.

Failed to sample tokens
ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

What: the Mt delay estimator models the fanin side loads, the opposite
output transition, the latch D-side driver and the flip-flop setup and
hold change of a cell swap, and SizeUpMt and VtSwapMt charge them.

Why: scoring a swap on the selected path alone let a scored gain turn
into a loss after the timing update.

How: side models in DelayEstimator and SequentialTimingEstimator, input
cap budgets that workers can check without STA, and ArcDelayState
renamed to EstimatorContext. The side models are off by default.

Setup repair profiler review follow-ups: the profiler constructor takes
a RepairSetupProfiler::Mode instead of an int, CRIT_VT_SWAP samples WNS
and TNS before its sweep, and the Bazel TestResizerMt target drops the
--gtest_filter that skipped the profiler and fixture tests.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@openroad-ci
openroad-ci force-pushed the secure-rsz-estimator-side-models branch from 116f5af to ef64398 Compare October 17, 2026 07:03
@maliberty

Copy link
Copy Markdown
Member

Codex:

  • Tests are skipped: src/rsz/test/BUILD:615 filters the Bazel target to TestResizerMtThreadPool.*, excluding every new RepairSetupProfiler test.
  • Mode 1 creates an undocumented file: RepairSetupProfiler.cc:80 opens events.csv in mode 1, though the PR specifies that mode 2 adds that file. The new test expects the same behavior, so the implementation and test should be aligned with the stated mode contract.

@maliberty

Copy link
Copy Markdown
Member

I tested removing the filter arg and all tests pass so I'm unclear on the purpose.

Comment thread src/rsz/src/Resizer.cc
Comment thread src/rsz/src/DelayEstimator.hh
Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/OptimizationPolicyConfig.hh
Comment thread src/rsz/src/OptimizationPolicyConfig.hh
Comment thread src/rsz/test/cpp/TestResizerMtFixture.hh
@maliberty
maliberty merged commit 7f440fe into The-OpenROAD-Project:master Oct 17, 2026
20 checks passed
@maliberty
maliberty deleted the secure-rsz-estimator-side-models branch October 17, 2026 15:13
@jhkim-pii

Copy link
Copy Markdown
Contributor Author

I tested removing the filter arg and all tests pass so I'm unclear on the purpose.

It was for local testing, but mistakenly merged. I removed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants