Skip to content

flow: E12 clustered global-place scorer — measured; the readout is the limit, not the clustering - #4492

Closed
oharboe wants to merge 11 commits into
The-OpenROAD-Project:masterfrom
oharboe:e12-clustered-scorer
Closed

oharboe wants to merge 11 commits into
The-OpenROAD-Project:masterfrom
oharboe:e12-clustered-scorer

Conversation

@oharboe

@oharboe oharboe commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Superseded / for reference. The findings here are being converged into
bazel-orfs#881.
This branch remains as the reproducible apparatus and evidence.

What this set out to test

E12 of the macro-placement estimation ladder: can a fast global placement run on RTL-MP's own std-cell clusters — an order of magnitude fewer movables — and still rank macro-placement candidates? Ranking accuracy was the only requirement.

It ran. The answer is more useful than a pass or a fail.

Result: the clustering was never the problem — the scalar is

Graded against ground truth measured on this setup (24 candidates generated, 23 evaluable, truth = the full production tail to grt, ~34 min/candidate, ~1 h wall for all 23 at 4-way parallel):

scorer ρ vs grt macro_paths_mean
flat, STA aggregate (wq25) +0.61 [+0.29, +0.78] ranks
flat, STA macro aggregate +0.59 [+0.20, +0.80] ranks
flat, raw HPWL +0.24 [−0.24, +0.65] no evidence
clustered HPWL +0.26 [−0.22, +0.66] no evidence
clustered macro-cone HPWL +0.39 [−0.01, +0.72] just misses

1. The campaign's central idea reproduces. A fast non-timing-driven placement with an STA readout ranks the macro-path KPI at +0.61, interval clear of zero, against the published +0.72 [+0.48, +0.84]. Scoring on the far side of the fog works.

2. "Drop the STA" (E3) does not reproduce. The campaign reports raw HPWL ranking the same truth at +0.67. Here it is +0.24 with the interval spanning zero — no demonstrable signal. This is load-bearing for the whole cheap-scorer programme and needs re-deriving before anything is built on it.

3. E12's clustering is faithful and cheap; its readout is the limit. Clustered HPWL (+0.26) is statistically indistinguishable from flat HPWL (+0.24), while tracking flat HPWL closely (+0.66 [+0.34, +0.86]) at 14.7 s vs 63.0 s and 0.87 GB vs 2.43 GB. So the cluster model reproduces what it was asked to reproduce — and inherits a scalar that carries no signal. No improvement to the clustering can fix that. E12's question changes from "compute this number cheaper" to "which number should we compute".

The constructive thread is the macro-cone readout at +0.39 — best of the HPWL family, only just short of significance, and the one variant that moved toward the live KPI, by restricting the sum to nets within reach of a macro pin.

Two findings that matter beyond E12

A candidate can be infeasible, and no wirelength score can say so. cand_s2's macro placement leaves a channel PDN cannot repair (PDN-0179). A selector shipping it would have produced a design that does not build. "Fraction of candidates infeasible" looks like an untracked KPI.

The archived reference describes a different population. Settled from both directions: our scores vs archived truth ρ = −0.42; our truth vs archived truth ρ = −0.26 [−0.65, +0.24] on macro_paths_mean and +0.07 on achieved — uncorrelated. Seed N here is a different placement than seed N there. ORFS and OpenROAD are ruled out (identical to the campaign's be0dca0b and 3ca581e38 pins, the latter with zero source diffs and the same src/sta); what remains is the campaign's much newer bazel-orfs. The archive stays internally consistent and still reproduces its published +0.72 — it just cannot anchor these candidates.

Chesterton's fence: why the divergence was not a bug

The clustered solve diverges at the pre-registered default on swerv — overflow floors at 0.92 for 2175 iterations while the density penalty climbs to 4.1e+28, then GPL-0305. That is a granularity mismatch, not a defect:

  • BinGrid::initBins() sizes bins from average dbInst area — correct for the regime placement_cluster was built for. Its commit describes "a small group of gates" whose members are "all placed at the center of the cluster", and notes small clusters give better results.
  • RTL-MP's leaf clustering deliberately goes the other way: min_num_macros_for_multilevel = 150 forces max_level = 1 here, and base_min_std_cell targets 10183–50915 cells per cluster, so 7 clusters hold 98.6% of instances.

Both tools behave as their authors intended; E12 straddles the seam. tinyRocket converges at the default with 13 clusters, so it is the granularity that diverges, not clustering as such. The 24 swerv runs therefore use E12_BIN_GRID_COUNT=8, disclosed as a knob and reported as exploratory rather than as a gate result.

Infrastructure fixes (independent of E12)

Running one experiment surfaced nine pre-existing bazel breakages; six are fixed here and would block anyone else the same way:

fix what it unblocked
drop empty patches/tcl_lang //... could not be parsed at all
bump bazel-orfs past 4254fc9 every SYNTH_USE_SYN=1 design failed synth (sv_elaborate: no input files)
swerv clkgate as a resolved path unknown module 'OPENROAD_CLKGATE' — any make-computed path in VERILOG_FILES is silently dropped under bazel
bazel-orfs split() patch any SYNTH_HIERARCHICAL + keep-modules design died at analysis
pin tinyRocket keep-modules bazel needs module names at analysis time; all 32 partitions failed without them
design-target visibility alias //flow/test/macro_e12 could not consume a design's synth

Left alone as pre-existing and not mine to redesign: gcd_single_flow → missing gcd_yosys_synth, mempool_group_synth visibility, nangate45/gcd grt, and nangate45/swerv_wrapper's ABC SIGSEGV under bazel's yosys 0.64.

The bump was verified differentially — bazelisk build --nobuild --keep_going //... yields a byte-identical failure set before and after, so 68 commits of bazel-orfs introduce no new analysis breakage.

Apparatus

flow/test/macro_e12/, a design ladder × four stages:

  • macro_e12.tcl — seeded population + flat control rung
  • dump_clusters.tcl — RTL-MP's partition, once, from the shared base floorplan
  • score_clustered.tcl — the clustered rung, one candidate per process
  • evaluate.tcl — the production tail to grt: the truth
  • grade_e12.py — ρ + bootstrap CI, cost table, verdict
  • run_parallel.sh — N-at-a-time driver

Two designs: nangate45/tinyRocket (mechanics: 2 macros, ~6 min tail, whole chain in ~30 min) and asap7/swerv_wrapper (the real 28-macro population).

The gate can now say "inconclusive". On the 4-candidate smoke run it reported PASS — rho = +0.80 [-1.00, +1.00]: an interval spanning the whole range, where any ρ lands "inside" by accident. Gate 1 now requires ρ in the interval, the population complete, and the interval clear of zero — the campaign's own E1 criterion, which I had failed to implement.

Flushing on the cheap design paid for itself: it found unplaced-IO (GPL-0326), a negative HPWL (inverted getTermBBox on unplaced terminals), and a cluster file that did not round-trip (escaped Verilog names read through Tcl list parsing turned \[ into [, missing 3751 of 29069 instances). Three of those four produce plausible-looking numbers rather than crashes, which is what a scoring experiment cannot survive.

🤖 Generated with Claude Code

… (draft)

A macro placement is a draw from a distribution, not an optimum. Seeding
RTL-MP on asap7 swerv_wrapper gives 24 placements whose downstream
macro-path timing spans ~300ps, and the placer's own annealing cost
cannot tell which is which -- it predicts area, not period. Selection
therefore needs a score measured after the fact. The established one is a
fast non-timing-driven global placement over every standard cell (the
"flat" rung), which ranks the ground truth -- macro-path mean at global
route, after the entire production tail -- at Spearman rho +0.72
[0.48, 0.84].

E12 asks whether that placement can run on RTL-MP's own std-cell
clusters instead, roughly an order of magnitude fewer movables, and
still rank. Ranking accuracy is the only requirement: a scorer that is
uniformly optimistic ranks perfectly, so rank inversions are the enemy
and absolute error never was. One pre-registered criterion decides it:
rho(clustered) must land inside the flat rung's interval on the
macro-path KPI. A failing verdict is the deliverable just as much as a
passing one -- since the truth includes repair/CTS/route, rho(clustered)
minus rho(flat) *is* the measured price of the abstraction.

It turns out both halves already exist in OpenROAD, so nothing here
implements a field solver -- deliberately, because the thing being
graded has to be the solver that would ship, not a model of it:

  placement_cluster {inst ...}   makes N instances one movable, and gpl
                                 measures pin offsets against the cluster
                                 centre, so intra-cluster nets collapse
                                 and inter-cluster nets are measured
                                 centre-to-centre -- bundled nets, free
  global_placement -overflow     stops the Nesterov solve early
  rtl_macro_placer -keep_clustering_data
                                 commits the cluster tree to odb as
                                 dbGroups that gpl ignores

The score is half-perimeter wirelength read out of odb in exact integer
DBU (dbNet::getTermBBox), so it needs no OpenROAD change and is
thread-count invariant by construction rather than by discipline.
Scoring is report-only: one candidate per process, because gpl's
Replace::reset() does not clear its cluster list and gpl does write GCell
locations back.

Three steps plus a gate, all under flow/test/macro_e12:

  macro_e12.tcl        regenerate the 24 candidates and re-measure them
                       flat. The candidate placements were never
                       archived, only their scores, so this is also the
                       rig check: until the regenerated flat scores
                       reproduce the archive, any clustered number is
                       measuring the rig.
  dump_clusters.tcl    RTL-MP's cluster partition, once, from the shared
                       base floorplan -- via ORFS's own macro_place
                       stage, so the partition is the one production
                       RTL-MP builds.
  score_clustered.tcl  the clustered rung, plus a free second readout
                       over the macro cone only.
  grade_e12.py         rho + bootstrap CI per KPI, and the verdict.

Deriving the coarsening once and sharing it across candidates is not
only a saving: every candidate is then scored through the identical
distortion, and common-mode distortion does not create rank inversions.
A partition re-derived per candidate would, and must not be used.

The five carried OpenROAD patches make the population generatable at all
-- seedable (0002), re-entrant (0001), round-tripping (0003), injection
equivalent to production (0004) -- plus a thread-invariant density
scatter (0005). They come from the public bazel-orfs macro-selector
branch and apply cleanly and in order at the commit the tools/OpenROAD
gitlink already records, which is byte-identical in src/mpl, src/gpl,
src/par and src/odb/src to the commit the archived reference numbers
were measured at. Since local_path_override cannot apply patches,
openroad is fetched via git_override pinned to that same commit, exactly
as ORFS did while carrying the single-process flow fixes; revert to
local_path_override when these land upstream.

Verified:

  * the patched OpenROAD builds through git_override, and the four
    regressions the patches ship all pass -- random_seed1,
    macro_placement_round_trip1, all_fixed_macros1, mt_invariance01
  * //flow/test/macro_e12 loads and its gate test passes, including five
    published numbers recomputed from the committed archive (+0.72,
    +0.82, +0.57, +0.65, +0.47) -- which is what pins the gate to the
    right column rather than a friendlier neighbouring one
  * every Tcl/odb/gpl API the scorer uses was probed against a real
    binary rather than assumed

Not yet run: the campaign itself. The flow targets are tags = ["manual"]
(ORFS CI does not run bazel), and the README pre-registers the
configuration, the early-kill criteria and the determinism check to run
before spending it.

Not included, by design: rtl_macro_placer -candidates k. That belongs in
OpenROAD, and it is planned only if this gate passes -- which is the
entire reason the gate exists.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>

@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 E12 experiment framework, which evaluates whether a clustered global placement on RTL-MP's standard-cell clusters can effectively rank macro-placement candidates compared to a flat placement. It adds several Tcl and Python scripts to generate candidates, dump clusters, score them, and grade the results against a committed archive of reference measurements. Additionally, it overrides the openroad dependency in MODULE.bazel to apply five custom patches addressing various issues in OpenROAD. The review feedback highlights a critical issue in grade_e12.py where diverged candidates with invalid HPWL scores are not filtered out during the Spearman correlation calculation, potentially corrupting the gate verdict, and suggests a fix to exclude them.

table = {}
for label, source, field in VARIANTS:
records = sources.get(source, {})
usable = [t for t in tags if t in records and field in records[t]]

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.

high

Diverged candidates (where diverged is 1 or True in the clustered JSON) have invalid/garbage HPWL scores. Currently, rho_table does not filter out these diverged candidates, meaning their garbage scores are included in the Spearman correlation (rho) calculation. This can silently corrupt the correlation results and lead to incorrect gate verdicts.

Filtering out diverged candidates from usable ensures that only valid, converged placements are scored, and also allows gate_one to correctly detect an incomplete population (since entry["n"] will be less than expected_n).

Suggested change
usable = [t for t in tags if t in records and field in records[t]]
usable = [
t for t in tags
if t in records and field in records[t] and not records[t].get("diverged", 0)
]

Found while preparing to actually run the probe: macro_e12.tcl opened
with an unconditional `source $::env(ORFS_FORK_TCL)`, and the bazel-orfs
commit ORFS pins has no fork facility at all -- no fork/ directory, no
ORFS_FORK_TCL, no fork_attrs(). The script would have died on its first
line, before doing anything.

Detect it and fall back to the serial arm, which already existed for the
threading comparison. This is a throughput difference, not a measurement
difference -- the same candidates, the same scores, one at a time -- but
it is a large one: the upstream campaign measured 65 candidates/h forked
against 23.8 serial, because generation dominates and RTL-MP is
thread-insensitive. Say so where someone is about to ask for 24
candidates, and point at E12_K=1 as the way to exercise the pipeline
first.

Bumping bazel-orfs to get fork back would be the alternative, but that
is an ORFS-wide change in service of one experiment's throughput, and
the serial arm measures the same thing.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
4969ea7 removed the tclZipfs patch when it landed in BCR tcl_lang, but
left behind patches/tcl_lang/BUILD.bazel, whose only content is
`exports_files(glob(["*.patch"]))` over a directory that now has no
patches. glob() disallows empty matches by default, so any target pattern
that has to parse this package fails:

  ERROR: package contains errors: patches/tcl_lang
  Error in glob: glob pattern '*.patch' didn't match anything

Building a named target never touches it, which is why this went
unnoticed -- but `bazelisk build //...` and `bazelisk test //...` cannot
parse the repository at all. Nothing references //patches/tcl_lang (the
@tcl_lang// references elsewhere are the external module), so remove the
directory rather than papering over it with allow_empty.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Every design whose config.mk sets SYNTH_USE_SYN=1 -- gcd and
swerv_wrapper among them -- fails its bazel synth on the previous pin:

  sv_elaborate -D SYNTHESIS ... --top gcd --std=1364-2005
  error: no input files
  [ERROR SYN-0001] Elaboration failed.

VERILOG_FILES arrives empty. bazel-orfs empties it for the synth action
on purpose -- the yosys path synthesises from canonicalized RTLIL and
the sources are deliberately not among that action's inputs -- but
OpenROAD-SYN elaborates the sources directly and has no canonicalize
step, so it gets nothing. The previous pin (6ebadeb4) predates
bazel-orfs 4254fc9 "synth: support OpenROAD-SYN engine
(SYNTH_USE_SYN=1)", which is what teaches the synth action the
difference.

Bump to ca4e9dd, the last commit before bazel-orfs 9bc8c74 "migrate
from local verilog submodule to rules_chisel" deletes the verilog/
subtree that @bazel-orfs-verilog is built from (strip_prefix =
"verilog"). Going further means migrating ORFS to rules_chisel, and
bazel-orfs main has additionally moved to Bazel 9.1.1 while ORFS is on
8.6.0. Note //fork lands only after that removal and so is still out of
reach here.

Verified by differential analysis rather than by hope: `bazelisk build
--nobuild --keep_going //...` produces a byte-identical set of failures
before and after the bump, so the 68 commits introduce no new analysis
breakage. Those remaining failures are pre-existing on master and are
left alone here:

  * //flow/designs/asap7/gcd:gcd_single_flow references
    :gcd_yosys_synth, which no rule emits at either pin
  * //flow/designs/nangate45/mempool_group:mempool_group_synth hits
    visibility errors on //flow/designs/src/mempool_group/rtl sources

//flow/designs/asap7/gcd:gcd_synth now builds through to 1_synth.odb.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
asap7/swerv_wrapper's bazel synthesis failed at elaboration:

  swerv_wrapper.sv2v.v:32:1: error: unknown module 'OPENROAD_CLKGATE'
  OPENROAD_CLKGATE clkgate (

The sv2v'd RTL instantiates OPENROAD_CLKGATE directly, so the clkgate
mapping model is a plain source file and config.mk duly lists it in
VERILOG_FILES -- as $(CLKGATE_MAP_FILE), which expands through
$(PRIMARY_VT_TAG) -> $(PRIMARY_VT) -> $(word 1, $(VT_LIST)).

bazel-orfs's config.mk parser cannot evaluate make functions, so any
VERILOG_FILES entry containing "$(" is dropped when the list is turned
into bazel labels. Under make the file is present and everything works;
under bazel the module definition silently disappears and the failure
surfaces much later, at elaboration. Spelling the path out is what makes
it a label the parser can resolve.

Note this is a general trap, not a swerv quirk: any design putting a
make-computed path in VERILOG_FILES is broken under bazel the same way,
and the symptom is an undefined module rather than a missing file.

The value written here is what $(CLKGATE_MAP_FILE) already expands to for
the platform's default PRIMARY_VT (RVT), verified with
`make print-VERILOG_FILES`: the make flow sees the identical three files
before and after, so only the bazel path changes. The comment records
that the literal has to be kept in step with that default and with
ASAP7_USE_VT should this design ever set it.

With this, //flow/designs/asap7/swerv_wrapper:swerv_wrapper_synth builds
through to 1_synth.odb (design area 47979 um^2).

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
First real run of the cluster dump reported "32 leaf clusters covering
203718 of 101831 movable instances" -- more instances than the design
has, by exactly 2x.

dbBlock::getGroups() returns EVERY group in the block, not just the roots
of the tree, so recursing into children from each entry reaches every
leaf twice: once as its own starting point (it has no children, so it
looks like a leaf) and once via its parent. Select leaves directly from
the flat list instead; no recursion is needed.

This mattered more than a wrong log line. gpl::placement_cluster_cmd
accepts repeated declarations of the same instance without complaint and
keeps the last, so the scorer would have run happily on a cluster model
that was not a partition of the netlist, and produced numbers that looked
entirely reasonable. Replace the count with a check that actually holds
the invariant -- fail if any instance is assigned to two clusters -- and
report coverage over the population the scorer will really cluster
(movable, non-macro) rather than a raw total.

After the fix, on asap7/swerv_wrapper: 16 leaf clusters, 101831 of 101831
movable instances covered, plus the 28 macros the tree also carries and
the scorer filters out.

Also expose the design's synth stage to the experiment. orfs_design
leaves flow targets package-private and ORFS's design() has no
visibility passthrough, so //flow/test/macro_e12 could not consume
swerv_wrapper_synth at all. Add a narrow alias visible to that one
package rather than widening the whole flow-target family.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Two independent problems, both hit by any design that uses hierarchical
synthesis without a pinned keep-module list. tinyRocket is the first such
design anyone has built under bazel, so it is where they surfaced.

1. bazel-orfs patch: orfs_design() sizes SYNTH_NUM_PARTITIONS from
   SYNTH_KEEP_MODULES with Starlark's split() and no separator, which is
   a Python-ism -- Starlark requires one. So a design setting both
   SYNTH_HIERARCHICAL=1 and SYNTH_KEEP_MODULES fails at analysis:

     Error in split: split() missing 1 required positional argument: sep

   Splitting on runs of whitespace is what the count actually needs,
   since a config.mk list arrives spread over backslash-continued lines
   and split(" ") alone would count the continuations as entries. Carried
   as //patches/bazel-orfs until it lands upstream.

   Note swerv_wrapper does not hit this: it reaches hierarchy through
   SYNTH_USE_SYN + OPENROAD_HIERARCHICAL and never sets
   SYNTH_HIERARCHICAL.

2. Pin tinyRocket's SYNTH_KEEP_MODULES (46 modules, captured from the
   discovery step's own kept_modules.json).

   This is not tidying. Parallel synthesis declares one per-module
   re-canonicalization action per kept module, so bazel needs those
   module names at analysis time. When the list is only discovered inside
   a build action, bazel still emits the partition actions but no
   per-module checkpoints exist to feed them, and all 32 partitions fail
   identically with

     ERROR: per-module checkpoint missing: partition_<Module>_canonical.rtlil

   Under make the pin is redundant -- discovery runs and finds the same
   list -- so the flow's behaviour is unchanged there. The comment records
   how to recapture the list if the RTL or SYNTH_MINIMUM_KEEP_SIZE moves.

Flattening synthesis would have dodged both, and would have been the
wrong fix: RTL-MP builds its clustering from dbModule hierarchy, so a
flat tinyRocket has no hierarchy for a macro-placement experiment to
consume.

//flow/designs/nangate45/tinyRocket:RocketTile_synth now builds (65s).
Chosen as the fast-flush design for the E12 pipeline: real checked-in
fakeram macros in two sizes, hierarchy preserved, nangate45, and small
enough to exercise every stage including the production tail.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
…lusive"

Adds the one pipeline stage that had never executed anywhere, and then
uses it -- which immediately found three real bugs and one flaw in the
gate itself.

evaluate.tcl: the truth measurement. Carries a candidate through the
production tail in flow.tcl's own order (tapcell, pdn,
global_place_skip_io, io_placement, global_place, resize, detail_place,
cts, global_route), entered where a candidate archive begins. It sources
ORFS's own stage scripts rather than reimplementing them, which is what
makes this the production tail and not an approximation, and stays
report-only via WRITE_ODB_AND_SDC_EACH_STAGE=0. Leaves use the archive's
`grt` field names so a re-measured truth is a drop-in for the archived
one rather than a second schema.

grade_e12.py learns --truth-dir for those leaves. With a re-measured
truth there is no archived score to reproduce, so gate 0 is vacuous
rather than passing -- decided from the truth source itself, because the
first attempt also swallowed the "run produced nothing" case.

The BUILD is now a ladder rather than one design: E12_DESIGNS x
E12_STAGES emits four executables each for nangate45/tinyRocket
(mechanics: 2 macros, ~6 min tail) and asap7/swerv_wrapper (the real
population: 28 macros, hours per candidate). An experiment is flushed on
the cheap design and repeated on the expensive one without edits.

Bugs the flush found, all of which would have cost hours each to find on
swerv:

  * score_clustered inherited unplaced IO. The candidate .odb is ORFS's
    2_2_floorplan_macro output, so gpl refused it with GPL-0326. The
    scorer now places pins itself, which also keeps both rungs measuring
    the same configuration.

  * HPWL came back NEGATIVE (-368716188153). Unplaced terminals make
    getTermBBox return an inverted rectangle with negative dx/dy. It was
    only obvious because it went below zero; on a partially placed design
    the same bug yields a plausible number. Now guarded.

  * clusters.txt did not round-trip. odb names carry escaped Verilog
    identifiers (buffer/Queue/_T_address\[0\]\[0\]$_DFFE_PP_$), and a
    whitespace-joined line read back with Tcl LIST parsing has its
    escapes interpreted, so \[ arrived as [ and 3751 of 29069 lookups
    missed. Tab-delimited fields split with `split` are raw strings and
    survive. Note the partition check added earlier is what caught this:
    without it gpl would have accepted a cluster model missing 13% of the
    design and produced a perfectly plausible score.

And the gate flaw, which is the most valuable find: on the four-candidate
smoke population it reported

  Gate 1 (E12): PASS -- rho = +0.80 [-1.00, +1.00]

A bootstrap interval spanning the entire range says nothing, yet any rho
at all would "land inside" the flat scorer's interval by accident. That
is exactly the false confidence pre-registration is meant to prevent.
Gate 1 now requires three things -- rho inside the interval, the
population complete, and the interval clear of zero, which is the
campaign's own E1 criterion -- and reports "inconclusive" when the
measurement is uninformative, because that is neither a pass nor a
failure. The archive itself passes the new test (0.72, lo = 0.48), and
the pass fixture was retargeted to that operating point rather than an
artificial extreme.

tinyRocket verdict committed as evidence of the flush, not as a result:
n=4 with no measured noise band, so its rho is uninterpretable by
construction.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@openroad-ci

openroad-ci commented Sep 1, 2026 •

Copy link
Copy Markdown
Member

🔍 QoR check

Metrics reflect the PR merge build — i.e. what will land on the target branch. Advisory — results are log-only and do not affect build status. The authoritative QoR gate remains the local rules-file check.

Commit 4ffafe4 · Jenkins build #3 · Baseline: build

62 design(s) checked — 1 with regression(s), 0 without a comparable baseline.
Design Variant Verdict local vs inline passed / failed / missing
asap7/aes base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-block base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes-mbff base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/aes_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/cva6 base ✅ pass ✅ MATCH 12 / 0 / 0
asap7/ethmac base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ethmac_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/gcd-ccs base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/jpeg_lvt base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-alu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/mock-cpu base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/riscv32i-mock-sram base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
asap7/uart base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/aes-hybrid base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
gf180/uart-blocks base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/aes base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
gt2n/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/aes base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/i2c-gpio-expander base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
ihp-sg13g2/spi base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/aes base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane133 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ariane136 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/black_parrot base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_be_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_fe_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/bp_multi_top base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/cva6 base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/dynamic_node base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/mempool_group base ✅ pass ✅ MATCH 12 / 0 / 0
nangate45/swerv base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/swerv_wrapper base ✅ pass ✅ MATCH 25 / 0 / 0
nangate45/tinyRocket base ❌ fail ✅ MATCH 19 / 6 / 0
sky130hd/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/chameleon base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/microwatt base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hd/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/aes base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/gcd base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/ibex base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/jpeg base ✅ pass ✅ MATCH 25 / 0 / 0
sky130hs/riscv32i base ✅ pass ✅ MATCH 25 / 0 / 0
❌ nangate45/tinyRocket base — 6 failing metric(s)
Metric target base delta limit band
cts__timing__setup__tns -176.595 -22.2673 693.0687600202988% -22.5073 PeriodPadding 20%
cts__timing__setup__ws -0.359736 -0.115637 211.0907408528412% -0.175637 PeriodPadding 5.0%
finish__timing__setup__tns -185.759 -35.7636 419.40800143162323% -36.0036 PeriodPadding 20%
finish__timing__setup__ws -0.360522 -0.118763 203.5642413883112% -0.178763 PeriodPadding 5.0%
globalroute__timing__setup__tns -202.352 -35.1151 476.25352056522695% -35.3551 PeriodPadding 20%
globalroute__timing__setup__ws -0.37744 -0.138444 172.63008870012425% -0.198444 PeriodPadding 5.0%

the archive cannot anchor it

Two results from running the apparatus on the full asap7/swerv_wrapper
population (k=24, all converged) plus the tinyRocket flush.

The necessary condition holds. rho(clustered HPWL, flat HPWL) = +0.66
[+0.36, +0.86] over 24 candidates, at 14.7 s against the flat rung's
63.0 s and 0.87 GB against 2.40 GB. The interval is clear of zero, so the
clustered abstraction really does carry a substantial part of the flat
rung's wirelength signal at roughly a quarter of the cost. It is not a
faithful reproduction -- a third of the rank information is gone -- and
it tracks flat HPWL (+0.66) far better than the flat STA aggregate
(+0.23, interval includes zero), which is what a wirelength score should
do.

That measurement needs no ground truth, which is the point of adding it:
the flat rung is the thing already shown to predict the flow, so a
clustered rung that failed to track it could be rejected without spending
days on a truth run. It did not fail.

The archive cannot serve as truth here, and this is now measured rather
than argued:

  archive's own wq25  vs archived macro_paths_mean:  +0.72 [+0.48, +0.84]
  regenerated wq25    vs archived macro_paths_mean:  -0.42 [-0.75, +0.00]

The archive is internally consistent -- its own column reproduces the
published figure exactly -- but the regenerated scores anti-correlate
with it, and the regenerated/archived ratio scatters 0.574 to 2.093
(stdev 0.357). So it is not a calibration offset: seed N here produces a
different placement than seed N did in the campaign, and the archived grt
values do not describe our candidates. An earlier reading of "a uniform
0.66 factor" was an artifact of having only one candidate.

ORFS and OpenROAD are ruled out as causes (identical to the campaign's
be0dca0 and 3ca581e38 pins respectively, the latter with zero source
diffs and the same src/sta). What remains is the campaign's much newer
bazel-orfs and its synth-pipeline commits, which would change the
OpenROAD-SYN netlist.

Consequently Gate 1 is correctly INCONCLUSIVE, and any grt-anchored
verdict now depends on re-measuring truth here -- which evaluate.tcl
does, at roughly 5 hours per swerv candidate on this host.

Also recorded: the divergence at the pre-registered default is a
granularity mismatch rather than a defect. gpl sizes bins from average
dbInst area, correct for the regime placement_cluster was built for ("a
small group of gates", members "all placed at the center"), while
RTL-MP's leaf clustering deliberately targets 10183-50915 cells per
cluster. tinyRocket converges at the default with 13 clusters, so it is
the granularity that diverges, not clustering as such. The 24 swerv runs
therefore use E12_BIN_GRID_COUNT=8, disclosed as a knob and reported as
exploratory rather than as a gate result.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
Candidate runs have been serial on the assumption that bazel-orfs's
//fork was needed for parallelism and is unreachable from any commit ORFS
can pin (it lands after the verilog/ subtree removal that
@bazel-orfs-verilog is built from). That was the wrong diagnosis: fork
was never in the way. Bazel's output-base lock is what serializes
concurrent `bazelisk run` invocations, and orfs_run_executable emits a
plain shell wrapper that execs make with no bazel server involved. Invoke
that wrapper directly and the lock is simply not in the picture.

So run_parallel.sh drives any of the four E12 stages over a candidate
list, N at a time, with no fork and no bazel. Per-candidate processes were
mandatory anyway -- gpl's Replace::reset() does not clear its cluster
list -- and e12_redirect already gives each tag its own work directory.
RUN_LOG_NAME_STEM is overridden per tag so workers do not race on a
shared run.log, and scheduling uses `wait -n` so a slow candidate does
not idle the other slots.

This matters on any machine, not just this one: a 24-candidate truth run
is hours of wall clock that parallelises almost perfectly, and handing the
campaign to a bigger host without a parallel driver would just move the
serialization somewhere else.

Concurrency is left to the caller because the limit is memory, not cores:
the flat rung peaks at 2.4GB on swerv and the timing-driven tail is
higher, so the right number comes from measuring one tail rather than from
the core count.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
problem, not the clustering

Truth re-measured for the full population with evaluate.tcl: 24
candidates generated, 23 evaluable, ~34 min each, about an hour of wall
clock for all 23 at 4-way parallel via run_parallel.sh. cand_s2 is
excluded because it is genuinely infeasible -- its macro placement leaves
a channel PDN cannot repair (PDN-0179). That is the strongest truth
signal a candidate can give, and notably one no wirelength score can
express: a selector shipping cand_s2 would have produced a design that
does not build.

Graded on that truth:

  flat, STA aggregate (wq25)     +0.61 [+0.29, +0.78]   ranks
  flat, STA macro aggregate      +0.59 [+0.20, +0.80]   ranks
  flat, raw HPWL                 +0.24 [-0.24, +0.65]   no evidence
  clustered HPWL                 +0.26 [-0.22, +0.66]   no evidence
  clustered macro-cone HPWL      +0.39 [-0.01, +0.72]   just misses

The campaign's central phenomenon reproduces: a fast non-timing-driven
placement with an STA readout ranks the macro-path KPI at +0.61, interval
clear of zero, against the published +0.72 [+0.48, +0.84]. The rig is
sound; what failed to reproduce was the candidate population, not the
idea.

E3's "drop the STA" does not reproduce. The campaign reports raw HPWL at
+0.67 on this KPI; here it is +0.24 with the interval spanning zero.
Anything built on HPWL-only being ranking-equivalent needs to re-derive
that first.

And E12's own result is not what it appeared. Clustered HPWL (+0.26) is
statistically indistinguishable from flat HPWL (+0.24), while tracking
the flat rung's HPWL closely (+0.66 [+0.34, +0.86]) at 14.7s against
63.0s and 0.87GB against 2.43GB. So the clustering is faithful and cheap;
the limitation is inherited from the scalar it reads. No improvement to
the cluster model can rescue a readout that carries no signal -- which
reframes E12 from "make the scorer cheaper" to "make the readout rank".

The constructive thread is the macro-cone readout at +0.39, best of the
HPWL family and only just short of significance. It is the one variant
that moved toward the live KPI, and it did so by restricting the sum to
nets within reach of a macro pin.

Also settled, from both directions: the archive describes a different
population. Our scores against archived truth give -0.42, and our truth
against archived truth gives -0.26 [-0.65, +0.24] on macro_paths_mean and
+0.07 on achieved -- uncorrelated. cand_s0's achieved matching to 0.6ps
is coincidence, since the population ties on achieved anyway. The archive
stays internally consistent and still reproduces its published +0.72; it
simply does not describe these candidates.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
@oharboe oharboe changed the title flow: E12 clustered global-place scorer for macro-placement selection (draft) flow: E12 clustered global-place scorer — measured; the readout is the limit, not the clustering Sep 2, 2026
@oharboe

oharboe commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator Author

Converging into bazel-orfs#881, which now carries:

  • ideas/e12-clustered-scorer.md — the experiment's record and verdict
  • a Negative findings of importance section in docs/estimate.md — the six results that invalidate assumptions a later experiment would otherwise build on

Closing, not abandoning. The headline: the clustering worked and the readout did not. The clustered rung reproduced the flat rung's HPWL at ρ +0.66 [+0.34, +0.86] for 14.7 s against 63.0 s, and ranked ground truth at +0.26 — indistinguishable from flat HPWL's +0.24. So E12's question becomes which number to compute, not how to compute it more cheaply. And because placement_cluster places every member at its cluster centre, a clustered placement cannot carry an STA readout at all, which leaves the macro-cone variant (+0.39 [−0.01, +0.72]) as the one live thread.

The branch stays pushed as reproducible apparatus and per-candidate evidence.

Still unfiled: six fixes here are independent of E12

These block anyone using ORFS through bazel today and are not experiment-specific. They deserve their own PRs rather than dying with this one:

commit what it unblocks
3ad77a0e6 patches/tcl_lang globs *.patch in a directory with none — //... cannot be parsed at all
e2143f019 bazel-orfs pin predates OpenROAD-SYN support — every SYNTH_USE_SYN=1 design fails synth with sv_elaborate: no input files
ec114b5af $(CLKGATE_MAP_FILE) is silently dropped when VERILOG_FILES is turned into labels → unknown module 'OPENROAD_CLKGATE'. General trap for any make-computed path
26015ca6a (split) bazel-orfs split() called without a separator — a Python-ism Starlark rejects, so any SYNTH_HIERARCHICAL + SYNTH_KEEP_MODULES design dies at analysis. Belongs upstream in bazel-orfs
26015ca6a (split) tinyRocket keep-modules unpinned — bazel needs module names at analysis time to declare per-module actions, so all 32 partitions fail
9394ac38d (part) design flow targets are package-private with no visibility passthrough

The bazel-orfs bump was verified differentially: bazelisk build --nobuild --keep_going //... yields a byte-identical failure set before and after, so 68 commits introduce no new analysis breakage.

Left alone as pre-existing: gcd_single_flow → missing gcd_yosys_synth, mempool_group_synth visibility, nangate45/gcd grt, and nangate45/swerv_wrapper's ABC SIGSEGV under bazel's yosys 0.64.

🤖 Generated with Claude Code

@maliberty

Copy link
Copy Markdown
Member

E12, E3, etc make this unreadable as they are inexplicable and must come from some other context

@oharboe

oharboe commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator Author

E12, E3, etc make this unreadable as they are inexplicable and must come from some other context

Agreed. Note that you found this PR in the bin, I immediately closed it as inactionable.

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.

3 participants