Skip to content

objects_finalized template#437

Merged
lwaern-intel merged 4 commits into
intel:mainfrom
lwaern-intel:lw/objects_finalized
May 25, 2026
Merged

objects_finalized template#437
lwaern-intel merged 4 commits into
intel:mainfrom
lwaern-intel:lw/objects_finalized

Conversation

@lwaern-intel
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds an objects_finalized lifecycle hook/template for DML 1.4 devices that runs after successful configuration, updates code generation to invoke it, and documents the behavior alongside immediate-after semantics.

Changes:

  • Introduce objects_finalized template in DML 1.4 builtins and wire it into the device template.
  • Update C backend generation to invoke _objects_finalized before executing immediate-after callbacks.
  • Add a DML+Python test plus documentation/release note updates describing the new hook.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/1.4/lib/T_objects_finalized.py Adds a test that asserts objects_finalized() ran for device and subdevice instances.
test/1.4/lib/T_objects_finalized.dml Defines a test device/subdevice using the new objects_finalized template and verifies immediate-after ordering.
py/dml/c_backend.py Emits a call to _objects_finalized in the generated Simics objects_finalized hook (for non-1.2).
lib/1.4/dml-builtins.dml Adds the objects_finalized template and integrates it into the built-in device template.
doc/1.4/language.md Documents that immediate-after callbacks during configuration run during the Simics objects_finalized hook after objects_finalized() calls.
RELEASENOTES-1.4.md Notes the addition of the objects_finalized template/hook.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/1.4/lib/T_objects_finalized.py Outdated
Comment thread py/dml/c_backend.py
Comment thread lib/1.4/dml-builtins.dml Outdated
Comment thread lib/1.4/dml-builtins.dml Outdated
Comment thread RELEASENOTES-1.4.md Outdated
@lwaern-intel lwaern-intel force-pushed the lw/objects_finalized branch from 22a583f to a24eee2 Compare April 22, 2026 13:33
@syssimics
Copy link
Copy Markdown
Contributor

PR Verification: ✅ success

@syssimics
Copy link
Copy Markdown
Contributor

PR Verification: ✅ success

Comment thread doc/1.4/language.md Outdated
Comment thread lib/1.4/dml-builtins.dml
Comment on lines +16 to +17
assert SIM_object_is_configured(dev.obj);
assert SIM_object_is_configured(partner.obj);
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.

move to s.objects_finalized(), which is called before?

Copy link
Copy Markdown
Contributor Author

@lwaern-intel lwaern-intel May 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eh. s is really just a test that objects_finalized is recursively invoked using the same mechanism as init, post_init, etc. For readability, I prefer all the "main" tests are centralized in top-level init(). Unless you insist.

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.

What I meant: s.objects_finalized is called before, so if the intent is to check that it's set early then it is slightly stronger to test that it's configured in s.objects_finalized vs dev.objects_finalized.

I do not insist, the gain is miniscule and if you prefer current for readability then that's probably worth more.

Comment thread test/1.4/lib/T_objects_finalized.dml
@mandolaerik
Copy link
Copy Markdown
Contributor

Looks good overall

@lwaern-intel lwaern-intel force-pushed the lw/objects_finalized branch from a24eee2 to 38301e5 Compare May 11, 2026 11:34
@syssimics syssimics requested a review from mandolaerik May 11, 2026 11:34
@syssimics
Copy link
Copy Markdown
Contributor

DML Verification : 6: ❌ failure

@syssimics
Copy link
Copy Markdown
Contributor

DML Verification : 7: ❌ failure

@lwaern-intel lwaern-intel force-pushed the lw/objects_finalized branch 2 times, most recently from 692235d to 2adb363 Compare May 11, 2026 11:47
@syssimics
Copy link
Copy Markdown
Contributor

PR Verification: ❌ failure

@syssimics
Copy link
Copy Markdown
Contributor

PR Verification: ✅ success

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comment thread test/1.4/lib/T_objects_finalized.py Outdated
…zed`

This *was* possible, contrary to the guarantee we now explicitly document, if
`SIM_process_pending_work()` were to be called as part of object configuration.
I don't know why in the world anyone would *ever* do that, but hey, now it
wouldn't cause issue.
@lwaern-intel lwaern-intel force-pushed the lw/objects_finalized branch from d16c5eb to 164dcb3 Compare May 15, 2026 11:58
@lwaern-intel lwaern-intel requested a review from Copilot May 15, 2026 12:04
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

@syssimics
Copy link
Copy Markdown
Contributor

PR Verification: ✅ success

@syssimics
Copy link
Copy Markdown
Contributor

PR Verification: ✅ success

@lwaern-intel lwaern-intel merged commit 8a45fe5 into intel:main May 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants