Skip to content
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

Fill in CanonicalABI.md #23

Merged
merged 21 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
41d8902
Fill in CanonicalABI.md (based on interface-types/#140)
lukewagner Mar 1, 2022
62f8fb8
Add dynamic alignment checks to load and store
lukewagner Apr 13, 2022
34db917
Split out separate canonicalize32/64 so there is an explicit float32 …
lukewagner Apr 13, 2022
fe03324
Sync CanonicalABI.md
lukewagner Apr 13, 2022
cb5259c
Add comment for pack/unpack usage
lukewagner Apr 13, 2022
7a2ee91
Add NaN canonicalization explanation
lukewagner Apr 13, 2022
26aa846
Canonicalize before storing/lowering to make it clear which bit patte…
lukewagner Apr 13, 2022
6a00372
Add string encoding links and reword string paragraph so they show up…
lukewagner Apr 13, 2022
da5d058
Fix text about multi-value limitation
lukewagner Apr 13, 2022
b52a78c
Add blurb about defaults-to in Explainer.md
lukewagner Apr 13, 2022
4035e4e
Sync CanonicalABI.md with definitions.py
lukewagner Apr 14, 2022
5679ffb
Pass string length in code units, not bytes, and fix string realloc a…
lukewagner Apr 14, 2022
171e706
Merge elem_size and byte_size into size
lukewagner Apr 14, 2022
32f8a0c
Add GitHub Actions workflow to test canonical abi
alexcrichton Apr 14, 2022
838e063
Merge pull request #24 from alexcrichton/actions-test
fitzgen Apr 14, 2022
6d77ea9
Make byte-to-bool conversion trap if greater than 1
lukewagner Apr 18, 2022
4bf614e
Add + to enum/union to match the other places
lukewagner Apr 18, 2022
5e438f4
Pass the return values to the post-return function
lukewagner Apr 18, 2022
62524b7
Fix typos
lukewagner Apr 20, 2022
818e6d3
Add NaN canonicalization tests
lukewagner Apr 20, 2022
bf73065
Sync CanonicalABI.md with canonical-abi/definitions.py
lukewagner Apr 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on:
push:
pull_request:

jobs:
canonical_abi:
name: Run Canonical ABI Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '>= 3.10.0'
- run: python design/mvp/canonical-abi/run_tests.py
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Component Model design and specification

This repository describes the high-level [goals], [use cases], [design choices]
and [FAQ] of the component model as well as a more-detailed [explainer] and
[binary format] covering the initial Minimum Viable Product (MVP) release.
and [FAQ] of the component model as well as a more-detailed [explainer],
[binary format] and [ABI] covering the initial Minimum Viable Product (MVP)
release.

In the future, this repository will additionally contain a [formal spec],
reference interpreter and test suite.
Expand All @@ -20,6 +21,7 @@ To contribute to any of these repositories, see the Community Group's
[FAQ]: design/high-level/FAQ.md
[explainer]: design/mvp/Explainer.md
[binary format]: design/mvp/Binary.md
[ABI]: design/mvp/CanonicalABI.md
[formal spec]: spec/
[W3C WebAssembly Community Group]: https://www.w3.org/community/webassembly/
[Contributing Guidelines]: https://webassembly.org/community/contributing/
29 changes: 16 additions & 13 deletions design/mvp/Binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,26 @@ Notes:
func ::= body:<funcbody> => (func body)
funcbody ::= 0x00 ft:<typeidx> opt*:vec(<canonopt>) f:<funcidx> => (canon.lift ft opt* f)
| 0x01 opt*:<canonopt>* f:<funcidx> => (canon.lower opt* f)
canonopt ::= 0x00 => string=utf8
| 0x01 => string=utf16
| 0x02 => string=latin1+utf16
| 0x03 i:<instanceidx> => (into i)
canonopt ::= 0x00 => string-encoding=utf8
| 0x01 => string-encoding=utf16
| 0x02 => string-encoding=latin1+utf16
| 0x03 m:<memidx> => (memory m)
| 0x04 f:<funcidx> => (realloc f)
| 0x05 f:<funcidx> => (post-return f)
```
Notes:
* Validation prevents duplicate or conflicting options.
* Validation of `canon.lift` requires `f` to have a `core:functype` that matches
the canonical-ABI-defined lowering of `ft`. The function defined by
`canon.lift` has type `ft`.
* Validation of `canon.lower` requires `f` to have a `functype`. The function
defined by `canon.lower` has a `core:functype` defined by the canonical ABI
lowering of `f`'s type.
* Validation of `canon.lift` requires `f` to have type `flatten(ft)` (defined
by the [Canonical ABI](CanonicalABI.md#flattening)). The function being
defined is given type `ft`.
* Validation of `canon.lower` requires `f` to be a component function. The
function being defined is given core function type `flatten(ft)` where `ft`
is the `functype` of `f`.
* If the lifting/lowering operations implied by `canon.lift` or `canon.lower`
require access to `memory`, `realloc` or `free`, then validation will require
the `(into i)` `canonopt` be present and the corresponding export be present
in `i`'s `instancetype`.
require access to `memory` or `realloc`, then validation requires these
options to be present. If present, `realloc` must have type
`(func (param i32 i32 i32 i32) (result i32))`.
* `post-return` is always optional, but, if present, must have type `(func)`.


## Start Definitions
Expand Down
Loading