Skip to content

Refactor CPU Partition dtype dispatch - #4175

Merged
zcbenz merged 1 commit into
ml-explore:mainfrom
PhysicistJohn:dispatch-cpu-partition
Aug 11, 2026
Merged

Refactor CPU Partition dtype dispatch#4175
zcbenz merged 1 commit into
ml-explore:mainfrom
PhysicistJohn:dispatch-cpu-partition

Conversation

@PhysicistJohn

Copy link
Copy Markdown
Contributor

Summary

Replace CPU Partition's exhaustive dtype switch with
dispatch_all_types. The common dispatcher covers the same 14 current dtypes
and leaves the nth-element implementation, kth normalization and validation,
axes, output dtype, and diagnostics unchanged.

This removes 27 net lines from Partition::eval_cpu.

Testing

  • Release CPU-only build with C++20 and global -Werror
  • Baseline/candidate parity across all 14 dtypes, noncontiguous layouts, axes,
    kth boundaries, floating special values, and exact diagnostics (2,114
    cases); transcripts byte-identical
  • Focused Python sorting tests (6/6 tests, 56/56 subtests)
  • Native C++ suite (247/247 cases, 3,326/3,326 assertions)
  • Global archive and linked-library export symbol sets unchanged
  • pre-commit and git diff --check

@zcbenz
zcbenz merged commit ec3ad74 into ml-explore:main Aug 11, 2026
28 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