Skip to content

feat(allocator): implement CloneIn for Box<[T]>#13505

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-30-feat_allocator_implement_clonein_for_box_t_
Sep 6, 2025
Merged

feat(allocator): implement CloneIn for Box<[T]>#13505
graphite-app[bot] merged 1 commit intomainfrom
08-30-feat_allocator_implement_clonein_for_box_t_

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Sep 1, 2025

Implement CloneIn for Box<[T]>. Use an efficient implementation which doesn't perform any bounds checks. Hopefully, where T is Copy, compiler will be able to boil this down to a single memcpy call.

(this stack is mostly leftovers from #13450 which turned out not to be required for that PR, but are still useful for other purposes)

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Sep 1, 2025
Copy link
Member Author

overlookmotel commented Sep 1, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq
Copy link

codspeed-hq bot commented Sep 1, 2025

CodSpeed Instrumentation Performance Report

Merging #13505 will not alter performance

Comparing 08-30-feat_allocator_implement_clonein_for_box_t_ (a54a4de) with main (26ab087)1

Summary

✅ 37 untouched benchmarks

Footnotes

  1. No successful run was found on main (a54a4de) during the generation of this report, so 26ab087 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@overlookmotel overlookmotel changed the base branch from 08-30-feat_allocator_relax_trait_bounds_of_clonein_ to graphite-base/13505 September 3, 2025 00:33
@overlookmotel overlookmotel force-pushed the 08-30-feat_allocator_implement_clonein_for_box_t_ branch from a9d10c6 to f08464f Compare September 3, 2025 00:33
@overlookmotel overlookmotel changed the base branch from graphite-base/13505 to 08-30-feat_allocator_relax_trait_bounds_of_clonein_ September 3, 2025 00:33
@overlookmotel overlookmotel changed the base branch from 08-30-feat_allocator_relax_trait_bounds_of_clonein_ to graphite-base/13505 September 3, 2025 00:36
@overlookmotel overlookmotel force-pushed the 08-30-feat_allocator_implement_clonein_for_box_t_ branch from f08464f to c6141ba Compare September 3, 2025 00:36
@overlookmotel overlookmotel changed the base branch from graphite-base/13505 to 08-30-feat_allocator_add_vec_into_boxed_slice_method September 3, 2025 00:36
@overlookmotel overlookmotel marked this pull request as ready for review September 3, 2025 00:39
@graphite-app graphite-app bot changed the base branch from 08-30-feat_allocator_add_vec_into_boxed_slice_method to graphite-base/13505 September 3, 2025 01:02
@graphite-app graphite-app bot force-pushed the 08-30-feat_allocator_implement_clonein_for_box_t_ branch from c6141ba to 01600c7 Compare September 3, 2025 01:08
@graphite-app graphite-app bot force-pushed the graphite-base/13505 branch from 9efdab4 to c1fdcf6 Compare September 3, 2025 01:08
@graphite-app graphite-app bot changed the base branch from graphite-base/13505 to main September 3, 2025 01:09
@graphite-app graphite-app bot force-pushed the 08-30-feat_allocator_implement_clonein_for_box_t_ branch from 01600c7 to 7d6daa4 Compare September 3, 2025 01:09
@overlookmotel overlookmotel marked this pull request as draft September 6, 2025 08:16
@overlookmotel overlookmotel force-pushed the 08-30-feat_allocator_implement_clonein_for_box_t_ branch from 7d6daa4 to f455da5 Compare September 6, 2025 08:17
@overlookmotel overlookmotel force-pushed the 08-30-feat_allocator_implement_clonein_for_box_t_ branch from f455da5 to 0c90418 Compare September 6, 2025 11:39
@overlookmotel overlookmotel marked this pull request as ready for review September 6, 2025 11:39
Copilot AI review requested due to automatic review settings September 6, 2025 11:39
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 implements the CloneIn trait for Box<[T]> to enable efficient arena-allocated cloning of boxed slices. The implementation includes compile-time size and alignment checks to ensure type safety and uses low-level memory operations for optimal performance.

  • Adds CloneIn implementation for Box<[T]> with both standard and semantic ID-preserving clone methods
  • Includes compile-time assertions to verify size and alignment compatibility between source and target types
  • Adds comprehensive test coverage for the new functionality

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

@graphite-app graphite-app bot added the 0-merge Merge with Graphite Merge Queue label Sep 6, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Sep 6, 2025

Merge activity

Implement `CloneIn` for `Box<[T]>`. Use an efficient implementation which doesn't perform any bounds checks. Hopefully, where `T` is `Copy`, compiler will be able to boil this down to a single `memcpy` call.

(this stack is mostly leftovers from #13450 which turned out not to be required for that PR, but are still useful for other purposes)
@graphite-app graphite-app bot force-pushed the 08-30-feat_allocator_implement_clonein_for_box_t_ branch from 0c90418 to a54a4de Compare September 6, 2025 17:25
@graphite-app graphite-app bot merged commit a54a4de into main Sep 6, 2025
25 checks passed
@graphite-app graphite-app bot deleted the 08-30-feat_allocator_implement_clonein_for_box_t_ branch September 6, 2025 17:30
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Sep 6, 2025
Copilot AI pushed a commit that referenced this pull request Sep 8, 2025
Implement `CloneIn` for `Box<[T]>`. Use an efficient implementation which doesn't perform any bounds checks. Hopefully, where `T` is `Copy`, compiler will be able to boil this down to a single `memcpy` call.

(this stack is mostly leftovers from #13450 which turned out not to be required for that PR, but are still useful for other purposes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants