Skip to content

drt: preserve top-layer wrong-way tracks#10875

Open
naveenvenk17 wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
naveenvenk17:nv-drt-restore-full-grid-10873
Open

drt: preserve top-layer wrong-way tracks#10875
naveenvenk17 wants to merge 1 commit into
The-OpenROAD-Project:masterfrom
naveenvenk17:nv-drt-restore-full-grid-10873

Conversation

@naveenvenk17

@naveenvenk17 naveenvenk17 commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Fixes #10873.

The regression came from dropping all track data above TOP_ROUTING_LAYER. The top routing layer uses coordinates from the next routing layer to create wrong-way edges and to build the maze x/y coordinate union. Removing those coordinates left valid routes without a path.

Keep the reduced z dimension, but collect tracks from the first routing layer above TOP_ROUTING_LAYER. That preserves the memory optimization while restoring the missing top-layer topology.

Tested on the GCP Linux VM:

  • The supplied tiny_rocket/IHP130 replay passed the original 50% and 70% failure points without DRT-0255.
  • Replay completed optimization iterations 0 and 1, then entered iteration 2 before the 20-minute cap.
  • Peak reported memory was 1650 MB. The full-grid rollback reached about 1900 MB.
  • All 26 //src/drt/test:all targets passed after rebasing onto current master.
  • Bazel --config=lint build for //src/drt:drt passed.
  • Stamped //:openroad build passed.
  • clang-format and git diff --check passed.

@naveenvenk17
naveenvenk17 requested a review from a team as a code owner July 10, 2026 18:50
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to OpenROAD! Thanks for opening your first PR.
Before we review:

Please ensure:

  • CI passes
  • Code is properly formatted
  • Tests are included where applicable
    A maintainer will review shortly!

@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 removes the logic that limits grid graph layers and fixed-shape costing to the TOP_ROUTING_LAYER threshold. Specifically, it removes the layer-skipping checks based on the grid graph's minimum/maximum layer numbers and the top routing layer configuration in both FlexDR_init.cpp and FlexGridGraph.cpp. There are no review comments, so I have no feedback to provide.

@maliberty

Copy link
Copy Markdown
Member

@mguthaus FYI

@mguthaus

Copy link
Copy Markdown
Contributor

Sounds like it's best to keep it removed. I'm not an expert in the DRT module and was just going for an easy reduction but obviously this isn't that.

@osamahammad21

Copy link
Copy Markdown
Member

The regression is narrower than the grid needing the full stack. The top routing layer gets its wrong-way edges from the tracks of the layer above it, and those track coords also feed the maze x/y coordinate union. So trimming the upper layers out of initTracks deleted all wrong-way edges on the top routing layer plus some nodes below, which is what breaks the maze search here.

None of that needs grid z-planes above the top routing layer, and that's where the memory win comes from. So we can keep collecting tracks one layer above TOP_ROUTING_LAYER while still trimming the z dimension.

Signed-off-by: Naveen Venkat <archgen.guest@nyayanidhi.in>
@naveenvenk17 naveenvenk17 changed the title drt: restore full routing-layer grid drt: preserve top-layer wrong-way tracks Jul 14, 2026
@naveenvenk17
naveenvenk17 force-pushed the nv-drt-restore-full-grid-10873 branch from ec98015 to 6d51dd4 Compare July 14, 2026 19:41
@naveenvenk17

Copy link
Copy Markdown
Contributor Author

Thanks, this was the right split. I updated the patch to keep the reduced z dimension and collect track coordinates from only the first routing layer above TOP_ROUTING_LAYER.

The supplied replay now passes both original failure points, completes iterations 0 and 1, and enters iteration 2 before the 20-minute cap. No DRT-0255 appears. Peak reported memory was 1650 MB, compared with about 1900 MB for the full-grid rollback. I also rebased onto current master and reran all 26 DRT tests, the DRT lint build, and the stamped OpenROAD build.

Comment on lines +475 to +482
// Do not add z planes above TOP_ROUTING_LAYER. Keep tracks from the first
// routing layer above it because initEdges uses those coordinates for
// wrong-way edges on the top routing layer.
const bool aboveTop = currLayerNum > router_cfg_->TOP_ROUTING_LAYER;
if (aboveTop && collectedAboveTopTracks) {
continue;
}
collectedAboveTopTracks = aboveTop;

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.

Easier to read and interpret.

Suggested change
// Do not add z planes above TOP_ROUTING_LAYER. Keep tracks from the first
// routing layer above it because initEdges uses those coordinates for
// wrong-way edges on the top routing layer.
const bool aboveTop = currLayerNum > router_cfg_->TOP_ROUTING_LAYER;
if (aboveTop && collectedAboveTopTracks) {
continue;
}
collectedAboveTopTracks = aboveTop;
if (currLayerNum - 2 > router_cfg_->TOP_ROUTING_LAYER) {
continue;
}

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.

DRT Maze Route cannot find path failure

4 participants