GeezerVison is showing github.com — bench(id): profile the fuel-spin isolation gap (#1067 slice 1) by dezren39 · Pull Request #12572 · developing-today/code
Conversation
dezren39
commented
Nov 22, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Summary
Slice 1 of #1067 (F12.10 fair scheduling and per-account quotas), cut per the feature-slice skill: for a missed performance target the first slice is the profile. The fuel_spin_isolation workload already measured the exit-criterion gap (victim p99 ratio 2.517 vs target 1.10, recorded 2026-11-10) but could not say where the spinning phase's added latency sits.
This PR adds the attribution to pkgs/id/benches/world_bench.rs and records the result:
- The victim driver now records the same sample split
many_worlds uses — (deadline-to-acknowledgement, driver wake lateness, input acknowledgement wait) — per phase.
- The bench differences the victim actor's own journal-append and command latency histograms across each phase from its
WorldHandle::metrics() snapshots, and prints one profile fuel_spin_isolation ... line per run.
BASELINES.md gains the profile section; the first attributed run's bench + profile lines are appended to baseline.txt. The 2026-11-10 reference line is unchanged. No production code changes; the bench line format is unchanged.
Result: the gap is runtime worker starvation, not victim service. In two attributed runs the victim's spinning-phase p99 was its driver's wake lateness (18.929 of 21.924 ms; 13.092 of 13.114 ms). The victim's actor is starved the same way (ack p99 0.2 → 5.086 / 4.007 ms) while its own service stays nearly free (command mean 55 µs calm → 130 / 64 µs spinning; queue depth max 0; no journal appends in this workload). Fifteen spinners run synchronous fuel-limited guest calls on the shared multi-thread runtime, occupying every worker for each burn — the #557 worker-parking disease in CPU form. The remedy is placement (guest execution off the shared workers), which is the next slice.
Criteria state on #1067 after this PR: exit benchmark — measured, target unmet, now attributed; fair hub scheduler — unimplemented, first fix step named by the profile; per-account quotas (worlds/storage/fuel-per-second) — unimplemented; slow-client back-pressure — unimplemented.
Evidence
All runs on the laptop (AMD Ryzen 7 7840U, reference machine), bench built via ~/tools/fleet-build-lock cargo bench --bench world_bench --no-run, run as ./target/release/deps/world_bench-<hash> --only fuel_spin_isolation (full size: 15 spinners, 20M spin fuel, 300 samples/phase). The laptop was under heavy shared fleet load throughout (load average ~16–30), so ratios are not comparable to the 2026-11-10 reference (2.517 at lighter load); the attribution is the transferable result, and both attributed runs agree on it.
Before (unmodified main 63f9558b9, fail-before): the run prints only the bench line — no profile line exists. Fresh gap: victim_p99_ms_calm=2.239 victim_p99_ms_spinning=38.168 ratio=17.043 target_met=false, 1,473 spins.
After (this branch, two runs):
ratio=11.575 — profile: spinning_wake_p99_ms=18.929 spinning_input_ack_p99_ms=5.086 calm_command_mean_us=55 spinning_command_mean_us=130 victim_queue_depth_max=0, 1,059 spins.
ratio=6.888 — profile: spinning_wake_p99_ms=13.092 spinning_input_ack_p99_ms=4.007 spinning_command_mean_us=64, 1,822 spins.
Full lines are committed in BASELINES.md / baseline.txt. The touched package's suites are unaffected (bench-only change; the bench compiles with no new warnings — the three world_bench.rs warnings at lines 230/235/707 pre-date the change). Suite-registry check for the bench path prints nothing, as required (no new test file; the bench is the registered suite).
Merge Danger
None to production behavior: the change is confined to pkgs/id/benches/world_bench.rs (the fuel_spin_isolation driver records two extra timestamps per sample and three metrics snapshots per run; all existing assertions unchanged) plus the two bench record files. The victim in this workload now receives three extra Metrics commands per run, outside the timed phases. Reverting restores the previous bench output exactly.

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Update after merge-forward (2026-11-22)
Main moved while this PR was open, in ways that bear directly on it:
- id-worlds: guest calls in blocking context — first #1067 fair-scheduling slice (draft, awaiting reference-machine bench) #12571 merged — the placement fix this profile names (
run_guest_call: guest calls under block_in_place in sandbox.rs), landed explicitly "awaiting reference-machine bench". This branch merged main forward (conflict in BASELINES.md resolved keeping both appended sections, including the CI-runner noise note, which says the 4-vCPU runner venue cannot decide the fix).
- This PR now also carries that reference-machine bench: two back-to-back pre/post pairs on the laptop at light load, full profile, recorded in
BASELINES.md ("Post-id-worlds: guest calls in blocking context — first #1067 fair-scheduling slice (draft, awaiting reference-machine bench) #12571 check") and baseline.txt. Verdict: the fix does not move the ratio (pre 6.049 / 6.711, post 6.826 / 6.085) and taxes the victim's own calls — spinning-phase command mean 67 / 103 µs pre → 1,651 / 2,191 µs post (~20×, both pairs), ack p99 3.963 / 6.456 → 12.983 / 17.242 ms. Placement cannot create CPU; the lever the evidence now supports is admission (bounding concurrent guest burns), which is also the quota hook. The next-slice statement in the issue note is corrected accordingly.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
The fuel_spin_isolation workload recorded the F12.10 exit gap
(victim p99 ratio 2.517 vs target 1.10, 2026-11-10) but not where
the spinning phase's added latency sits. The victim driver now
records the same sample split many_worlds uses — deadline-to-ack,
driver wake lateness, input acknowledgement wait — and the bench
differences the victim actor's own journal-append and command
latency histograms across each phase from its metrics snapshots,
printing one profile fuel_spin_isolation line per run.
Measurement only: no scheduler, quota, or back-pressure behavior
changes, and the bench line is unchanged.
Two attributed laptop runs (main 63f9558 + the profile
instrumentation, heavy shared fleet load) plus a fresh unattributed
gap measurement at unmodified main (ratio 17.043, vs the 2026-11-10
reference 2.517 at lighter load). The spinning phase's victim p99
is its driver's wake lateness (18.929 of 21.924 ms; 13.092 of
13.114 ms): synchronous guest burns occupy every shared-runtime
worker. The victim's own service is negligible (command mean
55 -> 130/64 us, queue depth max 0, no journal appends in this
workload). First bench+profile lines appended to baseline.txt; the
2026-11-10 reference line is unchanged.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
| Review |
Status |
Commit |
Review trigger |
| 📝 Code Review |
✅ Completed 2026-11-22T14:22:59.795306Z |
6aae239 |
New commits |
ℹ️ 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.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
coderabbitai
Bot
commented
Nov 22, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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:
d21818af-218f-4530-9b64-e004aac3a588
Commits
-
Reviewing files that changed from the base of the PR and between 6bc7fe5 and 6aae239.
Files selected for processing: 3
-
pkgs/id/benches/BASELINES.md
pkgs/id/benches/baseline.txt
pkgs/id/benches/world_bench.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
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…profile
# Conflicts:
# pkgs/id/benches/BASELINES.md
Two back-to-back pre/post pairs on the laptop at light ambient
load (full profile, same command): ratios indistinguishable
(pre 6.049/6.711, post 6.826/6.085), wake tail persists, ack p99
worsens (3.963/6.456 -> 12.983/17.242 ms), and the victim's own
spinning-phase command mean rises ~20x (67/103 -> 1,651/2,191 us,
bucketed p99 2,000 -> 50,000 us) because every guest call now pays
the block_in_place round trip under core saturation. Placement
cannot create CPU; the supported next lever is admission -
bounding concurrent guest burns. Pair lines appended to
baseline.txt.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6aae23928f
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
# load (load average ~20-24), so the ratio is not comparable to the 2026-11-10 reference
|
|
|
# above - the attribution is the result: the victim's spinning-phase p99 is its driver's
|
|
|
# wake lateness (18.929 of 21.924 ms), not its own service. See BASELINES.md.
|
|
|
bench fuel_spin_isolation unit=ms_per_command median=2.992 min=0.222 reps=1 victim_p99_ms_calm=1.894 victim_p99_ms_spinning=21.924 ratio=11.575 target_ratio=1.10 target_met=false calm_samples=300 spinning_samples=300 spins=1059 spinners=15 phase_ms=3000 commands_per_second=100 spin_fuel=20000000 calm_elapsed_secs=3.041 spinning_elapsed_secs=3.139
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep diagnostic runs out of the machine-readable baseline
Appending these runs introduces duplicate bench fuel_spin_isolation records alongside the existing reference measurement. .github/scripts/id-bench-compare.sh explicitly treats duplicate benchmark names as malformed rather than selecting a reference; running it against this baseline reproduces fuel_spin_isolation ... incomparable (malformed bench line). Consequently, the comparison step in .github/workflows/id-bench.yml can no longer report regressions for this workload. Keep the historical runs in BASELINES.md or a separate capture file, leaving exactly one active baseline record for this benchmark.
Useful? React with 👍 / 👎.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Nov 22, 2026
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|