Skip to content

Conversation

cwfitzgerald
Copy link
Member

@cwfitzgerald cwfitzgerald commented Aug 26, 2025

Connections

Thought I found a bug, realized I was holding it wrong but I was in there anyway so I fixed some stuff

Description

This does three things:

  • Improve the errors to be more actionable about what is happening.
  • Factor out the range contains code into a function with tests, so we can be sure that it is right and don't need to copy it all over.
  • Allow aliasing immutable borrows. This is what people will expect to be allowed.
  • Add #[track_caller] annotations.

Testing

As this has consequences for soundness, I added a bunch of tests. I checked the coverage report and all codepath I changed are covered in the tests.

Squash or Rebase?

Dontcare

@cwfitzgerald cwfitzgerald requested a review from a team as a code owner August 26, 2025 00:25
@cwfitzgerald cwfitzgerald force-pushed the cw/buffer-mapping branch 2 times, most recently from 124daab to 54ea66f Compare August 26, 2025 00:34
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

awesome feature & tests. absolutely love it

@Wumpf Wumpf enabled auto-merge (squash) September 1, 2025 19:56
@@ -125,6 +125,7 @@ By @cwfitzgerald in [#8162](https://github.com/gfx-rs/wgpu/pull/8162).
By @kpreid in [#8011](https://github.com/gfx-rs/wgpu/pull/8011).
- Make a compacted hal acceleration structure inherit a label from the base BLAS. By @Vecvec in [#8103](https://github.com/gfx-rs/wgpu/pull/8103).
- The limits requested for a device must now satisfy `min_subgroup_size <= max_subgroup_size`. By @andyleiserson in [#8085](https://github.com/gfx-rs/wgpu/pull/8085).
- Improve errors when buffer mapping is done incorrectly. Allow aliasing immutable [`BufferViews`]. By @cwfitzgerald in [#8150](https://github.com/gfx-rs/wgpu/pull/8150).
Copy link
Member

Choose a reason for hiding this comment

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

let's add a highlight for this & removed lifetimes on buffer mappings. If you're used to working around these this thing is a lifechanger!

@Wumpf Wumpf disabled auto-merge September 1, 2025 19:59
@cwfitzgerald
Copy link
Member Author

@Wumpf Alright, I can add a highlight for this, but removing lifetimes on buffer mappings is another PR entirely which does have a highlight: #8161

@Wumpf
Copy link
Member

Wumpf commented Sep 2, 2025

ah sorry, didn't realize that. Up to you then

@cwfitzgerald cwfitzgerald merged commit c488bbe into gfx-rs:trunk Sep 2, 2025
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants