Expand description
The history-run seam — the async RUN machine behind a trait, mirroring the
platform-seam shape of brep-app/src/store.rs’s ModelStore (a trait with
impls behind it, async surfaced via a poll idiom).
A history run is split SUBMIT → POLL/APPLY: HistoryRunner::submit_run
kicks off a run tagged with a monotonic generation, and the completed
RunReply is drained later via HistoryRunner::poll_run. The runner OWNS
the SceneRunner — so a future thread/worker
impl owns the resident registry that execute_history populates — and holds
the delta baseline across reruns.
This slice ships the DEFAULT InlineRunner: it runs on submit_run and
stashes the reply for an immediate poll_run, so the run stays synchronous
and byte-identical to the pre-seam in-process run. A native-thread impl (M2b)
and a wasm-worker impl (M3) slot in behind the SAME trait — submit_run
defers the work and poll_run surfaces it a frame (or many) later, so the
EngineState::pump caller never changes.
Structs§
- Inline
Runner - The default, SYNCHRONOUS runner: runs on submit, stashes the reply for an immediate poll. Behavior-identical to the pre-seam in-process run.
- Measure
Query - A per-object MEASUREMENT request routed to the runner (which owns the warm
registry). The runner resolves
ownerto its resident handle and measures bykind; the reply is the object-info JSON fragment MINUS the main-injectedname/creatingFeaturefields. Tagged with a monotonicidso the main side can pair the reply with its pending request. - Measure
Reply - A completed
MeasureQuery: the object-info measurement fields as a JSON fragment (WITHOUTname/creatingFeature, which the main thread injects from its eager provenance), tagged with the requestid. - RunReply
- A completed history run, tagged with the
generationit was submitted under so the applier can drop stale replies (a newer run that finished first). Theoutputis theSceneRunnerdelta to apply to the display scene. - Thread
Runner - The persistent-thread runner.
submit_*/resetpushCommands down the channel;poll_*first DRAIN every readyReplyinto the two demux buffers, then pop the matching one. TheSceneRunner(and thus the kernel’s resident registry it warms) lives ENTIRELY on the thread — it is never shared — so the only cross-thread traffic is theSendcommand/reply payloads.
Enums§
- Command
- A command sent main → runner (thread channel OR worker
postMessage) over one ordered stream (so aResetbefore aRunstays before it).Runcarries the whole request; the driver coalesces consecutiveRuns to shed a slider drag’s backlog (the thread inthread_main, the worker’s main side inWorkerRunner). - Measure
Kind - Which exact measurement a
MeasureQuerywants, mirroring the object-info kinds (crate::metadata): a whole solid, one named face, or one named edge. - Reply
- A reply sent runner → main; the main side demuxes it into per-kind buffers so
poll_run/poll_queryeach pop their own stream.
Traits§
- History
Runner - The history-run seam: SUBMIT a run, POLL for its completed reply, RESET the delta baseline, plus a QUERY channel for per-object measurements (routed to the runner so the warm registry answers them, never the cold main-side one). The Inline impl runs everything synchronously; a later thread/worker impl defers the work and surfaces the replies through the same poll idiom.
Functions§
- process_
command - Execute ONE
Commandagainstrunnerand return theReplyit produces, if any. The shared step both async drivers run: the native [thread_main] calls it for each (post-coalescing) command on the runner thread; the wasmWorkerRunner’sworker_entrycalls it perpostMessageon the worker.Run→ aReply::Run;Query→ aReply::Query;Resetdrops the delta baseline AND the runner’s OWN kernel history cache (the resident registry lives with the runner — thread or worker — not on main) and yields no reply.