Skip to content
This repository was archived by the owner on Aug 12, 2026. It is now read-only.
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
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ endif()
# Header files
include_directories(BEFORE ${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/include)

# Compiled public-API example
add_subdirectory(examples)

# doctest
if(ENABLE_TESTING)
enable_testing()
Expand Down
6 changes: 3 additions & 3 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ccache_version := "4.13.6"
cgal_benchmark_binary := if os_family() == "windows" { "out/build/reference/tests/CDT_cgal_benchmark.exe" } else { "out/build/reference/tests/CDT_cgal_benchmark" }
cmake_minimum_version := "4.4.0"
cmake_version := "4.4.1"
doxygen_version := "1.17.0"
doxygen_version := "1.16.1"
git_cliff_version := "2.13.1"
graphviz_version := "15.1.0"
just_version := "1.58.0"
Expand Down Expand Up @@ -381,12 +381,12 @@ default:
# Generate the API documentation in docs/html for local inspection or publishing.
[group('workflows')]
docs:
./scripts/doxygen.sh build "{{ doxygen_version }}" "{{ graphviz_version }}"
./scripts/doxygen.sh build "{{ doxygen_version }}" "{{ graphviz_version }}" "{{ python_version }}"

# Validate the generated API documentation without modifying the worktree.
[group('workflows')]
docs-check:
./scripts/doxygen.sh check "{{ doxygen_version }}" "{{ graphviz_version }}"
./scripts/doxygen.sh check "{{ doxygen_version }}" "{{ graphviz_version }}" "{{ python_version }}"

# Apply safe automatic formatting to C++/Python source and the Justfile.
[group('workflows')]
Expand Down
60 changes: 36 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ Arbitrary-precision numbers and functions are by [MPFR] and [GMP].
[Doxygen] provides automated document generation.
The supported C++ namespace and per-header contract are recorded in the
[C++ API boundary](docs/api-boundary.md).
The compiled [C++ API quickstart](docs/cpp-api-quickstart.md) demonstrates
validated construction, ten reported Metropolis proposals with separate
candidate-success and acceptance results, aggregate accounting, and a verified
persistence round trip.
The exact CGAL version, kernel, TDS, metadata, lifetime, TBB, benchmark, and
upgrade policies are recorded in the
[CGAL 6.2 integration contract](docs/cgal-integration.md).
Expand All @@ -84,13 +88,13 @@ Python and JSON Schema provide the local, offline cross-implementation compariso
### Regression-oracle scope

The principal reason to preserve this implementation is its causality-filtering Delaunay construction path in
[`include/Foliated_triangulation.hpp`](include/Foliated_triangulation.hpp). `find_invalid_timevalue_cells` classifies
[`include/Foliated_triangulation.hpp`](https://github.com/acgetchell/CDT-plusplus/blob/main/include/Foliated_triangulation.hpp). `find_invalid_timevalue_cells` classifies
cells from stored vertex time labels, `has_valid_timevalues` provides the predicate, `find_bad_vertex` selects a vertex
responsible for an acausal local configuration, and `fix_timevalues` removes offending vertices through CGAL so the
cavity is retriangulated until the foliation contract is satisfied.

The deterministic doctest scenario **"Detecting and fixing problems with vertices and cells"** in
[`tests/Foliated_triangulation_test.cpp`](tests/Foliated_triangulation_test.cpp) exercises this path with fixed points
[`tests/Foliated_triangulation_test.cpp`](https://github.com/acgetchell/CDT-plusplus/blob/main/tests/Foliated_triangulation_test.cpp) exercises this path with fixed points
and time labels. Its inputs, detected bad vertex, final initialization state, cell counts, and causal classification
are the first comparison fixture for `causal-triangulations`; exact Monte Carlo trajectories are not required to
match.
Expand Down Expand Up @@ -241,15 +245,17 @@ Windows development.
### Current reference-suite status

With the pinned baseline, the reference configuration and build succeed on
macOS with AppleClang. The cross-platform `just build` command runs all 128
macOS with AppleClang. The cross-platform `just build` command runs all 131
CTest registrations through `scripts/build.sh` on Unix and `scripts/build.bat`
on Windows: 104 doctest scenarios, 23 CLI integration tests, and one
arithmetic-backend correctness test. The same `reference-smoke` preset is the
on Windows: 106 doctest scenarios, 23 CLI integration tests, one compiled C++
API example, and one arithmetic-backend correctness test. The same
`reference-smoke` preset is the
supported local and CI contract; there are no overlapping focused
registrations that can pass while omitting another doctest suite. The current
`parallel` preset also registers 128 tests: 103 ordinary doctest scenarios, one
`parallel` preset also registers 129 tests: 103 ordinary doctest scenarios, one
parallel launcher containing five scenarios, the same 23 CLI integration
tests, and the arithmetic correctness test. The parallel-enabled
tests, the C++ API example, and the arithmetic correctness test. The
parallel-enabled
AddressSanitizer configuration exercises the same replayable stress contract.

## Setup
Expand All @@ -266,7 +272,7 @@ The smallest pkgx-assisted host setup is:
- pkgx
- Just, used by the recipes and `scripts/pkgx-build.sh` to resolve the repository's tool-version pins
- Python 3.14 for native dependency bootstrap, and uv when checking or running the Python support scripts
- Doxygen 1.17.0 and Graphviz 15.1.0 when checking or generating API documentation; pkgx can supply both
- Doxygen 1.16.1 and Graphviz 15.1.0 when checking or generating API documentation; pkgx can supply both

The pkgx build and documentation launchers supply their required tools ephemerally, including Git, Bash, CMake,
Ninja, Python, Doxygen, Graphviz, M4, Autoconf, Autoconf Archive, Automake, GNU Libtool, Texinfo, and pkg-config. If
Expand All @@ -289,7 +295,7 @@ development environment.

### Developer workflow

The repository-root [Justfile](Justfile) provides the same small command vocabulary used by the related projects:
The repository-root `Justfile` provides the same small command vocabulary used by the related projects:

```bash
just check # Fast, non-mutating local checks
Expand Down Expand Up @@ -346,7 +352,7 @@ 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`.

[pinact](https://github.com/suzuki-shunsuke/pinact) uses [`.pinact.yaml`](.pinact.yaml) to retain immutable action
[pinact](https://github.com/suzuki-shunsuke/pinact) uses [`.pinact.yaml`](https://github.com/acgetchell/CDT-plusplus/blob/main/.pinact.yaml) to retain immutable action
SHAs, readable release comments, and a seven-day release cooldown. `just update-actions` uses an installed pinact,
Go, or a pkgx-provided Go fallback, then requires `yamllint`, `actionlint`, and `zizmor` to pass. Direct third-party
Python dependencies install only from locked wheels. The uv environment provides `clang-format` and `yamllint`;
Expand Down Expand Up @@ -501,6 +507,9 @@ links (in 2+1 spacetime), and the timelike faces (in 3+1 spacetime).

Online documentation is at <https://adamgetchell.org/CDT-plusplus/>.

The compiled [C++ API quickstart](docs/cpp-api-quickstart.md) is the canonical
end-to-end public API example and is embedded verbatim in the generated site.

The scientific transition, proposal-ratio, geometry-delta, counter, and
precision contracts are recorded in
[`docs/metropolis-hastings.md`](docs/metropolis-hastings.md).
Expand All @@ -522,16 +531,19 @@ just docs-check
```

To generate the same publishable output used by the documentation workflow, run `just docs`; it writes `docs/html/`
only after strict generation succeeds. Both recipes require the pinned Doxygen and Graphviz versions and use pkgx
ephemerally when matching local tools are unavailable. `USE_MATHJAX` allows [MathJax] to render LaTeX formulae, and
only after strict generation and generated-site validation succeed. Both recipes require Doxygen 1.16.1 and Graphviz
15.1.0 and use pkgx ephemerally when matching local tools are unavailable. Doxygen 1.16.1 is the archival pin because
1.17.0 duplicates linked labels, emits broken alphabetical-index fragments for this repository, and injects an unused
Mermaid CDN dependency. `scripts/validate_generated_site.py` preserves that bounded workaround by checking the actual
HTML, local links and fragments, duplicate IDs and link labels, and required assets. `USE_MATHJAX` allows [MathJax] to render LaTeX formulae, and
`HAVE_DOT` enables [GraphViz] diagrams. Documentation validation is intentionally separate from the cross-platform
`just ci` contract. The documentation workflow runs `just docs` on Ubuntu and publishes its output to the `gh-pages`
branch.

## Citing CDT++

If CDT++ contributes to published work, cite the software using
[`CITATION.cff`](CITATION.cff) and cite the scientific methods relevant to the
[`CITATION.cff`](https://github.com/acgetchell/CDT-plusplus/blob/main/CITATION.cff) and cite the scientific methods relevant to the
work from [`REFERENCES.md`](REFERENCES.md). The software citation records the
current declared release, `1.0.0-rc3`. Advance its version and release date
together with the CMake, vcpkg, Python-tooling, Doxygen, and CLI metadata for
Expand All @@ -540,13 +552,15 @@ subsequent releases.
## Testing

Run `just build`; it selects `scripts/build.sh` on Unix or `scripts\build.bat`
on Windows, builds the test target, and executes all 128 CTest entries: 104
on Windows, builds the test target, and executes all 131 CTest entries: 106
doctest scenarios, 23 executable integration tests covering normal CLI use and
invalid-boundary rejection, and one arithmetic-backend correctness test
invalid-boundary rejection, one compiled C++ API example, and one
arithmetic-backend correctness test
labeled `scientific`. The parallel-enabled AddressSanitizer and `parallel`
configurations register 103 ordinary doctest scenarios, one launcher
containing five scenarios labeled `unit`, `parallel`, and `configuration`, the
same 23 integration tests, and the arithmetic test, for 128 CTest entries.
same 23 integration tests, the C++ API example, and the arithmetic test, for 129
CTest entries.
Every process-level test is labeled `integration`, and invalid-input tests also
carry the `cli-boundary` subcategory. Run `just ci` for the complete local
validation gate.
Expand Down Expand Up @@ -617,7 +631,7 @@ separate branch-coverage rate.

### Static Analysis

Python 3.14 is selected by [`.python-version`](.python-version), uv locks the environment in `uv.lock`, Ruff owns
Python 3.14 is selected by [`.python-version`](https://github.com/acgetchell/CDT-plusplus/blob/main/.python-version), uv locks the environment in `uv.lock`, Ruff owns
Python formatting and linting, and ty owns static type checking. Run `just python-sync` once and then use
`just python-check` or `just python-fix`; both commands are also part of the repository-wide validation recipes.

Expand Down Expand Up @@ -709,13 +723,11 @@ Optional:

## Issues

- [vcpkg]'s version of [date] has an unfixed bug [#23637] which produces `use-of-uninitialized-value` in [MemorySanitizer].
- [vcpkg] has issues with `fontconfig:arm64-osx` [#40623].
- [vcpkg] fails to build [gmp] on Linux (which breaks CI) [#45336]
Current work and known limitations are tracked in the
[CDT++ GitHub issue tracker](https://github.com/acgetchell/CDT-plusplus/issues).
The README does not duplicate a hardcoded issue list because tracker state
changes independently of repository releases.

[#45336]: https://github.com/microsoft/vcpkg/issues/45336
[#40623]: https://github.com/microsoft/vcpkg/issues/40623
[#23637]: https://github.com/microsoft/vcpkg/issues/23637
[CDT]: REFERENCES.md#cdt-framework-2001
[CGAL]: REFERENCES.md#cgal-triangulations
[CMake]: https://www.cmake.org
Expand Down Expand Up @@ -743,7 +755,7 @@ Optional:
[C++]: https://isocpp.org/
[Pitchfork Layout]: https://api.csswg.org/bikeshed/?force=1&url=https://raw.githubusercontent.com/vector-of-bool/pitchfork/develop/data/spec.bs#tld.docs
[PCG]: REFERENCES.md#pcg-random-number-generators
[TestU01]: http://simul.iro.umontreal.ca/testu01/tu01.html
[TestU01]: https://simul.iro.umontreal.ca/testu01/
[CONTRIBUTING.md]: https://github.com/acgetchell/CDT-plusplus/blob/main/.github/CONTRIBUTING.md
[CODE_OF_CONDUCT.md]: https://github.com/acgetchell/CDT-plusplus/blob/main/.github/CODE_OF_CONDUCT.md
[GitHub Actions]: https://github.com/features/actions
Expand Down
2 changes: 1 addition & 1 deletion REFERENCES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## How to Cite This Software

If CDT++ contributes to research or a project, cite it using the structured
metadata in [`CITATION.cff`](CITATION.cff). GitHub and other citation tools can
metadata in [`CITATION.cff`](https://github.com/acgetchell/CDT-plusplus/blob/16d1c769afc67e06f07639f6fd9de8136974e282/CITATION.cff). GitHub and other citation tools can
generate BibTeX, APA, and additional formats from that file.

Quick citation for the current declared release:
Expand Down
60 changes: 60 additions & 0 deletions cmake/RunCppApiQuickstartTest.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
if(NOT DEFINED TEST_EXECUTABLE OR NOT EXISTS "${TEST_EXECUTABLE}")
message(FATAL_ERROR "TEST_EXECUTABLE must name a built executable")
endif()

if(NOT DEFINED TEST_OUTPUT OR TEST_OUTPUT STREQUAL "")
message(FATAL_ERROR "TEST_OUTPUT must name the quickstart payload")
endif()

file(REMOVE "${TEST_OUTPUT}" "${TEST_OUTPUT}.meta")

execute_process(
COMMAND "${TEST_EXECUTABLE}" "${TEST_OUTPUT}"
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
RESULT_VARIABLE run_result
OUTPUT_VARIABLE run_output
ERROR_VARIABLE run_error)
if(NOT run_result EQUAL 0)
message(FATAL_ERROR "C++ API quickstart failed:\n${run_output}\n${run_error}")
endif()

set(move_pattern "[(](2,3|3,2|2,6|6,2|4,4)[)]")
set(result_pattern "accepted=(yes|no), successful=(yes|no)")
foreach(proposal RANGE 1 10)
if(NOT run_output
MATCHES "proposal ${proposal}: move ${move_pattern}, ${result_pattern}")
message(
FATAL_ERROR
"Quickstart did not report proposal ${proposal} completely:\n${run_output}")
endif()
endforeach()

string(
REGEX MATCHALL
"proposal [0-9]+: move ${move_pattern}, ${result_pattern}"
proposal_lines "${run_output}")
list(LENGTH proposal_lines proposal_count)
if(NOT proposal_count EQUAL 10)
message(FATAL_ERROR "Expected 10 proposal reports, found ${proposal_count}:\n${run_output}")
endif()

if(NOT run_output
MATCHES
"There were 10 proposed moves with [0-9]+ accepted moves and [0-9]+ rejected moves[.]")
message(FATAL_ERROR "Quickstart aggregate proposal summary is missing:\n${run_output}")
endif()
if(NOT run_output
MATCHES
"There were 10 candidate construction attempts with [0-9]+ successful candidates and [0-9]+ failed candidates[.]")
message(FATAL_ERROR "Quickstart candidate summary is missing:\n${run_output}")
endif()

if(NOT EXISTS "${TEST_OUTPUT}" OR NOT EXISTS "${TEST_OUTPUT}.meta")
message(FATAL_ERROR "Quickstart did not publish its payload and metadata sidecar")
endif()
file(READ "${TEST_OUTPUT}.meta" metadata)
if(NOT metadata MATCHES "transition_trace[.]count=10")
message(FATAL_ERROR "Quickstart metadata does not record all ten transitions:\n${metadata}")
endif()
if(NOT metadata MATCHES "configured_attempts=10")
message(FATAL_ERROR "Quickstart metadata does not record its explicit attempt plan:\n${metadata}")
endif()
18 changes: 9 additions & 9 deletions docs/Doxyfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Doxyfile 1.17.0
# Doxyfile 1.16.1

# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
Expand Down Expand Up @@ -476,33 +476,33 @@ EXTRACT_ALL = NO
# be included in the documentation.
# The default value is: NO.

EXTRACT_PRIVATE = YES
EXTRACT_PRIVATE = NO

# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
# methods of a class will be included in the documentation.
# The default value is: NO.

EXTRACT_PRIV_VIRTUAL = YES
EXTRACT_PRIV_VIRTUAL = NO

# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.

EXTRACT_PACKAGE = YES
EXTRACT_PACKAGE = NO

# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be
# included in the documentation.
# The default value is: NO.

EXTRACT_STATIC = YES
EXTRACT_STATIC = NO

# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined
# locally in source files will be included in the documentation. If set to NO,
# only classes defined in header files are included. Does not have any effect
# for Java sources.
# The default value is: YES.

EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_CLASSES = NO

# This flag is only useful for Objective-C code. If set to YES, local methods,
# which are defined in the implementation section but not in the interface are
Expand Down Expand Up @@ -781,7 +781,7 @@ WARNINGS = YES
# will automatically be disabled.
# The default value is: YES.

WARN_IF_UNDOCUMENTED = NO
WARN_IF_UNDOCUMENTED = YES

# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
# potential errors in the documentation, such as not documenting some parameters
Expand All @@ -798,7 +798,7 @@ WARN_IF_DOC_ERROR = YES
# EXTRACT_ALL is set to YES then this flag will automatically be disabled.
# The default value is: NO.

WARN_NO_PARAMDOC = NO
WARN_NO_PARAMDOC = YES

# If the WARN_AS_ERROR tag is set to FAIL_ON_WARNINGS then Doxygen completes the
# run, reports all warnings, and returns a non-zero status afterward.
Expand Down Expand Up @@ -963,7 +963,7 @@ EXCLUDE_SYMBOLS = cdt::detail::* \
# that contain example code fragments that are included (see the \include
# command).

EXAMPLE_PATH =
EXAMPLE_PATH = examples

# If the value of the EXAMPLE_PATH tag contains directories, you can use the
# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
Expand Down
27 changes: 27 additions & 0 deletions docs/api-boundary.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ platform-required `NOMINMAX` definition are preprocessing exceptions rather
than C++ API declarations. The formatter specializations remain in `fmt`, as
required by that library's customization contract.

The [C++ API quickstart](cpp-api-quickstart.md) is the canonical runnable
consumer of this boundary. CMake compiles it from the same source embedded in
the generated documentation, and CTest exercises its validated construction,
ten explicitly reported Metropolis proposals, aggregate summary accounting,
and persistence round trip.

## Header classification

| Header | Supported surface | Internal, customization, or experimental surface |
Expand Down Expand Up @@ -87,3 +93,24 @@ versioned binary library. `BUILD_SHARED_LIBS` alone does not establish an ABI
promise. The supported contract is C++23 source compatibility within the 1.0
surface documented here; `detail` and `experimental` declarations may change
without compatibility shims.

## Generated reference policy

The canonical Doxygen configuration extracts documented public and protected
declarations while excluding private, package/internal, static, file-local,
`detail`, and `experimental` symbols from the supported reference surface.
Source-browser pages may still show implementation text; visibility there does
not promote a declaration into the supported API.

The canonical configuration enables documentation-error, undocumented-symbol,
parameter, and return warnings. Because Doxygen also emits completeness warnings
for excluded implementation namespaces and source-browser entry points, the
repository wrapper classifies the completed warning log: only completeness noise
for `detail`, `experimental`, and recognized `src` entry-point artifacts is
ignored. The wrapper temporarily disables Doxygen's undifferentiated
fail-on-warning status so it can perform that classification after generation;
it then fails on every non-exempt warning. Malformed documentation and every
supported-public-surface warning are fatal. `just docs-check` builds the site
with the repository-pinned Doxygen and Graphviz versions, then validates the
warning policy, generated local links, fragments, identifiers, rendered labels,
and required assets without modifying the worktree.
Loading
Loading