Improve test suite performance - #434
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR focuses on speeding up the OptimizationProblems.jl test suite by reducing repeated model construction, cutting down the number of testset nodes, removing unnecessary distributed work in normal CI runs, and replacing dynamic eval-based lookups with getfield.
Changes:
- Replace multiple
Module.eval(Symbol(...))/eval(Meta.parse(...))usages in tests withgetfield-based lookups to avoid dynamic evaluation overhead. - Fold NLS residual checks into
test_one_problemand remove the separatepmapover NLS problems. - Gate diagnostic “probe_missing” distributed logging behind
JULIA_TEST_DEBUG=1and move adjusted-dimension warning checks into the scalable test pass.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/test-utils.jl | Replaces dynamic eval calls with getfield and removes unused dimension variables from tests. |
| test/test-scalable.jl | Extends scalable tests to also assert adjusted-dimension warnings, eliminating a separate warning-check pass. |
| test/test-in-place-residual.jl | Merges previously separate NLS testsets and exports nls_name_list to workers for use inside test_one_problem. |
| test/test-defined-problems.jl | Gates distributed “missing symbol probe” diagnostics behind JULIA_TEST_DEBUG=1 to avoid CI overhead. |
| test/runtests.jl | Collapses per-problem sub-testsets into one and runs NLS checks inline per problem instead of via a separate pmap. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_one_problem— NLS problems were constructed 3× at defaultn; now constructed once asADNLPModel(in Pass 1) and once asADNLSModel(in the NLS branch), eliminating the separatepmapovernls_name_listprobe_missingdiagnostic blocks behindJULIA_TEST_DEBUG=1— they serialised ~400 symbols to every worker on every CI run but made no assertionpmap— the ~100-problem sequentialforloop now runs on the worker pool viacheck_adjusted_dim_warning@testsetnode count —test_one_problem's 3–4 sibling testsets collapsed into one@testset "$pb";test_in_place_residual's two testsets merged into one@testset "NLS $prob"test_scalable— the separatepmapover scalable problems for warning checks is eliminated; each scalable item now carries awarn_checksfield and the worker handles both the scalability and the warning assertions in one passModule.eval(Symbol(...))calls inmeta_sanity_check,test_in_place_constraints, andtest-scalable.jlwithgetfield; remove deadnvar/nconassignments intest_compatibilityandtest_multi_precisionTest plan
improve-tests-perftest-defined-problems,test-scalable,test-in-place-residual,test-utils🤖 Generated with Claude Code