Skip to content

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Aug 31, 2025

Everything is npy_intp now which is the type of numpy array shape and strides anyway.

CI started failing recently in the macos test, because there the old ssize_t was a long, and we were trying to initialize an int array out of it.


📚 Documentation preview 📚: https://pytensor--1602.org.readthedocs.build/en/1602/

@ricardoV94 ricardoV94 added bug Something isn't working macOS C-backend labels Aug 31, 2025
@ricardoV94 ricardoV94 requested a review from Copilot August 31, 2025 15:28
Copilot

This comment was marked as outdated.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a compilation failure on macOS by standardizing variable types from platform-specific types to npy_intp. The issue occurred because ssize_t is a long on macOS, which couldn't be safely narrowed to int array initializers.

  • Replaces all ssize_t and int declarations with npy_intp for consistency with NumPy array shape/stride types
  • Updates loop iterator variables to use npy_intp instead of int
  • Increments C code cache version numbers to reflect the type changes

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
pytensor/tensor/elemwise_cgen.py Changes stride, jump, and iterator variable declarations from ssize_t/int to npy_intp
pytensor/tensor/elemwise.py Updates C code cache version numbers to reflect the type changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

codecov bot commented Aug 31, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.71%. Comparing base (7092f55) to head (87cb6d4).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1602   +/-   ##
=======================================
  Coverage   81.71%   81.71%           
=======================================
  Files         230      230           
  Lines       52924    52925    +1     
  Branches     9402     9402           
=======================================
+ Hits        43248    43249    +1     
  Misses       7244     7244           
  Partials     2432     2432           
Files with missing lines Coverage Δ
pytensor/tensor/elemwise.py 90.01% <100.00%> (ø)
pytensor/tensor/elemwise_cgen.py 96.82% <100.00%> (ø)

... and 2 files with indirect coverage changes

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

Copy link
Member

@jessegrabowski jessegrabowski left a comment

Choose a reason for hiding this comment

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

lgtm

@ricardoV94 ricardoV94 merged commit 051b32d into pymc-devs:main Sep 1, 2025
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working C-backend macOS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants