google / or-tools

Google's Operations Research tools:
https://developers.google.com/optimization/
Apache License 2.0
10.82k stars 2.09k forks source link

Unexpected "debug" output running fzn-cp-sat #4174

Closed CervEdin closed 3 months ago

CervEdin commented 3 months ago

What version of OR-Tools and what language are you using? Version: v9.8 Language: FlatZinc

Which solver are you using (e.g. CP-SAT, Routing Solver, GLOP, BOP, Gurobi)

cp-sat

What operating system (Linux, Windows, ...) and version?

Linux 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

What did you do? Steps to reproduce the behavior:

echo 'var int: x;' | minizinc --solver cpsatlp -

What did you expect to see

No solver debug output,as in previous versions (works as expected at least in 9.1)

x = -1125899906842624;
----------
==========

What did you see instead?

Very nice and interesting information, yet unexpected output.

%% File /tmp/mznfile2aynVL.fzn parsed in 0 ms
%% Presolve model
%%   - done in 0 ms
%% Model mznfile2aynVL
%%   - Satisfaction problem
%% The number of search workers, is not specified. For better performances, please set the number of workers to 8, 16, or more depending on the number of cores of your computer.
x = -1125899906842624;
----------
==========

Make sure you include information that can help us debug (full error message, model Proto).

This is that solver configuration file

{
  "id": "com.google.ortools.sat",
  "name": "OR Tools CP-SAT",
  "description": "Google's Operations Research CP-SAT-LP FlatZinc interface",
  "version": "9.8.3296",
  "mznlib": "../cpsat",
  "executable": "../../../bin/fzn-cp-sat",
  "tags": ["cpsatlp", "cp", "lcg", "int"],
  "stdFlags": ["-a", "-f", "-p", "-r", "-s", "-v"],
  "extraFlags": [
    ["--params", "Provide parameters interpreted as a text SatParameters proto", "string", ""]
  ],
  "supportsMzn": false,
  "supportsFzn": true,
  "needsSolns2Out": true,
  "needsMznExecutable": false,
  "needsStdlibDir": false,
  "isGUIApplication": false
}

Anything else we should know about your project / environment

My guess is there's some kind of debug flag or similar which is being set, despite the flatzinc solver not being given such option, possibly in ortools/flatzinc/fz.cc

Given that the this doesn't occur in 9.1 but at least started occurring in 9.8, possible commits which introduced the behavior are

02c993cebe fix flags support for fz
e0bcf09223 [FZ] cleanup and fix #3951
2c36589f5a integral_types.h -> types.h
c22933c1b9 [FZ] do not skip empty lines in output
3ff130df97 tweak includes
064b3efd74 cleanup code; move solve.cc to ortools/linear_solver
7172a5650a fix
43e560d236 [FLATZINC] remove num_solution/-n options
1672e39b43 use file::Stem
f98afa8e42 Add missing STL include
2ab1bbbd08 cleanup flatzinc search hacks; small improvement to CP-SAT lb_tree_search
0ec562802a flatzinc: sync
c2b97cac86 [FZ] remove obsolete warm_start annotation that was missing in minizinc 2.6.1; tweak ortools.msc.in; add -v flag
996115ac7f NULL -> nullptr

Of which these looks more relevant

c2b97cac86 [FZ] remove obsolete warm_start annotation that was missing in minizinc 2.6.1; tweak ortools.msc.in; add -v flag
7172a5650a fix
e0bcf09223 [FZ] cleanup and fix #3951
02c993cebe fix flags support for fz
lperron commented 3 months ago

seems like a minizinc bug

CervEdin commented 3 months ago

@Dekker1 do you have any idea what could be going on?

lperron commented 3 months ago

2 remarks:

Le mer. 10 avr. 2024 à 11:51, Erik Cervin Edin @.***> a écrit :

@Dekker1 https://github.com/Dekker1 do you have any idea what could be going on?

— Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/4174#issuecomment-2047063836, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3MDUNIP5EUYIDBMJI3Y4UDQNAVCNFSM6AAAAABF7LLZXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGA3DGOBTGY . You are receiving this because you were assigned.Message ID: <google/or-tools/issues/4174/2047063836 @.***>

CervEdin commented 3 months ago

Awesome, thanks for the speedy fix

On Wed, Apr 10, 2024, 11:55 AM Laurent Perron @.***> wrote:

2 remarks:

  • I was not checking the -v flag and was always printing some log at the start. This is fixed and should be available in 9.10 (this week or next).
  • I though all lines starting with a % would be discarded anyway. Laurent Perron | Operations Research | @.*** | (33) 1 42 68 53 00

Le mer. 10 avr. 2024 à 11:51, Erik Cervin Edin @.***> a écrit :

@Dekker1 https://github.com/Dekker1 do you have any idea what could be going on?

— Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/4174#issuecomment-2047063836,

or unsubscribe < https://github.com/notifications/unsubscribe-auth/ACUPL3MDUNIP5EUYIDBMJI3Y4UDQNAVCNFSM6AAAAABF7LLZXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGA3DGOBTGY>

. You are receiving this because you were assigned.Message ID: <google/or-tools/issues/4174/2047063836 @.***>

— Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/4174#issuecomment-2047078350, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXL5EVRLDVCQCBQRIR3CQLY4UEA7AVCNFSM6AAAAABF7LLZXWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBXGA3TQMZVGA . You are receiving this because you authored the thread.Message ID: @.***>