Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed dependency on the field-offset crate, alternate approach #136201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

davidv1992
Copy link
Contributor

This is an alternate approach to reach the same goals as #136003. As it touches the core of the query system, this too probably should be evaluated for performance.

r? @Mark-Simulacrum

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 28, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 28, 2025

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging.

cc @davidtwco, @wesleywiser

@davidv1992 davidv1992 force-pushed the eliminate-field-offset-alt branch from d8b458a to ef6ee83 Compare January 28, 2025 17:53
@jieyouxu
Copy link
Member

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 29, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 29, 2025
…t, r=<try>

Removed dependency on the field-offset crate, alternate approach

This is an alternate approach to reach the same goals as rust-lang#136003. As it touches the core of the query system, this too probably should be evaluated for performance.

r? `@Mark-Simulacrum`
@bors
Copy link
Contributor

bors commented Jan 29, 2025

⌛ Trying commit ef6ee83 with merge 3da1435...

@bors
Copy link
Contributor

bors commented Jan 29, 2025

☀️ Try build successful - checks-actions
Build commit: 3da1435 (3da1435f5981c3c4f3e5a0d03ec124848afc2c8c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3da1435): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (primary 1.1%, secondary 3.9%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
4.7% [4.7%, 4.7%] 1
Regressions ❌
(secondary)
3.9% [3.9%, 3.9%] 1
Improvements ✅
(primary)
-2.4% [-2.4%, -2.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [-2.4%, 4.7%] 2

Cycles

Results (secondary -2.0%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.0% [-2.0%, -2.0%] 1
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 778.134s -> 774.743s (-0.44%)
Artifact size: 328.46 MiB -> 328.46 MiB (0.00%)

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jan 29, 2025
@Mark-Simulacrum
Copy link
Member

@bors r+

I think this approach seems pretty clean and perf looks good.

@bors
Copy link
Contributor

bors commented Jan 31, 2025

📌 Commit ef6ee83 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 31, 2025
@Zoxc
Copy link
Contributor

Zoxc commented Feb 1, 2025

Is there some reason field-offset isn't updated instead? A safe abstraction is nicer to use here.

@davidv1992
Copy link
Contributor Author

I chose to not pursue that approach as the use of that dependency was really small in the compiler, and furthermore that project seems to be unmaintained. Though even if it weren't it seems rather excessive to me to have 2 dependencies for this.

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 1, 2025
…t, r=Mark-Simulacrum

Removed dependency on the field-offset crate, alternate approach

This is an alternate approach to reach the same goals as rust-lang#136003. As it touches the core of the query system, this too probably should be evaluated for performance.

r? `@Mark-Simulacrum`
@bors
Copy link
Contributor

bors commented Feb 1, 2025

⌛ Testing commit ef6ee83 with merge 8b69ce0...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 2, 2025

💔 Test failed - checks-actions

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Feb 2, 2025
@bjorn3
Copy link
Member

bjorn3 commented Feb 2, 2025

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 2, 2025
pub query_state: FieldOffset<QueryStates<'tcx>, QueryState<C::Key>>,
pub query_cache: FieldOffset<QueryCaches<'tcx>, C>,
pub query_state: usize,
pub query_cache: usize,
Copy link
Member

Choose a reason for hiding this comment

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

Please add comments explaining the meaning of these fields. Currently that seems quite tricky to figure out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the comments

@RalfJung
Copy link
Member

RalfJung commented Feb 2, 2025

@bors r-
(might as well add the comments in this PR rather than a follow-up)

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 2, 2025
@davidv1992 davidv1992 force-pushed the eliminate-field-offset-alt branch from ef6ee83 to 2574281 Compare February 3, 2025 08:40
@davidv1992
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 3, 2025
@RalfJung
Copy link
Member

RalfJung commented Feb 3, 2025

Thanks!

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Feb 3, 2025

📌 Commit 2574281 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2025
@Noratrieb
Copy link
Member

@bors rollup=maybe perf neutral

bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 4, 2025
Rollup of 5 pull requests

Successful merges:

 - rust-lang#134777 (Enable more tests on Windows)
 - rust-lang#135621 (Move some std tests to integration tests)
 - rust-lang#135844 ( Add new tool for dumping feature status based on tidy )
 - rust-lang#136167 (Implement unstable `new_range` feature)
 - rust-lang#136334 (Extract `core::ffi` primitives to a separate (internal) module)

Failed merges:

 - rust-lang#136201 (Removed dependency on the field-offset crate, alternate approach)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Contributor

bors commented Feb 4, 2025

☔ The latest upstream changes (presumably #136533) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 4, 2025
@davidv1992 davidv1992 force-pushed the eliminate-field-offset-alt branch from 2574281 to 62bbaa8 Compare February 5, 2025 16:56
@davidv1992
Copy link
Contributor Author

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 5, 2025
@bjorn3
Copy link
Member

bjorn3 commented Feb 7, 2025

@bors r=Mark-Simulacrum

@bors
Copy link
Contributor

bors commented Feb 7, 2025

📌 Commit 62bbaa8 has been approved by Mark-Simulacrum

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-tidy Area: The tidy tool CI-spurious-fail-msvc CI spurious failure: target env msvc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.