Skip to content

web: filter timing paths by slack range on histogram click in static mode#10138

Merged
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:web-static-chart
Apr 15, 2026
Merged

web: filter timing paths by slack range on histogram click in static mode#10138
maliberty merged 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:web-static-chart

Conversation

@openroad-ci

Copy link
Copy Markdown
Member

Summary

In static-page mode, clicking a slack histogram column showed all timing paths instead of filtering to that bin's slack range. Live WebSocket mode filters server-side, but the static cache handler (WebSocketManager._cacheRequest) ignored the slack_min/slack_max parameters and returned the full cached report.

This PR filters cached paths client-side using the half-open [slack_min, slack_max) range matching the histogram's bin assignment. Each filtered path is tagged with an _originalIndex so subsequent timing_highlight overlay lookups still resolve to the correct pre-rendered image.

Type of Change

  • Bug fix

Impact

  • Static reports only. Live WebSocket behavior is unchanged — the server-side STA filter is authoritative there.
  • Clicking a histogram column in a static report now narrows the timing view to paths in that bin, matching live-mode behavior and the user's visual intent.
  • Path selection in the filtered view highlights the correct timing path overlay via the preserved original index.

Verification

  • I have verified that the local build succeeds (bazel build //src/web/...).
  • I have run the relevant tests and they pass (bazel test //src/web/test/... — 18/18 pass, including the new timing_widget_test and expanded websocket_manager_test).
  • My code follows the repository's formatting guidelines.
  • I have signed my commits (DCO).

Added tests

  • test-websocket-manager.js: 6 new tests covering passthrough, [min, max) range, _originalIndex tagging, empty-range result, hold-side independence, and non-mutation of cached data.
  • test-timing-widget.js (new file): 4 tests covering row-index fallback, _originalIndex use, is_setup tab flag, and out-of-range guards.

Related Issues

Fixes #10020

…mode

When a slack histogram column is clicked, the timing view should show only
paths whose slack falls in that bin's range. In live WebSocket mode the
server performs this filtering, but in static page mode the cache handler
returned all paths regardless of slack_min/slack_max.

Filter cached paths client-side in WebSocketManager._cacheRequest using the
half-open [slack_min, slack_max) range matching the histogram's bin
assignment. Tag each filtered path with _originalIndex so subsequent
timing_highlight overlay lookups resolve to the correct pre-rendered image.
Use _originalIndex in TimingWidget._selectPathRow when present.

Fixes The-OpenROAD-Project#10020

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

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@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 implements slack range filtering for timing reports and introduces an _originalIndex property to maintain correct path highlighting when filters are applied. It also adds comprehensive unit tests for the TimingWidget and WebSocketManager. The review feedback identifies a missing update in _selectDetailRow that causes incorrect highlights when selecting pins in the detail table and suggests a more memory-efficient approach for filtering paths in the WebSocketManager to reduce garbage collection pressure.

Comment thread src/web/src/timing-widget.js
Comment thread src/web/src/websocket-manager.js Outdated
Use _originalIndex in _selectDetailRow so pin overlay requests match
the backend when paths are narrowed by histogram slack filter. Also
fuse the filter map+filter into a single pass to avoid allocating a
clone for every path in the unfiltered report.

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

Copy link
Copy Markdown
Member

@codex review

@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@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: d2fee8e0fb

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

&& json.paths) {
const filtered = [];
json.paths.forEach((p, i) => {
if (p.slack >= msg.slack_min && p.slack < msg.slack_max) {

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 Include last-bin upper-edge slacks in static filtering

This new static-mode filter excludes p.slack === msg.slack_max unconditionally, but the histogram binning logic counts max-edge values in the last bin (it clamps computed bin indices to the final bin). As a result, clicking the last histogram bar can omit some paths that were counted in that bar, so the path table no longer matches the bar count and those max-edge paths cannot be selected/highlighted.

Useful? React with 👍 / 👎.

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.

Fair but just a limitation of having only the top N paths available.

@maliberty maliberty enabled auto-merge April 15, 2026 06:26
@maliberty maliberty merged commit 2c25352 into The-OpenROAD-Project:master Apr 15, 2026
15 of 16 checks passed
@maliberty maliberty deleted the web-static-chart branch April 15, 2026 06:59
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.

Feature Proposal: Static HTML Timing Report

2 participants