Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Job API validation

Continuous checks in this repository

CI runs these on every push and pull request (.github/workflows/ci.yml):

CheckCommand
Rust 1.88 minimum versioncargo check --workspace --locked
Format, lint, docscargo fmt --check, cargo clippy --workspace --all-targets -- -D warnings, cargo doc
Rust testscargo test --workspace (worker adapter and models, legacy and common CLI lifecycle; the shared crates’ own tests run in optimization-jobs)
Legacy runner integrationpython3 scripts/runner/test_integration.py
Common job API integrationpython3 "$SHARED/scripts/job-api/test_integration.py", from Cargo’s checkout of optimization-jobs (SHARED=$(python3 scripts/job-api/shared_root.py))
Shared runner regressions, error codes and schema checksJOB_API_REQUIRE_SCHEMA=1 python3 "$SHARED/scripts/job-api/test_review.py"
MCP server with this repository’s workerpython3 "$SHARED/scripts/job-api/test_mcp.py"
Runnable tutorialpython3 tutorials/job-api/run.py
Route-search tutorial (uses optimization-job-api through git)tutorial matrix job: fmt, clippy, tests

The Rust tests include these cross-profile checks. Every BiteOpt or DE retry of a common fcmaes.retry/1 job equals a direct call of the shared native solver from the same retry_run_seed, and every CMA-ES retry equals the library’s CMA-ES retry. A legacy fcmaes.job/0.1 job and a common job with the same problem, optimizer, seed and budget agree retry by retry, at different worker counts. Every fcmaes.mode/1 front equals the feasible non-dominated part of a fcmaes_core::Mode run driven directly from the same seed, with the same hypervolume; every fcmaes.map-elites/1 archive equals the archive of fcmaes_core::map_elites_batch from the same seed, for both variations. Generation runs stop cooperatively at the deadline, on cancel.request and through jobs cancel, with complete accounting.

The detached systemd backend is not exercised in CI: hosted runners have no user manager. Run python3 scripts/runner/test_systemd.py on the target host.

Delivery acceptance (18 October 2026)

The 0.1 delivery was accepted on Linux x86_64 with Rust 1.99.1, against fcmaes-rust c2703e7, LP-IP-craft 0.28.0 (af9a9a4) and SQP-craft 0.16.0 (7bc997f). Its raw logs were not committed.

GateObserved result
Shared API/runner and native adaptersRelease builds passed in all three independent workspaces
Shared contract/durability tests18 passed, including legacy validation and float round-trip regression
Legacy fcmaes runner/worker tests11 passed, including 6 real CLI lifecycle tests
Original fcmaes Python integration suite14 passed unchanged
Mixed integration with all three native workers10 passed, none skipped
LP-IP / SQP local integration8 passed each; tests for other solvers skipped
LP-IP core/native/adapter Rust selection196 passed
SQP core/solver/QP/parallel/adapter Rust selection197 passed; 1 optional documentation census ignored
Tutorial executions9 examples completed; numerical/termination assertions passed
systemd detached acceptanceNot verified: no systemd user manager; explicit skip (exit 77)

The mixed harness uses deterministic retry seeds, independent objective/bound checks, known LP/MIP optima, infeasible and unbounded LPs, analytic derivative checks and independent SQP KKT acceptance for both QP backends. It compares serial and eight-task layouts; LP/SQP also run with one task and eight inner threads. These are correctness/resource checks, not performance benchmarks.

Fixes found during acceptance:

  • The default JSON parser could shift small f64 values by one bit on a repeated parse, so manifest validation rejected a completed journal. The shared crate now enables float_roundtrip; a regression test covers small and large exponents, stable spec digests and the journal-to-manifest path.
  • An LP assertion required bit-exact equality between a conservative bound and the objective; it now checks tolerance agreement and the bound’s side.

Review fixes (fcmaes-rust)

  • Queued launcher loss. A job whose launcher died while it waited for slots could never be finalized: it had no worker process record, so jobs repair refused it as “liveness unknown” indefinitely. Repair now recognizes an attempt that was never admitted (free locks, no process record, no reservation) and seals it as interrupted with zero work. Covered by test_launcher_lost_while_queued_is_sealed_with_zero_work in the shared harness. This changes crates/optimization-runner/src/lib.rs and scripts/job-api/test_integration.py, both shared files.
  • The route-search tutorial’s Cargo.lock lacked the new optimization-job-api dependency, so --locked builds of the tutorial failed.
  • fcmaes-job-worker duplicated the native worker’s solver dispatch and objective registry; both workers now use one library. Its reported engine version follows the workspace version instead of a hard-coded string.

CMA-ES, MODE and MAP-Elites profiles (19 October 2026)

The common worker gained CMA-ES in fcmaes.retry/1 and the new fcmaes.mode/1 and fcmaes.map-elites/1 profiles. Checked locally with Rust 1.97 on Linux x86_64, in addition to the CI set above:

CheckObserved result
Worker tests (cargo test -p fcmaes-job-worker)7 passed: discovery, validation and defaults of every path, equality with direct fcmaes-core runs, budgets, deadline and cancel stops
Shared contract tests7 passed, including the rules of the two new claims
CLI lifecycle (fcmaes-runner)9 passed, including a graceful jobs cancel of a MODE job
Shared harness10 passed, 2 skipped (LP/SQP workers not supplied), including the new black-box test of all three paths
Tutorial7 examples completed; Python rechecks of every front point, elite and candidate passed

Observed on the tutorial examples: CMA-ES reached Rosenbrock-10 values below 1e-14 in all 16 retries and stopped on its own after about 7,400 evaluations on average; MODE’s ZDT1 fronts reached a hypervolume of about 0.866 (the true front has 0.8767 for reference point 1.1, 1.1); MAP-Elites covered 60–80% of 400 niches of the 10-D Rastrigin projection benchmark. These are checks of the adapters, not performance benchmarks.

An independent review of the change found three defects, now fixed and tested. CMA-ES stores the unclamped decode of its best sample, which can lie an ulp outside a bound, so a box-edge optimum failed the worker’s bounds check and the whole job; the worker now reports the clamped point, which is exactly the evaluated one. The exact three-objective hypervolume costs O(F³) after the last cancellation check, so MODE populations for three objectives are limited to 1,000. A CMA-ES budget sum could overflow in debug builds before its checked rejection.

Synchronization of the shared crates as 0.1.1 (19 October 2026)

After the 0.1.0 delivery, each repository’s review changed the shared files independently: this repository fixed the queued-launcher repair, SQP-craft fixed it differently and made several further runner and journal fixes, and LP-IP-craft kept the delivered code. Version 0.1.1 unifies them. It takes SQP-craft’s API and runner changes, keeps this repository’s zero-work repair of a queued attempt with SQP-craft’s rule that detached attempts with a unit stay unknown, and adds the fcmaes set and archive claims. The same 20 files are now in all three repositories, recorded by SHARED-SOURCES.sha256.

Checked here with Rust 1.97 on Linux x86_64: the workspace tests (290 passed), the shared harness (10 passed, 2 skipped without LP/SQP workers), the review regressions (7 passed, the reboot case with the fcmaes worker), the legacy runner suite (14 passed), the tutorial and the route-search tutorial (53 tests). The other two repositories ran their own suites; see their validation reports. The shared harness with all three workers on one node passed (12 tests, none skipped) under each repository’s runner build, and every worker reports build.job_api_version: "0.1.1".

Result contract 0.2 (19 October 2026)

The shared crates moved to 0.2.0 with the result contract 0.2: five new claims, evidence (levels, checks, refutations, certificate slot), objective bounds, worker protocol 0.2 with 0.1 still accepted, coded runner errors, already_terminal on cancelling a finished job, and JSON Schemas for the job envelope and the result manifest. The shared set grew to 23 files with the two schemas and scripts/job-api/outcome_cases.json. CI installs jsonschema and sets JOB_API_REQUIRE_SCHEMA=1, so the schema checks cannot be skipped there.

An independent review before the merge reported 13 defects; all were fixed and are covered by tests (see the plan). After the fixes, 1.2 million generated outcomes found no disagreement between the JSON Schema and Outcome::check, and every case of outcome_cases.json behaves the same as a journal record through the runner.

In this repository the fcmaes worker reports evidence for all three profiles, records a retry whose re-check fails as a refutation instead of failing the job, labels MODE fronts as final_population with an unnormalized hypervolume, and adds fcmaes.evaluate/1. Checked with Rust 1.97 on Linux x86_64:

CheckObserved result
cargo fmt --check, Clippy -D warnings, cargo docPassed
Workspace tests (cargo test --workspace)298 passed, including 26 shared (5 legacy spec, 13 contracts, 8 durability) and 10 fcmaes worker tests
Legacy runner suite (scripts/runner/test_integration.py)14 passed
Shared harness13 passed, 2 skipped without LP/SQP workers
Shared review and schema tests (JOB_API_REQUIRE_SCHEMA=1)15 passed
Tutorial8 examples completed; results and jobs validated against the schemas
Route-search tutorial56 passed
Mixed node with all three workers, under each repository’s runner build13 passed, none skipped, three times
sha256sum -c docs/job-api/SHARED-SOURCES.sha25623 files OK

MSRV 1.88 is checked by CI; the toolchain could not be installed on the review host.

Application models, parallel populations and more algorithms (19 October 2026)

The fcmaes worker gains a model registry for application workers, inner_threads > 1 for its population-based optimizers and for BiteOpt and DE with batch, CR-FM-NES and PGPE retries, IPOP/BIPOP restarts, CVT archives and CMA-ME/CMA-MAE emitter phases (plan, application models). Checked with Rust 1.97 on Linux x86_64:

CheckObserved result
cargo fmt --check, Clippy -D warnings, mdBook link checkPassed
Workspace tests (cargo test --workspace)317 passed, including 25 fcmaes worker tests (9 profile, 7 algorithm and 5 registry integration tests, 3 unit tests and a doctest) and the batch BiteOpt and delayed DE tests of fcmaes-core
Legacy runner suite14 passed
Shared harness14 passed, 2 skipped without LP/SQP workers; 14 passed, none skipped, on a mixed node under each repository’s runner build
Shared review and schema tests (JOB_API_REQUIRE_SCHEMA=1)15 passed
Tutorial12 examples completed, including an application worker reading a hashed data file; results and jobs validated against the schemas
The 8 tutorial jobs of main on main’s and this workerIdentical resolved payloads; identical results apart from the new details.archive_kind of MAP-Elites
sha256sum -c docs/job-api/SHARED-SOURCES.sha25623 files OK

The tests run every population-based profile, and batch BiteOpt and DE, with one and with several inner threads and require identical results; compare the delayed DE with a sequential reference that tells in ask order; compare CR-FM-NES, PGPE and CMA-ES restart retries, and grid and CVT archives, with direct library runs from the same seeds; check that emitter phases spend exact budgets and only add or improve elites; and exercise the registry’s rejections (unknown or mistyped parameters, missing, unused or altered inputs, versions, kinds, domains, a model returning the wrong number of values).

An independent review before the merge found four defects, all fixed and tested: building a CVT archive with inner_threads=1 ran on Rayon’s global pool (every task now runs inside its own pool, also for one thread); a CVT archive and the emitter phase had no memory bound, so a job that passed validation could abort at execution (sample, descriptor and emitters × dimension² limits, and dimension ≤ 3162 and population × dimension ≤ 10⁷ for the evolution strategies); and the default CMA-ME emitter did not rank candidates that fill an empty niche first, as Fontaine et al. do. With the paper’s ranking, CMA-ME on the 20-dimensional sphere projection (400 niches, 4 × 16 × 400 emitter evaluations) reaches 82–98% coverage instead of 38–48%.

Delayed feedback costs some convergence per evaluation, more for DE than for BiteOpt (16 retries each, seed 7; best and median objective):

Optimizer10-D Rosenbrock, 30,000 evaluationsCassini1, 50,000 evaluations
BiteOpt, serial0 / 04.931 / 11.03
BiteOpt, batch 160 / 04.945 / 11.00
BiteOpt, batch 640 / 05.303 / 11.16
DE, serial0 / 8.6e-294.932 / 5.306
DE, batch 40 / 8.0e-304.956 / 8.447
DE, batch 160 / 2.0e-295.304 / 11.03
DE, batch 643.3e-26 / 0.535.304 / 13.81

At equal budgets of 20,000 evaluations per run (four runs, 20 dimensions, 400 grid niches), coverage was:

EmitterSphere projectionRastrigin projection
SBX MAP-Elites36%45%
Iso+LineDD MAP-Elites50%57%
100 SBX generations, then CMA-ME66%58%
100 SBX generations, then CMA-MAE (threshold_init 300 or 600)66%78%

The shared crates move to optimization-jobs (19 October 2026)

optimization-job-api, optimization-runner, the shared guide, plan, schemas and scripts moved to optimization-jobs (plan). This repository depends on the crates at a pinned git revision; the copies and their checksum manifest are gone. The 26 tests of the shared crates (5 legacy spec, 13 contracts, 8 durability) now run only there, as do 7 copies of the durability tests that ran here, so the workspace here has 33 tests fewer. fcmaes-job-worker depends on the runner, so cargo build -p optimization-runner -p fcmaes-job-worker builds optimization-run here. On the git dependency:

CheckObserved result
cargo fmt --check, Clippy -D warnings, cargo doc, mdBook link checkPassed
Workspace tests284 passed
Legacy runner suite14 passed
Shared harness and review tests from Cargo’s checkout, with this repository’s binariesHarness: 14 run, 12 passed, 2 skipped without LP/SQP workers; review: 15 passed
Tutorial12 examples completed; jobs and results validated against the schemas of the checkout

Earlier sections mention scripts/job-api/ and the checksum manifest as they were at the time.

The MCP server (19 October 2026)

This repository moved to optimization-jobs revision 0ee495f, which adds optimization-mcp, the MCP server over one node (guide, plan). cargo build -p optimization-runner -p fcmaes-job-worker builds it here. Nothing in this repository’s code changed. On Linux x86_64 with Rust 1.97:

CheckObserved result
cargo fmt --check, Clippy -D warnings, cargo doc, mdBook, documentation consistency and local link checksPassed
Workspace tests284 passed
Legacy runner suite14 passed
Shared harness from Cargo’s checkout14 run: 12 passed, 2 skipped without LP/SQP workers
Shared review tests (JOB_API_REQUIRE_SCHEMA=1)15 passed
test_mcp.py with this repository’s binaries25 passed, including the real-worker test (fcmaes.retry/1, claims and evidence)
Tutorial12 examples completed; jobs and results validated against the schemas of the checkout
GTOC1 route-search tutorial on the new revisionfmt clean, 56 tests passed, protocol smoke run passed

Review fixes (20 October 2026)

The review of 20 October 2026 reproduced, by validation alone, a one-evaluation DE job with dimension 10,000 and population 1,000,000 that passed and would have allocated 80 GB per population table (FC-01). BiteOpt and DE now share the evolution strategies’ limit, population × dimension ≤ 10⁷, in fcmaes.retry/1 and, through optimization-jobs, in legacy fcmaes.job/0.1; BiteOpt’s default population exceeds it from dimension 1,825 on. MODE results name their hypervolume method: exact through four objectives, a Monte Carlo estimate with samples, seed and standard_error above (FC-03). tutorials/job-api/run.py takes --bin-dir and honors CARGO_TARGET_DIR (FC-04). Cooperative stopping inside scalar retries (FC-02) is a capability upgrade and stays open.

This repository moved to optimization-jobs revision eb1c9de (cancellation that only escalates, objective-bound checks, MCP request limits, the shared SDK tested inside this worker before a repin). On Linux x86_64 with Rust 1.97:

CheckObserved result
cargo fmt --check, Clippy -D warnings for the worker, local documentation linksPassed
Workspace tests286 passed
Legacy runner suite14 passed
Shared harness from Cargo’s checkout14 run: 12 passed, 2 skipped without LP/SQP workers
Mixed node with this runner and the repinned LP-IP and SQP workers14 passed
Shared review tests (JOB_API_REQUIRE_SCHEMA=1)17 passed
test_mcp.py with this repository’s binaries28 passed, including the real-worker test
Tutorial12 examples completed, schemas validated; a missing binary under CARGO_TARGET_DIR is named
GTOC1 route-search tutorial on the new revision56 tests passed, protocol smoke run passed

Surrogate profile and declared artifacts (20 October 2026)

fcmaes.surrogate/1 (experimental, see surrogate.md) runs exact-GP Bayesian optimization on registered scalar models. Its tasks declare their trace (surrogate-TASK, records) and observations snapshot (surrogate-observations-TASK, json) as artifacts of the shared job API, so agents read them while a job runs and page through the trace, and the sealed result records their SHA-256 for a warm-start input. This repository moved to optimization-jobs revision 6a42472, which adds the declarations, paged reads and a surrogate case in the shared harness. On Linux x86_64 with Rust 1.97:

CheckObserved result
cargo fmt --check, Clippy -D warnings for the workspace, documentation consistencyPassed
Workspace tests312 passed
Shared harness from Cargo’s checkout15 run: 13 passed (including the surrogate case with artifact pages and a warm start), 2 skipped without LP/SQP workers
Shared review tests (JOB_API_REQUIRE_SCHEMA=1)20 passed
test_mcp.py with this repository’s binaries29 passed
scripts/surrogate/test_job_api.py2 passed: MCP pages through the trace; a running job’s trace read as an artifact before a cooperative cancel
tutorials/surrogate/run.pyBranin 0.3978880, warm job of 8 new calls from 48 observations taken through the artifact index, oscillator 1.3e-6
tutorials/job-api/run.pyCompleted
GTOC1 route-search tutorial on the new revision56 tests passed

Reproduce with sibling workers

To run the mixed acceptance, build each repository’s worker and pass the absolute paths to the shared harness (optimization-jobs’ CI does the same with the three repositories’ main):

SHARED=$(python3 scripts/job-api/shared_root.py)
python3 "$SHARED/scripts/job-api/test_integration.py" \
  --runner "$PWD/target/release/optimization-run" \
  --fcmaes /path/to/fcmaes-job-worker \
  --lp-ip /path/to/lp-ip-job-worker --sqp /path/to/sqp-job-worker