Skip to content

Avoid intermediate QUBO files for MQLib runs - #6

Closed
bernalde wants to merge 1 commit into
masterfrom
fix/issue-3-in-memory-mqlib-input
Closed

Avoid intermediate QUBO files for MQLib runs#6
bernalde wants to merge 1 commit into
masterfrom
fix/issue-3-in-memory-mqlib-input

Conversation

@bernalde

@bernalde bernalde commented May 26, 2026

Copy link
Copy Markdown
Member

Summary

  • Stream the generated QUBO model to MQLib through /dev/stdin on Unix platforms, avoiding an intermediate .qubo file on disk.
  • Keep the existing tempfile-backed path as a fallback for platforms without /dev/stdin, including Windows.
  • Add focused tests for MQLib input selection and model serialization.
  • Add David E. Bernal Neira to the package authors and README authors.

Note: the current MQLib_jll build recipe only installs ExecutableProduct("MQLib"); it does not provide a shared-library product or C ABI. This PR isolates the executable input boundary and removes the file write where the current artifact supports doing so, but it does not yet implement direct shared-library access.

Follow-up work for direct shared-library access

Tests run

  • julia +1.12 --project=. test/runtests.jl - passed (MQLib input: 4 passed; QUBODrivers suite: 124 passed).
  • julia +1.12 --project=. -e 'using Pkg; Pkg.test()' from /tmp/mqlib-ci-test.RMVVVu, a CI-like copy without the repo's ignored local Manifest.toml - passed.
  • git -c core.whitespace=cr-at-eol diff --check - passed.

Notes about tests not run

  • julia +1.12 --project=. -e 'using Pkg; Pkg.test()' directly in this checkout was not usable because the ignored local Manifest.toml pins path dependencies from this machine and conflicts with the current QUBOTools checkout version. The CI-like temporary-copy run above excludes that ignored manifest.
  • Windows CI was not run locally.

Refs #3

@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.

Question: This implementation still invokes the MQLib executable and streams the serialized model through stdin on Unix; it does not provide direct shared-library/C-API access. Since #3 specifically asks for direct access to MQLib as a shared library, should the PR body use Refs #3 instead of Closes #3 unless maintainers intend to accept this stdin path as the full resolution?

No code-level blocking issues found in the diff.

Tests run:

  • julia +1.12 --project=. test/runtests.jl passed (MQLib input: 4 passed; QUBODrivers suite: 124 passed).
  • julia +1.12 --project=. -e 'using Pkg; Pkg.test()' passed from /tmp/mqlib-review-test.KjtI3U, a clean copy without the ignored local Manifest.toml.
  • Manual default-hyperheuristic smoke test through MQLib.Optimizer() passed.
  • gh pr checks 6 reports Ubuntu and Windows CI passing.

@bernalde

Copy link
Copy Markdown
Member Author

Closing this as superseded by the shared-library path in #15.

The useful part of this PR is the Unix-only /dev/stdin optimization for the executable fallback. That is no longer the primary path once MQLib_jll exports libmqlib_c_api, and this branch now overlaps the same sampler/test code that #15 rewrites. Merging it now would create avoidable conflicts without advancing #7 or #8.

If we still care about optimizing the executable fallback after #15 lands and MQLib_jll v0.1.2+0 is available, the right follow-up is to port only the fallback input-selection pieces into _sample_with_executable with focused tests. I would not carry over the unrelated author metadata changes as part of that follow-up.

@bernalde bernalde closed this May 28, 2026
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.

1 participant