Add MiniZinc black-box propagator support#219
Conversation
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Please document both the DLL interface functions and the external process protocol, so reviewers can review that the PR adheres to the specification, and so that people can write their own conforming black boxes. |
The documentation for the ABI and executable streaming format will be part of the MiniZinc documentation. |
Great! Do you have a link to it? |
|
You can have a look at the current draft in my fork: https://github.com/Dekker1/libminizinc/blob/feat/blackbox/docs/en/blackbox.rst |
Thanks! Looks well documented. Perhaps mention whether |
|
Thanks for the feedback, I've updated the documentation with notes on these points. Regarding the seeming discrepancy, it should be noted that the |
|
I just pushed a small update to avoid an additional allocation for each |
|
I found and fixed a typo. The new autoconf build failure appears to be unrelated to the change. Diagnosis from an agent is that the autoconf is missing a dependency that might be solved by adding: |
Strengthen blackbox propagation, ownership, disposal, and error handling around external backends.
Add the MiniZinc annotations, use platform-neutral backend naming, and separate process startup paths and library fallback handling.
Validate protocol data and posting rules, document the callback contract, and integrate generated-header dependencies with Autoconf.
Reuse model-local backends while giving concurrent workers independent callback instances or persistent process sessions.
Use controlled posix_spawn setup, explicit descriptor inheritance, process groups, and bounded teardown.
Harden Windows handle and job-object management and adopt the fixed-width, instance-based shared-library ABI.
Exercise native process and library backends across CMake and Autoconf, including concurrency, malformed responses, portability, and diagnostics.
This PR adds support in Gecode’s FlatZinc interpreter for MiniZinc’s experimental black-box propagator interface. Models can delegate value propagation or bounds filtering to a shared library through
blackbox_dll, or to a persistent subprocess throughblackbox_exec.The implementation contains:
The interface is described in Defining Propagators in MiniZinc, by Jip J. Dekker, Peter J. Stuckey, Guido Tack, Huu Quang Tran, and Markus Wagner, presented at ModRef 2026.