Skip to content

doc: Update the rsz setup repair architecture - #11805

Open
jhkim-pii wants to merge 9 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-architecture-doc
Open

jhkim-pii wants to merge 9 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:secure-rsz-architecture-doc

Conversation

@jhkim-pii

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

Copy link
Copy Markdown
Contributor

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

Summary

  • Update src/rsz/doc/architecture.md to the setup repair code of this stack. The table below summarizes the 12 PRs, and the sections after it introduce the new Mt moves, the new options and the PARALLEL_EVAL policy.

Stack

# PR Change
1 #11794 LEGACY setup repair path regressions: 16 golden cases on five platforms.
2 #11795 Remove the experimental MT1, MEASURED_VT_SWAP and LEGACY_MT policies; the RSZ_* environment knobs become OptimizationPolicyConfig fields.
3 #11796 Setup repair profiler: -profile_mode 1/2 and -profile_dir write stage times, WNS/TNS samples and events.
4 #11797 Side-path models of the Mt delay estimator: fanin side loads, the opposite transition and the flip-flop checks.
5 #11798 RebufferMt: buffer-tree plans scored by a buffer-tree estimate.
6 #11799 The experimental PARALLEL_EVAL policy with VtSwapMt, SizeUpMt and RebufferMt, and -effort.
7 #11800 SplitLoadMt in the PARALLEL_EVAL default move set.
8 #11801 SwapPinsMt in the PARALLEL_EVAL WNS tail.
9 #11802 UnbufferMt in the PARALLEL_EVAL WNS tail.
10 #11803 SizeDownFanoutMt in the PARALLEL_EVAL WNS tail, and the same steps for every Mt generator.
11 #11804 -profile_mode 3 per-move analysis and report_delay_estimator_accuracy_for_rebuffering.
12 #11805 This PR: the architecture document.

New Mt Moves

  • Thread-safe forms of seven serial moves: VtSwapMt, SizeUpMt, RebufferMt, SplitLoadMt, SwapPinsMt, UnbufferMt and SizeDownFanoutMt.
  • The main thread reads live STA for each target (prepareInputs()); generate() and estimate() run on worker threads from that data, and each candidate is scored with the Liberty-table DelayEstimator over a window of stages, side paths included.
  • The serial moves and the LEGACY policies do not change.

New UI

  • repair_timing -phases PARALLEL_EVAL: the experimental policy (warning RSZ-2024).
  • repair_timing -effort low|medium|high: how far PARALLEL_EVAL goes after the batch stage stalls; high, the default, runs the WNS tail stage.
  • repair_timing -profile_mode 0|1|2|3 and -profile_dir dir: the setup repair profiler, off by default.
  • report_delay_estimator_accuracy_for_rebuffering -inst inst [-driver_pin pin] [-delay_levels n]: the buffer-tree estimate of a driver against STA.
  • report_delay_estimator_accuracy -estimator takes legacy or stage_window, and the experimental MT1, MEASURED_VT_SWAP and LEGACY_MT phase tokens are removed.

PARALLEL_EVAL Policy

  • One RC and STA update per batch instead of per move: worker threads generate and score the candidates of the worst endpoints, and the main thread commits a conflict-free batch in one ECO journal and keeps it only when WNS or TNS improves.
  • When the batches stall, the WNS tail stage repairs the worst endpoints with small batches.
  • Work is counted in reference units instead of wall time, so a run makes the same decisions on every machine and for any thread count.
image

@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 policy to the Resizer setup repair architecture, enabling parallel evaluation of multiple targets and batch commits to reduce timing updates. It adds several multi-threaded (Mt) move generators and candidates, a setup repair profiler for run-local diagnostics, and a diagnostic command to report rebuffering delay estimator accuracy. Additionally, EstimateParasitics is updated to track observer-estimated nets, allowing timing reads by observers without clearing pending nets. The review feedback highlights several critical safety improvements, primarily recommending defensive null checks in DelayEstimator.cc and Resizer.cc to prevent potential null pointer dereferences, as well as correcting a truncated FNV-1a 64-bit offset basis constant in Rebuffer.cc.

Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/DelayEstimator.cc
Comment thread src/rsz/src/Resizer.cc
Comment thread src/rsz/src/Rebuffer.cc Outdated
Comment thread src/rsz/src/Rebuffer.cc Outdated
@jhkim-pii
jhkim-pii marked this pull request as ready for review October 17, 2026 05:18
@jhkim-pii
jhkim-pii requested review from a team as code owners October 17, 2026 05:18
@openroad-ci
openroad-ci force-pushed the secure-rsz-architecture-doc branch from 01f8473 to fe9e82c Compare October 17, 2026 05:49
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>
What: UnbufferMt, the Mt form of buffer removal, joins the PARALLEL_EVAL
WNS tail.

Why: removing a buffer on the worst path is a gain the other Mt moves
cannot make.

How: the main thread checks the buffer and estimates the saved delay;
the tail removes buffers only in single-move batches, since a removal
cannot be reverted in place. LEGACY is unchanged.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: SizeDownFanoutMt, the Mt form of SizeDownFanout, joins the
PARALLEL_EVAL WNS tail, and every Mt generator follows the same steps:
isApplicable() and prepareInputs() on the main thread, generate() and
estimate() on the workers.

Why: the last serial move with an Mt form, and one rule for which code
may read live STA.

How: SizeDownFanoutMt measures the step-down cell per off-path load;
the virtual MoveGenerator::prepareInputs(Target&) replaces the per-move
prepare branches of the policy. PARALLEL_EVAL also stops at the walked
-max_utilization area. LEGACY is unchanged.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: profile mode 3 records what every move did to timing, and
report_delay_estimator_accuracy_for_rebuffering compares the buffer-tree
estimate of a driver with STA.

Why: to find the moves whose estimate misled the repair and to measure
the buffer-tree estimator.

How: RepairSetupAnalysis snapshots each move and samples timing after
it; the report plans the trees as RebufferMt does, applies the best one
in an ECO journal and undoes it. Lower profile modes do not change.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
What: architecture.md describes the setup repair code of this stack: the
policy model of LEGACY and PARALLEL_EVAL, the Mt generator steps and
threading, the PARALLEL_EVAL batch loop, batch outcome, stop rules, WNS
tail stage and effort levels, and the profiler.

Why: the document still described the code before the stack.

How: documentation only.

Signed-off-by: Jaehyun Kim <jhkim@precisioninno.com>
@openroad-ci
openroad-ci force-pushed the secure-rsz-architecture-doc branch from fe9e82c to eb07c44 Compare October 17, 2026 07:29
@oharboe

oharboe commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

WNS precent change gives strange numbers because WNS is often small. Perhaps switch to minimum clock period reg2reg change(ignore in/out constraints because they are often very ad-hoc)?

select a score-ordered conflict-free batch <- [ST]
commit the batch into the open journal <- [ST]
update parasitics and timing once <- [ST]
save, salvage, keep or undo the batch <- [ST]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Here is it called 'keep' but later it is called 'keep on speculation' or just 'Speculate'. One term would be better and speculate is clearer.

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.

3 participants