-
Notifications
You must be signed in to change notification settings - Fork 48
Documentation for adding new problems in contributing.md #410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
arnavk23
wants to merge
14
commits into
JuliaSmoothOptimizers:main
Choose a base branch
from
arnavk23:docs-update
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
114515a
Improve contributing.md: clarify requirements for adding new problems…
arnavk23 bab2d3b
Clarify meta field completeness and validation requirements in meta.m…
arnavk23 45090ce
Add note to benchmark.md about compatibility and meta field validatio…
arnavk23 fe9dcca
Update meta.md for improved clarity on meta fields
arnavk23 092c66c
Apply suggestions from code review
arnavk23 8cab328
addressing review comments
arnavk23 ca197e5
Update contributing.md
arnavk23 6a204ab
Fix punctuation and formatting in contributing.md
arnavk23 b2d0984
Apply suggestions from code review
arnavk23 ddbfd6e
Enhance contributing.md with NLS problem guidelines
arnavk23 5e11b7a
Apply suggestions from code review
arnavk23 a72b9f2
addressing review comments
arnavk23 29d50d4
Apply suggestions from code review
arnavk23 9b31405
addressing review comments
arnavk23 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -72,3 +72,40 @@ function function_name(; n::Int = default_nvar, type::Type{T} = Float64, kwargs. | |
| return nlp | ||
| end | ||
| ``` | ||
|
|
||
| ## Validating new problems | ||
|
arnavk23 marked this conversation as resolved.
|
||
|
|
||
| * Ensure all meta fields are accurate and complete. | ||
| * For problem implementation in both ADNLPProblems and PureJuMP, use the same initial point, variable bounds, constraint bounds and ensure objective and constraint values match within a relative tolerance. | ||
| * The objective of implementations must be callable at the starting point. | ||
|
arnavk23 marked this conversation as resolved.
Outdated
|
||
| * Problems modeled with `ADNLPModels` should support the `nls=true/false` keyword to allow both `ADNLPModel` and `ADNLSModel` instantiation from the same problem. | ||
|
arnavk23 marked this conversation as resolved.
Outdated
|
||
| * For least-squares problems, instantiate both `ADNLPModel` and `ADNLSModel` and ensure `residual!(nls, x, Fx)` is allocation-free with the objectives agree (or differ by a factor of 2 for LS). | ||
|
arnavk23 marked this conversation as resolved.
Outdated
arnavk23 marked this conversation as resolved.
Outdated
arnavk23 marked this conversation as resolved.
Outdated
|
||
| * For variable-size problems, verify that different values of `n` produce correct `nvar`, meta formulas predict actual values and instantiation works at various sizes. | ||
|
arnavk23 marked this conversation as resolved.
Outdated
|
||
|
|
||
|
arnavk23 marked this conversation as resolved.
|
||
| ## Reviewer Checklist for New Problems | ||
|
|
||
|
arnavk23 marked this conversation as resolved.
|
||
| **Meta** | ||
| - [ ] Every new problem (ADNLP or PureJuMP) is registered in Meta, with all fields (origin, objtype, contype, bounds, best-known, etc.) filled correctly. | ||
|
arnavk23 marked this conversation as resolved.
Outdated
arnavk23 marked this conversation as resolved.
Outdated
|
||
| - [ ] Meta formulas for variable sizes match actual model behavior. | ||
|
|
||
| **Definition** | ||
| - [ ] No extra or spurious exports are introduced. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we mention somewhere which file(s) is exporting the new function? |
||
| - [ ] Model name matches the file and function name. | ||
|
arnavk23 marked this conversation as resolved.
|
||
|
|
||
| **Implementation** | ||
| - [ ] Objective and constraint values agree within tolerance at test points. | ||
|
arnavk23 marked this conversation as resolved.
Outdated
|
||
| - [ ] Number of variables and constraints match. | ||
|
|
||
| **Sanity** | ||
| - [ ] Objective is callable at the starting point and does not return NaN (unless documented). | ||
| - [ ] Model instantiates without error for all supported types (Float32, Float64). | ||
|
arnavk23 marked this conversation as resolved.
Outdated
|
||
| - [ ] For scalable problems, changing n updates nvar and all related meta fields. | ||
|
arnavk23 marked this conversation as resolved.
Outdated
|
||
|
|
||
| **Least-Squares & In-Place APIs** | ||
|
arnavk23 marked this conversation as resolved.
|
||
| - [ ] If least-squares, ADNLP constructor supports `nls=true/false` for both ADNLPModel and ADNLSModel. | ||
| - [ ] In-place nonlinear constraint evaluation (`nln!`) and least-squares residuals (`residual!`) are allocation-free. | ||
|
arnavk23 marked this conversation as resolved.
Outdated
|
||
| - [ ] For least-squares, objectives for NLP and NLS agree (or differ by a factor of 2, as appropriate). | ||
|
|
||
| **Zero-Allocation** | ||
| - [ ] All in-place APIs (constraints, residuals) are allocation-free. | ||
| - [ ] No unnecessary allocations in tight loops or callbacks. | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.