Skip to content

Update rustc-hash to version 2#17954

Merged
bors merged 4 commits into
rust-lang:masterfrom
Noratrieb:rustc-blazing-hash
Oct 21, 2024
Merged

Update rustc-hash to version 2#17954
bors merged 4 commits into
rust-lang:masterfrom
Noratrieb:rustc-blazing-hash

Conversation

@Noratrieb

@Noratrieb Noratrieb commented Aug 24, 2024

Copy link
Copy Markdown
Member

This brings in the new optimized algorithm that was shown to have small performance benefits for rustc. I haven't run the rust-analyzer benchmarks.

See rust-lang/rustc-hash#37.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2024
@Noratrieb

Copy link
Copy Markdown
Member Author

oh lord, it looks like something relies on the iteration order or something like that :3.

@Veykril

Veykril commented Aug 25, 2024

Copy link
Copy Markdown
Member

Yup, the iteration here calls a mutating callback and the state there seems to be iteration dependent (sorting the iterator by key causes the same issue on master)

cm.memory.iter().map(|(addr, val)| transform((addr, val))).collect()

@Veykril

Veykril commented Aug 25, 2024

Copy link
Copy Markdown
Member

The funny thing is, that test apparently should succeed given rustc is fine with it?

        pub enum TagTree {
            Leaf,
            Choice(&'static [TagTree]),
        }
        const GOAL: TagTree = {
            const TAG_TREE: TagTree = TagTree::Choice(&[
                {
                    const VARIANT_TAG_TREE: TagTree = TagTree::Choice(
                        &[
                            TagTree::Leaf,
                        ],
                    );
                    VARIANT_TAG_TREE
                },
            ]);
            TAG_TREE
        };
        ```
        compiles just fine, yet the test errors on master

@Veykril

Veykril commented Aug 25, 2024

Copy link
Copy Markdown
Member

Naively I'd say, lets replace the FxHashMap at

vtable: VTableMap,
with an FxIndexMap and change the expected test output to success (if that change makes it succeed)

@hkalbasi

Copy link
Copy Markdown
Member

The test looks strange. I guess it meant to do recursive constants, something like this:

pub enum TagTree {
    Leaf,
    Choice(&'static [TagTree]),
}
const GOAL: TagTree = {
    const TAG_TREE: TagTree = TagTree::Choice(&[
        {
            const VARIANT_TAG_TREE: TagTree = TagTree::Choice(
                &[
                    TAG_TREE,
                ],
            );
            VARIANT_TAG_TREE
        },
    ]);
    TAG_TREE
};

The failure of the original test clearly is a bug. It should work with any order of execution, and sorting or using an stable iteration order does not fix the underlying problem. I would suggest changing the test to use an actual recursive constant like the code above, and opening an issue for that bug for further investigation.

@Veykril Veykril force-pushed the rustc-blazing-hash branch 4 times, most recently from 9059aff to 6a78851 Compare September 4, 2024 08:50
@Veykril

Veykril commented Sep 4, 2024

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

📌 Commit 6a78851 has been approved by Veykril

It is now in the queue for this repository.

@bors

bors commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

⌛ Testing commit 6a78851 with merge aee8b45...

bors added a commit that referenced this pull request Sep 4, 2024
Update rustc-hash to version 2

This brings in the new optimized algorithm that was shown to have small performance benefits for rustc. I haven't run the rust-analyzer benchmarks.

See rust-lang/rustc-hash#37.
@bors

bors commented Sep 4, 2024

Copy link
Copy Markdown
Contributor

💔 Test failed - checks-actions

@bors

bors commented Sep 20, 2024

Copy link
Copy Markdown
Contributor

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

@Veykril Veykril 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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 25, 2024
Noratrieb and others added 3 commits October 21, 2024 11:28
This brings in the new optimized algorithm that was shown to have small performance benefits for
rustc.
@Veykril Veykril force-pushed the rustc-blazing-hash branch 2 times, most recently from 9a94802 to 8be3b80 Compare October 21, 2024 09:42
@Veykril

Veykril commented Oct 21, 2024

Copy link
Copy Markdown
Member

Okay let's see what breaks
@bors r+

@bors

bors commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

📌 Commit 8be3b80 has been approved by Veykril

It is now in the queue for this repository.

bors added a commit that referenced this pull request Oct 21, 2024
Update rustc-hash to version 2

This brings in the new optimized algorithm that was shown to have small performance benefits for rustc. I haven't run the rust-analyzer benchmarks.

See rust-lang/rustc-hash#37.
@bors

bors commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

⌛ Testing commit 8be3b80 with merge 102a3b1...

@bors

bors commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

💔 Test failed - checks-actions

@Veykril Veykril force-pushed the rustc-blazing-hash branch from 8be3b80 to 02e189d Compare October 21, 2024 09:54
@Veykril

Veykril commented Oct 21, 2024

Copy link
Copy Markdown
Member

@bors r+

@bors

bors commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

📌 Commit 02e189d has been approved by Veykril

It is now in the queue for this repository.

@bors

bors commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

⌛ Testing commit 02e189d with merge fb832ff...

@bors

bors commented Oct 21, 2024

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing fb832ff to master...

@bors bors merged commit fb832ff into rust-lang:master Oct 21, 2024
@Noratrieb Noratrieb deleted the rustc-blazing-hash branch October 21, 2024 12:26
@Noratrieb

Copy link
Copy Markdown
Member Author

nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants