web: hierarchy browser in static reports, search race fix, module coloring fixes#10288
Conversation
Six search methods (searchBoxShapes, searchSNetViaShapes, searchSNetShapes, searchBlockages, searchObstructions, searchRows) returned lazy R-tree iterators without holding a lock. When the background eagerInit thread was concurrently building R-trees, a tile request could iterate a partially-constructed or destroyed R-tree, causing a segfault. Fix: hold a shared_lock on the init mutex and eagerly materialize results into a vector before returning, matching the existing pattern used by searchInsts and searchFills. Signed-off-by: Matt Liberty <mliberty@eng.ucsd.edu> Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Add module hierarchy data and colored _modules tiles to the static HTML report so the hierarchy browser works in offline mode. Server-side changes: - New module_color_palette.h: shared 31-color palette (single source of truth, previously duplicated in JS and Qt GUI). - HierarchyReport::getReport() assigns palette colors to MODULE nodes. - New serializeHierarchyResult() and computeDefaultModuleColors() shared helpers in hierarchy_report.cpp, used by both the WebSocket handler and saveReport(). - saveReport() embeds module_hierarchy JSON in the static cache and pre-renders _modules layer tiles with default module colors. Client-side changes: - hierarchy-browser.js reads server-assigned colors instead of maintaining a local palette copy. Removes MODULE_COLORS constant and _assignColors(); adds _readServerColors(). - Auto-loads hierarchy data in static mode. - websocket-manager.js: set_module_colors is a no-op in static mode (tiles are pre-rendered); module_hierarchy served from JSON cache. Signed-off-by: Matt Liberty <mliberty@eng.ucsd.edu> Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
…cells Two fixes to the _modules layer coloring: - Always include expanded modules in the color map. Previously, expanded modules with child modules were excluded, causing their direct leaf instances to lose color. The tile renderer looks up each instance's direct module, so parent and child colors never conflict. - Skip fill cells (CORE_SPACER) in the _modules layer rendering. These are physical-only cells that add visual noise to the module color overlay. Signed-off-by: Matt Liberty <mliberty@eng.ucsd.edu> Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
Use designated initializers for Color in hierarchy_report.h, and NOLINT the palette data table in module_color_palette.h where designated initializers would obscure the color data. Signed-off-by: Matt Liberty <mliberty@eng.ucsd.edu> Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
There was a problem hiding this comment.
Code Review
This pull request introduces module hierarchy reporting and visualization support, including a color palette for modules, server-side serialization, and integration into the static report generation. Additionally, it improves thread safety in the search module by replacing lazy R-tree iterators with eager collection under shared locks. The review comments suggest refactoring the repetitive mutex locking and R-tree access logic into helper functions to improve maintainability and reduce code duplication.
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
|
clang-tidy review says "All clean, LGTM! 👍" |
bf0b749
into
The-OpenROAD-Project:master
Summary
-webstartupweb_save_report)Type of Change
Impact
Search race fix: Six search methods returned lazy R-tree iterators without holding a lock. When the background
eagerInitthread was concurrently building R-trees, tile requests could iterate partially-constructed trees, causing a segfault. Now all search methods eagerly materialize results under ashared_lock, matching the existing pattern used bysearchInstsandsearchFills.Static hierarchy browser: The static HTML report now embeds module hierarchy data and pre-rendered
_moduleslayer tiles. The hierarchy browser auto-loads in static mode. The 31-color palette is consolidated into a singlemodule_color_palette.h(previously duplicated in JS and C++). The server assigns colors inHierarchyReport::getReport()and the JS client reads them from the response.Module coloring fixes: Expanded modules with child modules are no longer excluded from the color map — their direct leaf instances retain color since the tile renderer looks up each instance's direct module. Fill cells (
CORE_SPACER) are skipped in the_moduleslayer to reduce visual noise.Verification
bazel test //src/web/test/...— 23/23 pass).