Skip to content

perf(runtime): run every partition of a busy settle without comparing - #2124

Merged
mergify[bot] merged 1 commit into
masterfrom
feature/perf/2013-settle-adaptive
Oct 26, 2026
Merged

mergify[bot] merged 1 commit into
masterfrom
feature/perf/2013-settle-adaptive

Conversation

@tignear

@tignear tignear commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Part 3 of #2013, after #2106 and #2113: a partitioned settle in which many partitions are dirty runs all of them without comparing what they write. Partitioning stays opt-in. Whether it can be turned on by default is decided on measurements of Estimated across other designs (Heliodor, the b2/b3 benchmarks, rtlmeter), which follow separately.

What changes

  • Busy settles. At settle entry the generated code popcounts the partition flags. When at least a third are set, or the untracked byte is, it records "full" in a new flag byte. Every partition then runs, and it compares only the objects that have readers at or before it in the schedule: those readers need the flag for the next settle. Readers later in the schedule run in the same settle anyway.
    • The first version marked those earlier readers unconditionally. That fed back into the next settle's count, and on C906 it made nearly every settle full; it now marks them only when the object changed.
  • Fewer mark operations. A partition ORs the change bits per reader set and then per reader, and updates each reader's flag once. On C906 that is 6,304 flag updates instead of 118,197.

Worst case and how often it triggers

  • Worst case: a settle where everything changes costs 1.6x a single pass (C906 with full mode forced on every settle: 8.4 s simulation phase against 5.27 s single pass; without full mode an all-dirty settle costs about 2x). The rest of the overhead is the old-value loads at partition entry (1.3 Mbit of cross-partition state on C906) and the values kept live across each partition.
  • C906: full mode triggers on 10 of 34,844 settles (at most 0.03%). The simulation phase is 1.39 s, against 1.33 s for perf(runtime): mark settle partitions only when their inputs change #2113 and 5.27 s for the single pass, with a trace identical to the single pass.
  • A shadow copy of the watched objects instead of old-value loads was tried and measured worse: 1.81 s, forced full 11.2 s. It is not included.

Validation

A partitioned settle now starts by counting its dirty flags. When at
least a third are set, or the untracked byte, it runs every partition and
skips comparing what they write, except for objects read at or before
the writer in the schedule, whose readers need the flag for the next
settle. A settle where everything changes then costs 1.6x a single pass
instead of about 2x. The flags gain a byte recording the decision.

A partition also sets each reader's flag once, from one change bit per
reader, instead of once per changed object and reader.

Partitioning stays opt-in (#2013).

Change-Id: I73f58f3a3aa13e9ac693ceccb5beb83cc47dfe25
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T08:14:32.581352Z 9a57bcd 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.

@tignear tignear added the merge-ready Request merging through Mergify after required checks label Oct 26, 2026
@mergify mergify Bot added the queued Mergify queue entry label Oct 26, 2026
@mergify

mergify Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 44 minutes 9 seconds in the queue, including 41 minutes 49 seconds running CI.

Required conditions to merge
  • check-success = Conventional Commit title
  • check-success = Queue validation
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Lint & Format
    • check-neutral = @github-actions/Lint & Format
    • check-skipped = @github-actions/Lint & Format
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-neutral = @github-actions/NAPI Build (Linux ARM64 GNU)
    • check-skipped = @github-actions/NAPI Build (Linux ARM64 GNU)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/NAPI Build (Windows)
    • check-neutral = @github-actions/NAPI Build (Windows)
    • check-skipped = @github-actions/NAPI Build (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Rust Test & NAPI Build
    • check-neutral = @github-actions/Rust Test & NAPI Build
    • check-skipped = @github-actions/Rust Test & NAPI Build
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Ubuntu)
    • check-neutral = @github-actions/JS Test (Ubuntu)
    • check-skipped = @github-actions/JS Test (Ubuntu)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/JS Test (Windows)
    • check-neutral = @github-actions/JS Test (Windows)
    • check-skipped = @github-actions/JS Test (Windows)
  • any of [🛡 GitHub repository ruleset rule master]:
    • check-success = @github-actions/Conventional Commit title
    • check-neutral = @github-actions/Conventional Commit title
    • check-skipped = @github-actions/Conventional Commit title

@mergify
mergify Bot merged commit 4eba35d into master Oct 26, 2026
23 checks passed
@mergify
mergify Bot deleted the feature/perf/2013-settle-adaptive branch October 26, 2026 09:43
@mergify mergify Bot removed the queued Mergify queue entry label Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready Request merging through Mergify after required checks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant