Skip to content

Gecode 7 breaking changes - #274

Draft
zayenz wants to merge 151 commits into
mainfrom
feature/breaking-7
Draft

zayenz wants to merge 151 commits into
mainfrom
feature/breaking-7

Conversation

@zayenz

@zayenz zayenz commented Nov 4, 2026

Copy link
Copy Markdown
Member

Gecode 7 breaking changes, opened as a draft so CI can run. More work is coming on this branch: scoped enums, constant renames, and source cleanup.

What is here

  • CMake is the only build system; Autoconf and the maintained Makefiles are gone.
  • C++23, LLVM 22 formatting, snake_case naming, and clang-tidy checks. See docs/code-style.md and docs/breaking-7.md.
  • A Gecode-native float interval library, Float::Interval, replaces the vendored Boost copy. Bounds match the old code bit for bit, and Gecode has no external dependency for interval arithmetic. changelog.in lists the user-visible changes under 7.0.0.
  • The .zdev records are pull-request-only development records; they are removed before merging.

Validation so far

Local and on x86-64 Linux, not yet in CI:

  • The full float suite including sweeps passes in Release and Debug, with and without MPFR, on arm64 macOS. Debug without MPFR also passes on x86-64 with GCC 15.
  • The rounding probe is exact with AppleClang, LLVM 22, and GCC 14 at -O0, -O2, and -O3.
  • The four float examples give the same solutions and search statistics as before the switch.
  • ctest and uv run misc/check.py all pass.

What CI needs to cover

MSVC cannot be built locally, so CI is the first place this rounding code runs:

  • gecode/float.hh 79-88 (the GECODE_FLOAT_MODE_CONTROL87 and GECODE_FLOAT_DIRECTED_PER_OPERATION predicates) and 184-190 (Mode).
  • gecode/float/rounding.hpp 40-83 (the _control87 mode control and the Control87 fields), 110-135 and 169-222 (the per-operation style), and 162-165 (the volatile barrier used by cl.exe).

build-cmake-windows (cl.exe x64, MPFR off) and build-cmake-windows-vcpkg (cl.exe x64, MPFR on) run them through the check-tagged float tests (DirectedRounding, RoundingScope, MedianRoundingMode, Interval::OutwardRounding, and others). build-cmake-windows-msys2 compiles the MinGW <cfenv> path but runs no tests. cl.exe x86, MSVC ARM64, and clang-cl are not built in CI.

zayenz added 30 commits November 4, 2026 23:17
Zdev-Change-Id: Zb8fefba5e7a09b42d0e065beadd861a00753a972869ec7acfb2afe43b470ec48
Zdev-Change-Id: Z98a6d741c16a08b32d9ee476e47002e03f0e9e3c92a1f1f24728ad5045e0a40d
Zdev-Change-Id: Zd31dae216de3b897b48efca363cdde3dc9e1169a291c9b3d69df0ab05d5d7bdf
Zdev-Change-Id: Ze8474b4acc120d2bc1577f9bdef9ea06be3027629308f96092c1bfd7a26f78da
Zdev-Change-Id: Zb6ff89e9ae27985fdf3c6461cc363f96695cc88df8d607e533279ea8186c577d
Zdev-Change-Id: Z6c1d54a1013fcb118950463f6d78ffb7d4cf39724c457a676aa44bbdf48d06e6
Zdev-Change-Id: Zf903f6efbe2c981cca719755416475e3fbd7c69a5a588158e7f14b97aa3eab86
Zdev-Change-Id: Z43822b3ed57cc2bb7ce4e44e9bbff5df76f14777f613f2de9973d7180a1d263a
Zdev-Change-Id: Z9b51ce509fa929284b7d2b251a6e3566d0e592e27e8fecd6541788b5ea30c00a
Zdev-Change-Id: Zaf7a888eb914257e90f519223bfacc19df79b6e81c1f7fdcfb32ce9d12bda351
Zdev-Change-Id: Zff2d0e6ff1ca5650bb9fab0c1728ac3914074b51eeb8bebc42ffc047126cf906
Zdev-Change-Id: Z29f5a5de8dcaeb9c7e36ad57a6f0f8b6da3a7cbdb6796476784b9a4bfd45dd76
Zdev-Change-Id: Za38592943e829d0d5f0639f54bb56ed7b2929c5997714a009f9fb274ee681e37
Zdev-Change-Id: Z59edca85bfdb7c2701928e5f8262679749d118c3a98e03042baf26879102ba98
Zdev-Change-Id: Z0fbe6f16aff95c9a39ff5430e3bc4f73d4399ffde75421d1d68b5d450ff5b34b
Zdev-Change-Id: Z8d0205e00242e1d712a60c857607727e596c7bd6b3ccc4fc2364387902adf7f3
Zdev-Change-Id: Z2f16dcb32eaf668fab7f831f2cb1ce8bdafd7f6b7b30fa28158406da084ad476
Zdev-Change-Id: Z1b18cdeb9e1612dbc04fc22e901b19d940719bb2db0fa18fa22cfc611f6454e7
Zdev-Change-Id: Zf6a5788af4f4377c88afe00dea48d0affa568605375e155caa867901fc0194fa
Zdev-Change-Id: Zcc7415972bb86bd76ef8e9f9b584d467d0bc2ada68d15385be70b31f02188cb9
Zdev-Change-Id: Zcab7b04117e00a1fae0ceb57e7f08b8ef521927647e15241606b165f7a4eb00e
zayenz added 22 commits November 7, 2026 00:02
Enable readability-non-const-parameter.
Enable readability-else-after-return.
Enable readability-simplify-boolean-expr without De Morgan rewrites, and remove a dead branch in the Gist tree builder.
Enable readability-inconsistent-declaration-parameter-name, and update the parameter references in the Doxygen comments.
Enable readability-suspicious-call-argument. Its one report is a symmetric call.
Enable modernize-concat-nested-namespaces, and generate the same form. Shallower indentation lets clang-format repack the tables in the MiniModel tests.
Enable modernize-avoid-c-style-cast.
Enable modernize-avoid-variadic-functions.
Enable cppcoreguidelines-misleading-capture-default-by-value, cppcoreguidelines-missing-std-forward, google-build-explicit-make-pair, and google-global-names-in-headers.
Enable cppcoreguidelines-no-malloc.
Enable cert-err33-c with casts to void allowed.
Enable cppcoreguidelines-rvalue-reference-param-not-moved. Only the empty branch filter and print function take an rvalue without moving it.
Enable hicpp-exception-baseclass. FlatZinc::Error, AST::TypeError, and ShapeError now provide what(), and the tests that unwind with a thrown int use std::logic_error.
Enable misc-use-internal-linkage for functions.
Enable clang-analyzer cplusplus, deadcode, nullability, optin, security, unix, and valist, except the checks that only produce false positives here. Remove the dead stores this finds, including the unused search timer in Gist.
The per-check sweeps missed these. The names in declarations and
definitions now agree, and Cutoff::geometric no longer calls its scale
base in the definition; it passed them in the right order all along.
The cumulative tests hold their usage table in a vector, which also
removes the analyzer's report on an empty allocation.
Lint stops at the first failing stage, so the grammar actions and
parser.hh were reached only once everything else passed. yyerror keeps
external linkage, because the lexer calls it, and is now declared once
in parser.hh; the other parser functions become static. Token strings
come from strdup, so one helper holds the free the check has to allow.

The windows and none blackbox sources and the headers no linted source
includes get the same namespace form, which a lint here cannot reach.
Record why each excluded check does not fit, so that a later review
starts from the reasons, and which fix-its need care. Also restore
bugprone-unused-return-value, which the switch to whole groups excluded
by mistake.
@zayenz
zayenz force-pushed the feature/breaking-7 branch from 539e011 to f795152 Compare November 7, 2026 07:01
Pack has a data member l, and MSVC resolves l in the out-of-line
definition of calc_dff_lower_bound to that member instead of to the
template parameter of the same name. Rename the parameter. This, rather
than the function-typed parameter that 50707a2 changed, is what
MSVC rejected.

Removing the redundant parentheses around numeric_limits members in
blackbox-exec.cpp exposed them to the min and max macros of windows.h,
so define NOMINMAX as blackbox-backend.cpp does.
@zayenz
zayenz force-pushed the feature/breaking-7 branch from f795152 to 98c7bc3 Compare November 7, 2026 07:14
d86ed2f fixed this, and a44934b dropped the qualification when it
removed the const conversions. Note why it is there.
@zayenz
zayenz force-pushed the feature/breaking-7 branch from 98c7bc3 to 08405b4 Compare November 7, 2026 07:34
It links the library by hand, so it does not get cxx_std_23 from the
exported targets. Earlier Windows runs stopped before this step.
@zayenz
zayenz force-pushed the feature/breaking-7 branch from 08405b4 to bb0af29 Compare November 7, 2026 08:04

This branch has not been deployed

No deployments
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