Skip to content

feat(allocator): connect Vec2 module and make it compile#9647

Merged
graphite-app[bot] merged 1 commit intomainfrom
03-10-feat_allocator_add_vec2_module_and_make_it_compile
Mar 13, 2025
Merged

feat(allocator): connect Vec2 module and make it compile#9647
graphite-app[bot] merged 1 commit intomainfrom
03-10-feat_allocator_add_vec2_module_and_make_it_compile

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Mar 10, 2025

This PR aims to connect the Vec2 with the whole program and make it compile and pass the CI. Since the diff is hard to understand, we may need to read the commit one by one to understand the changes.

Copy link
Member Author

Dunqing commented Mar 10, 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.

@github-actions github-actions bot added the C-enhancement Category - New feature or request label Mar 10, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 10, 2025

CodSpeed Performance Report

Merging #9647 will not alter performance

Comparing 03-10-feat_allocator_add_vec2_module_and_make_it_compile (3943563) with 03-12-refactor_allocator_vec_disable_lint_warnings_in_vec2_files (5c5e010)

Summary

✅ 6 untouched benchmarks
🆕 27 new benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
🆕 codegen[checker.ts] N/A 23.1 ms N/A
🆕 codegen_sourcemap[checker.ts] N/A 66.1 ms N/A
🆕 isolated-declarations[vue-id.ts] N/A 58.8 ms N/A
🆕 lexer[RadixUIAdoptionSection.jsx] N/A 20.8 µs N/A
🆕 lexer[antd.js] N/A 24.1 ms N/A
🆕 lexer[cal.com.tsx] N/A 5.7 ms N/A
🆕 lexer[checker.ts] N/A 14.5 ms N/A
🆕 lexer[pdf.mjs] N/A 3.8 ms N/A
🆕 linter[RadixUIAdoptionSection.jsx] N/A 2.7 ms N/A
🆕 linter[cal.com.tsx] N/A 1.2 s N/A
🆕 linter[checker.ts] N/A 3 s N/A
🆕 mangler[antd.js] N/A 16.1 ms N/A
🆕 mangler[react.development.js] N/A 294.1 µs N/A
🆕 mangler[typescript.js] N/A 39.7 ms N/A
🆕 minifier[antd.js] N/A 167.6 ms N/A
🆕 minifier[react.development.js] N/A 1.8 ms N/A
🆕 minifier[typescript.js] N/A 294.6 ms N/A
🆕 semantic[RadixUIAdoptionSection.jsx] N/A 74.9 µs N/A
🆕 semantic[antd.js] N/A 106.4 ms N/A
🆕 semantic[cal.com.tsx] N/A 26.6 ms N/A
... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

@Dunqing Dunqing changed the title feat(allocator): add Vec2 module and make it compile feat(allocator): connect Vec2 module and make it compile Mar 10, 2025
@Dunqing Dunqing force-pushed the 03-10-feat_allocator_add_vec2_module_and_make_it_compile branch 3 times, most recently from c5a40c0 to 9580d1e Compare March 10, 2025 15:54
@Dunqing Dunqing force-pushed the 03-10-feat_allocator_add_vec2 branch from f328de5 to 7d8ee88 Compare March 11, 2025 10:26
@Dunqing Dunqing force-pushed the 03-10-feat_allocator_add_vec2_module_and_make_it_compile branch from 9580d1e to 642f881 Compare March 11, 2025 10:26
@Dunqing Dunqing marked this pull request as ready for review March 11, 2025 10:31
@overlookmotel overlookmotel changed the base branch from 03-10-feat_allocator_add_vec2 to graphite-base/9647 March 12, 2025 08:52
@overlookmotel overlookmotel force-pushed the 03-10-feat_allocator_add_vec2_module_and_make_it_compile branch from 642f881 to d9a6cb3 Compare March 12, 2025 08:57
@overlookmotel overlookmotel changed the base branch from graphite-base/9647 to main March 12, 2025 08:58
@overlookmotel overlookmotel force-pushed the 03-10-feat_allocator_add_vec2_module_and_make_it_compile branch from d9a6cb3 to 415d24f Compare March 12, 2025 08:58
@overlookmotel overlookmotel changed the base branch from main to graphite-base/9647 March 13, 2025 01:42
@overlookmotel overlookmotel force-pushed the 03-10-feat_allocator_add_vec2_module_and_make_it_compile branch from 415d24f to c068933 Compare March 13, 2025 01:42
@overlookmotel overlookmotel changed the base branch from graphite-base/9647 to 03-12-refactor_allocator_vec_disable_lint_warnings_in_vec2_files March 13, 2025 01:42
@overlookmotel
Copy link
Member

overlookmotel commented Mar 13, 2025

@Dunqing I hope you don't mind, but I've split this PR up into 4 parts (the preceding 3 PRs are pulled out of this one), just so the diffs are easier to read.

Annoyingly Graphite erases all record of multiple commits when it merges a PR, so if you want to keep a "paper trail" without the diffs of different commits combined, they have to be in separate PRs.

The only substantial change I made was to disable the clippy lints which bumpalo's code triggers (#9730), rather than fixing them all, as you had. Some of the changes related to pointers and arithmetic overflow are a bit subtle, and I don't 100% trust clippy's suggestions, so I thought it'd be better to defer making those changes.

I suggest that we get Vec2 connected up, solve the lifetime problems, and check it all works before making changes to bumpalo's code. Once we've got that far, we can re-enable lint rules and fix the warnings in batches - do the simple ones first, and then tackle the pointer-related ones in a separate PR - a smaller diff in that PR will make it easier to see what we're doing and check our work. The pointer stuff being correct is critical for safety, so I personally I think it's worthwhile proceeding cautiously with that.


I've been through this PR in detail and verified that the changes to alloc, dealloc and realloc calls are equivalent to the originals. It's kind of weird that we have to use the allocator_api2::Allocator methods, but Bumpalo doesn't expose its internal Alloc trait, so I think you're right that this is the only solution.

So... if you're happy with the changes I've made, I think we can merge the stack up to and including this PR.

I'd like to take a closer look at retain_mut before we merge that one. And I think maybe I have a solution to the lifetime problems in #9656. But it's a bit of a brain-bender!


In case I've screwed anything up, all the commits from your original stack before I made any changes are backed up on overlookmotel/vec-rewrite-original branch.

@Dunqing
Copy link
Member Author

Dunqing commented Mar 13, 2025

@Dunqing I hope you don't mind, but I've split this PR up into 4 parts (the preceding 3 PRs are pulled out of this one), just so the diffs are easier to read.

Annoyingly Graphite erases all record of multiple commits when it merges a PR, so if you want to keep a "paper trail" without the diffs of different commits combined, they have to be in separate PRs.

Thank you for splitting this PR, yes, this is also what I am thinking if I should do these different things in separate PRs. Currently, the whole stack is more clear about what I am doing, so of course I very much like you to do this.

The only substantial change I made was to disable the clippy lints which bumpalo's code triggers (#9730), rather than fixing them all, as you had. Some of the changes related to pointers and arithmetic overflow are a bit subtle, and I don't 100% trust clippy's suggestions, so I thought it'd be better to defer making those changes.

I suggest that we get Vec2 connected up, solve the lifetime problems, and check it all works before making changes to bumpalo's code. Once we've got that far, we can re-enable lint rules and fix the warnings in batches - do the simple ones first, and then tackle the pointer-related ones in a separate PR - a smaller diff in that PR will make it easier to see what we're doing and check our work. The pointer stuff being correct is critical for safety, so I personally I think it's worthwhile proceeding cautiously with that.

Yes, I agree!

I've been through this PR in detail and verified that the changes to alloc, dealloc and realloc calls are equivalent to the originals. It's kind of weird that we have to use the allocator_api2::Allocator methods, but Bumpalo doesn't expose its internal Alloc trait, so I think you're right that this is the only solution.

Yes, this is why I forked Bumpalo and exposed the alloc module in the last experiment.

So... if you're happy with the changes I've made, I think we can merge the stack up to and including this PR.

I'd like to take a closer look at retain_mut before we merge that one. And I think maybe I have a solution to the lifetime problems in #9656. But it's a bit of a brain-bender!

In case I've screwed anything up, all the commits from your original stack before I made any changes are backed up on overlookmotel/vec-rewrite-original branch.

I am okay with all changes to this stack. The decision to click the merge button is up to you, merge it when you think the timing is right now.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 13, 2025
Copy link
Member

overlookmotel commented Mar 13, 2025

Merge activity

  • Mar 12, 10:43 PM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 12, 10:43 PM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 12, 11:02 PM EDT: A user merged this pull request with the Graphite merge queue.

This PR aims to connect the Vec2 with the whole program and make it compile and pass the CI. Since the diff is hard to understand, we may need to read the commit one by one to understand the changes.
@overlookmotel
Copy link
Member

overlookmotel commented Mar 13, 2025

OK great. Thanks for reviewing my changes. Merging the bottom 4 PRs now.

@graphite-app graphite-app bot force-pushed the 03-12-refactor_allocator_vec_disable_lint_warnings_in_vec2_files branch from a5566f9 to 5c5e010 Compare March 13, 2025 02:45
@graphite-app graphite-app bot force-pushed the 03-10-feat_allocator_add_vec2_module_and_make_it_compile branch from c068933 to 3943563 Compare March 13, 2025 02:45
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 13, 2025
Base automatically changed from 03-12-refactor_allocator_vec_disable_lint_warnings_in_vec2_files to main March 13, 2025 03:00
@graphite-app graphite-app bot merged commit 3943563 into main Mar 13, 2025
28 checks passed
@graphite-app graphite-app bot deleted the 03-10-feat_allocator_add_vec2_module_and_make_it_compile branch March 13, 2025 03:02
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