Skip to content

JIT: Preserve snapshot semantics for overlapping promoted struct copies - #133877

Merged
jakobbotsch merged 2 commits into
mainfrom
copilot/fix-struct-copy-overlapping-slices
Sep 16, 2026
Merged

jakobbotsch merged 2 commits into
mainfrom
copilot/fix-struct-copy-overlapping-slices

Conversation

Copilot AI commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Physical promotion copies overlapping slices of the same local in ascending field order. When the destination starts above the source, an earlier store can overwrite a value needed by a later read.

  • Copy ordering: Reverse the completed plan in CopyBetweenFields only for same-local partial overlap with the destination after the source.
  • Helpers: Add DecompositionPlan::Reverse and ArrayStack::Reverse, preserving the stack’s debug mutation tracking.
  • Regression coverage: Cover both overlap directions, adjacent copies in both directions, identical offsets, and distinct locals.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
16 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.

Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix physical promotion for overlapping slices in struct copy JIT: Preserve snapshot semantics for overlapping promoted struct copies Sep 14, 2026
Copilot AI requested a review from jakobbotsch September 14, 2026 13:52
@jakobbotsch
jakobbotsch marked this pull request as ready for review September 15, 2026 09:17
Copilot AI lite review requested due to automatic review settings September 15, 2026 09:17
@jakobbotsch

Copy link
Copy Markdown
Member

cc @dotnet/jit-contrib PTAL @EgorBo

No diffs

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 5 pipeline(s).
11 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@jakobbotsch

Copy link
Copy Markdown
Member

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@jakobbotsch
jakobbotsch merged commit 248c29c into main Sep 16, 2026
144 of 147 checks passed
@jakobbotsch
jakobbotsch deleted the copilot/fix-struct-copy-overlapping-slices branch September 16, 2026 13:55
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Sep 17, 2026
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
…es (dotnet#133877)

Physical promotion copies overlapping slices of the same local in
ascending field order. When the destination starts above the source, an
earlier store can overwrite a value needed by a later read.

- **Copy ordering:** Reverse the completed plan in `CopyBetweenFields`
only for same-local partial overlap with the destination after the
source.
- **Helpers:** Add `DecompositionPlan::Reverse` and
`ArrayStack::Reverse`, preserving the stack’s debug mutation tracking.
- **Regression coverage:** Cover both overlap directions, adjacent
copies in both directions, identical offsets, and distinct locals.

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: jakobbotsch <7887810+jakobbotsch@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JIT: (bug) Physical promotion: struct copy between overlapping slices of the same local is not done from a snapshot

3 participants