Latest Results
Make solver adapter APIs preparation-aware (#1166)
## Summary
- Make `SolverAdapter.solve()` and `SamplerAdapter.sample()` copy the
supplied `Instance`, apply the Adapter's recommended Preparation,
execute through the public exact-input API, and leave the caller's
object unchanged.
- Add `solve_without_preparation()` and `sample_without_preparation()`
for callers that own Preparation and for custom Adapter implementations,
without accepting untyped catch-all options.
- Update HiGHS, Python-MIP, PySCIPOpt, and OpenJij to the two-layer API.
OpenJij keeps `initial_state` on its exact-input constructor and
preparation-free methods because it refers to prepared solver variables.
- Omit HiGHS and Python-MIP dual values when output-objective projection
is active, and document that OpenJij `SampleSet` objectives report the
original objective rather than penalty energy in v3.
- Update the English and Japanese migration guidance, Adapter tutorial,
special-constraint guide, OpenJij examples, release notes, generated
stub, and API reference data.
## User impact
Most callers can pass an unprepared `Instance` directly to `solve()` or
`sample()`. Applications that customize Preparation should prepare their
`Instance` in place and call the corresponding `*_without_preparation()`
API. Custom Adapters must implement that exact-input method. A concrete
Adapter may give the easy and preparation-free methods different
explicitly typed option sets when an option depends on the exact
prepared input and no transport through Preparation is defined. Make solver adapter APIs preparation-aware (#1166)
## Summary
- Make `SolverAdapter.solve()` and `SamplerAdapter.sample()` copy the
supplied `Instance`, apply the Adapter's recommended Preparation,
execute through the public exact-input API, and leave the caller's
object unchanged.
- Add `solve_without_preparation()` and `sample_without_preparation()`
for callers that own Preparation and for custom Adapter implementations,
without accepting untyped catch-all options.
- Update HiGHS, Python-MIP, PySCIPOpt, and OpenJij to the two-layer API.
OpenJij keeps `initial_state` on its exact-input constructor and
preparation-free methods because it refers to prepared solver variables.
- Omit HiGHS and Python-MIP dual values when output-objective projection
is active, and document that OpenJij `SampleSet` objectives report the
original objective rather than penalty energy in v3.
- Update the English and Japanese migration guidance, Adapter tutorial,
special-constraint guide, OpenJij examples, release notes, generated
stub, and API reference data.
## User impact
Most callers can pass an unprepared `Instance` directly to `solve()` or
`sample()`. Applications that customize Preparation should prepare their
`Instance` in place and call the corresponding `*_without_preparation()`
API. Custom Adapters must implement that exact-input method. A concrete
Adapter may give the easy and preparation-free methods different
explicitly typed option sets when an option depends on the exact
prepared input and no transport through Preparation is defined. Make solver adapter APIs preparation-aware (#1166)
## Summary
- Make `SolverAdapter.solve()` and `SamplerAdapter.sample()` copy the
supplied `Instance`, apply the Adapter's recommended Preparation,
execute through the public exact-input API, and leave the caller's
object unchanged.
- Add `solve_without_preparation()` and `sample_without_preparation()`
for callers that own Preparation and for custom Adapter implementations,
without accepting untyped catch-all options.
- Update HiGHS, Python-MIP, PySCIPOpt, and OpenJij to the two-layer API.
OpenJij keeps `initial_state` on its exact-input constructor and
preparation-free methods because it refers to prepared solver variables.
- Omit HiGHS and Python-MIP dual values when output-objective projection
is active, and document that OpenJij `SampleSet` objectives report the
original objective rather than penalty energy in v3.
- Update the English and Japanese migration guidance, Adapter tutorial,
special-constraint guide, OpenJij examples, release notes, generated
stub, and API reference data.
## User impact
Most callers can pass an unprepared `Instance` directly to `solve()` or
`sample()`. Applications that customize Preparation should prepare their
`Instance` in place and call the corresponding `*_without_preparation()`
API. Custom Adapters must implement that exact-input method. A concrete
Adapter may give the easy and preparation-free methods different
explicitly typed option sets when an option depends on the exact
prepared input and no transport through Preparation is defined. Add output objective semantics to Instance and ParametricInstance (#1167)
## Summary
- Add a v2 `OutputObjective` to `Instance` and `ParametricInstance` so
the active solver formulation can differ from the objective reported by
`evaluate()` and `evaluate_samples()`. Parameter materialization and
state reconstruction preserve that output meaning; v1 serialization
rejects models that it cannot represent losslessly.
- Make objective conversion an explicit Preparation phase, add canonical
QUBO/HUBO input classes and policy factories, and define `to_qubo()` /
`to_hubo()` as in-place Preparation followed by format extraction.
Whole-problem `as_minimization_problem()` / `as_maximization_problem()`
conversions keep their original meaning.
- Map solver optimality through the output-objective contract in the
HiGHS, PySCIPOpt, and Python-MIP adapters. A finite-penalty optimum
remains `Optimality.Unspecified` when it does not prove optimality for
the reported objective.
## Behavior change
QUBO/HUBO conversion now keeps the prepared minimization energy as the
active `Instance`, while evaluated results retain the input instance's
output semantics:
```python
from ommx import DecisionVariable, Instance, Sense
x = DecisionVariable.binary(0)
instance = Instance.from_components(
sense=Sense.Maximize,
objective=x,
decision_variables=[x],
constraints={0: x == 1},
)
qubo, offset = instance.to_qubo(uniform_penalty_weight=2.0)
state = {0: 0.0}
# Solver-facing energy: minimize -x + 2 (x - 1)^2.
assert instance.sense == Sense.Minimize
assert instance.objective.evaluate(state) == 2.0
# User-facing output: the input Maximize / x objective.
solution = instance.evaluate(state)
sample_set = instance.evaluate_samples({0: state})
assert solution.sense == Sense.Maximize
assert solution.objective == 0.0
assert sample_set.sense == Sense.Maximize
assert sample_set.objectives[0] == 0.0
```
This intentionally corrects the Python SDK v2 behavior, which restored
the active sense but evaluated the final penalized energy. Returned
QUBO/HUBO coefficients retain their existing meaning. The equivalent
editable workflow is `prepare(InstanceClass.qubo(),
PreparationPolicy.for_qubo(...))` followed by `as_qubo_format()`; HUBO
has matching helpers. Latest Branches
N/A
claude/sleepy-wilbur-9b1170 N/A
codex/slim-benchmark-workflow N/A
codex/instance-into-partial-evaluated Β© 2026 CodSpeed Technology