Skip to content

cover processor groups at the pointer width - #52

Merged
JamesLinYJ merged 1 commit into
mainfrom
cursor/cpu-group-pointer-width
Nov 9, 2026
Merged

JamesLinYJ merged 1 commit into
mainfrom
cursor/cpu-group-pointer-width

Conversation

@JamesLinYJ

Copy link
Copy Markdown
Owner

Summary

  • Cover processor-group affinity at the pointer width in src/system/cpu_topology.rs.
  • A group of exactly usize::BITS processors, one bit each, builds successfully and matches_sample_len equals that count. Masks are shifted only when the bit index is below usize::BITS.
  • An active count of usize::BITS + 1 returns CpuTopologyError::OutOfRangeAffinityMask and does not panic. These tests run on both 32-bit and 64-bit targets.

Groups that already fit in usize keep the existing success path.

Test plan

  • cargo test --locked --bin taskmgr pointer_width_group_builds_one_bit_per_processor
  • cargo test --locked --bin taskmgr active_count_above_pointer_width_is_out_of_range

This environment cannot compile Windows resources because llvm-rc is not installed, so the package tests were not executed here. The new tests call build_topology directly and do not need a live processor query.

Open in Web Open in Cursor 

Exercise a full group of usize::BITS processors and an active count
of usize::BITS + 1 on every pointer width. Masks shift only when the
bit index is below usize::BITS, and a wider group returns
OutOfRangeAffinityMask.

Co-authored-by: jameslincn <jameslincn@outlook.sg>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 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-11-03T06:33:52.186504Z 4fca5a9 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.

@JamesLinYJ
JamesLinYJ merged commit d6c3c54 into main Nov 9, 2026
3 checks passed
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.

2 participants