Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
run: |
mkdir installer
cp gambit* installer
"${WIX}bin/candle" gambit.wxs
"${WIX}bin/candle" build_support/msw/gambit.wxs
"${WIX}bin/light" -ext WixUIExtension gambit.wixobj
- uses: actions/upload-artifact@v5
with:
Expand Down
32 changes: 18 additions & 14 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,9 @@
ACLOCAL_AMFLAGS = -I m4

EXTRA_DIST = \
gambit.spec \
gambit.desktop \
gambit.wxs \
contrib/mac/Info.plist \
contrib/mac/gambit.icns \
build_support/msw/gambit.wxs.in \
build_support/osx/Info.plist.in \
build_support/osx/gambit.icns \
src/labenski/README.txt \
src/labenski/art/grab.xpm \
src/labenski/art/hand.xpm \
Expand Down Expand Up @@ -374,9 +372,12 @@ if WITH_GUI
bin_PROGRAMS += gambit
endif

EXTRA_PROGRAMS = gambit-enumpoly gambit
# Read version from GAMBIT_VERSION file for use in compilation
GAMBIT_VERSION = $(shell cat $(top_srcdir)/build_support/GAMBIT_VERSION)

# Define VERSION for all C++ compilations and set include paths
AM_CPPFLAGS = -I$(top_srcdir)/src -DVERSION=\"$(GAMBIT_VERSION)\"

AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/src/labenski/include ${WX_CXXFLAGS}
AM_CXXFLAGS = ${LLVM_CXXFLAGS}

## Command-line tools
Expand Down Expand Up @@ -604,6 +605,9 @@ gambit_SOURCES = \
src/gui/valnumber.cc \
src/gui/valnumber.h

# Add wxWidgets compilation flags for the GUI program
gambit_CXXFLAGS = $(AM_CXXFLAGS) $(WX_CXXFLAGS)
gambit_CPPFLAGS = $(AM_CPPFLAGS) $(WX_CXXFLAGS) -I$(top_srcdir)/src/labenski/include

if IS_WIN32
gambit_LDADD = $(RC_OBJECT_PATH) $(WX_LIBS_STATIC) -ldeflate -lzstd -llerc -lWebP
Expand All @@ -619,8 +623,8 @@ osx-bundle:
-mkdir Gambit.app/Contents
-mkdir Gambit.app/Contents/MacOS
-mkdir Gambit.app/Contents/Resources
cp ${top_srcdir}/contrib/mac/Info.plist Gambit.app/Contents
cp ${top_srcdir}/contrib/mac/gambit.icns Gambit.app/Contents/Resources/gambit.icns
cp build_support/osx/Info.plist Gambit.app/Contents
cp ${top_srcdir}/build_support/osx/gambit.icns Gambit.app/Contents/Resources/gambit.icns
echo -n 'APPL????' > Gambit.app/Contents/PkgInfo
cp gambit Gambit.app/Contents/MacOS/gambit
cp ${bin_PROGRAMS} Gambit.app/Contents/MacOS
Expand All @@ -635,11 +639,11 @@ osx-dmg: osx-bundle
msw-msi:
-mkdir installer
cp gambit* installer
candle gambit.wxs
candle build_support/msw/gambit.wxs
light -ext WixUIExtension gambit.wixobj

clang-tidy:
clang-tidy ${top_srcdir}/src/core/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""
clang-tidy ${top_srcdir}/src/games/*.cc ${top_srcdir}/src/games/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""
clang-tidy ${top_srcdir}/src/solvers/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""
clang-tidy ${top_srcdir}/src/tools/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=""
clang-tidy ${top_srcdir}/src/core/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
clang-tidy ${top_srcdir}/src/games/*.cc ${top_srcdir}/src/games/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
clang-tidy ${top_srcdir}/src/solvers/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
clang-tidy ${top_srcdir}/src/tools/*/*.cc -- --std=c++17 -I ${top_srcdir}/src -DVERSION=\"$(GAMBIT_VERSION)\"
1 change: 1 addition & 0 deletions build_support/GAMBIT_VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.4.0
2 changes: 1 addition & 1 deletion gambit.wxs → build_support/msw/gambit.wxs.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="8EE11AE3-2B91-4870-895B-44C46D648BD6" Name="Gambit 16" Language="1033" Version="16.4.0" Manufacturer="The Gambit Project" UpgradeCode="135FFB28-DA7C-427C-A3DA-783B805BCC22">
<Product Id="8EE11AE3-2B91-4870-895B-44C46D648BD6" Name="Gambit 16" Language="1033" Version="@GAMBIT_VERSION@" Manufacturer="The Gambit Project" UpgradeCode="135FFB28-DA7C-427C-A3DA-783B805BCC22">
<Package Description="Gambit" Comments="Software Tools for Game Theory" InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="gambit.cab" EmbedCab="yes" />

Expand Down
8 changes: 4 additions & 4 deletions contrib/mac/Info.plist → build_support/osx/Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>16.4.0</string>
<string>@GAMBIT_VERSION@</string>
<key>CFBundleShortVersionString</key>
<string>16.4.0</string>
<string>@GAMBIT_VERSION@</string>
<key>CFBundleGetInfoString</key>
<string>Gambit version 16.4.0, (c) 1994-2025 The Gambit Project</string>
<string>Gambit version @GAMBIT_VERSION@, (c) 1994-2025 The Gambit Project</string>
<key>CFBundleLongVersionString</key>
<string>16.4.0, (c) 1994-2025 The Gambit Project</string>
<string>@GAMBIT_VERSION@, (c) 1994-2025 The Gambit Project</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 1994-2025 The Gambit Project</string>
<key>LSRequiresCarbon</key>
Expand Down
File renamed without changes.
7 changes: 5 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
dnl

AC_INIT([gambit],[16.4.0])
AC_INIT([gambit],[m4_esyscmd_s([cat build_support/GAMBIT_VERSION])])
AC_CONFIG_SRCDIR([src/gambit.h])
AM_INIT_AUTOMAKE([subdir-objects foreign])
dnl AC_CONFIG_MACRO_DIR([m4])
Expand Down Expand Up @@ -145,5 +145,8 @@ AC_SUBST(WX_CXXFLAGS)
REZFLAGS=`echo $CXXFLAGS $WX_CXXFLAGS | sed 's/-mthreads//g' | sed 's/-g//g' | sed 's/-O. / /g' | sed 's/-I/--include-dir /g'`
AC_SUBST(REZFLAGS)

AC_CONFIG_FILES([Makefile])
GAMBIT_VERSION=`cat build_support/GAMBIT_VERSION`
AC_SUBST(GAMBIT_VERSION)

AC_CONFIG_FILES([Makefile build_support/osx/Info.plist build_support/msw/gambit.wxs])
AC_OUTPUT
17 changes: 13 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import pathlib

#
# Gambit documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 21 14:35:06 2010.
Expand Down Expand Up @@ -53,10 +55,17 @@
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = "16.4"
# The full version, including alpha/beta/rc tags.
release = "16.4.0"

_version_file = pathlib.Path(__file__).parent.parent / "build_support/GAMBIT_VERSION"
if _version_file.exists():
_full_version = _version_file.read_text().strip()
# The short X.Y version.
version = ".".join(_full_version.split(".")[:2])
# The full version, including alpha/beta/rc tags.
release = _full_version
else:
# Throw error if GAMBIT_VERSION file not found
raise FileNotFoundError("GAMBIT_VERSION file not found")

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
57 changes: 57 additions & 0 deletions doc/developer.contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,60 @@ To add a contributor, comment on a GitHub Issue or Pull Request, asking @all-con
@all-contributors please add @<username> for <contributions>

Refer to the `emoji key <https://allcontributors.org/docs/en/emoji-key>`__ for a list of contribution types.

Releases & maintenance branches
-------------------------------

Releases of Gambit are made by core developers.
Details of previous releases can be found in the `GitHub releases page <https://github.com/gambitproject/gambit/releases>`__.

Branches labeled ``maintX`` and ``maintX_Y``, where ``X`` is the major version number and ``Y`` is the minor version number, are associated with releases and point to the latest commit on a stable version.
Navigate to the Gambit repository on GitHub and select the `branches` tab to see the list of active maintenance branches.
Be sure to delete any maintenance branches that are no longer being maintained.

.. _making-a-new-release:

Making a new release
^^^^^^^^^^^^^^^^^^^^

When making a new release of Gambit, follow these steps:

1. Create a new branch from the latest commit on the ``master`` branch named ``maintX_Y``, where ``X`` is the major version number and ``Y`` is the minor version number of the new release.

2. Update the version number in the ``build_support/GAMBIT_VERSION`` file to ``X.Y.Z``.

All other files will automatically use the updated version number:

- `pyproject.toml` reads from GAMBIT_VERSION file at build time
- `configure.ac` reads from GAMBIT_VERSION file and substitutes into `build_support/osx/Info.plist` and `build_support/msw/gambit.wxs`
- `src/pygambit/__init__.py` reads from installed package metadata or GAMBIT_VERSION file
- `doc/conf.py` reads from GAMBIT_VERSION file at documentation build time
- Documentation pages reference the `|release|` substitution variable to automatically reflect the updated version number.

3. Update the `ChangeLog` file with a summary of changes

4. Once there are no further commits to be made for the release, create a tag for the release from the latest commit on the maintenance branch. ::

git tag -a vX.Y.Z -m "Gambit version X.Y.Z"

5. Push the maintenance branch and tags to the GitHub repository. ::

git push origin maintX_Y
git push origin --tags

6. Create a new release on the `GitHub releases page <https://github.com/gambitproject/gambit/releases>`__, using the tag created in step 4.
Include a summary of changes from the `ChangeLog` file in the release notes.

7. Currently there is no automated process for pushing the new release to PyPI. This must be done manually.

.. TODO: update this process to be automated via GitHub Actions: Issue #557

Patching maintained versions
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

If you have bug fixes that should be applied across maintained versions:

1. Make a branch from the oldest maintenance branch to which the change applies
2. Apply the change and make a pull request to that maintenance branch
3. After the pull request is merged, open new pull requests to each subsequent maintenance branch and finally to the master branch, merging each in turn
4. Create new releases from each maintenance branch as needed, following the steps in :ref:`making-a-new-release`.
8 changes: 4 additions & 4 deletions doc/tools.convert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ outputting the strategic form of the game in one of these formats:
Suppresses printing of the banner at program launch.


Example invocation for HTML output::
Example invocation for HTML output

$ gambit-convert -O html 2x2.nfg
Convert games among various file formats
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

<center><h1>Two person 2 x 2 game with unique mixed equilibrium</h1></center>
Expand All @@ -51,11 +51,11 @@ Example invocation for HTML output::
align=center>1,0</td></tr></table>


Example invocation for LaTeX output::
Example invocation for LaTeX output

$ gambit-convert -O sgame 2x2.nfg
Convert games among various file formats
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

\begin{game}{2}{2}[Player 1][Player 2]
Expand Down
8 changes: 4 additions & 4 deletions doc/tools.enummixed.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,23 +66,23 @@ points.
Computing the equilibria, in mixed strategies, of :download:`e02.nfg
<../contrib/games/e02.nfg>`, the reduced strategic form of the example
in Figure 2 of Selten (International Journal of Game Theory,
1975)::
1975)

$ gambit-enummixed e02.nfg
Compute Nash equilibria by enumerating extreme points
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,1,0,0,1,0
NE,1,0,0,1/2,1/2

In fact, the game e02.nfg has a one-dimensional continuum of
equilibria. This fact can be observed by examining the connectedness
information using the `-c` switch::
information using the `-c` switch

$ gambit-enummixed -c e02.nfg
Compute Nash equilibria by enumerating extreme points
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,1,0,0,1,0
Expand Down
4 changes: 2 additions & 2 deletions doc/tools.enumpoly.rst
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,11 @@ support of some set of equilibria.
Computing equilibria of the strategic game :download:`e01.nfg
<../contrib/games/e01.efg>`, the example in Figure 1 of Selten
(International Journal of Game Theory, 1975) sometimes called
"Selten's horse"::
"Selten's horse"

$ gambit-enumpoly e01.nfg
Compute Nash equilibria by solving polynomial systems
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,1.000000,0.000000,1.000000,0.000000,0.000000,1.000000
Expand Down
16 changes: 10 additions & 6 deletions doc/tools.enumpure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,33 +54,37 @@ pure-strategy Nash equilibria.

Computing the pure-strategy equilibria of extensive game :download:`e02.efg
<../contrib/games/e02.efg>`, the example in Figure 2 of Selten
(International Journal of Game Theory, 1975)::
(International Journal of Game Theory, 1975)

$ gambit-enumpure e02.efg

Search for Nash equilibria in pure strategies
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project

Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project

This is free software, distributed under the GNU GPL

NE,1,0,0,0,1,0

With the `-S` switch, the set of equilibria returned is the same,
except expressed in strategic game strategies rather than behavior
strategies::
strategies

$ gambit-enumpure -S e02.efg

Search for Nash equilibria in pure strategies
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,1,0,0,1,0

The `-A` switch considers only behavior strategy profiles where there
is no way for a player to improve his payoff by changing action at
only one information set; therefore the set of solutions is larger::
only one information set; therefore the set of solutions is larger

$ gambit-enumpure -A e02.efg
Search for Nash equilibria in pure strategies
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,1,0,1,0,1,0
Expand Down
14 changes: 7 additions & 7 deletions doc/tools.gnm.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ subsets of equilibria being found.

Computing an equilibrium of :download:`e02.nfg <../contrib/games/e02.nfg>`,
the reduced strategic form of the example in Figure 2 of Selten
(International Journal of Game Theory, 1975)::
(International Journal of Game Theory, 1975)

$ gambit-gnm e02.nfg
Compute Nash equilibria using a global Newton method
Gametracer version 0.2, Copyright (C) 2002, Ben Blum and Christian Shelton
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL
$ gambit-gnm e02.nfg

NE,1,0,2.99905e-12,0.5,0.5
Compute Nash equilibria using a global Newton method
Gametracer version 0.2, Copyright (C) 2002, Ben Blum and Christian Shelton
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL
NE,1,0,2.99905e-12,0.5,0.5


.. seealso::
Expand Down
5 changes: 3 additions & 2 deletions doc/tools.ipa.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,13 @@ equilibria being found.

Computing an equilibrium of :download:`e02.nfg <../contrib/games/e02.nfg>`,
the reduced strategic form of the example in Figure 2 of Selten
(International Journal of Game Theory, 1975)::
(International Journal of Game Theory, 1975)

$ gambit-ipa e02.nfg

Compute Nash equilibria using iterated polymatrix approximation
Gametracer version 0.2, Copyright (C) 2002, Ben Blum and Christian Shelton
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,1.000000,0.000000,0.000000,1.000000,0.000000
Expand Down
4 changes: 2 additions & 2 deletions doc/tools.lcp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ game.

Computing an equilibrium of extensive game :download:`e02.efg
<../contrib/games/e02.efg>`, the example in Figure 2 of Selten
(International Journal of Game Theory, 1975)::
(International Journal of Game Theory, 1975)

$ gambit-lcp e02.efg
Compute Nash equilibria by solving a linear complementarity program
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,1,0,1/2,1/2,1/2,1/2
4 changes: 2 additions & 2 deletions doc/tools.liap.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ not guaranteed to find all, or even any, Nash equilibria.

Computing an equilibrium in mixed strategies of :download:`e02.efg
<../contrib/games/e02.efg>`, the example in Figure 2 of Selten
(International Journal of Game Theory, 1975)::
(International Journal of Game Theory, 1975)

$ gambit-liap e02.nfg
Compute Nash equilibria by minimizing the Lyapunov function
Gambit version 16.4.0, Copyright (C) 1994-2025, The Gambit Project
Gambit version |release|, Copyright (C) 1994-2025, The Gambit Project
This is free software, distributed under the GNU GPL

NE,0.998701,0.000229,0.001070,0.618833,0.381167
Loading
Loading