Repository navigation
Fixes false conflict error for aliased global presets in Hydra - #5130
Conversation
…alse conflict error when two global presets resolve to the same value for a path (e.g. ``newton`` aliased to ``cube``).
~isaaclab_tasks.utils.hydra.apply_overrides raising a f…There was a problem hiding this comment.
🤖 Isaac Lab Review Bot
Summary
Fixes a false-positive conflict error in apply_overrides() when two global presets resolve to the same value for a given config path. This is a real-world pattern in dexsuite where aliases like newton = cube produce separate but equal dataclass instances.
Design Assessment
Correct and minimal. The fix adds value-equality checking before raising the conflict error, using the idiomatic if prev_val is not cur_val and prev_val != cur_val pattern — identity check as a fast-path, then __eq__ fallback. This is the right approach: reject genuinely conflicting values, silently accept duplicates that agree.
The applied_by dict now only records the first preset that claims a path (via the else branch). When a later preset matches the same path with an equal value, it's allowed through but the original claimant is preserved. This is semantically sound — the first writer wins for tracking, and duplicates are harmless.
Architecture Impact
None. This is a narrowly-scoped behavioral fix in the preset resolution logic. No API changes, no new dependencies, no schema changes.
Implementation Verdict
✅ Approve — Clean, correct fix with proper test coverage.
Test Coverage
Good. New test test_apply_overrides_aliased_globals_no_conflict correctly:
- Creates two separate but equal
SharedCfginstances (assertsis notand==) - Registers them under different preset names (
cube,newton) - Verifies no exception is raised when both are applied as global presets
- Asserts the final config value is correct
The existing test_apply_overrides_conflicting_globals_raises test ensures genuinely conflicting presets (different values) still raise ValueError.
CI Status
⏳ pre-commit: pending (CI just started)
Other checks: labeler ✅, Detect Changes ✅, Detect Doc Build Type ✅, remaining pending.
Findings
| # | Severity | File | Details |
|---|---|---|---|
| 1 | nit | config/extension.toml |
Version jumps from 1.5.15 → 1.5.17, skipping 1.5.16. The CHANGELOG on develop already has a 1.5.16 entry, so 1.5.17 is correct — but note that extension.toml on develop still says 1.5.15 (appears another PR added the 1.5.16 changelog entry without bumping the toml). This will self-resolve on merge if the 1.5.16 PR merges first, but worth confirming merge order. |
| 2 | nit | utils/hydra.py:405 |
Minor style thought: the else branch means applied_by[full_path] is only set on first encounter. If the first preset later appears again for the same path in a different sec, the tracking is correct since full_path includes sec. No bug, just noting the subtlety is handled. |
Overall this is a clean, well-tested bug fix. Ship it. 🚀
| [package] | ||
|
|
||
| # Note: Semantic Versioning is used: https://semver.org/ | ||
| version = "1.5.15" |
There was a problem hiding this comment.
nit: Version jumps 1.5.15 → 1.5.17 (skipping 1.5.16). The develop branch CHANGELOG already has a 1.5.16 entry but extension.toml still says 1.5.15 there — looks like another PR added the changelog without bumping the toml. This is fine as long as that PR merges first, but worth confirming merge order to avoid version skew.
| if full_path in applied_by: | ||
| raise ValueError( | ||
| f"Conflicting global presets: '{applied_by[full_path]}' and '{name}' " | ||
| f"both define preset for '{full_path}'" |
There was a problem hiding this comment.
👍 Good use of the is not + != pattern — identity check as fast-path avoids potentially expensive __eq__ on large dataclass trees, with equality as the semantic fallback. Clean.
Greptile SummaryThis PR fixes a false-positive conflict error in
Confidence Score: 5/5Safe to merge — the logic change is minimal, well-tested, and correctly scoped. No P0 or P1 issues found. The only finding is a P2 style note about the version number skipping 1.5.16 in extension.toml, which does not affect runtime behavior or correctness. The core fix is logically sound: the is not … and … != guard correctly identifies genuinely conflicting values while tolerating equal-valued aliases, and all edge cases (3+ presets, same preset twice, mixed equal/unequal) behave correctly. source/isaaclab_tasks/config/extension.toml — version jumps from 1.5.15 to 1.5.17, skipping 1.5.16. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[apply_overrides called with global_presets list] --> B[Phase 1: Resolve preset selections from explicit preset_sel]
B --> C[For each name in global_presets / sec / path]
C --> D{name in path_presets?}
D -- No --> C
D -- Yes --> E{full_path already in applied_by?}
E -- No --> F[Store applied_by = name]
F --> G{full_path already in resolved?}
E -- Yes --> H[Fetch prev_val and cur_val from path_presets]
H --> I{prev_val is not cur_val AND prev_val != cur_val?}
I -- Yes: Real conflict --> J[raise ValueError: Conflicting global presets]
I -- No: Alias or same value --> G
G -- No --> K[resolved = sec, path, name]
G -- Yes --> C
K --> C
C --> L[Fill remaining paths with default preset]
L --> M[Phase 2: Apply resolved presets in depth order]
M --> N[Phase 3: Apply scalar overrides on top]
N --> O[Return env_cfg, agent_cfg]
Reviews (1): Last reviewed commit: "Fixed :func:`~isaaclab_tasks.utils.hydra..." | Re-trigger Greptile |
| @@ -1,7 +1,7 @@ | |||
| [package] | |||
|
|
|||
| # Note: Semantic Versioning is used: https://semver.org/ | |||
There was a problem hiding this comment.
The extension.toml on the base branch was at 1.5.15, but the CHANGELOG in that same base already contained a 1.5.16 (2026-03-24) entry. This PR bumps straight to 1.5.17, meaning version 1.5.16 will never exist in the extension metadata. Downstream tooling or users checking the installed extension version against the changelog may find the gap confusing.
If 1.5.16 was supposed to be released as a separate increment, the correct sequence would be to first land a commit that brings extension.toml to 1.5.16, then bump again to 1.5.17 here. If this is intentional (e.g., the two versions are being merged into a single release), a brief note in the PR or changelog explaining the skip would be helpful.
…-sim#5130) # Description Fixed :func:`~isaaclab_tasks.utils.hydra.apply_overrides` raising a false conflict error when two global presets resolve to the same value for a path (e.g. ``newton`` aliased to ``cube``). ## Type of change <!-- As you go through the list, delete the ones that are not applicable. --> - Bug fix (non-breaking change which fixes an issue) ## Screenshots Please attach before and after screenshots of the change if applicable. <!-- Example: | Before | After | | ------ | ----- | | _gif/png before_ | _gif/png after_ | To upload images to a PR -- simply drag and drop an image while in edit mode and it should upload the image directly. You can then paste that source into the above before/after sections. --> ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [x] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there <!-- As you go through the checklist above, you can mark something as done by putting an x character in it For example, - [x] I have done this task - [ ] I have not done this task --> Co-authored-by: HuiDong Chen <[email protected]>
Removed the stale file-level `@pytest.mark.xfail` decorator on `test_environments_newton` (the cited Hydra deep nesting issue was already resolved by PR #5029 and follow-ups #5130 / #5177). ## Checklist - [x] I have read and understood the [contribution guidelines](https://isaac-sim.github.io/IsaacLab/main/source/refs/contributing.html) - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
Description
Fixed :func:
~isaaclab_tasks.utils.hydra.apply_overridesraising a false conflict error when two global presets resolve to the same value for a path (e.g.newtonaliased tocube).Type of change
Screenshots
Please attach before and after screenshots of the change if applicable.
Checklist
pre-commitchecks with./isaaclab.sh --formatconfig/extension.tomlfileCONTRIBUTORS.mdor my name already exists there