Skip to content

Priority exploration and a trace timeline - #21

Merged
dhruvl merged 8 commits into
mainfrom
pct-timeline
Aug 1, 2026
Merged

Priority exploration and a trace timeline#21
dhruvl merged 8 commits into
mainfrom
pct-timeline

Conversation

@dhruvl

@dhruvl dhruvl commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Two additions on one substrate: schedules can now be explored by priority with a stated per-run guarantee, and any run's trace can be drawn as a timeline you can open in a browser.

  • The trace grew the substrate both need, in one disclosed format change: every scheduler event now names the host whose code it runs (empty for the simulation's own steps), and the network records a deliver event paired to each send by uid. Recorded trace hashes therefore differ from 0.1.0 for every workload — the changelog says so plainly. TraceEvent is now a named tuple; recording is slightly cheaper than before.
  • Scheduling policies now see who is ready, not just how many: the policy seam receives a lazy sequence of (owner, label) views, where owners are per-loop task creation indices. The default seeded policy and scripted replay consume only the count, and their schedules are byte-identical to before — verified across seeds against the previous build.
  • policy="pct" runs Burckhardt et al.'s Probabilistic Concurrency Testing (ASPLOS 2010): distinct random priorities per chain of work, the highest-priority ready entry runs, and depth-1 change points demote the leader. The docs state the honest trade: on a shallow planted race uniform random finds the bug ~46x sooner; what PCT buys is a stated per-run floor for depth-d bugs, which uniform draws cannot promise. The horizon calibrates from seed 0's step count; PCT-found failures replay by seed and by recorded choice list.
  • --simloop-timeline renders each failing seed's trace to a self-contained HTML page: one lane per host plus one for the simulation, send-to-deliver arrows (duplicates, held-then-released re-sends and transmit-time holds all drawn honestly), crash and restart marks distinct from packet fates, hover details, zoom and pan, and a truncation banner past five thousand events. No external requests of any kind.
  • Benchmarks re-measured on this tree and republished: the single-process chaos campaign now explores ~52 seeds/second, down from ~55 in 0.1.0 — the per-delivery trace events are a feature with a cost, and the numbers say what they measured.

Suite green (455 tests + slow markers); strict mypy clean; no new runtime dependencies.

dhruvl added 8 commits August 1, 2026 16:24
The 300-seed chaos campaign now costs 5.3-6.3 s rather than the 5.0-5.2 s
published for 0.1.0: recording a trace event per delivery, not just per
send, is what lets a timeline draw both ends of a crossing, and a scenario
this network-heavy pays for the extra events. Nine runs on the M4 Air after
a warmup, median 5.8 s.
Both spellings of --simloop-timeline reach the guard as one string, so the
error fired on --simloop-timeline=tests while telling the user to write
exactly that. Name the two ways out instead, and pin the = form.

The crash sweep records lost for held packets where the crashed host is
either end, so a crashed sender's packets land in the destination's lane;
say so where the arrival fates are listed and in the verb table.
@dhruvl
dhruvl merged commit f18333c into main Aug 1, 2026
4 checks passed
@dhruvl
dhruvl deleted the pct-timeline branch August 1, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant