Repository navigation
Conversation
The scale operation of the rigid body mass, inertia, actuator gain, joint parameter and fixed tendon randomization terms validated the distribution parameters as a (low, high) range for every distribution. With distribution="gaussian" the parameters are (mean, std), so a valid configuration such as (0.5, 0.1) was rejected with "upper bound (0.1) must be ≥ lower bound (0.5)". Pass the distribution to _validate_scale_range. For gaussian it checks the mean with the existing lower-bound rules and requires a non-negative standard deviation. Uniform and log-uniform ranges are checked as before. Fixes #3514 Signed-off-by: Lim-jooyoung <mmporong@gmail.com>
|
run-ci |
There was a problem hiding this comment.
Isaac Lab Review Bot
The change correctly makes scale validation distribution-aware across the five affected event terms, interpreting gaussian parameters as (mean, std) while preserving range validation for uniform and log-uniform distributions. Documentation, changelog, and focused regression coverage accompany the implementation.
- Design and architecture: Validation remains centralized in the existing private
_validate_scale_rangehelper. Each of the nine affected parameter paths forwards the event term’s configured distribution, with the default aligned to the corresponding__call__default. Gaussian sampling remains unbounded, so validation intentionally constrains the configured mean and standard deviation rather than guaranteeing every sampled multiplier is non-negative. - API: The private helper gains a keyword-only argument with a default, preserving existing internal call compatibility. Public event-term signatures are unchanged, constructor error documentation is updated, and the package changelog records the corrected gaussian parameter semantics.
- Implementation: The validator preserves existing positivity and zero constraints on the first parameter, retains ordering checks for uniform and log-uniform ranges, and adds the appropriate non-negative standard-deviation check for gaussian parameters. The focused test exercises mass-term construction; the remaining affected paths use the same helper and were traced to ensure they pass their configured distribution consistently.
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.
|
| pytest.param("uniform", (0.5, 0.1), "upper bound", id="uniform-reversed-range"), | ||
| ], | ||
| ) | ||
| def test_scale_range_validation_follows_distribution(distribution, params, error) -> None: |
There was a problem hiding this comment.
Other terms lack test coverage The new cases construct only
randomize_rigid_body_mass, but this change updates nine validation calls across five terms. A missed or mismatched call in another term would go unnoticed. Please add construction-time cases for the other terms, including a field that allows zero and a term with multiple distribution parameters.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Extend the scale validation test to randomize_rigid_body_inertia, randomize_actuator_gains, randomize_joint_parameters and randomize_fixed_tendon_parameters, so each of the nine _validate_scale_range calls is exercised at term construction. Add rows for a field that allows a zero mean (tendon damping) and one that does not (tendon stiffness), and check the uniform fallback when no distribution is given. Signed-off-by: Lim-jooyoung <mmporong@gmail.com>
|
run-ci |
…ibutions (#8127) # Description Manager term constructors currently repeat defaults already declared in their callable signatures. This can make construction disagree with execution: omitting an optional `operation` raises `KeyError` in several randomization terms, and Gaussian mass scaling `(0.5, 0.1)` is rejected as a reversed `(low, high)` range. Resolve omitted keyword defaults into the term's existing `params` mapping before construction and scene resolution. The stable and experimental managers share the implementation; mutable defaults are copied per term and explicit values, including `None`, are preserved. Direct class construction receives the same defaults after `super().__init__`. Backend and task constructors now consume those resolved parameters. Observation-manager `out` buffers remain manager-owned, and task guards for required values now check `None` where appropriate. Replace scale-only validation with distribution-aware construction checks for mass, inertia, actuator gains, joint parameters, and fixed tendons. Gaussian parameters are `(mean, std)`, uniform ranges remain ordered, log-uniform bounds must be positive, and non-finite parameters fail early. These checks cover `add`, `abs`, and `scale`; the existing scale-sign policy remains separate from distribution validity. Exception documentation uses one `ValueError` entry per constructor. No validation or signature inspection is added to simulation/reset loops. Runtime parameter changes continue through the same mapping; this change does not add revalidation of arbitrary mutations after construction. A positive Gaussian mean still does not guarantee positive samples. Fixes #3514. This is a broader alternative to #8123, with shared parameter-default resolution and repository-wide adoption. ## Validation - **183 passed across 15 test files**, each run in its own process: stable manager suites; event requirements; camera terms and camera/manager integration; experimental frontend and reward parity; task curricula; PhysX, Newton and OVPhysX event integration. - Confirmed the default-resolution regression fails when default population is disabled, and the Gaussian regression fails against the original mass constructor with the reported bound-order error. - `uv run isaaclab -f` and the changelog gate passed against the upstream PR base; GitHub pre-commit and changelog checks also passed. - Clean `uv run isaaclab --docs` build passed with warnings treated as errors; the final incremental build also passed. - Existing dependency deprecation warnings remain in test output. ## Type of change - Bug fix ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the test-audit criteria - [x] I have added a changelog fragment for every touched package - [x] My name already exists in `CONTRIBUTORS.md` --------- Co-authored-by: Octi Zhang <zhengyuz@nvidia.com>
…ibutions (#8127) # Description Manager term constructors currently repeat defaults already declared in their callable signatures. This can make construction disagree with execution: omitting an optional `operation` raises `KeyError` in several randomization terms, and Gaussian mass scaling `(0.5, 0.1)` is rejected as a reversed `(low, high)` range. Resolve omitted keyword defaults into the term's existing `params` mapping before construction and scene resolution. The stable and experimental managers share the implementation; mutable defaults are copied per term and explicit values, including `None`, are preserved. Direct class construction receives the same defaults after `super().__init__`. Backend and task constructors now consume those resolved parameters. Observation-manager `out` buffers remain manager-owned, and task guards for required values now check `None` where appropriate. Replace scale-only validation with distribution-aware construction checks for mass, inertia, actuator gains, joint parameters, and fixed tendons. Gaussian parameters are `(mean, std)`, uniform ranges remain ordered, log-uniform bounds must be positive, and non-finite parameters fail early. These checks cover `add`, `abs`, and `scale`; the existing scale-sign policy remains separate from distribution validity. Exception documentation uses one `ValueError` entry per constructor. No validation or signature inspection is added to simulation/reset loops. Runtime parameter changes continue through the same mapping; this change does not add revalidation of arbitrary mutations after construction. A positive Gaussian mean still does not guarantee positive samples. Fixes #3514. This is a broader alternative to #8123, with shared parameter-default resolution and repository-wide adoption. ## Validation - **183 passed across 15 test files**, each run in its own process: stable manager suites; event requirements; camera terms and camera/manager integration; experimental frontend and reward parity; task curricula; PhysX, Newton and OVPhysX event integration. - Confirmed the default-resolution regression fails when default population is disabled, and the Gaussian regression fails against the original mass constructor with the reported bound-order error. - `uv run isaaclab -f` and the changelog gate passed against the upstream PR base; GitHub pre-commit and changelog checks also passed. - Clean `uv run isaaclab --docs` build passed with warnings treated as errors; the final incremental build also passed. - Existing dependency deprecation warnings remain in test output. ## Type of change - Bug fix ## Release backport - [x] <!-- backport-active-release --> Backport this pull request to the active release branch after it merges into `develop` ## Checklist - [x] I have read and understood the contribution guidelines - [x] I have run the pre-commit checks with `uv run isaaclab --format` - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have validated the changed behavior with focused coverage and applied the test-audit criteria - [x] I have added a changelog fragment for every touched package - [x] My name already exists in `CONTRIBUTORS.md` --------- Co-authored-by: Octi Zhang <zhengyuz@nvidia.com> (cherry picked from commit e73d1f1)
|
This is now resolved by #8127 which does a more broader fix of this issue across the codebase |
Description
randomize_rigid_body_mass,randomize_rigid_body_inertia,randomize_actuator_gains,randomize_joint_parametersandrandomize_fixed_tendon_parameterscheck their*_distribution_paramswith_validate_scale_rangewhenoperation="scale". That check, added in #3058, treats the parameters as a(low, high)range for every distribution, but withdistribution="gaussian"they are(mean, std). The configuration from the issue,fails at term construction with
ValueError: mass_distribution_params: upper bound (0.1) must be ≥ lower bound (0.5).This PR passes the term's
distribution(default"uniform", the same default as the term's__call__) to_validate_scale_rangeat all nine call sites. For gaussian parameters the function now:0.0) is still rejected. Gaussian samples are unbounded, so this checks the configuration, not every sampled scale;standard deviation must be ≥ 0.developalready rejected such a configuration, but as an upper/lower-bound ordering error.uniformandlog_uniformranges are accepted and rejected as before. The docstrings of the five terms list the new error.Tested without Isaac Sim, on CPU in an Ubuntu 24.04 Docker container (Python 3.12, torch 2.12.0 CPU wheel,
isaaclab,isaaclab_physxandisaaclab_contribinstalled in editable mode):test_scale_range_validation_follows_distributioninsource/isaaclab/test/envs/test_event_requirements.pybuildsrandomize_rigid_body_masswith aSimpleNamespaceenv. Ondevelopthe valid gaussian case fails with the error from the issue, and the negative-std and zero-mean cases fail becausedeveloprejects them with the (low, high) wording; the uniform case passes. With this change all four pass.source/isaaclab/test/envs/test_event_requirements.py: 10 passed.source/isaaclab/test/managers/test_event_manager.py: 14 passed..pre-commit-config.yamlpass on the changed files (run withpre-commit run --files).The issue is assigned. If a fix is already in progress there, I am happy to close this one.
This PR was prepared with Claude Code (Claude Opus 5.5): the code change, the test, the verification and this description.
Fixes #3514
Type of change
Release backport
developScreenshots
Not applicable.
Checklist
Docker and GPU tests run on demand. Push the commits you want tested, then
comment
run-cion the pull request.pre-commitchecks withuv run isaaclab --formatsource/<pkg>/changelog.d/for every touched package (do not editCHANGELOG.rstor bump package versions — CI handles that)CONTRIBUTORS.mdor my name already exists there