Skip to content

test(core): CellScheduler scale probe — measure the O(n²) before refactoring - #9131

Merged
AceHack merged 1 commit into
mainfrom
otto/cell-scheduler-scale-probe
Jul 2, 2026
Merged

test(core): CellScheduler scale probe — measure the O(n²) before refactoring#9131
AceHack merged 1 commit into
mainfrom
otto/cell-scheduler-scale-probe

Conversation

@AceHack

@AceHack AceHack commented Jul 2, 2026

Copy link
Copy Markdown
Member

Follow-up #1 to the DBSP consumer (#9129): measure the deferred O(n²)-queue hot path instead of assuming it.

What

A scale probe exercising the adversarial cases (wide fan-out, deep chain). Correctness-at-scale assertions are deterministic; wall-clock is informational only (not a DST proof).

Measured (N=2000)

  • wide fan-out ≈ 59ms
  • deep chain ≈ 35ms

Well within the design's stated "thousands of cells" target. The quadratic is real (fan-out ≈ O(N²) ⇒ ≈1.5s at N=10k) but does not bite at the target scale.

Outcome

The ImmutableQueue + Set-membership refactor stays deferred — now with data, not a guess. The measurement says it isn't yet earned; earn it when a consumer targets ~5–10k cells. Debt ledger §6a updated with the numbers.

This is the razor-honest disposition: measure first, refactor only when the number justifies it. It also proves the scheduler is correct at 2000 cells (nothing else exercised it beyond ~12).

🤖 Generated with Claude Code

…ctoring (shadow*)

Follow-up #1 to the DBSP consumer (#9129): measure the deferred O(n²)-queue hot path
instead of assuming it. Adds a scale probe (correctness-at-scale assertions are
deterministic; wall-clock is informational only, NOT a DST proof).

Measured at N=2000 (the adversarial cases): wide fan-out ≈59ms, deep chain ≈35ms —
well within the design's stated "thousands of cells" target. The quadratic is real
(fan-out ≈ O(N²) ⇒ ≈1.5s at N=10k) but does NOT bite at the target scale.

Outcome: the ImmutableQueue + Set-membership refactor stays DEFERRED — now with
DATA, not a guess. The measurement says it is not yet earned; earn it when a consumer
targets ~5-10k cells. Updated the debt ledger §6a with the numbers. This is the
razor-honest disposition: measure first, refactor only when the number justifies it.

Also proves the scheduler is CORRECT at 2000 cells (nothing else exercised it beyond
~12) — a real gain regardless of the perf decision.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

AgencySignature-v1:
  persona: otto
  actor: zeta-otto
  surface: tests
  topology: shadow-clone
  intent: cell-scheduler-scale-probe-measure-on2-hot-path-defer-with-data-not-guess
  authorization: aaron-standing-24h-autonomous-2026-07-02
  uncertainty: low
  measure: scale-probe-n2000-fanout-59ms-chain-35ms-quadratic-real-but-below-target-refactor-deferred-with-data-correctness-at-scale-proven
  delta-u: replaces-perf-guess-with-measurement-defers-refactor-honestly-proves-correctness-at-2000-cells
  seed: S4
@AceHack
AceHack merged commit d2367d1 into main Jul 2, 2026
29 of 31 checks passed
@AceHack
AceHack deleted the otto/cell-scheduler-scale-probe branch July 2, 2026 12:46

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

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: 553336bd19

ℹ️ 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".

let n = 2000
let sinks = [ for i in 1 .. n -> sprintf "s%04d" i ]
let cells = ("src", 0) :: [ for s in sinks -> s, 0 ]
let seed = [ "src", { D = 0; To = sinks } ] // src fans a message to every sink

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Exercise real fan-in/delivery in the scale probe

Because this scale case seeds D = 0 and sends only one message to each sink, the later count/contains assertions would still pass if the scheduler dropped all emitted sink messages after initializing the cells. It also never exercises the documented same-inbox q @ [msg] cliff, since no cell receives more than one message; a fan-in/aggregator workload or nonzero sink assertion is needed before using this probe to justify deferring the queue refactor.

Useful? React with 👍 / 👎.

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