Skip to content

Commit 3b42917

Browse files
authored
Merge pull request #234 from acgetchell/feat/222-weighted-proposal-policies
feat(cdt): add weighted move-family proposal policies
2 parents 820ead1 + 2e3f47d commit 3b42917

69 files changed

Lines changed: 13281 additions & 4446 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/audit.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ jobs:
7575
tool: cargo-audit@${{ steps.cargo_audit_version.outputs.version }}
7676

7777
- name: Run cargo audit
78-
run: |
79-
cargo audit --json > audit-results.json || true
80-
# Show human-readable output as well (reuses cached advisory DB)
81-
cargo audit --no-fetch
82-
continue-on-error: true
78+
run: cargo audit
79+
80+
- name: Write cargo audit JSON
81+
if: always()
82+
run: cargo audit --json --no-fetch > audit-results.json
8383

8484
- name: Upload audit results
8585
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ jobs:
6161
cache-bin: false # Avoid restoring stale rustup/cargo shims from cache.
6262
# toolchain, components, etc. are specified in rust-toolchain.toml
6363

64+
- name: Check declared Rust target
65+
run: cargo check --locked --workspace --target ${{ matrix.target }} --all-features --lib --bins
66+
6467
- name: Set up just
6568
uses: ./.github/actions/setup-just
6669

.github/workflows/dependabot-auto-merge.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@ jobs:
104104
APPROVED_HEAD_SHA: ${{ steps.coderabbit-approval.outputs.approved_head_sha }}
105105
GH_TOKEN: ${{ github.token }}
106106
PR_URL: ${{ github.event.pull_request.html_url }}
107-
run: gh pr merge --squash --match-head-commit "$APPROVED_HEAD_SHA" "$PR_URL"
107+
run: gh pr merge --auto --squash --match-head-commit "$APPROVED_HEAD_SHA" "$PR_URL"

.github/workflows/performance.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ jobs:
137137
performance-data-${{ runner.os }}-
138138
performance-baselines-main-
139139
140+
- name: Verify deterministic allocation contract
141+
if: steps.detect_bench.outputs.bench_found == 'true'
142+
run: just allocation-check
143+
140144
# For main branch: save baseline after successful benchmarks
141145
- name: Run benchmarks and save baseline (main branch)
142146
if: github.ref == 'refs/heads/main' && github.event_name == 'push' && steps.detect_bench.outputs.bench_found == 'true'

AGENTS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ When using the `gh` CLI to view issues, PRs, or other GitHub objects:
112112
- Keep production module preambles free of test-only imports; place `#[cfg(test)]` imports inside the relevant `tests` module instead
113113
- Detailed import guidance lives in `docs/dev/rust.md`
114114
115+
### Geometry Validation Ownership
116+
117+
- Delegate structural geometry validation—including incidence, orientation, manifold, embedding, and Euler-topology checks—to `delaunay` through the
118+
`src/geometry/` adapter whenever its API supports the check. Do not reimplement those algorithms in `src/cdt/`.
119+
- CDT validation owns only domain invariants that the geometry backend cannot express, such as foliation, causality, and agreement between CDT metadata and
120+
backend geometry. Add a narrow geometry trait/adapter method when CDT needs access to an upstream check.
121+
- Detailed validation-boundary guidance lives in `docs/dev/rust.md`.
122+
115123
### Public API Preludes
116124
117125
- Keep `prelude::*` small and focused on common quick-start workflows.

Cargo.lock

Lines changed: 149 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ harness = false
3434
name = "ci_performance_suite"
3535
harness = false
3636

37+
[[bench]]
38+
name = "allocation_profile"
39+
harness = false
40+
3741
[features]
3842
slow-tests = [ ]
3943

@@ -66,6 +70,7 @@ approx = "0.5.1"
6670
slotmap = "1.1.1"
6771
assert_cmd = "2.2.2"
6872
criterion = { version = "0.8.2", features = [ "html_reports" ] }
73+
dhat = "0.3.3"
6974
predicates = "3.1.4"
7075
proptest = "1.11.0"
7176

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ path integral over causally triangulated spacetimes and evaluating it using Mark
5050
- Resumable serde-backed CDT/MCMC checkpoints for continuation within a compatible build; serialized checkpoint files are
5151
[version-bound](docs/metropolis.md#serialized-checkpoint-compatibility)
5252
- Trace CSV simulation output for external analysis workflows; JSON summary/metadata for CLI/config export
53-
- Volume-profile, Hausdorff-dimension, and spectral-dimension observables for CDT analysis
53+
- Spatial-vertex input profiles, slab-triangle output profiles, and explicitly finite-window effective dimensional observables
5454

5555
See [CHANGELOG.md](CHANGELOG.md) for release history and [`docs/roadmap.md`](docs/roadmap.md) for current direction, near-term candidates, and non-goals.
5656

benches/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This document describes the Criterion benchmark suites. For regression workflows
99
cargo bench
1010
just bench-ci
1111
cargo bench --profile perf --bench ci_performance_suite
12+
cargo bench --profile perf --bench allocation_profile
1213
```
1314

1415
Run a focused group:
@@ -35,12 +36,19 @@ that should stay comparable across releases:
3536
- generating open-boundary and toroidal CDT triangulations;
3637
- validating generated triangulations;
3738
- attempting individual ergodic move types;
39+
- scaling guaranteed-success inverse volume finalization across increasing toroidal CDT meshes;
3840
- iterating proposal-site candidates through public move-attempt and single-step Metropolis proposal paths;
39-
- executing ten random-move sweeps, where each sweep attempts one move per current simplex;
41+
- evaluating state-dependent family policies that inspect the complete offered-site views;
42+
- executing fixed random-move attempt budgets equal to ten initial sweeps, so reported throughput exactly matches timed attempts;
4043
- running short Metropolis simulations sized as ten initial sweeps.
4144

4245
Keep this suite stable and release-relevant. Exploratory or noisy benchmarks belong in `cdt_benchmarks.rs`.
4346

47+
`allocation_profile` is a deterministic heap-allocation contract for cached
48+
observables. It verifies that a cached edge-count read allocates nothing and a
49+
borrow-to-owned slab-triangle-profile read performs exactly one vector allocation. The
50+
contract blocks `just ci`, `just bench-ci`, and the performance workflow.
51+
4452
## Benchmark Groups
4553

4654
### `triangulation_creation`
@@ -101,7 +109,7 @@ Includes configuration validation, proposal planning, accepted-move application,
101109

102110
### `simulation_analysis`
103111

104-
Measures post-run analysis such as acceptance rates, average action, and equilibrium measurement extraction.
112+
Measures post-run analysis such as acceptance rates, average action, and post-thermalization measurement extraction.
105113

106114
Use for output and analysis workflow regressions.
107115

0 commit comments

Comments
 (0)