Skip to content

Fix: xgenerator reports memory overlap to avoid in-place assignment corruption - #2936

Merged
JohanMabille merged 1 commit into
xtensor-stack:masterfrom
Tyagiquamar:fix-xgenerator-overlap-2819
Oct 20, 2026
Merged

JohanMabille merged 1 commit into
xtensor-stack:masterfrom
Tyagiquamar:fix-xgenerator-overlap-2819

Conversation

@Tyagiquamar

Copy link
Copy Markdown
Contributor

Fixes #2819. xgenerator's overlapping_memory_checker_traits returned false unconditionally, so assignment from an xgenerator reading its resized target (e.g. xt::concatenate into itself) could read uninitialized memory. Report true so a temporary is used. Root cause analysis in BYTEASK.md.

@Tyagiquamar
Tyagiquamar force-pushed the fix-xgenerator-overlap-2819 branch from 80a1441 to e8acbeb Compare October 12, 2026 12:50
@codspeed

codspeed Bot commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

⚠️ 1 benchmark measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. This result is not comparable, so it counts as unchanged.

Preventing compiler optimizations

✅ 255 untouched benchmarks


Comparing Tyagiquamar:fix-xgenerator-overlap-2819 (e8acbeb) with master (d9a57b6)

Open in CodSpeed

@JohanMabille JohanMabille 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.

Approving it since it fixes an issue, but I find this solution too cautious. Most generators do not read values and will suffer a performance hit with this change.
However fixing it properly required more involve changes that should be done in a dedicated PR.

@JohanMabille
JohanMabille merged commit 57f3d07 into xtensor-stack:master Oct 20, 2026
40 of 41 checks passed
@Tyagiquamar

Tyagiquamar commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor Author

I'll look into more, thanks for merging this PR

However fixing it properly required more involve changes that should be done in a dedicated PR.

@JohanMabille

Copy link
Copy Markdown
Member

I'll look into more

Do not hesitate if you have questions, the issue I opened to track it is not very detailed.

And thanks again for the fix!

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.

Avoiding temporary fails with xt::concatenate

2 participants