Issue 8: shared modules across proof families

Copy Markdown View Source

Measured source: 7bb23dbf6c7ade41f1a529b1a13a85a632048ba6, with a clean working tree for all three configurations. Elixir 1.20.5, OTP 29.1.2, Lean 4.35.0, Linux x86-64. Locked dependencies are unchanged. The registry now covers 25 shared theories and models. These six representative workflows exercise composition, buffer sequences, Core execution, periodic rules, Port source connection, and cost-contract comparison. The integer pilot has separate measurements.

Reproduction

ERL_FLAGS='+S 4:4' LEAN_NUM_THREADS=4 \
  REDUCTION_BOUNDS_PROOF_MODE=embedded REDUCTION_BOUNDS_PROOF_CACHE=off \
  mix reduction_bounds.bench --no-suite \
  --workloads composed,circular_buffer_sequence,execution,periodic,port_source,contract_comparison \
  --repetitions 3 --max-cases 4 --output _build/issue8-all-proofs-embedded.json

Repeat separately with mode named and cache shared, then mode named and cache on, using separate output paths. All three measurements used the same source and machine settings. Each configuration prepares an isolated Mix build; each workload clears only that isolated verification cache, runs once cold, then runs three warm attempts in fresh VMs. Dependency Lean build artifacts already existed. No tests or static checks ran concurrently with measurements.

Command wall time

Cold verification-cache samples, seconds:

WorkloadEmbeddedShared onlyShared and targets
composed2.9175.8325.949
circular_buffer_sequence3.0058.4568.559
execution3.7427.0787.288
periodic1.6112.8742.724
port_source9.20813.43013.121
contract_comparison5.2569.52110.636

Warm attempts, median of three samples, seconds:

WorkloadEmbeddedShared onlyShared and targets
composed2.5083.8513.186
circular_buffer_sequence3.0124.1503.464
execution3.6163.5893.100
periodic1.7172.3091.869
port_source9.5256.7553.153
contract_comparison5.2433.7233.349

Shared-only runs recheck the target on every attempt. In the default configuration, all reported modules were cache hits on each warm attempt. Embedded runs had no cache hits. All 72 workload commands completed successfully, with every reported module accepted and no incomplete verification requests.

These results do not show a universal speedup. Reusing the Port source and contract theories helps; execution improves with target reuse. Small composition, buffer-sequence and periodic cases are slower even when their artifacts are warm. Splitting introduces per-module publication, import and artifact-loading costs; all six cold cases are slower. This stage broadens safe reuse and coalesces concurrent cold work. It does not remove runner startup or guarantee faster whole-suite throughput. Three warm samples are observations, not a statistical performance guarantee.

Sampled process-tree memory

Maximum across each cold and three warm runs, GiB:

WorkloadEmbeddedShared onlyShared and targets
composed1.131.131.13
circular_buffer_sequence1.161.131.13
execution1.171.171.17
periodic1.021.111.12
port_source1.351.261.27
contract_comparison1.201.201.20

RSS is sampled every 100 ms and summed over the process tree; shared pages may be counted more than once. This is not an exact OS high-water mark.

Preparation and validation

Independent targets sharing a cold dependency closure are tested concurrently: only one request compiles that closure and the other reuses its checked artifacts. Independent closures can proceed concurrently. Tests also cover failed preparation, owner termination, cancelled waiters, readiness invalidation and independent-VM atomic artifact publication. Every family is checked through named, repeated, cache-disabled and embedded paths, including all shared module reports and axiom audits. Existing public API and source-replay tests remain enabled.

The full suite returned 303/304 passed (18/18 documentation tests, 285/286 other tests), in 837.7 seconds. The sole failure was the new independent-VM test parsing terminal diagnostics as JSON before its proof reports. A test-only change tags the JSON record and reads it independently of diagnostics. mix test --failed --seed 0 then passed the remaining test (1 passed, 10.0 seconds). The complete suite was not rerun after this parser-only change. Its existing cache state and validation scheduling do not constitute a controlled whole-suite throughput comparison with earlier stages.

mix check and mix docs --warnings-as-errors passed. Validation output:

Preparation readiness is local to one VM and advisory. Each fresh benchmark VM can report itself as preparation owner while still obtaining all artifacts from disk cache. Inspect per-module cached flags to distinguish compilation from reuse. Coordination timings include dependency identity lookup and lease waiting; they are included in runner wall time. Requests still submit their complete ordered closure to the pinned sequential runner.

Raw reports and matching artifact directories:

Absolute paths in raw reports identify the original run. After moving the checkout, use the matching files in the adjacent _artifacts directories. See shared proof modules and benchmarking for architecture, controls and timing interpretation.