Repository navigation
Skip occupied IDs when appending HDF5 episodes - #9342
weakriver3000 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Isaac Lab Review Bot
Needs attention: Implementation (1). Other reviewed categories look good.
- PR description: The title and body match the numbering fix, count correction, changelog, and reopen regression; reported Windows validation is scoped clearly, and no measurable performance claim requires benchmarks.
- Design and architecture: Architecture looks good.
- Scope and over-engineering: No over-engineering issues.
- API: API changes look good.
- Compatibility and deprecation: No breaking changes identified.
- Implementation: The shared duplicate guard repeats an HDF5 lookup after automatic allocation establishes absence; move that guard into the explicit-ID branch.
- Style consistency: Style consistency looks good.
- Test quality: Test quality looks good.
Minor fixes needed. Posted 1 inline finding.
Automated review; human maintainers own approval decisions.
| next_demo_id = self._next_demo_id | ||
| while f"demo_{next_demo_id}" in self._hdf5_data_group: | ||
| next_demo_id += 1 | ||
| episode_group_name = f"demo_{next_demo_id}" |
There was a problem hiding this comment.
🟡 Warning · Implementation — Avoid the second membership lookup
The loop establishes that the automatic ID is free, but the shared duplicate check queries HDF5 again on every automatic write. Check duplicates only in the explicit-ID branch.
Confidence Score: 5/5
[Medium impact] The PR appears safe to merge; both automatic and explicit writes remain protected against occupied IDs. SummaryAutomatic HDF5 episode IDs skip occupied names, while explicitly numbered episodes count toward the total.
Reviews (2) · Last reviewed commit: "Avoid redundant HDF5 episode ID lookup" · Reviewed by Greptile |
Fixes #9341.
Automatic episode numbering skips occupied IDs. Explicit duplicate IDs still raise
ValueError, and the episode count includes explicitly numbered entries.The regression test reproduces the collision after reopening the file and verifies that the append preserves the existing episode. The HDF5 test file had 5 passes and 1 POSIX-only test skipped on Windows. All applicable repository-wide pre-commit checks passed.