Skip to content

web: add net fanout histogram to charts widget#10649

Open
maliberty wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:web-fanout-histogram
Open

web: add net fanout histogram to charts widget#10649
maliberty wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:web-fanout-histogram

Conversation

@maliberty

Copy link
Copy Markdown
Member

Summary

Adds a Net Fanout tab to the web charts widget, alongside the existing Setup/Hold Slack views.

  • New fanout_histogram request that bins per-net load count directly from odb (no STA dependency).
  • Tightens the histogram Y-axis snap so a tall bar fills most of the chart height instead of ~half.
  • Keeps the hover tooltip clamped inside the widget bounds.

Changes

  • charts-widget.js — Net Fanout tab + Y-axis snap / tooltip fixes
  • request_handler.{cpp,h}fanout_histogram request handler
  • timing_report.{cpp,h} — per-net fanout binning from odb
  • web.cpp — wire up the new request
  • test/js/test-charts-widget.js — coverage for the new tab

@maliberty maliberty self-assigned this Jun 13, 2026
@openroad-ci openroad-ci force-pushed the web-fanout-histogram branch from 46c26df to b410a49 Compare June 13, 2026 21:33

@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 a new Net Fanout tab to the charts widget, allowing users to view and interact with net fanout distributions. Key changes include frontend support for log-scale rendering, tooltips, and double-click bin selection, alongside backend handlers to compute and serialize the fanout histogram. Feedback highlights two critical stability and concurrency issues: first, double-clicking a bin with a very large number of nets could cause severe performance degradation or crashes, so limiting the selection size is recommended; second, accessing the database in handleFanoutHistogram without acquiring the shared tcl_eval_->mutex lock introduces potential race conditions, which should be resolved by locking the mutex.

Comment thread src/web/src/request_handler.cpp
Comment thread src/web/src/request_handler.cpp
Adds a "Net Fanout" tab alongside Setup/Hold Slack, backed by a new
fanout_histogram request that bins per-net load count from odb directly
(no STA dependency).  Also tightens the histogram Y-axis snap so a tall
bar fills most of the chart instead of half, and keeps the hover tooltip
inside the widget bounds.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b410a49752

ℹ️ 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".

Comment thread src/web/src/request_handler.cpp
Double-clicking a densely populated fanout bin could select tens of
thousands of nets, inserting each into the SelectionSet and computing
highlight shapes for all of them -- prohibitively slow and memory-heavy,
to the point of hangs or crashes on large designs.

Cap the selection at 1000 nets while still reporting the true bin count,
and surface a truncated flag so the client warns when the limit is hit.

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@openroad-ci openroad-ci force-pushed the web-fanout-histogram branch from b410a49 to efd55c7 Compare June 14, 2026 03:10
@maliberty maliberty marked this pull request as ready for review June 14, 2026 03:11
@maliberty maliberty requested a review from a team as a code owner June 14, 2026 03:11
@maliberty maliberty requested a review from gadfort June 14, 2026 03:11

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: efd55c73d6

ℹ️ 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".

Comment on lines 382 to +386
const data = await this._app.websocketManager.request(req);
this._histogramData = data;
this._syncView();

const total = data.total_endpoints || 0;
const unconstrained = data.unconstrained_count || 0;
const constrained = total - unconstrained;
this._statusLabel.textContent = `${constrained} endpoints` +
(unconstrained > 0 ? `, ${unconstrained} unconstrained` : '');
if (this._currentTab === 'fanout') {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Drop stale histogram responses after tab switches

If a user switches tabs while a histogram request is in flight, the response is interpreted using the new this._currentTab when it completes. For example, a fanout_histogram response that arrives after switching back to Setup is stored in _histogramData, rendered as slack data, and then reports 0 endpoints because total_endpoints is absent; the reverse can render slack bins as fanout. Capture the requested tab/generation before the await and ignore responses that are no longer current.

Useful? React with 👍 / 👎.

Comment on lines +1023 to +1025
// STA-touching code (descriptors, getProperties) must hold the
// shared STA lock.
std::lock_guard<std::mutex> sta_lock(tcl_eval_->mutex);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Honor DBU mode for fanout-bin inspection

When a fanout bin is double-clicked with Show DBU enabled, this new inspect path still formats properties with the default micron converter because it never reads use_dbu or installs ScopedDbuFormat before writeInspectPayload; unlike the existing select/inspect/select_next paths, the client request also omits the flag. The first net opened from the histogram therefore shows inconsistent units until the user re-inspects or cycles selection.

Useful? React with 👍 / 👎.

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.

1 participant