Skip to content

Fix #103: soft restart with an inactive dependent domain - #105

Merged
MLopez-Ibanez merged 7 commits into
MLopez-Ibanez:masterfrom
Saethox:fix-103-soft-restart
Oct 27, 2026
Merged

MLopez-Ibanez merged 7 commits into
MLopez-Ibanez:masterfrom
Saethox:fix-103-soft-restart

Conversation

@Saethox

@Saethox Saethox commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

Fixes #103.

numeric.configurations.equal() computed the domain of each parameter before it looked at the parameter's value. When a parameter that defines a dependent domain is NA, getDependentBound() returns a single NA, and x_domain[[2L]] fails with subscript out of bounds. The domain is only used when the value is not NA, so it is now computed only then.

tests/testthat/test-bug-103.R adds:

  • a test that calls similarConfigurations() on two configurations in which the parameter that defines the dependent domain is inactive, once with equal and once with different values of the other parameter;
  • a test that calls irace() on the space from Soft restart fails when a dependent domain's parameter is inactive #103 for seeds 1 to 10 (seeds 3, 4, 5, 6, 9 and 10 failed before).

Saethox and others added 5 commits October 23, 2026 20:23
…oft restart with an inactive dependent domain.

When a parameter that defines a dependent domain is NA, getDependentBound()
returns a single NA, and `x_domain[[2L]]` fails with "subscript out of
bounds". The domain is only used when the value is not NA, so compute it
only then.

 * tests/testthat/test-bug-103.R: New.
 * NEWS.md: Mention the fix.
…odel. (fix MLopez-Ibanez#102)

Inside `[.data.table`, a column takes precedence over a local variable of
the same name, so a parameter column can shadow the local variables that an
expression reads. truncate_rows() subset its argument with
`-seq.int(n + 1L, nx)` and now truncates with head() instead.
generate_sobol() and sample_from_model() read `param` and `this_model`
inside data.table expressions; these now only call closures that are
defined before the subset. The random draws do not change.

 * tests/testthat/test-bug-102.R: New.
 * NEWS.md: Mention the fix.
…odel. (fix MLopez-Ibanez#102)

Inside `[.data.table`, a column takes precedence over a local variable of
the same name, so a parameter column can shadow the local variables that an
expression reads. truncate_rows() subset its argument with
`-seq.int(n + 1L, nx)` and now truncates with head() instead.
generate_sobol() and sample_from_model() read `param` and `this_model`
inside data.table expressions; these now only call closures that are
defined before the subset. The random draws do not change.

 * tests/testthat/test-bug-102.R: New.
 * NEWS.md: Mention the fix.
@MLopez-Ibanez
MLopez-Ibanez force-pushed the master branch 2 times, most recently from 1a2c707 to 657c076 Compare October 27, 2026 20:31
@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.48%. Comparing base (657c076) to head (ead0050).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #105   +/-   ##
=======================================
  Coverage   75.48%   75.48%           
=======================================
  Files          30       30           
  Lines        5119     5120    +1     
=======================================
+ Hits         3864     3865    +1     
  Misses       1255     1255           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MLopez-Ibanez
MLopez-Ibanez merged commit 1b18fb8 into MLopez-Ibanez:master Oct 27, 2026
14 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.

Soft restart fails when a dependent domain's parameter is inactive

2 participants