Skip to content

id: implement the loadgen core and re-express world_bench on it (#8307) - #10067

Merged
dezren39 merged 1 commit into
mainfrom
queue/16856-8307-loadgen-core
Nov 14, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/16856-8307-loadgen-core

Conversation

@dezren39

@dezren39 dezren39 commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

Implements step 1 of the #5891 shared workload-generator record (packet #8307): the loadgen core in pkgs/id/tests/common/loadgen.rs, plus the world_bench re-expression, without changing any bench output line.

The core (tests/common/loadgen.rs, std-only)

  • Workloads are data: MixTable states counts per 1,000 ops over the op families (validated: sums to exactly 1,000, no family twice); the op stream is a pure function of the mix — op i is decided by i mod 1,000 walking the table — so mixes are never time-sampled.
  • Determinism before realism: every run is driven by a recorded seed. The corpus and actor identity material are generated from the seed by a fully specified in-file PRNG (SplitMix64), so the same (seed, actor, index) yields identical bytes on every machine. No new dependency: the module compiles in both include contexts (tests via mod common;, benches via #[path]).
  • Profiles are parameters: honest profiles are closed-loop; adversarial profiles are open-loop with a named modifier (churn / slowloris / amplify / bomb / garbage / exhaust) and a target rate.
  • Surfaces behind one trait: Target is the record §2 contract (connect(seed, actor), per-op execute, disconnect). A surface refusing an op class aborts the run — unsupported is recorded, never silently downgraded.
  • Scheduler: single-threaded closed-loop driver; warm-up ops are executed and discarded; per-op failures are counted by family and the run continues; open-loop profiles are refused by this step's executor with the refusal named (the rate executor is the record's step 4). RunSpec::header_line() fixes the §4 run-identity fields; the header/summary writer is step 2 and is deliberately not here. GENERATOR_VERSION starts at 1.

The bench re-expression (benches/world_bench.rs)

The four synchronous workloads now run as loadgen workloads (single-family mixes, Profile::honest, fixed seed) through the scheduler against InProcess surfaces implemented as direct core calls, with their sample math and output lines unchanged:

  • journal_append_fsync — one actor; connect opens the per-rep journal; the append op times each FileJournal::append; sample = mean op latency.
  • checkpoint_compaction — the journal fill moves to connect (untimed setup, as before); the single measured op is the compaction.
  • guest_replay — journal construction moves to connect; the measured op is restore + replay, still asserting the guest saw every committed event (id(bench): PR #1387 guest_replay benchmark replays zero events — restore() never puts committed chat events in replay #1403's lesson kept).
  • session_fanout — connect spawns the world and subscribes all clients (inside the runtime, as WorldHandle::spawn requires); the measured op is one chat round drained by every receiver; sample = mean round latency per client.

The two async, wall-clock-paced workloads (many_worlds, fuel_spin_isolation) keep their dedicated drivers in this step: their pacing is the open-loop / rate-based executor work of the record's later steps, and faking a closed-loop re-expression would change what they measure. That boundary is named in the bench source and on #8307.

Verification

  • cargo test --test loadgen_determinism: 16/16 pass — the module's unit tests (mix validation and stream counts, corpus/actor determinism, warm-up discarding, unsupported-abort, open-loop refusal, header fields) plus the acceptance invariant through the public include path: same seed → identical corpus sequence and identical driven workload sequence.
  • cargo bench --bench world_bench -- --quick: all six output lines in their established formats (values are the laptop's, not baseline updates — baselines move only under the id: design: the standard server baseline (from #5685) #5894 protocol).

Closes #8307. Unblocks the #5896 benchmark-matrix task (queue 12924) on the core; steps 2+ of the record remain their own packets.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Step 1 of the #5891 shared workload-generator record: a std-only core in tests/common/loadgen.rs (mix tables as counts per 1,000 ops, a seeded corpus and actor derivation, honest/adversarial profiles, the Target surface trait, and a closed-loop scheduler whose runs are replayable from their spec), wired into tests/common and covered by the seeded-determinism acceptance tests. The four synchronous world_bench workloads run through the scheduler as InProcess surfaces with unchanged output lines; the two async wall-clock-paced workloads keep their dedicated drivers until the record's open-loop executor step.
@dezren39
dezren39 requested a review from a team as a code owner November 14, 2026 14:53
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T14:53:02.994166Z
We couldn’t complete this review. Comment @codex review to try again.
74c83b6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ec10aab2-7126-4fd7-b6e7-e895491c15c6
Commits

Reviewing files that changed from the base of the PR and between 335781b and 74c83b6.

Files selected for processing: 4

  • pkgs/id/benches/world_bench.rs
  • pkgs/id/tests/common/loadgen.rs
  • pkgs/id/tests/common/mod.rs
  • pkgs/id/tests/loadgen_determinism.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 48c72ef into main Nov 14, 2026
1 check passed
@dezren39
dezren39 deleted the queue/16856-8307-loadgen-core branch November 14, 2026 14:53
dezren39 added a commit that referenced this pull request Nov 15, 2026
* id: implement the per-interface benchmark matrix (#5896)

Implements the #5896 decision record (task 10503) on top of the
landed prerequisites: the #5891 loadgen core (#8307, PR #10067) and
the #5894 standard server baseline (fleet-laptop / ci-runner machine
classes, standard-default configuration, scales S0/S1/S2).

- world_bench: the four loadgen-core workloads now also emit a
  versioned results.jsonl bundle — a run manifest (schema_version,
  run_id, git sha, started_at_utc, machine_class, OS/arch, CPU,
  toolchain, build profile, generator version, seed) plus one cell
  record per (workload x interface x configuration) tuple. The
  measured interface is in_process; the shell-contract transports
  (iroh, websocket, ssh-exec) have no adapter in this harness, so
  their cells are recorded explicitly as unsupported with a reason —
  never omitted, never zero. Measured cells carry metric entries
  with statistic, unit, value, sample_count and raw samples. The
  legacy bench lines / baseline.txt remain the compatibility view.
- id-bench-compare.sh: matrix mode for .jsonl inputs compares by
  the full identity (machine_class, workload_id, interface_id,
  configuration_id, metric, statistic) — same-name cells on
  different interfaces can no longer collide; a machine-class
  mismatch is incomparable, never compared; explicit non-measured
  statuses are reported as-is. Legacy mode unchanged; tests cover
  both (all pass).
- id-bench.yml: stamps the bundle ci-runner + the run commit,
  uploads results.jsonl with the raw output in the bench-output
  artifact, and links the bundle from the job summary (index, not
  the record).
- BASELINES.md: documents the bundle, the identity, the machine
  classes, and the re-baseline procedure for baseline.jsonl.

Verified: cargo bench build (bench profile) succeeds; a --quick
run of journal_append_fsync emits a well-formed bundle (manifest +
measured cell + 3 unsupported transport cells) and its median
(5144us) is in line with the committed baseline (5180us).

Task 12924 (queue repo-health-code-pilot), lane code-a.

* id: add the fleet-laptop matrix baseline (#5896)

baseline.jsonl generated by a full-size world_bench run on the
fleet reference laptop at 9bcd1a7 (manifest inside the bundle
carries run_id, commit, machine class fleet-laptop, rustc 1.99.0):
4 measured in_process cells + 12 explicitly unsupported transport
cells. Self-comparison with id-bench-compare.sh matrix mode reports
every measured metric ok at +0.0%.

Note: the matrix guest_replay median (1.284 us_per_event) differs
from the legacy baseline.txt line (0.170) — the #8307 loadgen
re-expression changed that workload's shape after baseline.txt was
taken (2026-10-30); the matrix baseline records the current
harness's numbers, and baseline.txt is untouched by this change.

---------

Co-authored-by: repo-worker-tmp-code-b <fleet@developing.today>
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.

id: implement loadgen core — step 1 of the #5891 workload-generator record

1 participant