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
12 changes: 8 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Thank you for helping improve CDT++.

CDT++ is being prepared for one final C++23 release, v1.0.0, after which this repository will be archived. The project
CDT++ v1.0.0-rc1 is the release candidate for the final C++23 release, v1.0.0, after which this repository will be
archived. The project
is maintained as a scientific reference implementation and regression oracle for
[causal-triangulations](https://github.com/acgetchell/causal-triangulations), its supported Rust successor. The
maintenance and archival scope is tracked by
Expand Down Expand Up @@ -46,9 +47,12 @@ substantial implementation so its maintenance value and scope can be agreed upon
just ci
```

`just check` is the fast, non-mutating source and tooling gate. `just ci` adds the supported build and 22-test smoke
suite. When changing C++ behavior, also run `just clang-tidy` with the pinned LLVM 22 toolchain and review its
advisory diagnostics.
`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 21-entry CTest suite: all 83 doctest unit scenarios
and 20 CLI integration tests. 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.

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/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
uses: taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2.83.2
with:
tool: just@${{ steps.resolve.outputs.version }}
12 changes: 1 addition & 11 deletions .github/workflows/_sanitizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,8 @@ jobs:
- name: Set up Just
uses: ./.github/actions/setup-just

- name: Resolve LLVM version
id: llvm-version
shell: bash
run: echo "version=$(just --evaluate llvm_version)" >> "$GITHUB_OUTPUT"

- name: Set up Clang
- name: Set up pkgx
uses: pkgxdev/setup@4d4ae97af87ccb39ab8be4e073dea697fef2c6f7 # v5.0.0
with:
+: llvm.org@${{ steps.llvm-version.outputs.version }}

- name: Report compiler version
run: clang --version

- name: Restore artifacts or set up vcpkg
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
Expand Down
92 changes: 40 additions & 52 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,69 +44,34 @@ jobs:
- name: Windows MSVC
os: windows-latest
compiler_package: ""
cc: ""
cxx: ""
cc: cl
cxx: cl

steps:
- name: Disable Git autocrlf on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
git config --global core.autocrlf false
git config --global core.eol lf

- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
fetch-depth: 0
persist-credentials: false
submodules: true

- name: Set up Unix environment with pkgx
if: runner.os != 'Windows'
uses: pkgxdev/setup@4d4ae97af87ccb39ab8be4e073dea697fef2c6f7 # v5.0.0

- name: Activate MSVC
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
arch: x64

- name: Select the Windows vcpkg triplet
if: runner.os == 'Windows'
shell: pwsh
run: Add-Content -Path $env:GITHUB_ENV -Value 'VCPKG_DEFAULT_TRIPLET=x64-windows'

- name: Restore artifacts or set up vcpkg
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6

- name: Build and test Unix
if: runner.os != 'Windows'
env:
CC: ${{ matrix.cc }}
CDT_PKGX_COMPILER_PACKAGE: ${{ matrix.compiler_package }}
CXX: ${{ matrix.cxx }}
run: ./scripts/pkgx-build.sh

- name: Configure Windows
if: runner.os == 'Windows'
run: cmake --preset reference -S .

- name: Build Windows
if: runner.os == 'Windows'
run: cmake --build --preset reference --parallel 2

- name: Test Windows
if: runner.os == 'Windows'
run: ctest --preset reference-smoke

quality:
name: Repository quality checks
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Set up Just
uses: ./.github/actions/setup-just

- name: Resolve tool versions
- name: Resolve CI tool versions
id: tool-versions
shell: bash
run: |
Expand All @@ -116,7 +81,8 @@ jobs:
echo "zizmor=$(just --evaluate zizmor_version)"
} >> "$GITHUB_OUTPUT"

- name: Set up repository tools with pkgx
- 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 }}
Expand All @@ -135,26 +101,48 @@ jobs:
run: uv sync --locked --group dev

- name: Install zizmor
uses: taiki-e/cache-cargo-install-action@417450f3c33ee20393705369577571770643d4c7 # v3.0.7
uses: taiki-e/install-action@43aecc8d72668fbcfe75c31400bc4f890f1c5853 # v2.83.2
with:
tool: zizmor@${{ steps.tool-versions.outputs.zizmor }}

- name: Check repository quality
run: just check
- name: Install pinact on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$installDirectory = Join-Path $env:RUNNER_TEMP 'pinact-bin'
New-Item -ItemType Directory -Force -Path $installDirectory | Out-Null
$env:GOBIN = $installDirectory
$pinactModule = just --evaluate pinact_module
go install $pinactModule
$installDirectory >> $env:GITHUB_PATH

- name: Select the Windows vcpkg triplet
if: runner.os == 'Windows'
shell: pwsh
run: Add-Content -Path $env:GITHUB_ENV -Value 'VCPKG_DEFAULT_TRIPLET=x64-windows'

- name: Restore artifacts or set up vcpkg
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
with:
vcpkgDirectory: ${{ github.workspace }}/.cache/vcpkg

- name: Run the canonical local CI contract
env:
CC: ${{ matrix.cc }}
CDT_PKGX_COMPILER_PACKAGE: ${{ matrix.compiler_package }}
CXX: ${{ matrix.cxx }}
run: just ci

build:
name: build
if: ${{ always() }}
needs:
- platform
- quality
runs-on: ubuntu-latest

steps:
- name: Verify platform matrix
env:
PLATFORM_RESULT: ${{ needs.platform.result }}
QUALITY_RESULT: ${{ needs.quality.result }}
run: |
test "${PLATFORM_RESULT}" = success
test "${QUALITY_RESULT}" = success
14 changes: 13 additions & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ jobs:
with:
persist-credentials: false

- name: Set up Just
if: matrix.language == 'c-cpp'
uses: ./.github/actions/setup-just

- name: Set up C++ environment with pkgx
if: matrix.language == 'c-cpp'
uses: pkgxdev/setup@4d4ae97af87ccb39ab8be4e073dea697fef2c6f7 # v5.0.0
Expand All @@ -72,6 +76,14 @@ jobs:
if: matrix.language == 'c-cpp'
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6

- name: Prepare C++ dependencies outside CodeQL tracing
if: matrix.language == 'c-cpp'
env:
CC: gcc
CDT_PKGX_COMPILER_PACKAGE: gnu.org/gcc@16
CXX: g++
run: just codeql-prepare

- name: Initialize CodeQL
uses: github/codeql-action/init@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
with:
Expand All @@ -84,7 +96,7 @@ jobs:
CC: gcc
CDT_PKGX_COMPILER_PACKAGE: gnu.org/gcc@16
CXX: g++
run: ./scripts/pkgx-build.sh
run: just codeql-build

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@99df26d4f13ea111d4ec1a7dddef6063f76b97e9 # v4.37.0
Expand Down
20 changes: 17 additions & 3 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,23 @@ jobs:
permissions:
contents: write
steps:
- uses: DenverCoder1/doxygen-github-pages-action@a30f9538f8ef1305aeceb563018f452c7a62d200 # v2.0.0
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
persist-credentials: false

- name: Set up Just
uses: ./.github/actions/setup-just

- name: Set up pkgx
uses: pkgxdev/setup@4d4ae97af87ccb39ab8be4e073dea697fef2c6f7 # v5.0.0

- name: Build documentation
run: just docs

- name: Publish documentation
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
folder: docs/html
config_file: docs/Doxyfile
6 changes: 6 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# CDT++ intentionally scans tests/; Semgrep's built-in defaults do not.
.git/
.cache/
.venv/
out/
vcpkg_installed/
24 changes: 24 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
type: software
title: "CDT-plusplus: Causal Dynamical Triangulations in C++"
abstract: >-
A C++23 scientific reference implementation of 2+1-dimensional causal
dynamical triangulations, including foliated triangulation construction,
Pachner moves, the Regge action, and Metropolis-Hastings evolution.
authors:
- family-names: "Getchell"
given-names: "Adam"
email: "adam@adamgetchell.org"
orcid: "https://orcid.org/0000-0002-0797-0021"
version: "1.0.0-rc1"
date-released: "2026-07-20"
repository-code: "https://github.com/acgetchell/CDT-plusplus"
url: "https://github.com/acgetchell/CDT-plusplus"
license: BSD-3-Clause
keywords:
- "causal-dynamical-triangulations"
- "computational-geometry"
- "metropolis-hastings"
- "quantum-gravity"
- "regge-calculus"
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ unset(_vcpkg_install_options)

project(
CDT-plusplus
VERSION 0.1.8
VERSION 1.0.0
DESCRIPTION "Fast Causal Dynamical Triangulations in C++"
LANGUAGES CXX)

# 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 "-rc1")
set(CDT_VERSION "${PROJECT_VERSION}${CDT_VERSION_SUFFIX}")
configure_file(cmake/Version.hpp.in "${PROJECT_BINARY_DIR}/Version.hpp" @ONLY)

# Project settings
include(cmake/StandardProjectSettings.cmake)

Expand Down Expand Up @@ -114,7 +120,8 @@ find_package(fmt CONFIG REQUIRED)
find_package(Microsoft.GSL CONFIG REQUIRED)

# https://www.pcg-random.org
find_path(PCG_INCLUDE_DIRS "pcg_extras.hpp")
find_path(PCG_INCLUDE_DIRS "pcg_extras.hpp" REQUIRED)
target_include_directories(project_options SYSTEM INTERFACE "${PCG_INCLUDE_DIRS}")

find_package(Boost CONFIG REQUIRED COMPONENTS compat program_options)
target_link_libraries(project_options INTERFACE Boost::compat)
Expand All @@ -126,14 +133,12 @@ find_package(spdlog CONFIG REQUIRED)
find_package(TBB CONFIG REQUIRED)

# Header files
include_directories(BEFORE ${PROJECT_SOURCE_DIR}/include)
include_directories(BEFORE ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/include)

# doctest
if(ENABLE_TESTING)
enable_testing()
message(STATUS "Building tests. Look at /tests for unit tests.")
message(STATUS "Look at /tests/logs for spdlog results from unit tests.")
message(NOTICE "These logs can get quite big in DEBUG mode if you run all tests.")
message(STATUS "Building tests.")
add_subdirectory(tests)
endif()

Expand Down
10 changes: 2 additions & 8 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,12 @@
"testPresets": [
{
"name": "reference-smoke",
"displayName": "Run the supported reference smoke tests",
"description": "Exclude the full and duplicate unit-test registrations",
"displayName": "Run the complete unit and integration suite",
"description": "Run all registered unit and integration tests",
"configurePreset": "reference",
"output": {
"outputOnFailure": true
},
"filter": {
"exclude": {
"name": "^(cdt-unit-tests|cdt-utilities-tests)$",
"label": "reference-smoke-exclude"
}
},
"execution": {
"noTestsAction": "error",
"stopOnFailure": false
Expand Down
Loading
Loading