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
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,59 @@ jobs:
shell: bash
run: ctest --test-dir build/package-consumer -C ${{ matrix.build_type }} --output-on-failure

- name: Validate v1.8 installed consumers on Windows
if: runner.os == 'Windows'
shell: pwsh
run: |
$consumers = @(
'package-consumer-governor',
'package-consumer-deterministic',
'package-consumer-nested',
)
foreach ($consumer in $consumers) {
$build = "build/$consumer"
$arguments = @(
'-S', "tests/$consumer",
'-B', $build,
'-A', 'x64',
'-DCMAKE_PREFIX_PATH=${{ github.workspace }}/build/install'
)
if ('${{ matrix.tbb }}' -eq 'ON') {
$arguments += "-DCMAKE_TOOLCHAIN_FILE=$env:VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake"
$arguments += '-DVCPKG_INSTALLED_DIR=${{ github.workspace }}/build/vcpkg_installed'
}
cmake @arguments
cmake --build $build --config '${{ matrix.build_type }}' --parallel 2
ctest --test-dir $build -C '${{ matrix.build_type }}' --output-on-failure
}

- name: Validate v1.8 installed consumers on Unix
if: runner.os != 'Windows'
shell: bash
env:
CC: ${{ matrix.cc }}
CXX: ${{ matrix.cxx }}
run: |
set -euo pipefail
for consumer in package-consumer-governor package-consumer-deterministic package-consumer-nested; do
args=(
-S "tests/$consumer"
-B "build/$consumer"
-G Ninja
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/build/install
)
if [[ '${{ matrix.tbb }}' == 'ON' ]]; then
args+=(
"-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
"-DVCPKG_INSTALLED_DIR=${GITHUB_WORKSPACE}/build/vcpkg_installed"
)
fi
cmake "${args[@]}"
cmake --build "build/$consumer" --parallel 2
ctest --test-dir "build/$consumer" --output-on-failure
done

sanitizers:
name: linux-clang-debug-asan-ubsan
runs-on: ubuntu-latest
Expand Down Expand Up @@ -346,6 +399,8 @@ jobs:
tools/analyze_v15_adaptive_routes.py \
tools/analyze_v16_scientific_foundations.py \
tools/analyze_v17_reproducible_runtime.py \
tools/analyze_v18_governed_execution.py \
tools/summarize_v15_regression.py \
tools/generate_v15_benchmark_plots.py \
tools/publish_v15_benchmark_docs.py \
tools/publish_v16_benchmark_docs.py \
Expand All @@ -354,3 +409,14 @@ jobs:
tools/verify_source_manifest.py \
tools/validate_benchmark_smoke.py \
tools/check_documentation.py

- name: Validate release script syntax and line endings
run: |
sh -n scripts/validation/run_v18_governed_execution_release_validation.sh
python3 - <<'PYLINE'
from pathlib import Path
path = Path('scripts/validation/run_v18_governed_execution_release_validation.bat')
raw = path.read_bytes()
if raw.replace(b'\r\n', b'').count(b'\n'):
raise SystemExit('v1.8 Windows validator contains bare LF line endings')
PYLINE
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ CMakeUserPresets.json
/dir
/echo
/rmdir

build-*/
**/__pycache__/
*.pyc
*.pyo
validation/output/
42 changes: 40 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# Changelog

## 1.8.0 — Governed Scientific Execution

### Added

- Explicit process-level `ResourceGovernor` with effective CPU-capacity diagnostics.
- Move-only, exception-safe root and inherited execution leases.
- Operation-specific minimum, preferred, maximum, requested, granted, capped, and observed worker fields.
- Flexible Adaptive partial grants and exact fail-closed Deterministic grants.
- Immediate, waiting, deadline, cancellation, impossible-request, and shutdown outcomes.
- Direct cancellation wakeups without periodic polling.
- FIFO admission with bounded bypass, aging, and oldest-request reservation.
- Shared multi-Runtime budgets with isolated profiles, adaptive state, and numerical configuration.
- Nested lease inheritance without independent blocking root acquisition.
- oneTBB task-arena upper-bound reporting and serialized OpenCV single-thread containment.
- Stable resource fingerprints, decision reports, and deployment-manifest fields.
- Publication benchmark schema with alternating pair order, real participation measurement, correct throughput definitions, raw samples, 95% bootstrap intervals, fourteen Linux publication SVG figures, and a plot manifest.
- Expanded governor, Runtime, cancellation, fairness, nested, deterministic, backend, effective-capacity, sanitizer, package-consumer, and exact-archive validation.

### Changed

- Flexible operations no longer reserve the Runtime ceiling blindly; useful concurrency is estimated from operation size, scheduler requirements, nesting state, and the Runtime ceiling.
- A governed backend running with one participant retains its authenticated scheduler identity instead of being rewritten as Sequential.
- Public concurrent sibling partitioning is not exposed until strict delegated-capacity accounting is proven across all scheduler paths.
- Benchmark statuses are `PASS`, `FAIL`, `INCONCLUSIVE — NO MATERIAL REGRESSION DETECTED`, or `INCONCLUSIVE — MORE EVIDENCE REQUIRED`.
- Source packaging excludes all validation output, build/install trees, binaries, caches, nested archives, Python bytecode, and dependency trees.

### Scope

- v1.8 is exclusively process-level CPU governance.
- Rodinia HotSpot is removed from the v1.8 artifact and preserved separately for `SmartParallel v1.9.0 — Rodinia HotSpot Integration`.
- OpenMP expansion, BLAS, FFT, NUMA scheduling, affinity, GPU, MPI, and cross-process governance remain deferred.

### Compatibility

- All accepted v1.0–v1.7 APIs and tests remain supported.
- `worker_budget` remains accepted; `maximum_workers` is the explicit v1.8 Runtime ceiling.
- v1.7 profiles are adapted only when their resource meaning is unambiguous; incompatible deterministic contracts fail closed.

All notable public changes to SmartParallel are documented here. Detailed internal milestone history is retained in [`docs/archive/v1.1-development/CHANGELOG_DEVELOPMENT_HISTORY.md`](docs/archive/v1.1-development/CHANGELOG_DEVELOPMENT_HISTORY.md).

## [1.7.0] — Reproducible Runtime
Expand All @@ -24,7 +62,7 @@ All notable public changes to SmartParallel are documented here. Detailed intern
- Final Windows/MSVC `31 full` publication: **24/24** main tests, **24/24** isolated no-oneTBB/no-OpenCV tests, **3/3** oneTBB + OpenCV focused tests, and **6/6** exact returned source-ZIP tests passed.
- Installed core, profile, Vision, and OpenCV consumers passed; installed calibration, explicit approval, two fresh Deterministic replay processes, manifest comparison, and unchanged Approved profile checks passed.
- Every v1.7 benchmark objective was accepted. Adaptive warm start measured **2.600×** faster than fresh cold Adaptive execution with a 95% interval of **2.500–2.764×**; Deterministic replay measured **1.014×** warm latency with a **0.959–1.084×** interval.
- The 1,000-entry exact profile database loaded in **713.304 ms**, with a 95% interval of **708.684–716.005 ms**. Explicit Runtime and copied-context overhead intervals crossed the 20 µs objective and were reported honestly as `INCONCLUSIVE-PASS`.
- The 1,000-entry exact profile database loaded in **713.304 ms**, with a 95% interval of **708.684–716.005 ms**. Explicit Runtime and copied-context overhead intervals crossed the 20 µs objective and were reported honestly as `NOT-ESTABLISHED`.
- Two fresh replay manifests were byte-identical with SHA-256 `caa94172f51f4a161658ed39fff102340186ea6f3bba4f327a5a3fa2694e898c`, identical output digest, nine deterministic replays, and zero adaptive maintenance counters.
- The retained v1.6 Windows suite produced **3,936 samples** and passed every execution-validity, reference-accuracy, reproducibility, route-authentication, numerical-capability, cross-scheduler, pointwise-plan, Fast-compatibility, and scientific-kernel performance-sanity gate.
- An independent Linux/GCC publication also accepted every v1.7 objective and retained v1.6 gate.
Expand Down Expand Up @@ -94,7 +132,7 @@ All notable public changes to SmartParallel are documented here. Detailed intern
- Complete deterministic suite: **20/20 passed**.
- Every execution-validity, required-reference, reproducibility, route-authentication, numerical-capability, adversarial-accuracy, cross-scheduler, and pointwise-plan gate passed.
- Accurate reduced the predefined adversarial sum and dot absolute errors from **3000 to 0**.
- Policy-aware Fast / retained Fast produced a paired median of **1.0634×** with a 90% robust interval of **0.9739–1.1611×**; the gate is an honest **inconclusive-pass**, not evidence of a regression above 5%.
- Policy-aware Fast / retained Fast produced a paired median of **1.0634×** with a 90% robust interval of **0.9739–1.1611×**; the gate is an honest **not-established**, not evidence of a regression above 5%.
- The largest Fast AXPY, dot, norm, stencil, and heat workloads passed the broad performance-sanity gate with accepted machine-specific speedups of **1.19×**, **2.35×**, **2.96×**, **3.78×**, and **2.14×** versus compact direct-sequential references.
- Full AXPY vectors, stencil fields, and heat-diffusion fields were validated and recorded with complete-output digests.
- The corrected heat pilot was correct, reproducible, authenticated, and parallel; on the accepted Linux machine, Fast completed the largest 20-iteration workload about **2.14×** faster than the compact direct-sequential oracle. The result remains machine-specific and is not a universal speedup claim.
Expand Down
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ endif()

project(
SmartParallel
VERSION 1.7.0
DESCRIPTION "Reproducible adaptive parallel execution for modern C++"
VERSION 1.8.0
DESCRIPTION "Governed scientific execution for modern C++"
LANGUAGES CXX
)

Expand Down Expand Up @@ -114,6 +114,10 @@ option(SMARTPARALLEL_BUILD_V170_TOOLS
"Build v1.7 calibration and profile command-line tools" OFF)
option(SMARTPARALLEL_BUILD_V170_BENCHMARKS
"Build v1.7 Reproducible Runtime benchmark suite" OFF)
option(SMARTPARALLEL_BUILD_V180_GOVERNED_EXECUTION_VALIDATION
"Build v1.8 Governed Scientific Execution validation" OFF)
option(SMARTPARALLEL_BUILD_V180_BENCHMARKS
"Build v1.8 Governed Scientific Execution benchmarks" OFF)
option(SMARTPARALLEL_BUILD_SCIENTIFIC_TEST1
"Build scientific Test 1: numerical integration" OFF)
option(SMARTPARALLEL_BUILD_SCIENTIFIC_TEST2
Expand Down
38 changes: 35 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,33 @@
# SmartParallel

## SmartParallel v1.8.0 — Governed Scientific Execution

> **Trust the deployment.**

SmartParallel v1.8 coordinates participating CPU execution paths inside one process under an explicit CPU budget. Multiple Runtime instances may share one `ResourceGovernor`; operation-scoped leases prevent nested reacquisition and deterministic execution rejects unavailable exact grants before output modification. oneTBB is bounded honestly through task arenas, OpenCV is contained through serialized single-thread provider calls, and every resource decision is inspectable.

```cpp
smart::ResourceGovernorOptions governor_options;
governor_options.cpu_budget = 8;
auto governor =
std::make_shared<smart::ResourceGovernor>(governor_options);

smart::RuntimeOptions options_a;
options_a.governor = governor;
options_a.maximum_workers = 6;
smart::Runtime runtime_a(options_a);

smart::RuntimeOptions options_b;
options_b.governor = governor;
options_b.maximum_workers = 4;
smart::Runtime runtime_b(options_b);
```

![SmartParallel v1.8 observed participation versus declared budget](docs/v1.8/assets/benchmarks/linux-gcc-accepted/01_budget_vs_peak_participation.svg)

See the [v1.8 documentation](docs/v1.8/README.md), [trust contract](docs/v1.8/trust-the-deployment.md), [admission model](docs/v1.8/admission-policies.md), and [benchmark evidence](docs/v1.8/accepted-benchmark-evidence.md).


SmartParallel is a C++17 adaptive CPU execution framework for reproducible scientific and engineering computation. It coordinates parallel scheduling, supports complete semantic-operation routes, and now exposes owned reproducible Runtime state, persistent exact execution profiles, explicit numerical behavior, and non-owning multidimensional data views.

## What it solves
Expand All @@ -15,6 +43,7 @@ SmartParallel provides an adaptive loop runtime, coordinated nested execution, c
- **SmartParallel v1.5 — Adaptive Execution Routes:** adds optional semantic operations whose automatic mode can learn between complete Native routes and specialized providers, beginning with exact 8-bit thresholding and OpenCV.
- **SmartParallel v1.6 — Scientific Foundations:** adds explicit Fast, Reproducible, and Accurate numerical contracts, canonical deterministic reductions, host-memory scientific views, AXPY/dot/norm/stencil operations, and a heat-diffusion pilot.
- **SmartParallel v1.7 — Reproducible Runtime:** adds isolated owned Runtime configuration, lightweight contexts, persistent Candidate/Approved semantic profiles, Adaptive warm starts, exact no-learning Deterministic replay, execution fingerprints, calibration/profile tools, and cross-process heat-diffusion manifests.
- **SmartParallel v1.8 — Governed Scientific Execution:** adds operation-specific CPU admission, hierarchical leases, shared multi-Runtime and nested coordination, exact deterministic grants, direct cancellation, fairness protection, effective-capacity diagnostics, and explainable resource evidence.

## v1.7 — Trust the experiment

Expand Down Expand Up @@ -130,7 +159,7 @@ The corrected accepted Linux/GCC/x86-64 schema-v2 publication contains **2,442 r
- Accurate reduced the fixed adversarial sum and dot absolute errors from **3000 to 0**;
- sum, AXPY, and stencil cross-scheduler matrices passed across their eligible worker budgets and scheduler engines;
- Reproducible and Accurate AXPY/stencil authenticated the new fixed pointwise plans and real parallel execution;
- policy-aware Fast / retained Fast had a paired median of **1.0634×** with a 90% robust interval of **0.9739–1.1611×**; the result is an **inconclusive-pass**, not evidence of a regression above the 5% investigation boundary;
- policy-aware Fast / retained Fast had a paired median of **1.0634×** with a 90% robust interval of **0.9739–1.1611×**; the result is an **not-established**, not evidence of a regression above the 5% investigation boundary;
- the largest Fast AXPY, dot, norm, stencil, and heat workloads all passed the new performance-sanity gate, recording **1.19×**, **2.35×**, **2.96×**, **3.78×**, and **2.14×** speedups over their compact direct-sequential references on the accepted machine;
- the complete corrected deterministic suite passed **20/20** tests;
- nine restrained SVG plots, raw data, generated statistics, environment metadata, and source hashes are retained under `docs/v1.6/assets/benchmarks/`.
Expand Down Expand Up @@ -244,6 +273,9 @@ The historical v1.1 real-world suite remains available through `scripts\benchmar

## Documentation

- [v1.8 documentation](docs/v1.8/README.md) — process-level CPU governance, exact resource admission, benchmarks, and validation
- [v1.8 accepted benchmark evidence](docs/v1.8/accepted-benchmark-evidence.md) — Linux/GCC raw data, 95% intervals, and publication figures
- [v1.8 release validation status](docs/v1.8/validation-status.md) — accepted Linux evidence and the remaining Windows acceptance step
- [v1.7 documentation](docs/v1.7/README.md) — owned Runtime state, persistent profiles, deterministic replay, tools, fingerprints, and release validation
- [v1.7 reproduction guide](docs/v1.7/reproduction-guide.md) — benchmarks, CLI pilot, package consumers, and exact-ZIP validation
- [v1.6 documentation](docs/v1.6/README.md) — numerical contracts, data views, scientific operations, pilot, and evidence
Expand All @@ -268,9 +300,9 @@ The historical v1.1 real-world suite remains available through `scripts\benchmar

## Project status

**Current release: v1.7.0 — Reproducible Runtime.** v1.7 preserves the validated scheduler, v1.4 algorithms, v1.5 Vision routes, and v1.6 numerical/scientific contracts while adding isolated Runtime ownership, exact persistent semantic profiles, explicit approval, no-learning Deterministic replay, stable execution fingerprints, and cross-process experiment manifests. The repository retains all earlier evidence. Performance measurements remain machine-specific.
**Current release candidate: v1.8.0 — Governed Scientific Execution.** v1.8 preserves the validated v1.0–v1.7 APIs, numerical contracts, profiles, and deterministic replay while adding operation-specific CPU admission, shared multi-Runtime budgets, hierarchical nested leases, direct cancellation wakeups, starvation-resistant admission, and explainable resource evidence. The accepted Linux/GCC publication and exact-archive validation are retained in this source tree. Final Windows/MSVC publication evidence remains a separate required acceptance step before the release is tagged final.

Important boundaries remain: independent Runtime instances are not governed by one process-wide CPU budget, cross-architecture bitwise identity is not promised, concurrent multi-process profile writers are unsupported, SHA-256 detects modification but does not prove authorship, and automatic scheduling is not guaranteed to beat the best manually selected strategy on every workload.
Important boundaries remain: governance covers participating execution paths inside one process, not unrelated application threads or external processes; oneTBB limits are upper bounds rather than private worker ownership; direct OpenCV use outside SmartParallel is not governed; deterministic execution does not promise identical queue timing; cross-architecture bitwise identity is not promised; and automatic scheduling is not guaranteed to beat the best manually selected strategy on every workload.

## License

Expand Down
Loading
Loading