Repository navigation
Align send/sendTo error types and clean up step and host internals - #324
Merged
Merged
Conversation
Contributor
Type performanceMeasured with TypeScript 6.0.3 and
Marginal instantiations are measured against the matching setup without that API call:
Check times (informational)
Type instantiations are the comparison metric. Check time varies with runner load and is informational only. |
Contributor
Runtime performanceMedian of 5 independent benchmark processes on Pull request baseline
Process runtime reference points
Effect Machine change from base
Process runtime reference change from base
Regression guardNo large, noise-adjusted throughput or heap regressions detected. Versions and interpretation
Higher throughput is better; lower heap is better. Variability is the median absolute deviation across independent processes, relative to their median. Small differences on shared GitHub-hosted hardware remain informational; the required guard rejects only large changes beyond the measured noise allowance. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up cleanup and alignment pass over the unified step/host architecture from #323:
step.ts: Extracted a singlechildlessStephelper insidebuildshared byadvance,move(now delegating toadvance), andmoveChildlessOwned(preserving its zero-allocation in-place snapshot return path while sharing step creation when aStepis returned). Full reference-vs-indexed and owned-vs-persistent differential coverage is preserved.sendandsendTosurface with its runtime behavior: Every caller-awaitedsend/sendToEffect now includesMachineSchemaDecodeErrorin its error channel and rejects events refused by the receiving machine's schema while leaving the receiver running acrossLocalMachine,AtomMachine, andClusterMachine. Transition commands (enqueue.sendTo) have no waiting caller and continue to deliver directly (failing the receiver onLocalMachine, or refusing the sending step onClusterMachine).LocalMachine (generic)/LocalMachine (compiled)toLocalMachine (reference planner)/LocalMachine (indexed planner)(only the header row ofmatrix.txtchanged; all cell values are unchanged)."generic" | "compiled"test strategy parameters inprocess.tsand internal tests withLocalPlannerStrategy = "reference" | "indexed"(preservingruntime.ts'sstartProcessWithStrategyForTestingcompatibility withperf/runtime/counter.mjs).selectExecutionPlanForTestinginexecutionPlan.tsto delegate to cachedreferenceExecutionPlan/compileExecutionPlan.step.ts,runtime.ts,runtimeCompiled.ts,runtimeProtocol.ts, andCONTRIBUTING.md(removing references to the deletedruntimeGeneric.ts).MachineTestdetours intrace.ts: Verified that neither detour can move throughstep.start/step.sendwithout breakingMachineTest's public contract (InitialTrace.startingState, effectfulRunServices<M>, rawRunError<M>vsStartupError, and idempotent post-finalMachine.planbehavior) and documented the exact constraints at both call sites.stepHost.ts's directkernel.plan.initial+toStartupFailurebypass ontokernel.startSnapshotinstep.ts(with differential coverage instepDifferential.test.ts); removed redundantentry._tag === "Initial"check andExit.Successcasts instepHost.ts; replacedthis as unknown as Childrencast instep.tsPlanningwith a default parameter; removed deadrunCommandsincommandRuntime.ts; replaced unusedsendParentonProcessInitialContext/StartInternalOptionswithdeliverTo(eliminating an extra per-invoked-child closure); switchedclusterInstance.tssnapshotForfromlast.microsteps.length > 0tolast.plannedto avoid eagerly materializing microstep snapshots.stepHost.tsexitsWorkcheckingstep.exited(moving settled work intoMachineStep.Step.stopwould changeMachineStep.test.ts);testing/machine/work.tsreadingwork[Step.WorkTypeId].channels;clusterWork.tssupportOfreadingtoImpl(machine).handlersdirectly;clusterInstance.tssnapshotForCommitre-readingisFinal/getFinalOutputEffectandchildTargetresolving persisted child ids viaClusterProgress.send/sendToauditMachineRef.sendStoppedError | MachineSchemaDecodeError/ rejects, receiver stays activeMachineTarget.send(self)StoppedError | MachineSchemaDecodeError/ delivered & failed receiverStoppedError | MachineSchemaDecodeError/ rejects, receiver stays activeMachineTarget.send(parent)StoppedError | MachineSchemaDecodeError/ delivered & failed parentStoppedError | MachineSchemaDecodeError/ rejects, parent stays activeMachineTarget.send(external ref)StoppedError | MachineSchemaDecodeError/ rejects, receiver stays activeMachineTarget.send(self,parent,ClusterMachine.target)StoppedError | MachineSchemaDecodeError/ died withRejected("InvalidEvent")StoppedError | MachineSchemaDecodeError/ rejects withMachineSchemaDecodeError, entity stays activeChildOwner.sendToStoppedError/ failed child (Local) or died (Cluster)StoppedError | MachineSchemaDecodeError/ rejects, child stays activeMachine.sendTo(child)/ChildMachineRuntime.sendToStoppedError/ failed child (Local) or died (Cluster)StoppedError | MachineSchemaDecodeError/ rejects, child stays activeMachine.sendTo(address)/MachineRuntime.sendToStoppedError/ failed child machine (or delivered toLogic)StoppedError | MachineSchemaDecodeError/ rejects if addressed child is a machine (delivers toLogic), child stays activeLogic.Endpoint.send/Logic.InitialContext.sendToStoppedError(endpoint & address) / delivered & failed receiverStoppedError | MachineSchemaDecodeError/ rejects if receiver is a machine, receiver stays activeMachineStep.Children.sendToMachine.toStepStoppedErrorStoppedError | MachineSchemaDecodeErrorAtomMachineMachineAtom.send/ChildMachineAtom.sendStoppedError | MachineSchemaDecodeError(+ChildNotActiveError) / rejects, stays activeClusterMachineClient.sendRejected | ClientError/ rejects withRejected("InvalidEvent"), entity stays activeenqueue.sendTotransition commandsChangeset
Validation
pnpm check