Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Intent to Ship: WebAssembly Branch Hints

106 views
Skip to first unread message

Emanuel Ziegler

unread,
Mar 25, 2025, 8:49:27 AMMar 25
to blink-dev, Jakob Kummerow

Hi all,


We are preparing to ship the WebAssembly Branch Hints proposal in M136 which has been voted to phase 4 in the Wasm Community Group last July. Chrome is now catching up with shipping it after requests from partners. The feature is already implemented in Firefox.

The proposal was championed by Yuri Iozzelli from Leaning Technologies and the V8 team was not involved in its standardization process. The implementation has no effect on existing code by design which is why a Finch trial would not yield any insights. We have a Chromium feature available for a Finch kill-switch if necessary.

Thank you,
    Emanuel



Contact emails

ecmzi...@chromium.orgjkum...@chromium.org

Explainer

None

Specification

https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md

Summary

Improves the performance of compiled WebAssembly code by informing the engine that a particular branch instruction is very likely to take a specific path. This allows the engine to make better decisions for code layout (improving instruction cache hits) and register allocation. https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md



Blink component

Blink>JavaScript>WebAssembly

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

None



Gecko: No signal

WebKit: No signal

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

No

Is this feature fully tested by web-platform-tests?

No

Flag name on about://flags

None

Finch feature name

V8Flag_experimental_wasm_branch_hinting

Requires code in //chrome?

False

Estimated milestones

Shipping on desktop136
Shipping on Android136
Shipping on WebView136


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5165273114738688?gate=5186994509185024

This intent message was generated by Chrome Platform Status.

Stephen Chenney

unread,
Mar 25, 2025, 9:01:47 AMMar 25
to Emanuel Ziegler, blink-dev, Jakob Kummerow
I think you have a stronger interop story than the fields would indicate ...

On Tue, Mar 25, 2025 at 8:49 AM Emanuel Ziegler <ecmzi...@chromium.org> wrote:

Hi all,


We are preparing to ship the WebAssembly Branch Hints proposal in M136 which has been voted to phase 4 in the Wasm Community Group last July. Chrome is now catching up with shipping it after requests from partners. The feature is already implemented in Firefox.

The proposal was championed by Yuri Iozzelli from Leaning Technologies and the V8 team was not involved in its standardization process. The implementation has no effect on existing code by design which is why a Finch trial would not yield any insights. We have a Chromium feature available for a Finch kill-switch if necessary.

Thank you,
    Emanuel



Contact emails

ecmzi...@chromium.orgjkum...@chromium.org

Explainer

None

Specification

https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md

Summary

Improves the performance of compiled WebAssembly code by informing the engine that a particular branch instruction is very likely to take a specific path. This allows the engine to make better decisions for code layout (improving instruction cache hits) and register allocation. https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md



Blink component

Blink>JavaScript>WebAssembly

TAG review

None

TAG review status

Not applicable

Risks



Interoperability and Compatibility

None



Gecko: No signal

In the summary it says that Firefox has shipped. Should the Gecko signal be "Shipped"?
 

WebKit: No signal

Web developers: No signals

And here you indicated that a developer pushed the proposal. Is that not a signal of some kind?
 
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
To view this discussion visit https://groups.google.com/a/chromium.org/d/msgid/blink-dev/CAPAU7RwMXE%2BnsewWqSQ0M%2BS7gH600KjJtnp2T3Oyw8GPz4nNHg%40mail.gmail.com.

Emanuel Ziegler

unread,
Mar 25, 2025, 9:51:43 AMMar 25
to Stephen Chenney, blink-dev, Jakob Kummerow
Thanks for the feedback! I've updated the status accordingly, setting the feedback from Mozilla and web developers to Positive (after all it was championed by a web developer). I'm not sure if Mozilla already shipped the feature, but at least it's fully implemented since M127. I also set Apple's position to neutral since while we are not sure about their implementation plans, they were present at the phase 4 vote, actively participated in the discussion and did not oppose.

Domenic Denicola

unread,
Mar 25, 2025, 9:26:08 PMMar 25
to Emanuel Ziegler, blink-dev, Jakob Kummerow
On Tue, Mar 25, 2025 at 9:49 PM Emanuel Ziegler <ecmzi...@chromium.org> wrote:

Hi all,


We are preparing to ship the WebAssembly Branch Hints proposal in M136 which has been voted to phase 4 in the Wasm Community Group last July. Chrome is now catching up with shipping it after requests from partners. The feature is already implemented in Firefox.

The proposal was championed by Yuri Iozzelli from Leaning Technologies and the V8 team was not involved in its standardization process. The implementation has no effect on existing code by design which is why a Finch trial would not yield any insights. We have a Chromium feature available for a Finch kill-switch if necessary.

Thank you,
    Emanuel



Contact emails

ecmzi...@chromium.orgjkum...@chromium.org

Explainer

None

Specification

https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md

It seems like you put the explainer in the specification field, and didn't link to the specification. I guess the spec is at https://github.com/WebAssembly/branch-hinting/blob/main/document/core/appendix/custom.rst ? Although I'm not sure the rendering there is quite right... is there a better URL?
 


Summary

Improves the performance of compiled WebAssembly code by informing the engine that a particular branch instruction is very likely to take a specific path. This allows the engine to make better decisions for code layout (improving instruction cache hits) and register allocation. https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md



Blink component

Blink>JavaScript>WebAssembly

TAG review

None

TAG review status

Not applicable


Risks



Interoperability and Compatibility

None


Can you expand on why you believe there are no interop and compat risks?
 


Gecko: No signal

WebKit: No signal 

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

No

Why not?
 


Is this feature fully tested by web-platform-tests?

No

Why not?


Flag name on about://flags

None

Finch feature name

V8Flag_experimental_wasm_branch_hinting

Requires code in //chrome?

False

Estimated milestones

Shipping on desktop136
Shipping on Android136
Shipping on WebView136


Anticipated spec changes

Open questions about a feature may be a source of future web compat or interop issues. Please list open issues (e.g. links to known github issues in the project for the feature specification) whose resolution may introduce web compat/interop risk (e.g., changing to naming or structure of the API in a non-backward-compatible way).

None

Link to entry on the Chrome Platform Status

https://chromestatus.com/feature/5165273114738688?gate=5186994509185024

This intent message was generated by Chrome Platform Status.

--

Emanuel Ziegler

unread,
Mar 26, 2025, 5:31:42 AMMar 26
to Domenic Denicola, blink-dev, Jakob Kummerow
See answers below. Thanks!

On Wed, Mar 26, 2025 at 2:26 AM Domenic Denicola <dom...@chromium.org> wrote:


On Tue, Mar 25, 2025 at 9:49 PM Emanuel Ziegler <ecmzi...@chromium.org> wrote:

Hi all,


We are preparing to ship the WebAssembly Branch Hints proposal in M136 which has been voted to phase 4 in the Wasm Community Group last July. Chrome is now catching up with shipping it after requests from partners. The feature is already implemented in Firefox.

The proposal was championed by Yuri Iozzelli from Leaning Technologies and the V8 team was not involved in its standardization process. The implementation has no effect on existing code by design which is why a Finch trial would not yield any insights. We have a Chromium feature available for a Finch kill-switch if necessary.

Thank you,
    Emanuel



Contact emails

ecmzi...@chromium.orgjkum...@chromium.org

Explainer

None

Specification

https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md

It seems like you put the explainer in the specification field, and didn't link to the specification. I guess the spec is at https://github.com/WebAssembly/branch-hinting/blob/main/document/core/appendix/custom.rst ? Although I'm not sure the rendering there is quite right... is there a better URL?

Unfortunately, the rendered content has not been updated in a while and this is the only source of truth until the spec is fully merged into the Wasm spec.
  

Summary

Improves the performance of compiled WebAssembly code by informing the engine that a particular branch instruction is very likely to take a specific path. This allows the engine to make better decisions for code layout (improving instruction cache hits) and register allocation. https://github.com/WebAssembly/branch-hinting/blob/main/proposals/branch-hinting/Overview.md



Blink component

Blink>JavaScript>WebAssembly

TAG review

None

TAG review status

Not applicable


Risks



Interoperability and Compatibility

None


Can you expand on why you believe there are no interop and compat risks?

This is a fully optional proposal without any difference in functionality. If an engine does not support it, it will simply run the code a little slower.

Gecko: No signal

WebKit: No signal 

Web developers: No signals

Other signals:

WebView application risks

Does this intent deprecate or change behavior of existing APIs, such that it has potentially high risk for Android WebView-based applications?

None



Debuggability

None



Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, ChromeOS, Android, and Android WebView)?

No

Why not?

Sorry, that was a mistake and has been fixed. We are planning on shipping it everywhere since the changes are not architecture dependent.


Is this feature fully tested by web-platform-tests?

No

Why not?

Because there is no observable behavior change that could be tested against.

Emanuel Ziegler

unread,
Mar 26, 2025, 6:26:09 AMMar 26
to Domenic Denicola, blink-dev, Jakob Kummerow
Ah, I looked in the wrong "binary" rendering of the spec. This is the correct link: https://webassembly.github.io/branch-hinting/metadata/code/binary.html (yes, it's extremely simple)
I updated the link in the feature. Sorry for the confusion!

Domenic Denicola

unread,
Mar 26, 2025, 9:37:34 PMMar 26
to Emanuel Ziegler, Domenic Denicola, blink-dev, Jakob Kummerow
Thanks for the answers! LGTM1.

Mike Taylor

unread,
Mar 27, 2025, 10:54:43 AMMar 27
to Domenic Denicola, Emanuel Ziegler, blink-dev, Jakob Kummerow

Chris Harrelson

unread,
Mar 27, 2025, 11:50:45 AMMar 27
to Mike Taylor, Domenic Denicola, Emanuel Ziegler, blink-dev, Jakob Kummerow

Emanuel Ziegler

unread,
Mar 27, 2025, 1:26:09 PMMar 27
to Chris Harrelson, Mike Taylor, Domenic Denicola, blink-dev, Jakob Kummerow
Thank you all!

FYI: we decided to only ship with M137 to give the feature a little more time in staged mode. While we don't foresee any problems, there is also no harm in waiting another 4 weeks. I have adjusted the target milestone in the feature accordingly for transparency.
Reply all
Reply to author
Forward
0 new messages