WebAssembly / compilation-hints

Compilation Hints
Other
0 stars 0 forks source link

Shared issues with Branch Hinting #4

Closed yuri91 closed 1 month ago

yuri91 commented 6 months ago

This proposal shares a lot with the Branch Hinting proposal (to the point that if this came first, branch hinting would just have been one of the sections added by this proposal), so I (as the champion of the Branch Hinting proposal) would like to present what I think are the remaining issues for standardization that are shared between the two proposals, so that we can reach a solution together.

Dependence on the Custom Annotation proposal for the testing requirement

The main issue that held back the BH proposal was to come up with a reasonable way to satisfy the requirement of implementing it in the reference interpreter, along with tests. A lot of work was done to integrate the concept of optional parsing and validation of known custom section in the interpreter, but it is all tied to the Custom Annotations proposal, which has been near phase 4 but not quite for a long time. I would appreciate any help in getting that through the finishing line.

Find a proper place for the spec text

The core spec does describe a custom section: the "name" section. It does so in the appendix. The Custom Annotation proposal also currently adds to the appendix the description of the new custom annotations (custom and name), and so does Branch Hinting for both the section and the corresponding annotation.

But @rossberg pointed out that the appendix might not be the proper place, and we should maybe create a new document for the specification of custom sections and annotations.

This particular issue was not discussed much in the CG meetings, so I don't know what other folks think about it, but it's critical to have consensus on where the spec text is supposed to be before standardization.

ecmziegler commented 5 months ago

The design is obviously very much based on branch hinting and custom annotations in order not to introduce inconsistencies. While it's in principle independent of the former, it very much depends on the latter. So I agree that moving the custom annotations proposal forward is desirable for both proposals. I think compilation hints could benefit from more flexibility in custom annotations (see issue #1), but those can be added later and we don't want to block the progress there. With instruction-level hints, we can already get quite far.

Regarding the spec text, I would support having a dedicated section given that this proposal will add multiple sections and we expect more to come.

ecmziegler commented 1 month ago

Now that branch hinting and custom annotations were voted to phase 4, I will close this issue.