Skip to content

odb: Validate 3dbv region coordinate count (#10460)#10623

Merged
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
KMohnishM:fix-3dbv-coords-10460
Jun 9, 2026
Merged

odb: Validate 3dbv region coordinate count (#10460)#10623
maliberty merged 1 commit into
The-OpenROAD-Project:masterfrom
KMohnishM:fix-3dbv-coords-10460

Conversation

@KMohnishM

Copy link
Copy Markdown
Contributor

Summary

Enforce and validate coordinate count when parsing 3dbv regions in DbvParser::parseRegion.

  • Validates that the coords node is present on a region (logs ODB-0521 if missing).
  • Ensures that exactly 4 coordinates are defined (representing a standard rectangular bounding box).
  • Emits a clean error if the coordinate count is incorrect, including a specific note if the count is > 4 stating that polygonal regions are not yet supported.
  • Fixes the existing test (example.3dbv and golden file write_3dbv.3dbvok) where front_reg lacked coordinates.
  • Adds new integration tests (example_no_coords.3dbv and example_polygon.3dbv) to prevent future regressions.

Type of Change

  • Bug fix
  • New feature

Impact

Attempts to load a 3dbv file containing a region with missing or polygonal coordinates will now fail immediately with a clean error message (ODB-0521) rather than propagating uninitialized bounding boxes.

Verification

  • I have verified that the local build succeeds (./etc/Build.sh).
  • I have run the relevant tests and they pass.
  • My code follows the repository's formatting guidelines.
  • I have included tests to prevent regressions.
  • I have signed my commits (DCO).

Related Issues

Closes #10460

@KMohnishM KMohnishM requested a review from a team as a code owner June 9, 2026 09:40
@KMohnishM KMohnishM requested a review from maliberty June 9, 2026 09:40
@github-actions github-actions Bot added the size/M label Jun 9, 2026

@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 validation for 3DBV region coordinates, ensuring they are specified and contain exactly four coordinates, as polygonal regions are not yet supported. It also adds corresponding test cases to verify these validation errors. The review feedback correctly identifies a bug in the new Tcl test script where exact string matching is used on the error message, which will cause the tests to fail because the error message contains additional formatting. Using regexp to match the error ID is recommended.

Comment thread src/odb/test/read_3dbv_fail.tcl Outdated
Comment thread src/odb/test/read_3dbv_fail.tcl Outdated

@github-actions github-actions 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.

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!

@KMohnishM KMohnishM force-pushed the fix-3dbv-coords-10460 branch from 28db84b to 29c0137 Compare June 9, 2026 09:42
@maliberty

Copy link
Copy Markdown
Member

Thanks for contributing. odb.write_3dbv.tcl is failing.

Comment thread src/odb/test/write_3dbv.3dbvok Outdated
Comment on lines +36 to +37
- [0, 1082] No newline at end of file
- [0, 1082]

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.

This looks like a mistakenly added whitespace.

@KMohnishM KMohnishM force-pushed the fix-3dbv-coords-10460 branch from 29c0137 to 06c01f9 Compare June 9, 2026 15:25
@KMohnishM

Copy link
Copy Markdown
Contributor Author

Thanks for the review @maliberty ! I have cleaned up the trailing whitespace/newlines in write_3dbv.3dbvok to match master's formatting.

I also formatted the Bazel BUILD file with buildifier to resolve the failing lint check and addressed the code review feedback by using regexp in read_3dbv_fail.tcl. Everything should compile and pass successfully now.

@maliberty maliberty merged commit 065077a into The-OpenROAD-Project:master Jun 9, 2026
16 checks passed
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.

3dbv: Error when a region does not specify exactly 4 coordinates

2 participants