Skip to content

Conversation

@cmt0
Copy link
Contributor

@cmt0 cmt0 commented Nov 16, 2025

Differential Revision: D87159004

@pytorch-bot
Copy link

pytorch-bot bot commented Nov 16, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15842

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit e335d5e with merge base b1e3e28 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 16, 2025
@meta-codesync
Copy link

meta-codesync bot commented Nov 16, 2025

@cmt0 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D87159004.

@github-actions
Copy link

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

cmt0 added a commit to cmt0/executorch that referenced this pull request Nov 17, 2025
Summary: Pull Request resolved: pytorch#15842

Differential Revision: D87159004
Summary:
unsigned int seems to be a more correct format specifier than unsigned long for size_t on toolchains that don't support %zu.

Differential Revision: D87159004
Copy link
Contributor

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 updates the printf format specifiers for size_t and ssize_t types on the Xtensa platform, changing from "lu"/"ld" (long unsigned/long int) to "u"/"d" (unsigned int/int) format specifiers.

  • Changed ET_PRIsize_t from "lu" to "u" for Xtensa
  • Changed ET_PRIssize_t from "ld" to "d" for Xtensa

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +164 to +165
#define ET_PRIsize_t "u"
#define ET_PRIssize_t "d"
Copy link

Copilot AI Nov 17, 2025

Choose a reason for hiding this comment

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

Using 'u' and 'd' format specifiers assumes size_t/ssize_t are the same size as unsigned int/int on Xtensa. If size_t is larger than unsigned int (e.g., on a 64-bit pointer model with 32-bit int), this will cause truncation and incorrect output. The comment mentions 'zu' is not supported, but typically platforms support either 'zu' or provide alternative size-matching specifiers. Consider verifying that size_t is definitively the same size as unsigned int on Xtensa, or use a cast to unsigned int/int at call sites with appropriate range checking.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

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

@cmt0 this seems like a valid comment - are size_t/ssize_t the same as unsigned int/int on Xtensa 32-bit/64-bit?

@JacobSzwejbka JacobSzwejbka merged commit 529a265 into pytorch:main Nov 18, 2025
151 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants