Verification defaults and measurement status

Copy Markdown View Source

The retained defaults are named shared modules with shared and target artifact caching. The job limit of 2 is a provisional fallback, not a measured optimum or a restriction imposed by Lean, Lynx or the hardware. The reference M2 Max now has a successful controlled comparison supporting an initial recommendation of 4 jobs with 2 Lean threads. This policy review changes no runtime default, proof or public deadline. That comparison used the earlier Lynx backend. The current locked backend supports module parallelism within a request, so the historical profile is a starting point to remeasure, not a new performance result for this revision.

Effective settings and overrides

SettingRetained behaviorOverride and scope
Shared module representationNamed modulesREDUCTION_BOUNDS_PROOF_MODE=embedded embeds the same proof sources in target modules.
Artifact reuseShared and target modules, where keys are eligibleREDUCTION_BOUNDS_PROOF_CACHE=shared caches theories only; off rechecks every module.
Aggregate verification admission2 jobs per VM, provisionalSet REDUCTION_BOUNDS_LEAN_JOBS before application startup, or application configuration :lean_jobs; the environment variable takes precedence.
Per-call target concurrency2Public max_concurrency is a per-call upper bound, additionally constrained by the VM job budget.
Public target deadline60,000 msPublic timeout includes assembly, preparation waiting, admission and verification; existing validation rules apply.
Lean optionsEmpty option list unless suppliedPublic lean_options affect elaboration and cache keys.
Lean worker threadsNot set by this librarySet LEAN_NUM_THREADS explicitly for a controlled comparison; the benchmark examples use 2, not a new production default.
ExUnit case countChosen by ExUnit or the callermix test --max-cases N controls test cases, not the number of Lean jobs or threads.
Runner lifecycleA fresh process for each cache-policy group with ready modules; empty input launches noneReusable sessions and additional scheduling across requests remain conditional follow-ups.
Module schedulingLynx verifies ready independent modules in parallel within a requestReports retain input order; LEAN_NUM_THREADS controls Lean worker capacity separately from the VM job budget.

Invalid job-limit values fail startup; changing the limit requires an application restart. Different OS processes have different budgets. Independent-VM tests use explicit child limits and run in the synchronous test phase. Neither core count nor available memory alone determines an optimal job budget.

Evidence behind the retained policy

Named modules share kernel-checked artifacts across different targets. Internal dependency fingerprints include sources, imports/dependencies, options and diagnostic origins. The adapter removes these keys from the wire request; Lynx computes persistent keys and partitions by Lean/runtime identity. Unknown external compiled imports disable caching for their consumers and dependents. Every request still checks matching artifacts through the runner and retains transitive axiom audits, source/callee replay and negative-proof rejection. Previously returned Elixir maps are not proof evidence.

Reuse helps representative warm Port-source, contract and integer workflows. The all-family comparison also records slower small composed, buffer-sequence and periodic examples, and slower cold samples. The default is a consistent reuse policy, not a universal fastest setting. Measure representative workloads when startup/import costs dominate.

The controlled scheduling cohorts show shorter ordinary command wall times on Linux while retaining the same verification calls and assertions. Those are selected cohorts, not a claim about a whole-suite or Mac percentage. Source and fixture isolation were audited before enabling asynchronous execution. Global mutation, restart and independent-VM cases retain the required serialization.

The current application does not contain duplicate maintained copies of shared Lean theories. Named and embedded assembly derive from the same packaged files and source providers. Keep the embedded and cache-bypass controls as supported diagnostic/comparison paths: mixed workload measurements still make them useful. Removing them merely to end a migration would discard evidence and audit tools.

Reference Mac configuration

The M2 Max calibration passed all 345 tests in each of four full-suite runs, at the same clean revision, seed and case limit. Jobs 4 reduced command wall time by 36.6% cold and 33.9% warm relative to jobs 2, with maximum sampled process-tree RSS rising from about 1.99 GiB to 3.76 GiB. To remeasure the historical profile on that reference machine, use:

REDUCTION_BOUNDS_LEAN_JOBS=4 LEAN_NUM_THREADS=2 mix test

To reproduce the test scheduling controls, also pass --seed 0 --max-cases 24. Both variables must be set for this measured profile; leaving Lean threads unspecified is a different configuration. This was an initial machine-specific recommendation from one paired trial on the earlier backend, not a measured optimum for the current backend or a portable default. Repeat with rotated configuration order before making a stronger claim.

What the measurements do not finalize

The earlier Linux calibration was interrupted, and jobs 2 with cold caches and max_cases 24 had two public API deadline failures on that earlier source. Those results remain historical unsuccessful configurations. The later ordinary Mac logs did not record effective Lean job/thread settings or controlled cache state. The new controlled Mac comparison supplies that missing evidence for its exact revision and settings; it does not turn the historical runs into controlled data.

Retain the fallback of 2 for compatibility on unmeasured machines. No portable adaptive policy or cross-machine optimum has been established. Set explicit limits for the target workload and measure both throughput and memory. The Mac comparison preserves the public 60,000 ms deadline; only an unrelated integration test's nested stream limit was removed, retaining its ExUnit 300-second bound.

Legacy paired actual-call residuals exclude preparation/admission waiting but are not isolated startup. Current events mark the parallel module schedule; multi-module requests have no additive residual because module times may overlap. Startup/runtime initialization attribution and critical-path/frontier timing remain incomplete. The conditional optimization review records the gates before adding reusable sessions or additional scheduling across requests.

Repeating the controlled comparison

On the target Mac, use a clean committed checkout and a new output path:

mix reduction_bounds.calibrate --jobs 2,4 --lean-threads 2 \
  --seed 0 --max-cases 24 --suite-repetitions 1 --trials 1 \
  --output _build/mac-jobs2-vs4.json

This is four whole-suite executions: cold and warm at each limit. It can take many minutes. Run one calibration at a time with other machine activity recorded. Repeat promising configurations with --trials 2 and a new output path; trials rotate configuration order and each begins with a fresh cache. Compare threads only after holding them fixed for the job comparison. Add jobs 1 as a serial reference if useful. No task changes production defaults automatically.

Record command wall time, RSS/CPU samples, waits, effective settings, cache hits, failures and timeouts. Missing/inconsistent results remain incomplete, and a failed run is not a successful speedup. See calibration for report validity and benchmarking for measurement scope.

Issue status

The Issue 8 status record separates implemented work, validation evidence, provisional policy and outstanding acceptance criteria. The proposed GitHub update keeps the issue open for startup attribution; optional backends are deferred rather than claimed as delivered.