-
Notifications
You must be signed in to change notification settings - Fork 984
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
use hashbrown
in more crates (etc.)
#6938
Conversation
hashbrown
in naga
etc.hashbrown
in naga
& main wgpu
crates` etc.
hashbrown
in naga
& main wgpu
crates` etc.hashbrown
in naga
& main wgpu
crates etc.
hashbrown
in naga
& main wgpu
crates etc.hashbrown
in naga
& main wgpu
crates, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking generally good, some comments!
CHANGELOG.md
Outdated
##### Use `hashbrown` in `naga` & main `wgpu` crates | ||
|
||
Use `hashbrown` to simplify no-std support. (This may help improve performance as well.) | ||
|
||
By Brody in [#6938](https://github.com/gfx-rs/wgpu/pull/6938). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This actually applies to more than just this section - we generally reserve the larger "Major Changes" items for breaking changes or very heavy refactors. So like when no-std lands in the whole stack, that definitely will deserve a large item. But for this, a single line is fine as this is all internal and not user facing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense, I just pushed updates to compress all of this info & remove the unmeasured performance speculation. I have also squished the older hashbrown changelog update into here, out of the other place. I think this should be much cleaner.
Incidentally for small edits like this, I wouldn't mind if the reviewer wants to make the edit as a co-author if we want to save time going back-and-forth. Totally up to your best judgment on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes total sense, I just pushed updates to compress all of this info & remove the unmeasured performance speculation. I have also squished the older hashbrown changelog update into here, out of the other place. I think this should be much cleaner.
Nice
Incidentally for small edits like this, I wouldn't mind if the reviewer wants to make the edit as a co-author if we want to save time going back-and-forth. Totally up to your best judgment on this.
Yeah I do that for complex changes where explaining it is harder than just doing it :) For most cases though, commenting is easier than fully task switching to a new branch and getting out of "review" mode.
hashbrown
in naga
& main wgpu
crates, etc.hashbrown
in more crates (etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Splitting out these "controversial" changes into more bite-sized pieces is really nice to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last iteration. Might be worth setting up a hashmap on a banned type list to properly enforce this at least until we're fully checking non-std.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oop wrong button sorry 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I have addressed comments from @bushrat011899 & @cwfitzgerald, which have all been really helpful. I have raised #6999 to reconsider the choice of hasher for HashMap (and HashSet). I would like to see if I can fix a couple more little things here.
I think this should be ready now. There may be a couple minor nits left, IMO not worth blocking this too much longer. |
@brody4hire One last rebase to address the branch conflicts and this should be good to go. |
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
5601c2d
to
fd4766b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thank you!
- Use `hashbrown` to simplify no-std support. By Brody in [#6938](https://github.com/gfx-rs/wgpu/pull/6938) & [#6925](https://github.com/gfx-rs/wgpu/pull/6925). | ||
- If you use Binding Arrays in a bind group, you may not use Dynamic Offset Buffers or Uniform Buffers in that bind group. By @cwfitzgerald in [#6811](https://github.com/gfx-rs/wgpu/pull/6811) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra blank line here - my bad thought I removed it d'oh
Connections
hashbrown
updates introduced in PR: Start usinghashbrown
#6925Description
hashbrown
innaga
& top-levelwgpu
cratesstd::collections::HashMap
viarustc_hash::FxHashMap
inwgpu-hal
hashbrown
in mainwgpu
cratehashbrown
indeno_webgpu
hashbrown
with default-features = false, as needed to support no-std buildPOSSIBLE API IMPACT
Exported
naga
API with these updates would be exporting types & members using HashMap & HashSet from hashbrown rather than std::collections. I think this is a crucial part of supporting no-std. I don't expect the blast radius to be very high, just wanted to point this out to avoid potential surprises for anyone./cc @bushrat011899
Testing
cargo test --all-features -p naga
cargo test --all-features -p wgpu-core
cargo test --all-features -p wgpu-hal
cargo test --all-features -p wgpu
cargo xtask test
Checklist
cargo fmt
.taplo format
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.