Skip to content

odb: resume the outer ECO journal after a nested commit/undo - #11571

Open
maliberty wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:odb-nested-eco-resume
Open

maliberty wants to merge 2 commits into
The-OpenROAD-Project:masterfrom
The-OpenROAD-Project-staging:odb-nested-eco-resume

Conversation

@maliberty

@maliberty maliberty commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

A nested beginEco sets the enclosing journal aside on the ECO stack. When the inner ECO finished, commitEco/undoEco left no journal active, so edits made after that point were not recorded and the outer undoEco could not revert them. This affected both nested undo (the reported case) and nested commit.

  • Each ECO stack entry now records whether a nested beginEco set it aside or endEco stopped it.
  • After an inner commit or undo, a set-aside outer journal becomes active again. A journal stopped by endEco stays stopped, which is how rmp and the replace_hier_mod_undo tests use it.
  • Added three TestJournal cases: nested undo then edit, nested commit then edit, and endEco followed by a nested commit.

Fixes The-OpenROAD-Project-private/OpenROAD#3836

A nested beginEco suspended the enclosing journal on the ECO stack, but
commitEco/undoEco of the inner ECO left no active journal. Edits made
after the inner ECO ended were not recorded, so the outer undoEco did not
revert them.

The stack now records whether an entry was suspended by a nested
beginEco (resumed after the inner ECO ends) or stopped by endEco (stays
stopped).

Fixes The-OpenROAD-Project-private/OpenROAD#3836

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty maliberty self-assigned this Sep 29, 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 support for nested ECOs (Engineering Change Order) in OpenDB by refactoring the journal stack to track suspended journals and adding a helper function to resume them. It also includes comprehensive unit tests for nested undo and commit behaviors. The review feedback suggests adding assertions in resumeSuspendedEco to verify state validity before resuming a journal, and setting block->journal_ to nullptr immediately after pushing to the stack in beginEco to ensure exception safety in case of allocation failures.

Comment thread src/odb/src/db/dbDatabase.cpp
Comment thread src/odb/src/db/dbDatabase.cpp
@maliberty

Copy link
Copy Markdown
Member Author

@codex review

Signed-off-by: Matt Liberty <mliberty@precisioninno.com>
@maliberty
maliberty marked this pull request as ready for review September 29, 2026 17:27
@maliberty
maliberty requested a review from a team as a code owner September 29, 2026 17:27
@maliberty maliberty closed this Oct 3, 2026
@maliberty maliberty reopened this Oct 3, 2026
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