Skip to content

Conversation

RomeoV
Copy link

@RomeoV RomeoV commented Jul 26, 2025

The use of CPUInfo makes --trim difficult.
Removing this dependency here would unlock a large amount of libraries which use the Polyester library to be trimmmable (notably e.g. almost everything in the SciML ecosystem).

However, we might need a bit more discussion on the exact removal of this feature.

The use of CPUInfo makes `--trim` difficult.
Removing this dependency here would unlock a large amount of libraries
which use the Polyester library to be trimmmable (notably e.g. almost
everything in the SciML ecosystem).

However, we might need a bit more discussion on the exact removal of
this feature.
@ChrisRackauckas
Copy link
Member

@oscardssmith can you follow up to check whether these cause any performance regression? I would assume not.

@oscardssmith oscardssmith self-assigned this Jul 27, 2025
Copy link

codecov bot commented Jul 28, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (e7dc67a) to head (6a48733).
⚠️ Report is 14 commits behind head on main.

Files with missing lines Patch % Lines
src/request.jl 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #28       +/-   ##
==========================================
- Coverage   43.75%   0.00%   -43.75%     
==========================================
  Files           4       4               
  Lines         128     126        -2     
==========================================
- Hits           56       0       -56     
- Misses         72     126       +54     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

ChrisRackauckas pushed a commit to ChrisRackauckas/PolyesterWeave.jl that referenced this pull request Jul 29, 2025
This commit fixes a critical bug that occurs when using more than 64 threads.
The change from CPUSummary.sys_threads() to Threads.nthreads() introduced
a type instability where worker_bits() and worker_mask_count() would return
regular Int instead of StaticInt types with high thread counts.

Changes:
- Modified worker_bits() to always return Int for consistency
- Updated worker_mask_count() to use regular integer division
- Added new _request_threads method that handles Int parameter
- Added test for high thread count compatibility

The fix maintains backward compatibility while ensuring the code works
correctly with any number of threads.

Fixes the MethodError: no method matching _request_threads(::UInt32, ::Ptr{UInt64}, ::Int64, ::Nothing)

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>

function worker_bits()
wts = nextpow2(CPUSummary.sys_threads()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.
wts = nextpow2(Threads.nthreads()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.
Copy link
Member

@ChrisRackauckas ChrisRackauckas Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
wts = nextpow2(Threads.nthreads()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.
wts = nextpow2(StaticInt{Threads.nthreads()}()) # Typically sys_threads (i.e. Sys.CPU_THREADS) does not change between runs, thus it will precompile well.

@ChrisRackauckas
Copy link
Member

Should no longer be required due to JuliaSIMD/CPUSummary.jl#31

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.

3 participants