Repository navigation
fix: RE91 solution creation and dominance fast-path correctness - #194
Conversation
The random variables (indices 7-10) have infinite bounds, so sampling them gave NaN with random.uniform or raised OverflowError with Generator.uniform. The previous reset to 0.0 had no effect because FloatSolution.variables returns a copy. Sample the 7 decision variables and assign the whole list. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…sses FastNonDominatedRanking and the non-dominated archives used isinstance() to pick their vectorized/moocore paths, so DominanceComparator subclasses such as GDominanceComparator were silently ranked with plain Pareto dominance. Require the exact DominanceComparator type instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…atch add_batch() kept every non-dominated row, so exact and near-duplicate solutions (within objective_tolerance) that add() rejects ended up in the archive. Keep weakly non-dominated rows and drop duplicates, preferring solutions already in the archive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for these fixes, all three bugs are real. I ran the full suite locally on this branch, both on its own and merged with #193. Everything passes and Good to go
Needs changes: duplicate filtering in Making This is a Python loop that runs one NumPy operation per kept solution against all the solutions kept so far. Its cost grows with the square of the number of solutions, in the method that exists to avoid exactly that. On my machine:
That's about 110x slower, and the whole suite goes from ~25 s to ~200 s. Any real run that uses an unbounded archive on a many-objective problem would see the same slowdown. Some options:
Whichever you choose, it would help to run the full Minor
|
The near-duplicate filter in NonDominatedSolutionsArchive.add_batch compared each kept row against all rows kept so far in a Python loop, which made the DTLZ2 unbounded-archive integration test ~110x slower. Remove exact duplicates with np.unique (lowest index wins), then sort by a weighted sum of the objectives so near-duplicates end up next to each other, and only run the tolerance check inside those small groups. The result is the same as the previous loop.
Move the duplicate tests above the __main__ block, rewrite them as a pytest class parametrized over both archive classes, and cover chains of near-duplicates, a shared coordinate and a linear front.
|
Thanks for catching this. I took the first option:
It gives exactly the same result as the previous loop: I compared the two on 3000 random batches full of exact and near-duplicates (2–5 objectives). Timings on my machine, which is slower than yours overall:
So the integration test now takes the same time as on The duplicate tests are now a pytest |
VectorizedNonDominatedSolutionsArchive.add_batch, added in jMetal#193, still used isinstance(), unlike the other default-comparator fast paths. Results were unaffected because add() already checks the exact type.
|
Since #193 landed first, I merged After the merge, |
Fixes found while reviewing the 1.10 release.
Changes
create_solution(src/jmetal/problem/multiobjective/re.py): the random variables (indices 7-10) have infinite bounds, so sampling them gave NaN (random.uniform) or raisedOverflowError(Generator.uniform). The previous reset to0.0had no effect becauseFloatSolution.variablesreturns a copy. Now only the 7 decision variables are sampled and the whole list is assigned.src/jmetal/util/ranking.py,src/jmetal/util/archive.py):FastNonDominatedRankingand the non-dominated archives chose their vectorized/moocore paths withisinstance, so subclasses such asGDominanceComparatorwere silently treated as plain Pareto dominance. They now require the exactDominanceComparatortype.NonDominatedSolutionsArchive.add_batchduplicates (src/jmetal/util/archive.py): it kept exact and near-duplicate solutions (withinobjective_tolerance) thatadd()rejects. It now drops them and prefers solutions already in the archive.Each fix has its own regression tests (
tests/problem/multiobjective/test_re91.py,tests/util/test_g_dominance_fast_paths.py,tests/util/test_archive.py).Verification
ruff check src/ tests/ examples/: clean.testCI workflow.