Skip to content

Route CPU widths through fixed dynamic slots - #277

Merged
NousLoop merged 4 commits into
mainfrom
ci/dynamic-cpu-slot-design
Nov 17, 2026
Merged

NousLoop merged 4 commits into
mainfrom
ci/dynamic-cpu-slot-design

Conversation

@NousLoop

@NousLoop NousLoop commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

With the design approved, implement one private dynamic CPU capability. An explicit cores count routes only to ci-cpu-dynamic if fresh capacity proves a common maximum fits. Legacy exact-width labels are never selected by the new route; existing inventories remain readable during migration. Omitting cores keeps ci-cpu routing and existing affinity. Worker overrides do not influence routing.

The first attempt and retry read the exact decimal counts from the original plan. The executor selects a deterministic subset of its fixed slot inside the scope, checks the kernel mask again, and refuses insufficient or inconsistent capacity before launch without adding to the drain count. CI_CPUS reports the measured mask. Concurrent parts use disjoint slots, and the default worker count on the dynamic path is bounded by the measured width.

Validation on the local Windows checkout and Linux Python 3.12 Docker container:

  • git diff --cached --check passed.
  • python -m unittest -q tests.test_dynamic_cpu tests.test_cpu_width tests.test_workers tests.test_part_slots tests.test_route tests.test_flow tests.test_reusable tests.test_inventory tests.test_presence tests.test_public_flow: 311 passed, 1 skipped.
  • python -m ci_runners.inventory lint . --deny tests/deny.sha256: 0 findings.
  • All 2,796 mutation targets matched once; 44 selected mutants (including all 12 new mutations) were killed with tests/mutants.py one().
  • The broader suite including tests.test_pool had two local Claim failures: test_a_killed_host_side_leaves_the_slot_held_until_the_command_ends and test_a_host_side_that_fails_keeps_the_directory_of_a_running_supervisor. Both reproduce on 164ca22 in the same container; the hosted suite is the full check.

New mutants and their guards:

  • Accept multiple part pools under the dynamic capability: SizedPools.test_dynamic_inventory_requires_one_private_slotted_generic_pool.
  • Select ci-cpu for explicit cores: SizedPools.test_same_host_routes_and_binds_distinct_slots.
  • Accept conflicting published width limits: SizedPools.test_rejects_inconsistent_shared_label_limits.
  • Retry without fresh proof or convert cores back to a matrix number (two mutants): SizedPools.test_retries_keep_width.
  • Read retry cores from the retry payload rather than the plan: Wiring.test_both_attempts_forward_the_original_core_count.
  • Accept explicit cores on an ordinary runner: Executor.test_ordinary_runner_rejects_explicit_cores.
  • Select CPUs outside a slot or omit the post-pin readback check (two mutants): Wiring.test_scope_must_read_back_the_exact_selected_mask.
  • Leave the default workers unclamped or ignore an explicit worker overrun (two mutants): Executor.test_dynamic_core_count_controls_affinity_but_omission_does_not.
  • Allow an undersized in-scope mask: Executor.test_concurrent_parts_meet_in_disjoint_slots_and_refuse_too_narrow_scope.

Needs the lead: migrate callers still depending on old exact-width runners; use a major version if removal breaks a consumer. Install matching components before registering or relabelling the pilot pool and verify a real systemd scope on PRO 6000 before rollout. No host configuration, runner state, release or existing release stamp was changed; the tests below used isolated scopes outside the active runner configuration.

Acceptance follow-up on the reviewed head: PRO 6000 isolated tests used an inventory copy and real transient systemd scopes. The 4/6/8/12/16 logical CPU cases bound the requested width, reported the kernel mask in CI_CPUS, and preserved workers semantics. A 24-CPU request exceeded the 20-CPU slot limit: the planner rejected it and an independent executor check returned unavailable before launch. A narrowed scope and an explicit worker overrun also refused before launch. The production inventory, pool registry and hook target were unchanged. GitHub runner dispatch was not exercised.

Release decision: v1.22.0 will use the dynamic pool directly. The stamp draft must be verified against this implementation before its own merge. Do not deploy the earlier per-width pool preview.

@NousLoop NousLoop changed the title Propose per-part affinity within fixed CPU slots Route CPU widths through fixed dynamic slots Nov 17, 2026
@NousLoop
NousLoop marked this pull request as ready for review November 17, 2026 08:47
@NousLoop
NousLoop merged commit 72e6496 into main Nov 17, 2026
6 checks passed
@NousLoop
NousLoop deleted the ci/dynamic-cpu-slot-design branch November 17, 2026 08:49
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