Skip to content

rsz: Add SwapPinsMt to the PARALLEL_EVAL WNS tail - #11801

Merged
maliberty merged 5 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-swap-pins-mt
Oct 18, 2026
Merged

maliberty merged 5 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-swap-pins-mt

Conversation

@jhkim-pii

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

Copy link
Copy Markdown
Contributor

Part 8 of 12 of the PARALLEL_EVAL setup repair stack. It builds on #11800 and also shows the commits of parts 1 to 7; its own change is the last commit.

Summary

  • Add SwapPinsMt, the Mt form of the pin swap, to the PARALLEL_EVAL WNS tail.

Changes

  • Resizer::swapPinDelays() is split out of findSwapPinCandidate(), so both forms compare the same arc delays.
  • SwapPinsMtGenerator measures the arc delay through each equivalent input of the target gate on the main thread and picks the fastest one on a worker; the displaced signal pays the same delay difference in the score.
  • -sequence accepts swap; without -sequence the WNS tail adds SwapPinsMt, and -skip_pin_swap keeps it out.
flowchart LR
  P["critical signal on input A"] --> G["equivalent inputs A, B<br/>(arc delays measured on the main thread)"]
  G --> C{"B faster than A?"}
  C -- yes --> S["swap A and B;<br/>the displaced signal pays the difference"]
  C -- no --> N["no candidate"]
Loading

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
  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 (this PR)
  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 introduces the experimental PARALLEL_EVAL setup repair policy (SetupParallelEvalPolicy), which optimizes setup timing in parallel batches using worker threads. It removes older experimental policies (LEGACY_MT, MT1, MEASURED_VT_SWAP) and adds several supporting components, including a bottleneck analysis tool, a batch selector, a repair setup profiler, and multi-threaded move generators (RebufferMtGenerator, SplitLoadMtGenerator, SwapPinsMtGenerator). The review feedback is highly constructive, pointing out several critical locations where null pointer dereferences could occur, specifically regarding candidate_scene_cell in DelayEstimator.cc, input_ in both SplitLoadMtCandidate.cc and SwapPinsMtCandidate.cc, prepared_timing_ in SequentialTimingEstimator.cc, stage.arc.scene/min_max in SetupParallelEvalPolicy.cc, and the ports in OptimizerTypes.cc.

Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/move/SplitLoadMtCandidate.cc
Comment thread src/rsz/src/move/SwapPinsMtCandidate.cc
Comment thread src/rsz/src/SequentialTimingEstimator.cc
Comment thread src/rsz/src/policy/SetupParallelEvalPolicy.cc
Comment thread src/rsz/src/OptimizerTypes.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-17T05:51:59.209001Z 7448902 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".

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>
What: RebufferMt, an Mt buffering move that plans a beam of Rebuffer
trees per driver and scores each with the buffer-tree estimator.

Why: buffering needs the same scored, comparable candidates as the cell
swaps before a batch policy can choose among them.

How: makeRebufferTreePlans() and applyRebufferTreePlan() in Rebuffer,
estimateBufferTreeWithSidePaths() in DelayEstimator, and current
required times after the endpoint scan. No policy runs RebufferMt yet;
PARALLEL_EVAL will. LEGACY is unchanged.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: PARALLEL_EVAL, an experimental setup repair policy that commits a
batch of VtSwapMt, SizeUpMt and RebufferMt moves per timing update.

Why: one timing update per batch instead of per move cuts the repair
time.

How: worker threads scan endpoints and generate and score candidates
from prepared data; BatchSelector, BottleneckAnalysis and
ParallelEvalState pick, rank and stop; each batch is kept, salvaged or
rolled back by its WNS and TNS (the group's under -path_group).
OptimizationPolicy::finish() ends each phase, and the Optimizer prints
the final report after the last phase. LEGACY results do not change.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: SplitLoadMt, the Mt form of SplitLoad, joins the PARALLEL_EVAL
default sequence.

Why: splitting off the less critical loads is a strong setup move that
PARALLEL_EVAL lacked.

How: estimateLoadChange() scores the lighter target load and the moved
loads are charged as side loads; the split itself is chosen as in the
serial move. LEGACY is unchanged.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: SwapPinsMt, the Mt form of the pin swap, joins the PARALLEL_EVAL WNS
tail.

Why: a pin swap is a cheap gain on the worst endpoints once the batches
stall.

How: Resizer::swapPinDelays() is shared with the serial move; the Mt
generator measures the arc delays on the main thread and picks the
fastest input on a worker. LEGACY is unchanged.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@openroad-ci
openroad-ci force-pushed the secure-rsz-swap-pins-mt branch from 7448902 to e9ea89d Compare October 17, 2026 07:16
@maliberty
maliberty merged commit e9ea89d into The-OpenROAD-Project:master Oct 18, 2026
20 checks passed
@maliberty
maliberty deleted the secure-rsz-swap-pins-mt branch October 18, 2026 02:24
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