Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kainino0x
Copy link
Contributor

@kainino0x kainino0x commented Aug 28, 2024

Re-done against main, with new names, 2024-10-30.

Commits titled [subst] are done by strict (case-sensitive, whole word) find-and-replace.

Type Old New Used in
dict GPUImageDataLayout GPUTexelCopyBufferLayout writeTexture,
parent type of ↙
dict GPUImageCopyBuffer GPUTexelCopyBufferInfo
extends ↑
T2B, B2T
dict GPUImageCopyTexture GPUTexelCopyTextureInfo T2B, B2T, T2T, writeTexture
dict GPUImageCopyTextureTagged GPUCopyExternalImageDestInfo
extends ↑
copyExternalImageToTexture
dict GPUImageCopyExternalImage GPUCopyExternalImageSourceInfo copyExternalImageToTexture
union GPUImageCopyExternalImageSource GPUCopyExternalImageSource member of ↖

Fixes #4573

@kainino0x kainino0x added this to the Milestone 0 milestone Aug 28, 2024
@kainino0x kainino0x force-pushed the image-copies-rename branch 3 times, most recently from c3bb6d3 to 472d734 Compare August 28, 2024 20:39
Copy link
Contributor

github-actions bot commented Aug 28, 2024

Previews, as seen when this build job started (f828d32):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

@kainino0x kainino0x added proposal api WebGPU API labels Aug 28, 2024
@kainino0x kainino0x requested a review from toji August 28, 2024 20:46
Copy link

@mwyrzykowski mwyrzykowski left a comment

Choose a reason for hiding this comment

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

Not a breaking change either from what I can tell, since these are all dictionaries.

@Kangz
Copy link
Contributor

Kangz commented Sep 10, 2024

GPU Web WG 2024-09-04 Atlantic-time
  • CW: useful for people learning the spec to have names which make sense.
  • KG: IMO a couple of the names aren't better than what currently exist. Think only solution is for me to review the PR. My preference, leave as is.
  • GT: is the plan to break native apps?
  • CW: yes. Multiple times in the next 6 months.
  • Defer this.

@kdashg
Copy link
Contributor

kdashg commented Oct 29, 2024

Here are my suggestions:

  • GPUImageCopyBuffer -> GPUTexelCopyBufferData
    • GPUTexelCopyBufferDict
    • GPUTexelCopyBufferDesc
  • GPUImageCopyTexture -> GPUTexelCopyTextureData
    • GPUTexelCopyTextureDict
    • GPUTexelCopyTextureDesc
  • -> GPUCopyExternalImageSource
    • GPUCopyExternalImageSourceDict
    • GPUCopyExternalImageSourceDesc
  • GPUCopyExternalImageSource -> GPUCopyExternalImageSourceObject
    • GPUImageCopyExternalImageSourceResource
    • GPUCopyExternalImageSource
  • -> GPUCopyExternalImageDestination
    • GPUCopyExternalImageDest

@kainino0x
Copy link
Contributor Author

From meeting discussion:

GPUTexelCopyBufferLayout
GPUTexelCopyBufferInfo
GPUTexelCopyTextureInfo
GPUCopyExternalImageSourceInfo
GPUCopyExternalImageSource
GPUCopyExternalImageDestInfo

@kainino0x kainino0x marked this pull request as draft October 30, 2024 22:18
@kainino0x kainino0x force-pushed the image-copies-rename branch 4 times, most recently from c3f70aa to 0f92005 Compare October 31, 2024 04:11
@kainino0x kainino0x force-pushed the image-copies-rename branch from 64384cb to f828d32 Compare October 31, 2024 04:15
@kainino0x kainino0x marked this pull request as ready for review October 31, 2024 04:19
Copy link
Member

@toji toji left a comment

Choose a reason for hiding this comment

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

LGTM again, thanks for continuing to push this forward!

@kainino0x kainino0x merged commit 3f48a1d into gpuweb:main Nov 1, 2024
4 checks passed
@kainino0x kainino0x deleted the image-copies-rename branch November 1, 2024 22:29
@kainino0x kainino0x added the api resolved Resolved - waiting for a change to the API specification label Nov 1, 2024
jrprice pushed a commit to jrprice/gpuweb that referenced this pull request Nov 7, 2024
* [subst] GPUImageDataLayout -> GPUTexelCopyBufferLayout

* [subst] GPUImageCopyBuffer -> GPUTexelCopyBufferInfo

* [subst] GPUImageCopyTexture -> GPUTexelCopyTextureInfo

* [subst] GPUImageCopyTextureTagged -> GPUCopyExternalImageDestInfo

* [subst] GPUImageCopyExternalImage -> GPUCopyExternalImageSourceInfo

* [subst] GPUImageCopyExternalImageSource -> GPUCopyExternalImageSource

* image {copy,data} -> texel {copy,data}

* image copy -> [=texel copy=]

* update section headers

* [subst] |imageCopyTexture| -> |texelCopyTextureInfo|

* [subst] Update algorithm name

* [subst] |dataLayout| -> |bufferLayout|

* Add docs to explain the names

* Restore approximate link for #typedefdef-gpuimagecopyexternalimagesource
@Kangz
Copy link
Contributor

Kangz commented Nov 19, 2024

GPU Web WG 2024-10-29/30 Mountain View F2F
  • KN: Nothing additional to say. What remains is naming proposals.
  • KG: Posted a comment. Some aspect of bikeshedding. Corentin had a point that these names are the same that C headers use. In C headers you’re much more likely to have type them a lot. JS specs are less sensitive to that because of defaulting. Need more care in the C world. My suggestions are at Rename image copies -> texel copies #4838 (comment) [ the ones that end in Desc
    • In Web IDL we often use Source suffixes when doing a typedef union. Would be nice to retain that.
    • Like to draw a strong distinction between data and *objects. *Use Dict for dictionary, Desc for descriptor. I like Dict because in JS [Web IDL] these are dictionaries.
    • Usually shorten “destination” to Dest even if we don’t shorten “source” to src.
  • Jasper: I like Dict, but not in the C header. Seems wrong for C++ and C and Rust. Because they are structs, not dictionaries. Pick up the pattern used elsewhere.
  • KG: Think we get Desc from Vulkan.
  • Jasper: Desc is used everywhere.
  • CW: You have to type these out. They are a mouthful. That’s why I’m partial to the previous names. “GPU texel copy buffer descriptor” is a lot. That’s why I’m worried about this rename.
  • KG: Buttons-pressed wise are longer, but not much longer. It’s a balancing act.
  • KG: The reason we desire these names is the distinction between the designating the object, or the data describing the object (e.g. layout and size).
  • Jasper: I am fine with the bold names.
  • CW: The bold names are Kai’s.
  • KG: my recommendation is the ones that end in Desc
  • CW: I don’t want to block this. Go with the ones end in Desc
  • KN: How do you feel about Info.
  • CW: Descriptor is not shortened anywhere else.
  • KG: It’s good that it’s different from all the other “Descriptor” uses in the web API.
  • Jasper: I like the bold names… ending in Data.
  • KG: But you’re not copying Data. Often have to clarify with folks with the difference between the data and a description of data.
  • MW: outside of GPU we don’t have a lot of other abbreviations.
  • CW: The only other ones we have are Dest and Src for various things.
  • KG: In the field that is very common.
  • KG: I’m proposing using Dest.
  • KG: I’ll post a PR .
    • I could be ok with Info. Seems it has the fewest objections to that?
  • LokoK: Said “Shape” (but got vetoed on basis of not communicating enough)
  • KG: I will post a PR
    • with Info it’s least objectionable.
    • SourceInfo and DestInfo feel natural.
    • Leave the typedef as external image Source.
  • GPUTexelCopyBufferLayout
    GPUTexelCopyBufferInfo
    GPUTexelCopyTextureInfo
    GPUCopyExternalImageSourceInfo
    GPUCopyExternalImageSource
    GPUCopyExternalImageDestInfo

ErichDonGubler added a commit to erichdongubler-mozilla/wgpu that referenced this pull request Nov 25, 2024
This commit was authored by running the following Nushell script, using
the `nu` binary and the lovely `fastmod` tool:

```nushell
# Copy-pasted from the OP in [`gpuweb`gfx-rs#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update old { strip_gpu_prefix | str trim }
  | update new { strip_gpu_prefix | str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

def strip_gpu_prefix []: string -> string {
  $in | str replace --regex '^GPU' ''
}

# Rename image APIs.
for entry in $renames_table {
  fastmod --accept-all --fixed-strings $entry.old $entry.new --iglob '!CHANGELOG.md' --iglob "!xtask/src/vendor_web_sys.rs" --iglob '!wgpu/src/backend/webgpu/webgpu_sys/' --iglob '!deno_webgpu/'
}
cargo fmt
```

…and cleaning up `deno_webgpu/`'s Rust compilation errors.
ErichDonGubler added a commit to erichdongubler-mozilla/wgpu that referenced this pull request Nov 26, 2024
This commit was authored by running the following Nushell script, using
the `nu` binary and the lovely `fastmod` tool:

```nushell
# Copy-pasted from the OP in [`gpuweb`gfx-rs#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update old { strip_gpu_prefix | str trim }
  | update new { strip_gpu_prefix | str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

def strip_gpu_prefix []: string -> string {
  $in | str replace --regex '^GPU' ''
}

# Rename image APIs.
for entry in $renames_table {
  fastmod --accept-all --fixed-strings $entry.old $entry.new --iglob '!CHANGELOG.md' --iglob "!xtask/src/vendor_web_sys.rs" --iglob '!wgpu/src/backend/webgpu/webgpu_sys/' --iglob '!deno_webgpu/' --iglob '!wgpu/src/backend/webgpu.rs'
}
cargo fmt
```

…and cleaning up `deno_webgpu/`'s Rust compilation errors.
ErichDonGubler added a commit to gfx-rs/wgpu that referenced this pull request Nov 27, 2024
This commit was authored by running the following Nushell script, using
the `nu` binary and the lovely `fastmod` tool:

```nushell
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update old { strip_gpu_prefix | str trim }
  | update new { strip_gpu_prefix | str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

def strip_gpu_prefix []: string -> string {
  $in | str replace --regex '^GPU' ''
}

# Rename image APIs.
for entry in $renames_table {
  fastmod --accept-all --fixed-strings $entry.old $entry.new --iglob '!CHANGELOG.md' --iglob "!xtask/src/vendor_web_sys.rs" --iglob '!wgpu/src/backend/webgpu/webgpu_sys/' --iglob '!deno_webgpu/' --iglob '!wgpu/src/backend/webgpu.rs'
}
cargo fmt
```

…and cleaning up `deno_webgpu/`'s Rust compilation errors.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 27, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Nov 27, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Nov 30, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Nov 30, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Dec 1, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193

UltraBlame original commit: 08a24ec855174eaf82c2da1069d7778f2edc70fc
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Dec 1, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193

UltraBlame original commit: 155ce9b483bd2e947c85fa85b24c9c0866240432
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Dec 1, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193

UltraBlame original commit: 08a24ec855174eaf82c2da1069d7778f2edc70fc
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Dec 1, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193

UltraBlame original commit: 155ce9b483bd2e947c85fa85b24c9c0866240432
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Dec 1, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193

UltraBlame original commit: 08a24ec855174eaf82c2da1069d7778f2edc70fc
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Dec 1, 2024
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193

UltraBlame original commit: 155ce9b483bd2e947c85fa85b24c9c0866240432
juj added a commit to juj/wasm_webgpu that referenced this pull request Sep 12, 2025
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
jwidar pushed a commit to jwidar/LatencyZeroGithub that referenced this pull request Sep 16, 2025
…m upstream IDL r=webgpu-reviewers,webidl,teoxoy,emilio

Driven by [gpuweb#4838](gpuweb/gpuweb#4838).

The vast majority of this script was implemented with a Nushell script,
using the `nu` binary and the wonderful `fastmod` tool

```
# Copy-pasted from the OP in [`gpuweb`#4838](gpuweb/gpuweb#4838).
let renames_table = '
Type 	Old 	New 	Used in
dict 	GPUImageDataLayout 	GPUTexelCopyBufferLayout 	"writeTexture,
parent type of ↙"
dict 	GPUImageCopyBuffer 	"GPUTexelCopyBufferInfo
extends ↑" 	T2B, B2T
dict 	GPUImageCopyTexture 	GPUTexelCopyTextureInfo 	T2B, B2T, T2T, writeTexture
dict 	GPUImageCopyTextureTagged 	"GPUCopyExternalImageDestInfo
extends ↑" 	copyExternalImageToTexture
dict 	GPUImageCopyExternalImage 	GPUCopyExternalImageSourceInfo 	copyExternalImageToTexture
union 	GPUImageCopyExternalImageSource 	GPUCopyExternalImageSource 	member of ↖
'

let renames_table = $renames_table
  | from tsv
  | select 'Old ' 'New '
  | rename old new
  | update new { $in | lines | get 0 } # only the first line has the renamed symbol identifier
  | update new { str trim }
  | update old { str trim }
  | sort-by old | reverse # Replace most specific symbol names first (some have the same "word segments" but with fewer segments)

# Rename image APIs.
let rename_paths = [
  ...("dom/webgpu/*.{cpp,h}" | str expand)
  "dom/webidl/WebGPU.webidl"
] | each { glob $in } | flatten

for entry in $renames_table {
  print $'replacing ($entry.old | to nuon) with ($entry.new | to nuon)'
  fastmod --accept-all $'\b($entry.old)' $entry.new ...$rename_paths
}
```

Differential Revision: https://phabricator.services.mozilla.com/D230193
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api resolved Resolved - waiting for a change to the API specification api WebGPU API proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[editorial] Consider if there's a much better name for "image copies"
5 participants