Skip to content

Fix non-deterministic encoding of syntax contexts - #161450

Open
aerooneqq wants to merge 1 commit into
rust-lang:mainfrom
aerooneqq:syntax-ctxt-non-deterministic-encoding
Open

Fix non-deterministic encoding of syntax contexts#161450
aerooneqq wants to merge 1 commit into
rust-lang:mainfrom
aerooneqq:syntax-ctxt-non-deterministic-encoding

Conversation

@aerooneqq

@aerooneqq aerooneqq commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Reiteration of #157409. Explanation can be found in comment for encoding_indices and in the issue.

Fixes #129094. Blocked by #161353.

r? @petrochenkov

No llms used.

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 21, 2026
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Aug 21, 2026
@rust-log-analyzer

This comment has been minimized.

@aerooneqq
aerooneqq force-pushed the syntax-ctxt-non-deterministic-encoding branch from b07d315 to 3f750ec Compare August 21, 2026 10:33
@rust-log-analyzer

This comment has been minimized.

@rust-bors

This comment has been minimized.

@aerooneqq
aerooneqq force-pushed the syntax-ctxt-non-deterministic-encoding branch from a34d24f to 3868148 Compare September 2, 2026 08:27
@rustbot

rustbot commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

.collect()
});

all_ctxt_data.sort_by_key(|&(ctxt, _)| self.get_encoding_index(ctxt));

@petrochenkov petrochenkov Sep 3, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Note: here and below get_encoding_index takes the encoding_indices in every iteration of the loop, it could be more efficient to take the lock once.

View changes since the review

@petrochenkov

Copy link
Copy Markdown
Contributor

@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 Sep 3, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Sep 3, 2026
…ing, r=<try>

Fix non-deterministic encoding of syntax contexts
@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2026
@rust-bors

rust-bors Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 7e01adf (7e01adfdd3209974b2d32d2eb35d4173deaa540b)
Base parent: 4fcf397 (4fcf39725a9c99bd495d8c73af83628a256ff9a9)

@rust-timer

This comment has been minimized.

@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (7e01adf): comparison URL.

Overall result: ❌ regressions - please read:

Benchmarking means the PR may be perf-sensitive. It's automatically marked not fit for rolling up. Overriding is possible but disadvised: it risks changing compiler perf.

Next, please: If you can, justify the regressions found in this try perf run in writing along with @rustbot label: +perf-regression-triaged. If not, fix the regressions and do another perf run. Neutral or positive results will clear the label automatically.

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

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
0.6% [0.1%, 1.9%] 72
Regressions ❌
(secondary)
0.6% [0.1%, 1.7%] 50
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [0.1%, 1.9%] 72

Max RSS (memory usage)

Results (primary 1.0%, secondary -1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
1.0% [1.0%, 1.0%] 1
Regressions ❌
(secondary)
3.7% [2.6%, 4.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.7% [-4.6%, -1.4%] 5
All ❌✅ (primary) 1.0% [1.0%, 1.0%] 1

Cycles

Results (primary -0.2%, secondary 4.5%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
2.3% [2.3%, 2.3%] 1
Regressions ❌
(secondary)
4.5% [4.5%, 4.5%] 1
Improvements ✅
(primary)
-2.7% [-2.7%, -2.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -0.2% [-2.7%, 2.3%] 2

Binary size

This perf run didn't have relevant results for this metric.

Bootstrap: 476.065s -> 474.462s (-0.34%)
Artifact size: 401.18 MiB -> 401.32 MiB (0.03%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Sep 3, 2026
@petrochenkov petrochenkov added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.

derives: parallel compiler makes builds irreproducible

5 participants