Expand description
Bounded deterministic parallel proposal execution (spec
110-bounded-parallel-workflow-scheduling, P2, ADR-0042).
Extends the P1 sequential proposal executor in crate::proposal with a
wave-based concurrent dispatcher over the same CanonicalProposal/
ResolvedProposalNode shapes. A traverse_contracts::ParallelSchedule
(computed by traverse_contracts::compute_parallel_schedule) levelizes
the already-validated acyclic graph into waves of node ids whose
dependencies are satisfied by earlier waves; this module authorizes and
executes that schedule.
FR-004a (spec 110): the first P2 implementation permits a wave with more
than one member only when every member’s declared effect_class is
pure_read — enforce_pure_read_only_parallelism checks this before
any dispatch. Once authorized, each wave runs on real OS threads via
std::thread::scope, bounded to max_concurrent_nodes per batch;
outcomes are folded back into the trace in the wave’s lexicographic
order (not completion order), so the observable trace is deterministic
regardless of real scheduling (FR-002).
Wall-clock and payload-size bounds (FR-001, FR-005) are checked between
waves, before committing to the next one — Rust gives no safe way to
preemptively interrupt an in-flight OS thread without unsafe, and
FR-004a already restricts concurrent work to side-effect-free local reads,
so a wave that is already dispatched is always allowed to finish; a
budget that is already exhausted simply stops further waves from
starting, reported as traverse_contracts::CanonicalProposal’s trace
terminal state cancelled.
Structs§
- Parallel
Authorization Error - Parallel
Authorization Failure - Parallel
Execution Limits - Execution-time bounds that structural schedule validation cannot express (spec 110 FR-001: “time, memory” bounds). Checked between waves.
Enums§
Constants§
Functions§
- enforce_
pure_ read_ only_ parallelism - Enforces spec 110 FR-004a: the first P2 implementation permits parallel
execution only for
pure_readnodes. Any wave with more than one member is denied outright unless every member in it ispure_read. - execute_
parallel_ proposal - Executes an authorized
ParallelSchedulewave by wave, dispatching each wave’s nodes concurrently (bounded tolimits.max_concurrent_nodesbatches) when the wave has more than one member, and folding results back in lexicographic order regardless of real completion order (spec 110 FR-002).