Repository navigation
trace: instrumented COMM stepper with occurrence provenance (#58) - #67
Merged
Merged
Conversation
Phase 1 of the event-structure trace layer. Step a rho-calculus term while tagging every active parallel component with its provenance (Initial / Born), so each Comm firing becomes an Event whose identity is order-independent: the pair of occurrences it consumes, grounding out in the start term = its causal history. This is what later phases read the causal order off: an event depends on the producers of the occurrences it consumes, which records reflective causality (a Drop unfreezing a substituted process) with no special rule. - OccKey / EventKey / Event; run_events; enabled_events - tracing spans over firing + provenance (silent without a subscriber) - unit tests: causal (reflective), concurrent, conflict, same-label Refs #58 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… logging Per issue #58's tracing criterion, emit a `debug_span` over each *fired* event carrying its label and the occurrences it consumed and produced (`out`, `inp`, `produces`), instead of a per-candidate `trace!` that fired repeatedly for enabled-but-unfired reactions and omitted the keys. Document that `enabled_events` returns full successor states for the branching callers of later phases. Refs #58 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Phase 1 of the trace / event-structure toolkit (milestone Trace & event-structure analysis). The crux: everything downstream is bookkeeping over what this produces.
What
A stepper (
crates/stratum-lts/src/event.rs) that tags every active parallel component with its provenance, so eachCommfiring becomes anEventwith an order-independent identity.OccKey = Initial(i) | Born(EventKey, k)— where a component was born.EventKey { channel, message, out, inp }— identity = the two occurrences consumed (grounds out atInitialleaves = the event's causal history). Label is(channel, message),≡N-canonical.Event { key, produces };run_events(start, max_events) -> (Vec<Event>, truncated);enabled_events(crate-private).Why it captures reflective causality for free
A
Commsubstitutes⌜Q⌝and aDropunfreezesQ, so residue components are born from the firing. A later event consuming one points itsout/inpkey back at the producer — recording the dependency with no special rule for reflection. Causality is just "I consumed what you produced".Provenance is computed on the nominal term (canonicalization reuses de Bruijn
0and fuses≡-equal subterms, which would collapse distinct occurrences); names are canonicalized only for≡Nmatching and the label.Tests (happy-path + the three phenomena)
causal_reflective_dependency—x⟨|a⟨|0|⟩|⟩ | x(y).*y | a(z).0: the a-event'sout== the x-event's produced occurrence.concurrent_events_are_independent— disjoint reactions, both occurrencesInitial.racing_inputs_share_the_output_occurrence— one output, two inputs → sharedout(conflict seed).same_label_distinct_events— identical(channel, message), distinctout/inp.Verbose
tracingspans over firing + provenance (silent without a subscriber). fmt / clippy-D warnings/cargo test --workspaceall green locally.Closes #58