Skip to content

refactor(partition): ♻️ name the node-mask regimes instead of a bare bool - #252

Merged
robertodr merged 1 commit into
mainfrom
refactor/node-mask-enum
Aug 20, 2026
Merged

refactor(partition): ♻️ name the node-mask regimes instead of a bare bool#252
robertodr merged 1 commit into
mainfrom
refactor/node-mask-enum

Conversation

@diagonal-hamiltonian

Copy link
Copy Markdown
Collaborator

🤖 AI text below 🤖

Summary

Follow-up to #249, which shipped the cgroup placement fix with a bool mask_is_private parameter.
This renames that parameter to enum class NodeMask { Shared, PerRank }. No behaviour change.

partition_cpusets(n, gi, gc, true) does not say at the call site which regime true means, and
the safe default is spelled false. The enum names both, and a third launcher regime would be a
new enumerator rather than a second bool.

Changes

  • enum class NodeMask { Shared, PerRank } in CpuTopology.h.
  • partition_cpusets's fourth parameter becomes NodeMask mask = NodeMask::Shared.
  • PartitionGroup::node_mask_private_ becomes NodeMask node_mask_; classify_node_masks_
    converts masks_are_pairwise_disjoint's bool at the call site. The predicate keeps its bool
    return -- it answers a question about masks, not about policy.
  • Test call sites lose their /*mask_is_private=*/ argument comments, which the enum value replaces.

Every assertion and every test-case name is unchanged, and grep -rn mask_is_private cpp/ is empty.

Checklist

  • Tests added or updated to cover the changes
  • Documentation updated (docstrings, docs/, CONTRIBUTING.md) if needed
  • CHANGELOG / release notes updated if applicable

AI/LLM disclosure

  • I did not use LLM tooling, or used it only privately for ideation
  • I used the following tool to help write this PR description: Claude Code
  • I used the following tool to generate or modify code: Claude Code

…bool

Replace `bool mask_is_private` with `enum class NodeMask { Shared, PerRank }`
across partition_cpusets and PartitionGroup. Type change only: Shared is the
old false, PerRank the old true, and no branch, default or assertion moves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@robertodr
robertodr enabled auto-merge (squash) August 20, 2026 09:10
@github-actions

Copy link
Copy Markdown

Docs preview: https://pr-252.monoprop-docs.pages.dev

@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.70%. Comparing base (1a4177e) to head (313a891).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #252   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files          14       14           
  Lines         742      742           
  Branches       98       98           
=======================================
  Hits          725      725           
  Misses         12       12           
  Partials        5        5           
Flag Coverage Δ
cpp 97.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@robertodr
robertodr merged commit 48cadcb into main Aug 20, 2026
23 checks passed
@robertodr
robertodr deleted the refactor/node-mask-enum branch August 20, 2026 09:16
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants