Skip to content

perf(api): the default resource policy pins two workers, so nothing can show multi-core behaviour #1463

Description

@DecisionNerd

Summary

ExecutionResourcePolicy::default() (crates/graphforge-api/src/resource_policy.rs:66-82) sets a fixed two-worker facade:

mode: ResourcePolicyMode::Explicit,
tokio_worker_threads: Some(2),
target_partitions: Some(2),
io_concurrency: Some(2),
compute_threads: Some(2),

pinned by defaults_and_bounds_are_stable at write_modes.rs:404. It preserves pre-#337 behaviour. On an 8-core / 16-thread host it is simply wrong, and every default-constructed instance takes two workers whatever the machine has.

Why this is a precondition, not a cleanup

#1456 lists this as work item 4, "independent of everything above; do it now". Under the foundation-first sequencing it is stronger than independent — it is a precondition for #1462 meaning anything.

While the default pins two workers, a serial-fraction instrument measures the facade rather than the engine, and no parallelism work underneath can show up in a ladder rung. The G500 ladder currently runs at 0.85–0.89 effective cores across a 64x edge range on a 16-thread host, and this default is one reason why.

Shape

Derive concurrency from machine parallelism: mode: Automatic with the individual knobs None so each defers to the mode. Keep the explicit path intact for callers that want to pin.

A change of this shape is already written and uncommitted on perf/unpin-compute-drop-rss-growth-gate — it has not been committed or test-run.

Acceptance

  • Defaults derive from logical_cpus() rather than a constant; the mode is Automatic.
  • Both pinning tests updated to assert the derived value rather than Some(2) — assert the invariant (concurrency follows the machine), not the observation (it equals 2).
  • Explicit policies still honoured, and validate() bounds unchanged.
  • A ladder rung shows effective cores above 1.0 once observe(storage): nothing measures the serial fraction of ingest, and #1387 budgets against it #1462 can report it, or the reason it does not is understood and recorded.

Caution

Worker count, execution partitions and durable partition layout are three different numbers. Raising this default must not change the recorded UUID splitters or the durable partition count — those are format parameters, not execution choices.

Plan: rev 8, phase 0b. Parent: #1456 (its work item 4).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions