Skip to content

Resolve shared CondaPkg NumPy conflict with CIMOptimizer - #56

Merged
bernalde merged 2 commits into
mainfrom
fix/issue-55-shared-condapkg-numpy
Jun 28, 2026
Merged

Resolve shared CondaPkg NumPy conflict with CIMOptimizer#56
bernalde merged 2 commits into
mainfrom
fix/issue-55-shared-condapkg-numpy

Conversation

@bernalde

Copy link
Copy Markdown
Member

Summary

  • Remove DWave's direct PyPI NumPy dependency so shared CondaPkg environments can use the NumPy selected by the conda/PyPI solve.
  • Update compatibility metadata tests to enforce that DWave does not own a direct PyPI NumPy policy.
  • Add test/shared_condapkg_resolve.jl and README documentation for the full Python-backed JuliaQUBO benchmark-tier CondaPkg resolve smoke.

Closes #55.

Tests

  • julia --project=. -e 'include("test/compat_metadata.jl")'
  • env JULIA_DEPOT_PATH=/tmp/dwave-issue55-pair/depot JULIA_PKG_PRECOMPILE_AUTO=0 julia --startup-file=no --project=/tmp/dwave-issue55-pair/project -e 'import Pkg; Pkg.Registry.update(); Pkg.develop(Pkg.PackageSpec(path=pwd())); Pkg.add([Pkg.PackageSpec(name="CIMOptimizer", version=v"0.2.2"), Pkg.PackageSpec(name="CondaPkg", version=v"0.2.36")]); import CondaPkg; CondaPkg.resolve(); println("DWave + CIMOptimizer CondaPkg resolve succeeded")'
  • env JULIA_DEPOT_PATH=/tmp/dwave-issue55-full/depot JULIA_PKG_PRECOMPILE_AUTO=0 julia --startup-file=no test/shared_condapkg_resolve.jl
  • julia --project=. -e 'import Pkg; Pkg.test()'

Branch Hygiene

  • Base branch: main
  • Source branch: fix/issue-55-shared-condapkg-numpy
  • Branch point: origin/main
  • Stacked status: not stacked
  • Prerequisite PRs: none

@bernalde
bernalde marked this pull request as ready for review June 28, 2026 22:41

@bernalde bernalde left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewing as maintainer at head 8d02eff. I am the PR author, so GitHub permits only a COMMENT event from me; a formal approve/request-changes must come from another maintainer. There are no blocking issues; on the merits this is an approve.

This PR removes DWave's direct PyPI numpy = "~=2.2.0" pin (added in #53) so the shared CondaPkg solve can use the conda-selected NumPy, updates the metadata tests, and adds test/shared_condapkg_resolve.jl plus a README section. Verified against merge-base 93b634c: 4 files, 67 additions, 11 deletions, matching the PR totals.

Intent vs issue #55: the change is the right fix for the right problem. #55 reports that the ~=2.2.0 PyPI pin (numpy <2.3) conflicts with the conda-side numpy 2.4.6 that CIMOptimizer pulls via pytorch-cpu. Removing the pin is option 1 from the issue. I verified both acceptance criteria by reproducing the resolves myself with CondaPkg v0.2.36:

  • DWave (no numpy) + CIMOptimizer: resolves, conda selects numpy 2.4.6.
  • Full tier DWave + PySA + CIMOptimizer + QiskitOpt: resolves, numpy 2.4.6, qiskit 2.3.1.
    I also confirmed the three hardcoded tier snapshots in the metadata test match the real registered CondaPkg.toml of QiskitOpt v0.7.1, PySA v0.4.2, and CIMOptimizer v0.2.2. Notably QiskitOpt v0.7.1 itself dropped its numpy pin, so with DWave also dropping its pin no package now constrains numpy below 2.3; that is what makes the full tier resolve. Closes #55 is appropriate. DWave's source only uses stable numpy APIs (np.array, from_numpy_vectors), so deferring to the conda-selected numpy carries no API-break risk.

Blocking issues:

  • None.

Nonblocking issues:

  1. test/compat_metadata.jl contains a tautological assertion: Test.@test haskey(cimoptimizer_conda_deps, "pytorch-cpu") checks a literal dict the test itself just defined, so it always passes and verifies nothing about DWave or real CIMOptimizer metadata. Either drop it or replace it with an assertion that exercises something real (e.g. that DWave declares no conda pytorch/numpy that would collide).
  2. The snapshot comment was weakened relative to #53. It now reads Mirrors the registered Python-backed benchmark tier from issue #55 and no longer names the mirrored versions, whereas the prior comment named QiskitOpt v0.7.0. The versions (CIMOptimizer 0.2.2, QiskitOpt 0.7.1, PySA 0.4.2) live only in test/shared_condapkg_resolve.jl. Name them in the comment too so the hardcoded snapshot can be re-audited deliberately when the tier moves.

Questions:

  1. The NumPy policy has now flip-flopped across PRs (removed, then pinned ~=2.2.0 in #53, now removed again), each time driven by a new driver's constraint. The audited stable stack testset now asserts !haskey(pip_deps, "numpy"), i.e. numpy is intentionally no longer audited and floats to whatever ocean-sdk/conda selects. That is reasonable given CIMOptimizer's conda numpy, and the !haskey test does guard against a future re-add. Should the README or a comment state this policy explicitly (DWave intentionally does not pin numpy and defers to dwave-ocean-sdk plus the shared conda solve), so the next contributor does not reintroduce a pin and restart the cycle? Non-blocking; the test already encodes the rule, but the rationale is undocumented.

Tests run:

  • Ran the two updated testsets in test/compat_metadata.jl standalone against head CondaPkg.toml: both pass (audited 4/4, shared benchmark env 7/7).
  • Reproduced acceptance criterion 1 (DWave + CIMOptimizer) and criterion 2 (full tier) via CondaPkg.resolve() on manually-merged CondaPkg.toml files built from the real registered dependency sets: both resolve, numpy 2.4.6.
  • Did not run the full Pkg.test() suite (imports DWave through PythonCall, needs the full Python env and, for the cloud sampler, network/credentials) nor the heavy test/shared_condapkg_resolve.jl end-to-end through the Julia registry; the dependency resolution it checks is verified above, and the PR reports both green.

Merge-readiness: Mergeable. The fix is correct and both issue acceptance criteria are verified; the nonblocking items are test-quality and documentation polish. I defer the formal approval to another maintainer since I authored this PR.

Comment thread CondaPkg.toml
Comment thread test/compat_metadata.jl Outdated
Comment thread test/compat_metadata.jl Outdated
@bernalde

Copy link
Copy Markdown
Member Author

Commits pushed:

  • 6d81197e330edb6a992a2f4ca6b00d5f5346003b Address shared benchmark metadata review

Main changes:

  • Named the mirrored benchmark-tier snapshot in test/compat_metadata.jl: CIMOptimizer v0.2.2, QiskitOpt v0.7.1, and PySA v0.4.2.
  • Replaced the tautological CIMOptimizer literal-dict assertion with checks against DWave's actual conda deps: only python overlaps with CIMOptimizer, and DWave does not contribute conda-side numpy or pytorch-cpu.

Tests:

  • julia --project=. -e 'include("test/compat_metadata.jl")': pass.
  • julia --project=. -e 'import Pkg; Pkg.test()': pass.
  • timeout 20m gh pr checks 56 --watch --fail-fast: pass, 4/4 CI jobs green.
  • No separate lint/type-check command is defined for this repo; CI runs Julia package tests.

Comments intentionally not addressed:

  • 3488671486 was informational verification of the NumPy removal and did not require a code change.

Declined Blocking comments:

  • None.

Remaining risks or follow-up items:

  • None identified for these review comments.

@bernalde
bernalde merged commit ca17983 into main Jun 28, 2026
4 checks passed
@bernalde bernalde mentioned this pull request Jun 29, 2026
@bernalde
bernalde deleted the fix/issue-55-shared-condapkg-numpy branch June 30, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolve remaining NumPy conflict with CIMOptimizer shared CondaPkg environment

1 participant