Preserve HDF5 environment arguments across file lifecycles - #7309
Preserve HDF5 environment arguments across file lifecycles#7309CoffeeDrivenCoder wants to merge 1 commit into
Conversation
Read environment arguments from the active dataset before merging updates so reopened files retain their metadata and reused handlers do not leak state between files. Fixes isaac-sim#7308 Signed-off-by: CoffeeDrivenCoder <wangke088@zju.edu.cn>
There was a problem hiding this comment.
Isaac Lab Review Bot
The change makes the active HDF5 data group's persisted env_args attribute the source of truth when merging updates, addressing both metadata loss after reopening and metadata leakage when reusing a handler.
- Design and architecture: The revised ownership model is consistent with
get_env_name(), which already reads persisted metadata directly. It removes reliance on handler-lifetime cache state without introducing new abstractions or dependencies. - API: Public signatures and the on-disk JSON representation remain unchanged.
create(),set_env_name(), andget_env_name()retain their existing contracts, and the package includes an appropriately scoped changelog fragment. - Implementation: The create/reuse and close/reopen(
r+)/update paths were traced. Reading the active group's attribute before each merge preserves existing values, while a newly created group starts from an empty mapping. The two focused regression tests cover both lifecycle failures. Re-parsing the small JSON attribute on each update is an intentional, non-blocking tradeoff for avoiding stale instance state.
No blocking issues. No inline issue met the actionable-evidence threshold; the assessment above records the review feedback.
Automated review; human maintainers own approval decisions.
Greptile SummaryThis PR makes the active HDF5 data group the source of truth when environment arguments are updated, preserving metadata across reopen operations while preventing handler state from leaking into newly created datasets.
Confidence Score: 5/5The PR appears safe to merge, with the changed metadata lifecycle behavior covered by focused regression tests and no actionable defects identified. The handler now consistently merges against metadata stored in the active HDF5 group, preserving reopened-file arguments and preventing state from a previously closed file from contaminating a newly created dataset. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[add_env_args called] --> B{Active data group has env_args?}
B -- Yes --> C[Deserialize persisted mapping]
B -- No --> D[Start with empty mapping]
C --> E[Merge supplied arguments]
D --> E
E --> F[Serialize mapping to active data group]
Reviews (1): Last reviewed commit: "Preserve HDF5 environment arguments" | Re-trigger Greptile |
Description
HDF5DatasetFileHandlerpreviously treated its instance-level_env_argscache as the source of truth. A freshhandler opened in
r+mode therefore replaced the dataset's existing environment arguments when adding a field,while a reused handler carried custom arguments from a closed dataset into a newly created one.
This change reads the
env_argsattribute from the active HDF5 data group before merging updates. Existing metadatais preserved after reopening, and a new data group starts with an empty mapping regardless of handler history.
Fixes #7308
No new dependencies are required.
Type of change
Screenshots
Not applicable; this change affects dataset metadata serialization.
Validation
2 failed, 3 deselected.5 passed(CPU and CUDA coverage included).Checklist
pre-commitchecks with./isaaclab.sh --format(focused Ruff lint and format checks pass; the full repository hook suite is left to CI)source/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bumpextension.toml— CI handles that)CONTRIBUTORS.mdor my name already exists there