Skip to content

Fix abort when vector elements=0 - #4093

Closed
FeliGame wants to merge 14 commits into
ml-explore:mainfrom
FeliGame:set-vector-zero-byte
Closed

FeliGame wants to merge 14 commits into
ml-explore:mainfrom
FeliGame:set-vector-zero-byte

Conversation

@FeliGame

@FeliGame FeliGame commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Fix 4061

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

@zcbenz zcbenz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I can't merge this until @JamesPriceZV verifies it.

@zcbenz zcbenz added the await response This pull request is waiting for response from the author. label Aug 10, 2026
@zcbenz

zcbenz commented Aug 21, 2026

Copy link
Copy Markdown
Member

The original issue was really a minor issue and the fix is risky on the other hand, since it is difficult to verify whether it works and whether it breaks, I'm going to close this.

@reiterate-app

Copy link
Copy Markdown

I got bit by this too. Would it be possible to do a smaller fix?

Scatter::eval_gpu already handles the equivalent idx_ndim == 0 case by padding rather than touching set_vector_bytes globally:

if (idx_ndim == 0) {
// Add a 0 in idx_shapes and strides to avoid the missing buffer binding
// error in the metal API.
idx_shapes.push_back(0);
idx_strides.push_back(0);
idx_contigs.push_back(false);
}

Would it be possible to do the same thing here?

@zcbenz

zcbenz commented Sep 25, 2026

Copy link
Copy Markdown
Member

@reiterate-app looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

await response This pull request is waiting for response from the author. low priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Metal: set_vector_bytes passes nullptr to setBytes for empty vectors

3 participants