Skip to content
Open
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions docs/src/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,40 @@ function function_name(; n::Int = default_nvar, type::Type{T} = Float64, kwargs.
return nlp
end
```

## Validating new problems
Comment thread
tmigot marked this conversation as resolved.
Comment thread
arnavk23 marked this conversation as resolved.

* Ensure all meta fields are accurate and complete.
* For problem implementation in both ADNLP and PureJuMP, use the same initial point, variable bounds, constraint bounds and ensure objective and constraint values match within a relative tolerance.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
* The objective of implementations must be callable at the starting point and should not return NaN unless expected.
Comment thread
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.
Comment thread
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).
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
Comment thread
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.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated

Comment thread
arnavk23 marked this conversation as resolved.
## Reviewer Checklist for New Problems

Comment thread
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.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
- [ ] Meta formulas for variable sizes match actual model behavior.

**Definition**
- [ ] No extra or spurious exports are introduced.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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.
Comment thread
arnavk23 marked this conversation as resolved.

**Implementation**
- [ ] Objective and constraint values agree within tolerance at test points.
Comment thread
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).
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
- [ ] For scalable problems, changing n updates nvar and all related meta fields.
Comment thread
arnavk23 marked this conversation as resolved.
Outdated

**Least-Squares & In-Place APIs**
Comment thread
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.
Comment thread
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 (Julia ≥ 1.7).
Comment thread
arnavk23 marked this conversation as resolved.
Outdated
- [ ] No unnecessary allocations in tight loops or callbacks.
Loading