Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ QualifierAlignment: Custom
QualifierOrder:
- static
- inline
- constexpr
- type
- const
- constexpr
- volatile
- restrict
RawStringFormats:
Expand Down
14 changes: 10 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,20 @@ substantial implementation so its maintenance value and scope can be agreed upon
just fix
just check
just ci
just build-parallel
```

`just check` is the fast, non-mutating source and tooling gate, including the repository-owned Semgrep policy and
its fixtures. `just ci` adds the supported build and complete 22-entry CTest suite: all 103 doctest unit scenarios
and 21 CLI integration tests. When changing C++ behavior, also run
its fixtures. `just ci` adds the supported build and complete 24-entry CTest suite: all 103 doctest unit scenarios
and 23 CLI integration tests. `just build-parallel` builds the distinct
CGAL/oneTBB configuration and runs the same scientific suite plus the
replayable parallel stress launcher, for 25 entries. When changing C++ behavior, also run
`just clang-tidy` with the pinned LLVM 22 toolchain and review its advisory diagnostics.
GitHub Actions runs the same `just ci` contract in its Ubuntu GCC, Ubuntu Clang, macOS AppleClang, and Windows
MSVC jobs. The Windows job continues to compile with native MSVC; LLVM tooling is used only for source formatting.
GitHub Actions runs `just ci` in its Ubuntu GCC, Ubuntu Clang, macOS AppleClang, and Windows MSVC jobs. The two
Ubuntu jobs also run `just build-parallel` to exercise the opt-in CGAL/oneTBB contract. The Windows job continues
to compile with native MSVC; LLVM tooling is used only for source formatting. Toolchain setup is pkgx-first;
because pkgx does not currently publish its CMake and Ninja packages for Windows, that job uses the exact Justfile
pins available as PyPI wheels through `uv tool install --no-build`.

6. Run the relevant Linux sanitizer configuration for changes involving memory, lifetime, undefined behavior, or
concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-just/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,6 @@ runs:
echo "version=$version" >> "$GITHUB_OUTPUT"

- name: Install Just
uses: taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2.83.2
uses: taiki-e/install-action@7572810d7dd469b651bb7793945692cf78da5dd7 # v2.85.0
with:
tool: just@${{ steps.resolve.outputs.version }}
53 changes: 44 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,25 @@ jobs:
compiler_package: gnu.org/gcc@16
cc: gcc
cxx: g++
run_parallel_contract: true
- name: Ubuntu Clang
os: ubuntu-latest
compiler_package: llvm.org@22
cc: clang
cxx: clang++
run_parallel_contract: true
- name: macOS AppleClang
os: macos-latest
compiler_package: ""
cc: clang
cxx: clang++
run_parallel_contract: false
- name: Windows MSVC
os: windows-latest
compiler_package: ""
cc: cl
cxx: cl
run_parallel_contract: false

steps:
- name: Disable Git autocrlf on Windows
Expand Down Expand Up @@ -76,16 +80,35 @@ jobs:
shell: bash
run: |
{
echo "cmake=$(just --evaluate cmake_version)"
echo "llvm=$(just --evaluate llvm_version)"
echo "ninja=$(just --evaluate ninja_version)"
echo "ninja-windows-wheel=$(just --evaluate ninja_windows_wheel_version)"
echo "uv=$(just --evaluate uv_version)"
echo "zizmor=$(just --evaluate zizmor_version)"
} >> "$GITHUB_OUTPUT"

- name: Set up canonical CI environment with pkgx
if: runner.os != 'Windows'
uses: pkgxdev/setup@4d4ae97af87ccb39ab8be4e073dea697fef2c6f7 # v5.0.0
with:
+: llvm.org@${{ steps.tool-versions.outputs.llvm }}
+: >-
llvm.org@${{ steps.tool-versions.outputs.llvm }}
cmake.org@${{ steps.tool-versions.outputs.cmake }}
ninja-build.org@${{ steps.tool-versions.outputs.ninja }}

- name: Resolve pkgx certificate bundle
if: runner.os != 'Windows'
shell: bash
run: |
ssl_cert_file="$(
env -u SSL_CERT_FILE pkgx +curl.se/ca-certs env |
sed -n 's/^SSL_CERT_FILE=//p'
)"
if [[ -z "$ssl_cert_file" || ! -r "$ssl_cert_file" ]]; then
echo "pkgx CA bundle is missing or unreadable: $ssl_cert_file" >&2
exit 1
fi
echo "SSL_CERT_FILE=$ssl_cert_file" >> "$GITHUB_ENV"

- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
Expand All @@ -97,13 +120,17 @@ jobs:
with:
version: ${{ steps.tool-versions.outputs.uv }}

- name: Synchronize Python development dependencies
run: uv sync --locked --group dev

- name: Install zizmor
uses: taiki-e/install-action@07b4745e0c39a41822af610387492e3e53aa222b # v2.83.4
with:
tool: zizmor@${{ steps.tool-versions.outputs.zizmor }}
# pkgx's CMake and Ninja packages do not currently support Windows.
- name: Set up pinned Windows wheel toolchain
if: runner.os == 'Windows'
shell: pwsh
env:
CMAKE_VERSION: ${{ steps.tool-versions.outputs.cmake }}
NINJA_VERSION: ${{ steps.tool-versions.outputs.ninja-windows-wheel }}
run: |
uv tool install --no-build "cmake==$env:CMAKE_VERSION"
uv tool install --no-build "ninja==$env:NINJA_VERSION"
uv tool dir --bin | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Install pinact on Windows
if: runner.os == 'Windows'
Expand Down Expand Up @@ -133,6 +160,14 @@ jobs:
CXX: ${{ matrix.cxx }}
run: just ci

- name: Run the opt-in CGAL/oneTBB contract
if: matrix.run_parallel_contract
env:
CC: ${{ matrix.cc }}
CDT_PKGX_COMPILER_PACKAGE: ${{ matrix.compiler_package }}
CXX: ${{ matrix.cxx }}
run: just build-parallel

Comment thread
coderabbitai[bot] marked this conversation as resolved.
build:
name: build
if: ${{ always() }}
Expand Down
34 changes: 31 additions & 3 deletions .github/workflows/codecov-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,40 @@ jobs:
- name: Set up Just
uses: ./.github/actions/setup-just

- name: Setup GCC
- name: Resolve coverage tool versions
id: tool-versions
run: |
{
echo "cmake=$(just --evaluate cmake_version)"
echo "ninja=$(just --evaluate ninja_version)"
} >> "$GITHUB_OUTPUT"

- name: Set up coverage toolchain
uses: pkgxdev/setup@4d4ae97af87ccb39ab8be4e073dea697fef2c6f7 # v5.0.0
with:
+: gnu.org/gcc@16
+: >-
gnu.org/gcc@16
cmake.org@${{ steps.tool-versions.outputs.cmake }}
ninja-build.org@${{ steps.tool-versions.outputs.ninja }}

- run: gcc --version
- name: Resolve pkgx certificate bundle
shell: bash
run: |
ssl_cert_file="$(
env -u SSL_CERT_FILE pkgx +curl.se/ca-certs env |
sed -n 's/^SSL_CERT_FILE=//p'
)"
if [[ -z "$ssl_cert_file" || ! -r "$ssl_cert_file" ]]; then
echo "pkgx CA bundle is missing or unreadable: $ssl_cert_file" >&2
exit 1
fi
echo "SSL_CERT_FILE=$ssl_cert_file" >> "$GITHUB_ENV"

- name: Report coverage toolchain
run: |
cmake --version
ninja --version
gcc --version

- name: Restore artifacts or setup vcpkg
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
Expand Down
47 changes: 46 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.21)
cmake_minimum_required(VERSION 4.4.0)

# vcpkg settings must be set before project()
if(DEFINED ENV{VCPKG_ROOT} AND NOT DEFINED CMAKE_TOOLCHAIN_FILE)
Expand Down Expand Up @@ -26,10 +26,48 @@ project(
DESCRIPTION "Fast Causal Dynamical Triangulations in C++"
LANGUAGES CXX)

# CDT++ does not use C++ modules, so avoid unnecessary dependency scanning.
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)

# CMake project versions are numeric, so keep the release-candidate suffix in
# the product version used by executables and release metadata.
set(CDT_VERSION_SUFFIX "-rc2")
set(CDT_VERSION "${PROJECT_VERSION}${CDT_VERSION_SUFFIX}")
set(CDT_SOURCE_REVISION "unknown")
find_package(Git QUIET)
if(GIT_FOUND)
if(IS_DIRECTORY "${PROJECT_SOURCE_DIR}/.git")
set_property(
DIRECTORY APPEND
PROPERTY CMAKE_CONFIGURE_DEPENDS
"${PROJECT_SOURCE_DIR}/.git/HEAD"
"${PROJECT_SOURCE_DIR}/.git/index")
endif()
execute_process(
COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
RESULT_VARIABLE _git_revision_result
OUTPUT_VARIABLE _git_revision
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(_git_revision_result EQUAL 0)
set(CDT_SOURCE_REVISION "${_git_revision}")
execute_process(
COMMAND "${GIT_EXECUTABLE}" status --porcelain --untracked-files=no
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
RESULT_VARIABLE _git_status_result
OUTPUT_VARIABLE _git_status
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(_git_status_result EQUAL 0 AND NOT _git_status STREQUAL "")
string(APPEND CDT_SOURCE_REVISION "-dirty")
endif()
endif()
unset(_git_revision)
unset(_git_revision_result)
unset(_git_status)
unset(_git_status_result)
endif()
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# Project settings
include(cmake/StandardProjectSettings.cmake)
Expand Down Expand Up @@ -79,6 +117,13 @@ option(ENABLE_PARALLEL_TRIANGULATION
option(ENABLE_DEPRECATION_ERRORS
"Treat deprecated C++ and CGAL API use in project targets as an error" ON)

if(ENABLE_PARALLEL_TRIANGULATION AND ENABLE_SANITIZER_THREAD)
message(
FATAL_ERROR
"The pinned CGAL/oneTBB parallel path is not a supported ThreadSanitizer combination. Use the sequential tsan preset and the parallel asan preset."
)
endif()

target_compile_definitions(
project_options
INTERFACE CDT_ENABLE_PARALLEL_TRIANGULATION=$<BOOL:${ENABLE_PARALLEL_TRIANGULATION}>)
Expand Down
55 changes: 51 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
{
"version": 3,
"$schema": "https://raw.githubusercontent.com/Kitware/CMake/v4.4.0/Help/manual/presets/schema.json",
"version": 12,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21,
"major": 4,
"minor": 4,
"patch": 0
},
"configurePresets": [
{
"name": "common",
"hidden": true,
"$comment": "Uninitialized-variable diagnostics are disabled because vcpkg and imported package configurations probe optional variables before defining them.",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_CXX_EXTENSIONS": false,
"CMAKE_CXX_STANDARD": "23",
"CMAKE_CXX_STANDARD_REQUIRED": true
},
"warnings": {
"author": true,
"deprecated": true,
"experimental": true,
"installAbsoluteDestination": true,
"policy": true,
"uninitialized": false,
"unusedCli": true
},
"errors": {
"author": true,
"deprecated": true,
"experimental": true,
"installAbsoluteDestination": true,
"policy": true,
"uninitialized": false,
"unusedCli": true
}
},
{
Expand All @@ -27,7 +47,6 @@
"rhs": "Linux"
},
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Wcast-qual -Wformat=2 -Werror=float-equal -Wshadow -Wcast-align -Wunused -Wnull-dereference -Wdouble-promotion -Wimplicit-fallthrough -Wextra-semi -Woverloaded-virtual -Wnon-virtual-dtor -Wold-style-cast",
Expand All @@ -47,6 +66,16 @@
"ENABLE_TESTING": true
}
},
{
"name": "parallel",
"displayName": "Supported CGAL/oneTBB build",
"description": "Configure the opt-in CGAL parallel insertion and removal path with tests",
"inherits": "reference",
"binaryDir": "${sourceDir}/out/build/parallel",
"cacheVariables": {
"ENABLE_PARALLEL_TRIANGULATION": true
}
},
{
"name": "debug",
"displayName": "Local debug build",
Expand Down Expand Up @@ -98,6 +127,11 @@
"name": "reference",
"displayName": "Build the supported headless reference targets",
"configurePreset": "reference"
},
{
"name": "parallel",
"displayName": "Build the supported CGAL/oneTBB targets",
"configurePreset": "parallel"
}
],
"testPresets": [
Expand All @@ -113,6 +147,19 @@
"noTestsAction": "error",
"stopOnFailure": false
}
},
{
"name": "parallel-smoke",
"displayName": "Run the CGAL/oneTBB invariant and stress suite",
"description": "Run the complete suite with the parallel TDS plus the replayable stress contract",
"configurePreset": "parallel",
"output": {
"outputOnFailure": true
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
}
}
]
}
Loading
Loading