profile
viewpoint
Pat Hickey pchickey @fastly Portland, OR http://moreproductive.org I work on Lucet, Cranelift, WebAssembly, etc

bytecodealliance/wasmtime 3815

Standalone JIT-style runtime for WebAssembly, using Cranelift

m4b/faerie 174

Magical ELF and Mach-o object file writer backend

gimli-rs/object 112

A unified interface for reading and writing object file formats

bytecodealliance/wasi 101

Experimental WASI API bindings for Rust

fastly/terrarium-rust-guest 27

The "http_guest" crate used by Fastly Labs Terrarium https://wasm.fastlylabs.com/

CraneStation/wasi-common 26

WASI implementation in Rust

CraneStation/wasmtime-wasi 24

WASI suppport for wasmtime

fastly/terrarium-templates 21

Template and example projects for Fastly Labs Terrarium https://wasm.fastlylabs.com

pchickey/arduino-freertos-libs 8

A distribution of FreeRTOS as an Arduino library

pchickey/gcc-sam3u-build 8

Build scripts for sam3u w/ at91lib 1.6 using arm-none-eabi-gcc

pull request commentbytecodealliance/wasmtime

Add wasi example to include simple in-memory filesystem interaction

Yes, thanks very much for this PR!

joshuawarner32

comment created time in 7 hours

issue commentbytecodealliance/wasmtime

Enable intercepting all filesystem access with WasiCtxBuilder

Welcome! The use case you describe is very much something we want to enable.

I'm presently working on a bunch of renovations to the wasi-common crate (see #2202, #2205). @sunfishcode and @alexcrichton have some ideas and works-in-progress that will also help us change the architecture of this crate. Your design ideas sound right in line with what we'd like to see, so I'd encourage you to either expand on them here or make a PR where we can all take a look together.

One thing I'm failing at right now is describing a cohesive vision for what we want wasi-common to become - there are a lot of moving parts right now, and I'm trying to balance the limited time I get to do code gardening against bigger concerns like shipping a new wasi snapshot (long overdue at this point, but none of the folks involved have had much spare bandwidth this summer) and some more urgent aspects of the design which need fixing for the sake of production systems using it. We're eager to get more help with any and all of these parts of the WASI puzzle, if you'd like to be more involved we can chat on the bytecode alliance zulip.

joshuawarner32

comment created time in 4 days

PR opened bytecodealliance/wasmtime

dep gardening

Thank you @maxded and @bjorn3 - cargo deny helped us identify that these deps can be consolidated:

  • gimli goes to 0.22.0
  • object goes to 0.21.1

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+17 -29

0 comment

7 changed files

pr created time in 4 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 45c98d91adc0488cf2f8bd2a820da7224b42037a

bump cargo.lock

view details

push time in 4 days

create barnchbytecodealliance/wasmtime

branch : pch/dep_gardening

created branch time in 4 days

push eventbytecodealliance/lucet

Pat Hickey

commit sha fac920f1a96ebfd0e6ebf40b29c37987f585499d

import latest wasmtime repo: 0.20 release (clif 0.67)

view details

Pat Hickey

commit sha 386cd69d7ab52d160b85d6fe6349778db4098f39

Merge branch 'pch/lucet_wasi_generate_hooks' into pch/wasmtime_0.20

view details

Pat Hickey

commit sha 9b197b97d5ac3b4693bc66913f66bb145fe9426c

lucet-wasi: fixes for upstream changes in wasi-common macro allows you to specify error mappings, which need to match upstream, but we dont have them exposed upstream in the nice way the witx file is, for better or worse.

view details

Pat Hickey

commit sha 90e5af211c7a8c4826de55b6c0c890967cdd3196

target lexicon fixes

view details

Pat Hickey

commit sha f5efdac420dfb2ded95b9fbec31ad0177bde7acf

Merge remote-tracking branch 'origin/main' into pch/wasmtime_0.20

view details

Pat Hickey

commit sha 7d6b3b4424b60ad59bd247de5e6505a52b4a9101

Merge pull request #591 from bytecodealliance/pch/wasmtime_0.20 Update to wasmtime 0.20

view details

push time in 5 days

delete branch bytecodealliance/lucet

delete branch : pch/wasmtime_0.20

delete time in 5 days

PR merged bytecodealliance/lucet

Update to wasmtime 0.20

Mostly just version bumps. Only changes of substance are in lucet-wasi. I merged #590 into this branch to simplify these changes.

+127 -112

1 comment

14 changed files

pchickey

pr closed time in 5 days

issue commentfastly/cli

Support more than one Rust toolchain version

Ideally we would always support the stable rust version - this special version points to the latest stable release that rustup knows about. So maybe we should express a disjunction of constaints?

phamann

comment created time in 5 days

issue commentbytecodealliance/wasmtime

Add cargo-deny?

This seems like a good idea. I was not familiar with cargo-deny but it looks like a useful tool.

Fastly runs cargo-audit in CI, and I'd support doing the same here.

Agree that duplicate lock entries from direct dependencies should be avoided in CI - this shouldn't happen very frequently, and when it does its straightforward to fix.

It looks like we have two autocfg versions that are transitive deps, that is harder to resolve, so having an exceptions list seems like a reasonable rule there.

I don't have an opinion on the licensing checks. We could disable linting those until we can get legal advice on what we should allow.

maxded

comment created time in 5 days

push eventbytecodealliance/lucet

Pat Hickey

commit sha 9b9cfe8f708b6188dc17f37ac1cac282a2b2d63c

lucet-wasi: add tracing_subscriber required for e.g. RUST_LOG=wasi-common=trace

view details

Pat Hickey

commit sha 7de5977c26577967261bd38d8a7673d29b9e148f

Merge pull request #590 from bytecodealliance/pch/lucet_wasi_generate_hooks lucet-wasi-generate: accept pre_hook and post_hook as proc macro arguments

view details

Pat Hickey

commit sha 9761ce319f60bb788da4e56287d5c68599aa75e6

Merge pull request #588 from bytecodealliance/pch/lucet_wasi_tracing lucet-wasi executable: add tracing_subscriber

view details

Pat Hickey

commit sha f5efdac420dfb2ded95b9fbec31ad0177bde7acf

Merge remote-tracking branch 'origin/main' into pch/wasmtime_0.20

view details

push time in 5 days

push eventbytecodealliance/lucet

Pat Hickey

commit sha 9b9cfe8f708b6188dc17f37ac1cac282a2b2d63c

lucet-wasi: add tracing_subscriber required for e.g. RUST_LOG=wasi-common=trace

view details

Pat Hickey

commit sha 9761ce319f60bb788da4e56287d5c68599aa75e6

Merge pull request #588 from bytecodealliance/pch/lucet_wasi_tracing lucet-wasi executable: add tracing_subscriber

view details

push time in 5 days

delete branch bytecodealliance/lucet

delete branch : pch/lucet_wasi_tracing

delete time in 5 days

PR merged bytecodealliance/lucet

Reviewers
lucet-wasi executable: add tracing_subscriber

required for e.g. RUST_LOG=wasi-common=trace

+106 -2

0 comment

3 changed files

pchickey

pr closed time in 5 days

push eventbytecodealliance/lucet

Pat Hickey

commit sha 7f60b6b9d19a9c191c51d1810e2edf4be51022e2

lucet-wasi-generate: accept pre_hook and post_hook as proc macro arguments

view details

Pat Hickey

commit sha 7de5977c26577967261bd38d8a7673d29b9e148f

Merge pull request #590 from bytecodealliance/pch/lucet_wasi_generate_hooks lucet-wasi-generate: accept pre_hook and post_hook as proc macro arguments

view details

push time in 5 days

delete branch bytecodealliance/lucet

delete branch : pch/lucet_wasi_generate_hooks

delete time in 5 days

PR merged bytecodealliance/lucet

lucet-wasi-generate: accept pre_hook and post_hook as proc macro arguments

in the process, convert the option parsing to use kw & lookahead like its friends do in wiggle-generate

+48 -12

0 comment

2 changed files

pchickey

pr closed time in 5 days

pull request commentWebAssembly/WASI

Add an agenda for the 09-24 meeting.

should we cancel the meeting for lack of an agenda?

sunfishcode

comment created time in 6 days

pull request commentbytecodealliance/wasmtime

wasi common: move fs and path into Entry methods

wrt the Rights flags: right now, the canonical definition of the rights type is in the witx snapshot, but if we evolve how rights work, I expect the first thing we'll do is make the canonical definition a type defined in wasi-common, and then define conversion functions for whenever we need to represent those to the guest via each snapshot we support.

wrt separation of responsibilities: first off, theres a big overlap between Handle and Entry right now, which needs design work still. I'm not 100% sure how to resolve these yet. My goal is that the handle/entry concept will be responsible for exporting all types used in its interfaces. Whether those types are imported from a given snapshot's wiggle generated code, or defined canonically without wiggle, is an implementation detail.

At the moment, snapshots manipulate the entry table (mostly get_entry but some remove_entry and insert_entry_at) and call Entry methods (though they do so with types exported by crate::handle... admittedly this is muddled). Since we want to define many snapshots that will usually look a lot alike, I tried to move as much complexity out of these bodies as possible, while exposing as few pointers (and, with them, assumptions about how guest programs represent things in memory) to the Entry methods as possible. Unfortunately, I haven't figured out how to do this with absolutely no pointers, unless we reintroduce mut vs const borrows to the wiggle api so that const borrows can overlap.

Then, each snapshot will be responsible for calling the handle/entry concept, converting any of its interfaces's types to and from the ones expected by the Entry methods. Whichever snapshot's types get exported by crate::handle gets to skip this converting to/from code. For all of the types in snapshot 0, we'll have to define conversion functions, but the overwhelming majority of them should compile to a no-op because the representation is exactly the same.

This PR leaves this work incomplete - #2205 is still a work in progress at completing that abstraction with the scheduler methods.

pchickey

comment created time in 6 days

PR opened bytecodealliance/lucet

Update to wasmtime 0.20

Mostly just version bumps. Only changes of substance are in lucet-wasi. I merged in #590 to simplify these changes.

+175 -124

0 comment

14 changed files

pr created time in 6 days

create barnchbytecodealliance/lucet

branch : pch/wasmtime_0.20

created branch time in 6 days

PR opened bytecodealliance/lucet

lucet-wasi-generate: accept pre_hook and post_hook as proc macro arguments

in the process, convert the option parsing to use kw & lookahead like its friends do in wiggle-generate

+48 -12

0 comment

2 changed files

pr created time in 6 days

create barnchbytecodealliance/lucet

branch : pch/lucet_wasi_generate_hooks

created branch time in 6 days

issue commentbytecodealliance/wasmtime

Tracking issue for guest stack switching in Wasmtime

For design reference - in Lucet we introduced Vmctx::block_on as the new user-facing primitive for stack switching in an async context. We haven't gotten rid of the lower level yield primitives yet, but block_on is the primitive I wish I could use in wasi-common https://github.com/bytecodealliance/lucet/pull/551

kubkon

comment created time in 6 days

issue commentbytecodealliance/wasmtime

Add define_anonymous_data function to cranelift-module

Seems reasonable to me

bjorn3

comment created time in 7 days

push eventbytecodealliance/wasmtime

bjorn3

commit sha 863d4272a792dd03c023c1ec2c006a1b7f384c1f

cranelift-object: Support per function sections This makes it possible for the linker to omit unused functions when --gc-sections is passed.

view details

Pat Hickey

commit sha 1fabb051b0436a38f794ca395601dcdcc31d3c18

Merge pull request #2218 from bjorn3/per_function_sections cranelift-object: Support per function sections

view details

push time in 7 days

PR merged bytecodealliance/wasmtime

cranelift-object: Support per function sections cranelift cranelift:module

This makes it possible for the linker to omit unused functions when --gc-sections is passed.

For cg_clif the executable size savings are quite big. One example is 26MB when a single .text section is used, but 15MB when a single section for each function is used, which is the same as when compiled using cg_llvm. I will probably disable this in debug mode though as it significantly increases the linking time.

The same could be done for data objects. I will try how much it helps for them.

+48 -8

1 comment

1 changed file

bjorn3

pr closed time in 7 days

push eventbytecodealliance/wasmtime

bjorn3

commit sha deb20c129a7d36bd5b53f3727a5acf9231c7337e

Fix relocated readonly data in custom sections Lld doesn't allow relocations in readonly sections

view details

Pat Hickey

commit sha 230850233601afb94f14853202b8aa0478049a39

Merge pull request #2212 from bjorn3/fix_custom_section_rel_ro Fix relocated readonly data in custom sections

view details

push time in 7 days

PR merged bytecodealliance/wasmtime

Fix relocated readonly data in custom sections cranelift cranelift:module

Lld doesn't allow relocations in readonly sections

This is required for https://github.com/bjorn3/rustc_codegen_cranelift/issues/1055.

+3 -1

3 comments

1 changed file

bjorn3

pr closed time in 7 days

pull request commentbytecodealliance/wasmtime

Fix relocated readonly data in custom sections

Ah sorry I just forgot. Thanks for the reminder :)

bjorn3

comment created time in 7 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

push eventpchickey/hexf

Pat Hickey

commit sha 22ef8792e47788ffb44ff15ac3cff5444c2fe890

travis: update minimum rust version

view details

push time in 12 days

PR opened lifthrasiir/hexf

modernize: remove proc macro hack

Hi! So, first off, I apologize for sending such a big diff at once. I'm happy to break this down into smaller PRs if you would prefer.

Thanks for making a small useful crate that has needed essentially no maintenance. About two months ago, changes finally landed in rust stable that support proc macros in the expression position, which obviates proc_macro_hack - that crate has noted its no longer necessary in [its readme](https://github.com/dtolnay/proc-macro-hack/blob/master/README.md].

This PR gets rid of all proc_macro_hack machinery. It also updates the crates to the rust 2018 edition, which permits importing macros via ordinary use hexf::hexf32; statements rather than #[macro_use] extern crate hexf;. I stumbled upon this modernization project because a new rustacean colleague wasn't aware of the old macro_use syntax, so I think this update will help usability.

Finally, we bump to the latest syn dependency. This will help users keep their dependency trees slim, since its very common to depend on a 1.0.x series syn these days.

Inadvertently, my editor applied rustfmt to all of the files I edited (which ended up being all of them). This does make the diff a bit bigger but doesn't seem harmful to me. This whole patch took me about 20 minutes to write so if you'd like me to redo it without the rustfmt changes I'm amenable.

+205 -122

0 comment

8 changed files

pr created time in 12 days

create barnchpchickey/hexf

branch : pch/remove_proc_macro_hack

created branch time in 12 days

fork pchickey/hexf

Hexadecimal float support for Rust 1.15 or later

fork in 12 days

pull request commentbytecodealliance/wasmtime

wasi common: move fs and path into Entry methods

rebased on top of main after #2201 merged

pchickey

comment created time in 13 days

push eventbytecodealliance/wasmtime

Joey Gouly

commit sha 22369cfa0dbbbb6e7e843d5acc2e8a8bbbe419f4

arm64: Combine mul + add into madd Copyright (c) 2020, Arm Limited.

view details

Nick Fitzgerald

commit sha 3a6dd832c0fcc51d72e7ef866cda246e8bafe849

Harvest left-hand side superoptimization candidates. Given a clif function, harvest all its integer subexpressions, so that they can be fed into [Souper](https://github.com/google/souper) as candidates for superoptimization. For some of these candidates, Souper will successfully synthesize a right-hand side that is equivalent but has lower cost than the left-hand side. Then, we can combine these left- and right-hand sides into a complete optimization, and add it to our peephole passes. To harvest the expression that produced a given value `x`, we do a post-order traversal of the dataflow graph starting from `x`. As we do this traversal, we maintain a map from clif values to their translated Souper values. We stop traversing when we reach anything that can't be translated into Souper IR: a memory load, a float-to-int conversion, a block parameter, etc. For values produced by these instructions, we create a Souper `var`, which is an input variable to the optimization. For instructions that have a direct mapping into Souper IR, we get the Souper version of each of its operands and then create the Souper version of the instruction itself. It should now be clear why we do a post-order traversal: we need an instruction's translated operands in order to translate the instruction itself. Once this instruction is translated, we update the clif-to-souper map with this new translation so that any other instruction that uses this result as an operand has access to the translated value. When the traversal is complete we return the translation of `x` as the root of left-hand side candidate.

view details

Nick Fitzgerald

commit sha 89f1e02f1fc0416459a64c6af4d9109d418b5a43

Remove executable bits from a few Rust source files

view details

Nick Fitzgerald

commit sha 5a871711215aac0623ec205c708559bf8ea62440

Do not use the `matches!` macro so we work with older rustc versions

view details

Nick Fitzgerald

commit sha b2acec116480509b0b5defa2802fdaa24e39d113

Harvest integer comparisons into Souper left-hand side candidates

view details

Nick Fitzgerald

commit sha c87aaeeecea7c8a4f29114b7fa5bdda9e7c7f457

cranelift_codegen::souper_harvest: Update TODOs to include more instructions

view details

Nick Fitzgerald

commit sha e1c8878b33a6a1908248f42069e407105618167e

cranelift_codegen::souper_harvest: Move preopt out of `Context`, into `clif-util` This allows for more flexibility of when/where to harvest LHS candidates. For example, we could choose to harvest candidates that overlap with and supercede our current preopt peepholes. This commit also makes sure that we compute the CFG before running preopt, when harvesting LHS candidates via `clif-util souper-harvest`.

view details

Chris Fallin

commit sha a0646c8d3f13253c78a797116e0ddb8336a0f25e

Account for duplicated if-block params on `end` op in unreachable case. This is a close analogue to bnjbvr@'s fix in commit 518b7a7e. Similar to that fix, this PR fixes a bug in which the Wasm translator could misalign its value stack and either mistranslate or cause a panic with a type-checking error. Found via fuzzing by :decoder in SpiderMonkey (bug 1664453).

view details

Chris Fallin

commit sha 539815ef12b64f954b980174292a3aa2d63ba022

Merge pull request #2197 from cfallin/fix-if-params Account for duplicated if-block params on `end` op in unreachable case.

view details

Nick Fitzgerald

commit sha 9fea412333f09c3146d587edda6c59c94d00f62b

Merge pull request #2184 from fitzgen/souper-harvest Harvest left-hand side superoptimization candidates

view details

Nick Fitzgerald

commit sha 31cbbd1d209f62b6513232b66ecdda66c3e00969

clif-util: Use `anyhow::Error` for errors instead of `String` Also does the same for `cranelift-filetests`.

view details

Nick Fitzgerald

commit sha ed38348b222ff3a41405ed67b94dcdcc13028fe1

clif-util: Switch to using `structopt` for CLI arguments

view details

Nick Fitzgerald

commit sha d32b2c82f8e6876a77e26d01e520c4ba3abb9430

CI: Don't enforce builds work with rustc 1.43.0 for `clif-util` `clif-util` doesn't get used in SpiderMonkey, so it doesn't need to work with rustc 1.43.0.

view details

Nick Fitzgerald

commit sha a923ecae9ea5ad4bc22af7e1667f34c507f30985

clif-util: Fix typo in subcommand description Co-authored-by: Andrew Brown <andrew.brown@intel.com>

view details

Nick Fitzgerald

commit sha 379aed8092cd1241ec7839e77d05557b1dceb234

Merge pull request #2203 from fitzgen/clean-up-clif-util Clean up `clif-util`: use anyhow and structopt

view details

Joshua Nelson

commit sha d28abad44119fdac9cb3fa0bc086630b5ea49d7d

Upgrade to target-lexicon 0.11 This allows downstream library users to use `CDataModel` without having to install two different versions of target-lexicon.

view details

Chris Fallin

commit sha 1c7fa7f7856eb8444ce7db60ca00fd9529d5ead5

Merge pull request #2181 from jgouly/madd-opt arm64: Combine mul + add into madd

view details

Pat Hickey

commit sha 7bfc4597a0141f3f54f27e13e3f32576d2046ba7

Merge pull request #2201 from bytecodealliance/pch/wasi_common_move_type_imports wasi-common: code motion around type imports

view details

Pat Hickey

commit sha f055877c2cff7f54e2df9343770120328c247766

move fd and path from wasi_snapshot_preview1 into Entry methods anything that just requires an entry be in scope is moved to entry/fd.rs and entry/path.rs, which just contain `impl Entry` blocks. Additionally, the bodies of these functions were transformed so that as much GuestPtr dereference as possible happens out in wasi_snapshot_preview1. Entry methods just get a `& T` or `&mut T` passed in. However, there are a few functions where multiple GuestPtrs are passed into a wasi_snapshot_preview1 function. We cannot safely dereference both at once, because it is semantically valid for these memory regions to overlap, but the wiggle borrow checker will refuse to borrow overlapping regions. In these cases, we have to pass the GuestPtr into the Entity method to be dereferenced in a smaller scope where exclusive access is possible.

view details

Pat Hickey

commit sha 1e1a367a5e6aa1d284017f90f01ea7bba6872a18

make the path::get function into method Entry::path_get this is just code motion, but it puts like with like.

view details

push time in 13 days

pull request commentbytecodealliance/wasmtime

wasi-common: code motion around type imports

Thanks! I'm not yet 100% happy with the way sched is structured, #2205 gets it closer.

pchickey

comment created time in 13 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 6db24fd08fa6f675e1b4ef818f8684602fd58730

handle: re-export all of the wasi types used by handles

view details

Pat Hickey

commit sha 66ba582bba5e5f19ed57c0454de1cca8546452ac

sched: re-export the wasi types used for times and events

view details

Pat Hickey

commit sha 5639881519a82157cbc23752c3ed973236bcb702

ctx: import Fd without any types:: prefix

view details

Pat Hickey

commit sha 83c1fa1b8bcc34350eab6139a7f961b1004975fd

entry: import types from handle

view details

Pat Hickey

commit sha e47927f0fd6c983d55b0b7187c1b18bd565fa232

fs: only import wasi Fd type in one place

view details

Pat Hickey

commit sha e5129b39cb00c7ea0ec4863e8b73fb2e0fc869c0

path: import types from handle rather than wasi

view details

Pat Hickey

commit sha 4763678be2477ddf6074337fabb964a70d3d8108

sys: import types from handle or sched, not wasi. drop types:: prefix.

view details

Pat Hickey

commit sha b72d5de86c7618f2e5d7454e16cee59fc0465c85

virtfs: import types from handle, drop types:: prefix

view details

Pat Hickey

commit sha 7bfc4597a0141f3f54f27e13e3f32576d2046ba7

Merge pull request #2201 from bytecodealliance/pch/wasi_common_move_type_imports wasi-common: code motion around type imports

view details

push time in 13 days

delete branch bytecodealliance/wasmtime

delete branch : pch/wasi_common_move_type_imports

delete time in 13 days

PR merged bytecodealliance/wasmtime

wasi-common: code motion around type imports wasi

This PR should be NFC (no functional change) - just code motion.

The wiggle transformation of wasi-common saw us import the generated types all over the crate via use crate::wasi::types;. In order to make the crate more agile for future changes to the way we do wiggle codegen for supporting multiple snapshots, this PR sets in place the design pattern that:

  • only the handle, fd, and sched modules get to import types from the wiggle codegen
  • all other modules import the types they need from those modules
  • drop the types:: prefix everywhere we can

We ignore this rule in snapshots::wasi_snapshot_preview1 because we'll be making more changes to that soon.

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+660 -728

1 comment

38 changed files

pchickey

pr closed time in 13 days

PR opened bytecodealliance/lucet

lucet-wasi executable: add tracing_subscriber

required for e.g. RUST_LOG=wasi-common=trace

+106 -2

0 comment

3 changed files

pr created time in 13 days

create barnchbytecodealliance/lucet

branch : pch/lucet_wasi_tracing

created branch time in 13 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha cfdeff1d95269dea503d811a09455c8b5509d363

windows poll: transform to not pass mut vec everywhere NFC, should work exactly the same, just trying to factor

view details

push time in 13 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 75c0e23b869bdd0ff50c2f14b176b00db47a9f2f

windows poll: it would help if i ever built this code before committing it

view details

push time in 13 days

PR opened bytecodealliance/wasmtime

wasi-common: poll_oneoff is factored part-way into sched, and error handling is changed

based on #2201 and #2202

prior to this, we would report a missing entry for an fd as an error event, but not a bad capability. why? i think because of the way the code was written.

Also, we'd poll rather than report subscription errors as early as possible. This is an odd choice because maybe none of the non-errored subscriptions would ever come due, leaving the user waiting forever with no error to react to. So, now poll_oneoff returns early if any of the subscriptions were parsed as an error.

The extraction of the Event type and its subordinates from sched and sys is still incomplete. That representation changes in ephemeral and working on this refactoring has made me want to make even more changes to the design of the interface (userdata isnt a good design imho!) so i'm going to hold off on that for a minute till we come up with a better consensus on the design there.

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+1501 -1415

0 comment

40 changed files

pr created time in 14 days

create barnchbytecodealliance/wasmtime

branch : pch/wasi_common_sched_methods

created branch time in 14 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha c444faf34037e7b703422b9761e096fed85a8aa8

fix windows

view details

push time in 14 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 8ac9f8d050729521c691fbc3b6717566a486811a

move fd and path from wasi_snapshot_preview1 into Entry methods anything that just requires an entry be in scope is moved to entry/fd.rs and entry/path.rs, which just contain `impl Entry` blocks. Additionally, the bodies of these functions were transformed so that as much GuestPtr dereference as possible happens out in wasi_snapshot_preview1. Entry methods just get a `& T` or `&mut T` passed in. However, there are a few functions where multiple GuestPtrs are passed into a wasi_snapshot_preview1 function. We cannot safely dereference both at once, because it is semantically valid for these memory regions to overlap, but the wiggle borrow checker will refuse to borrow overlapping regions. In these cases, we have to pass the GuestPtr into the Entity method to be dereferenced in a smaller scope where exclusive access is possible.

view details

Pat Hickey

commit sha adbfb4467270a90f670268bbb7965779b8140a41

make the path::get function into method Entry::path_get this is just code motion, but it puts like with like.

view details

push time in 14 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha a7e671ed7b2d225d3562fafc3a8d71f34c1afb61

make the path::get function into method Entry::path_get this is just code motion, but it puts like with like.

view details

push time in 14 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 891b579f46ad47db7d58f849dd53304f8b096d95

move fd and path from wasi_snapshot_preview1 into Entry methods anything that just requires an entry be in scope is moved to entry/fd.rs and entry/path.rs, which just contain `impl Entry` blocks. Additionally, the bodies of these functions were transformed so that as much GuestPtr dereference as possible happens out in wasi_snapshot_preview1. Entry methods just get a `& T` or `&mut T` passed in. However, there are a few functions where multiple GuestPtrs are passed into a wasi_snapshot_preview1 function. We cannot safely dereference both at once, because it is semantically valid for these memory regions to overlap, but the wiggle borrow checker will refuse to borrow overlapping regions. In these cases, we have to pass the GuestPtr into the Entity method to be dereferenced in a smaller scope where exclusive access is possible.

view details

push time in 14 days

PR closed bytecodealliance/wasmtime

wasi-common: the big refactor for support of ephemeral wasi

There's lots of code motion to happen here.

  • [x] rest of crate should not import from crate::wasi::types - just a few select locations (fd, entry, sched)
  • [ ] juicy bodies of wasi_snapshot_preview1 moves out to entry::fd, entry::path, sched...

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+1170 -1111

2 comments

40 changed files

pchickey

pr closed time in 15 days

pull request commentbytecodealliance/wasmtime

wasi-common: the big refactor for support of ephemeral

This got out of control, I refactored it into #2201 and #2202

pchickey

comment created time in 15 days

PR opened bytecodealliance/wasmtime

wasi common: move fs and path into Entry methods

based on #2201

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+1171 -1113

0 comment

40 changed files

pr created time in 15 days

PR opened bytecodealliance/wasmtime

wasi-common: code motion around type imports

This PR should be NFC (no functional change) - just code motion.

The wiggle transformation of wasi-common saw us import the generated types all over the crate via use crate::wasi::types;. In order to make the crate more agile for future changes to the way we do wiggle codegen for supporting multiple snapshots, this PR sets in place the design pattern that:

  • only the handle, fd, and sched modules get to import types from the wiggle codegen
  • all other modules import the types they need from those modules
  • drop the types:: prefix everywhere we can

We ignore this rule in snapshots::wasi_snapshot_preview1 because we'll be making more changes to that soon.

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+660 -728

0 comment

38 changed files

pr created time in 15 days

create barnchbytecodealliance/wasmtime

branch : pch/wasi_common_move_entry_methods

created branch time in 15 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 6db24fd08fa6f675e1b4ef818f8684602fd58730

handle: re-export all of the wasi types used by handles

view details

Pat Hickey

commit sha 66ba582bba5e5f19ed57c0454de1cca8546452ac

sched: re-export the wasi types used for times and events

view details

Pat Hickey

commit sha 5639881519a82157cbc23752c3ed973236bcb702

ctx: import Fd without any types:: prefix

view details

Pat Hickey

commit sha 83c1fa1b8bcc34350eab6139a7f961b1004975fd

entry: import types from handle

view details

Pat Hickey

commit sha e47927f0fd6c983d55b0b7187c1b18bd565fa232

fs: only import wasi Fd type in one place

view details

Pat Hickey

commit sha e5129b39cb00c7ea0ec4863e8b73fb2e0fc869c0

path: import types from handle rather than wasi

view details

Pat Hickey

commit sha 4763678be2477ddf6074337fabb964a70d3d8108

sys: import types from handle or sched, not wasi. drop types:: prefix.

view details

Pat Hickey

commit sha b72d5de86c7618f2e5d7454e16cee59fc0465c85

virtfs: import types from handle, drop types:: prefix

view details

push time in 15 days

create barnchbytecodealliance/wasmtime

branch : pch/wasi_common_move_type_imports

created branch time in 15 days

push eventbytecodealliance/wasmtime

Alex Crichton

commit sha 38428e1fbb8352c41808b17b842ba8f7d6f7fd89

Expand modules instantiated in instantiate-wasm-smith This commit uses the new `MaybeInvalidModule` type in `wasm-smith` to try to explore more points in the fuzz target space in the `instantiate-maybe-invalid` fuzz target. The goal here is to use the raw fuzz input as the body of a function to stress the validator/decoder a bit more, and try to get inputs we might not otherwise generate.

view details

Nick Fitzgerald

commit sha 3a602994e6e872dba666e2b8f2d5ebec32137396

Merge pull request #2185 from alexcrichton/fuzz-maybe-invalid Expand modules instantiated in instantiate-wasm-smith

view details

Chris Fallin

commit sha e8f772c1ac08bf77a9b0b33eec2fb07bba354db2

x64 new backend: port ABI implementation to shared infrastructure with AArch64. Previously, in #2128, we factored out a common "vanilla 64-bit ABI" implementation from the AArch64 ABI code, with the idea that this should be largely compatible with x64. This PR alters the new x64 backend to make use of the shared infrastructure, removing the duplication that existed previously. The generated code is nearly (not exactly) the same; the only difference relates to how the clobber-save region is padded in the prologue. This also changes some register allocations in the aarch64 code because call support in the shared ABI infra now passes a temp vreg in, rather than requiring use of a fixed, non-allocable temp; tests have been updated, and the runtime behavior is unchanged.

view details

Chris Fallin

commit sha 074a0afa832fe6478c32f8cf321abe6f62351c70

Merge pull request #2142 from cfallin/machinst-abi-x64 x64 new backend: port ABI implementation to shared infrastructure with AArch64.

view details

Anton Kirilov

commit sha f612e8e7b26e88993386378a5077115bed8a4242

AArch64: Add various missing SIMD bits In addition, improve the code for stack pointer manipulation. Copyright (c) 2020, Arm Limited.

view details

Chris Fallin

commit sha d52797a25723e3810c5ea2e5378d47f491a4e25a

Merge pull request #2188 from akirilov-arm/doom3 AArch64: Add various missing SIMD bits

view details

Benjamin Bouvier

commit sha 9c328cc64b5e96df737e6154a984280abb180664

machinst x64: Remove unfinished comment;

view details

Benjamin Bouvier

commit sha 9620ce6bdfd57d0acceadbd0b6a31ebc2b2dd263

machinst x64: mask shift count too;

view details

Benjamin Bouvier

commit sha 6a3c4fb54e06775ff96a9ff4b8b6bd298f116bcc

machinst x64: rename output_to_reg to get_output_reg;

view details

Benjamin Bouvier

commit sha a835c247c03f19499d642110b4d5b145455db532

machinst: make get_output_reg target independent;

view details

Benjamin Bouvier

commit sha 7a833f442ad4922b47ff2b057c57b9465a5a6e79

machinst: common up some instruction data helpers;

view details

Benjamin Bouvier

commit sha cb96d16ac77c4624bfd6c52b1a3ca370de46fc6e

machinst x64: inline helper used only once;

view details

Benjamin Bouvier

commit sha b4a2dd37a4ce3c3cf3f44ca145048caebbec7532

machinst x64: rename input_to_reg to put_input_to_reg; Eventually, we should be able to unify this function's implementation with the aarch64 one; but the latter does much more, and this would require abstractions brought up in another pending PR#2142.

view details

Alex Crichton

commit sha b189321d61b9c63646e7d8359337129ecf1a0312

Actually add instantiate-maybe-invalid fuzz target (#2190) Forgot to add it to the manifest so it didn't actually get built!

view details

Chris Fallin

commit sha bd3ba0a774c888a2c7f2c098af161df00fda9cdf

Merge pull request #2189 from bnjbvr/x64-refactor-sub machinst x64: a few small refactorings/renamings

view details

Benjamin Bouvier

commit sha a1bdf11602784c2ff3d38ebe92f8c8524898bf5d

machinst x64: fix gen_store_base_offset for multi-value returns; The previous method assumed that this could be used only for I64 values, but this is actually used for multi-value returns, which can have any type.

view details

Chris Fallin

commit sha 170a8112c27fb16f1f8f374f05436ad0e3843c24

Merge pull request #2191 from bnjbvr/x64-fix-multivalue-store machinst x64: fix gen_store_base_offset for multi-value returns

view details

Chris Fallin

commit sha 37752760501d29f23f3f302d810bcedaf6d287b2

Update minimum Rust version in CI to 1.43.0. Firefox currently requires vendored Rust code (including Cranelift) to compile on Rust 1.43.0, according to this line: https://searchfox.org/mozilla-central/rev/eb9d5c97927aea75f0c8e38bbc5b5d288099e687/python/mozboot/mozboot/util.py#16 Whenever that version is updated, we can bump this CI check's Rust version accordingly.

view details

Chris Fallin

commit sha ae6693a6380144812d0c8de7dc4bd816b8f679e7

Merge pull request #2193 from cfallin/min-rust-1.43 Update minimum Rust version in CI to 1.43.0.

view details

Nick Fitzgerald

commit sha 443965b95dfcd4d04f70272a12ee4c99e9793fb4

Create a crate for converting Souper optimizations into Peepmatic DSL This crate is currently empty but is hooked up to our CI, the cargo workspace, our publish script, etc.

view details

push time in 15 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha fa6e62c31d7ce284b54c291a97eca366269319e5

fix warming

view details

push time in 15 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 91fe32f350ee93506accc0504fb867d9f1e75320

thats the last of the fd methods. reorganize the file some too

view details

Pat Hickey

commit sha df363f3b9635b9ac05461ac1e6240c0364168f01

start moving path stuff

view details

Pat Hickey

commit sha 12e6ffa14676ed818a11e87fa8271adfee1138e6

move the rest of path

view details

push time in 15 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 6385ab6d070b617245c81c6568d63eff50bbf753

wasi-common: golf fd_readdir to work in terms of &mut [u8]

view details

push time in 20 days

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 12094d966b6668e0eed99c5a492c5932af6b695d

golf

view details

push time in 20 days

push eventbytecodealliance/wasmtime

Joey Gouly

commit sha 650d48cd84f6257d4a5416cf77df6ecb4c63016b

arm64: Don't always materialise a 64-bit constant This improves the mov/movk/movn sequnce when the high half of the 64-bit value is all zero. Copyright (c) 2020, Arm Limited.

view details

Pat Hickey

commit sha 87222d6db0dbaf788b14b298820ebd776e0cdfa5

wasi-common: move GuestPtr deref out of path::get

view details

Pat Hickey

commit sha 6213a05c8557b8b1263d9c2a9ef0e6a3579f8ee9

wiggle: add array indexing methods to GuestPtr<[T]>

view details

Pat Hickey

commit sha 51d88f7899ff8d1c5dc3032a7aac114d265cc905

wasi-common: move implementation of args, env methods into StringArrayWriter

view details

Pat Hickey

commit sha a2eae907010f17347147844b8bd89f6afe41588c

test-all.sh: wasimtime-wasi-c does not exist anymore

view details

Pat Hickey

commit sha fe5d6d59e6989dfc4e76586a1f8b142a1305a901

wasi example: theres lots of useful tracing messages for debugging

view details

Pat Hickey

commit sha 7eb607b07679fda289b4dbd8ba18a4184e7d943a

bugfix!

view details

Pat Hickey

commit sha e98f136adbc40e0f53d4ef400484a619d7f95221

pin nightly toolchain to 2020-08-30 - staticvec is broken with 09-01

view details

Pat Hickey

commit sha f3f61272176586dc68376ea6c4636de5de8c6c77

maybe try nightly 08-25?

view details

Pat Hickey

commit sha 2ef78d0a887530ffd831f13f88a4e15a2c6b6e13

Merge pull request #2182 from bytecodealliance/pch/staticvec_broken_again CI: pin nightly toolchain to 2020-08-31 - staticvec is broken with 09-01

view details

Pat Hickey

commit sha 1047f3ce277023f7cf3f0341c6f183c12487fe19

Merge remote-tracking branch 'origin/main' into pch/wasi_common_array_writer

view details

Pat Hickey

commit sha ddd50f7443ee6f362008e0c302e2d0a489dd3332

fix error report

view details

Pat Hickey

commit sha 82b367295634be310ea07813e83b912154167331

delete extra dep

view details

Pat Hickey

commit sha b63e974014d2f04f2dd5dbaab6f54f5e2136182d

code review fixes

view details

Pat Hickey

commit sha 39f1c9716cf50264d8b72afd6c1de90bd2b9c60c

restructure StringArrayWriter trait into StringArray struct

view details

Pat Hickey

commit sha 1d410d655995e1116958c6752fecb02c53145f1e

move more constructor stuff into stringarray

view details

Pat Hickey

commit sha 580c236dee05992985e0c5aeb18a632ff78c8640

wiggle: implement array get/get_range in terms of ptr/add/as_array hard to get it wrong when you use the safe primitives i already made!

view details

Pat Hickey

commit sha 776f12ae3c0c21e8cda0b7c251c998d35ef0a1c0

tests: exercise array getters

view details

Pat Hickey

commit sha 48fab12142c971405ab1c56fdceadf78bc2bbff4

Merge pull request #2160 from bytecodealliance/pch/wasi_common_array_writer wasi-common: factor out common string array writer code

view details

bjorn3

commit sha ba9908dd0f84207116ef35fbdc42a4f5484efb93

Don't substract 1 from end_addr in line program writing (#2174) * Don't substract 1 from end_addr in line program writing Fixes #2173 * add testcase for end_sequence having offset past retq (#1) * Update tests/all/debug/translate.rs Co-authored-by: Gabor Greif <ggreif@gmail.com> Co-authored-by: Gabor Greif <ggreif@gmail.com>

view details

push time in 21 days

issue commentWebAssembly/WASI

Clarification for implementing Rust-like enums with values, specifically `clockid`

That is another great question - stdin, stdout, and stderr are the first three fds that are preopened. Theyre distinct from other fd preopens that are actually directory fds (they map to a path prefix, not a file).

The subtypes category is a different thing from that concept, the idea there is there will be a type hierarchy (subtyping relationships) between handles, so we can eventaully use the type system to distinguish between directory fds, file fds, stream fds, and so on. That whole aspect of witx and implementations is not fleshed out at all, and probably should not have been added until it was actually going to be used.

As for docs, I think making a markdown file about witx in the /design/ directory of this repo is the way to go. Thank you!

SirJosh3917

comment created time in 25 days

issue commentWebAssembly/WASI

Clarification for implementing Rust-like enums with values, specifically `clockid`

Hi Josh, great questions! First off, I'm sorry that witx docs are lacking - the language and tooling has been evolving, and I've been too busy to write any. The short story is, witx types resemble C more than Rust right now, for historical reasons - the original spec of WASI snapshot 0 was a C header, and we wanted to keep ABI compatibility when we changed the canonical description to be witx. We expect this to evolve when the Interface Types spec and toolchain support lands - many of the same people working on WASI are working on that right now.

Witx enums are c-style - they do not have payloads, they are just an integer where only a subset of values (counting up from 0) are valid. The integer type specified in a union declaration determines its representation in memory. So, clockid is a u32 in memory, whereas errno is a u16. (In the particular case of clockid, its wasteful to use 4 bytes to represent 4 variants, but thats what we got stuck with for compatibility.)

Witx unions are for rust-style enums that have different types for each variant. The union requires a witx enum type be provided for use as the discriminant. Unions are laid out like a C struct { the_variant_enum tag; union { variant_type_1 variant1; ... } u; }.

If you're using the witx crate to parse and validate, the Layout trait on AST nodes will provide the size and alignment of any datatype, and there are special UnionLayout and StructMemberLayout types that describe the interiors of unions and structs.

SirJosh3917

comment created time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 87222d6db0dbaf788b14b298820ebd776e0cdfa5

wasi-common: move GuestPtr deref out of path::get

view details

Pat Hickey

commit sha 6213a05c8557b8b1263d9c2a9ef0e6a3579f8ee9

wiggle: add array indexing methods to GuestPtr<[T]>

view details

Pat Hickey

commit sha 51d88f7899ff8d1c5dc3032a7aac114d265cc905

wasi-common: move implementation of args, env methods into StringArrayWriter

view details

Pat Hickey

commit sha a2eae907010f17347147844b8bd89f6afe41588c

test-all.sh: wasimtime-wasi-c does not exist anymore

view details

Pat Hickey

commit sha fe5d6d59e6989dfc4e76586a1f8b142a1305a901

wasi example: theres lots of useful tracing messages for debugging

view details

Pat Hickey

commit sha 7eb607b07679fda289b4dbd8ba18a4184e7d943a

bugfix!

view details

Pat Hickey

commit sha 1047f3ce277023f7cf3f0341c6f183c12487fe19

Merge remote-tracking branch 'origin/main' into pch/wasi_common_array_writer

view details

Pat Hickey

commit sha ddd50f7443ee6f362008e0c302e2d0a489dd3332

fix error report

view details

Pat Hickey

commit sha 82b367295634be310ea07813e83b912154167331

delete extra dep

view details

Pat Hickey

commit sha b63e974014d2f04f2dd5dbaab6f54f5e2136182d

code review fixes

view details

Pat Hickey

commit sha 39f1c9716cf50264d8b72afd6c1de90bd2b9c60c

restructure StringArrayWriter trait into StringArray struct

view details

Pat Hickey

commit sha 1d410d655995e1116958c6752fecb02c53145f1e

move more constructor stuff into stringarray

view details

Pat Hickey

commit sha 580c236dee05992985e0c5aeb18a632ff78c8640

wiggle: implement array get/get_range in terms of ptr/add/as_array hard to get it wrong when you use the safe primitives i already made!

view details

Pat Hickey

commit sha 776f12ae3c0c21e8cda0b7c251c998d35ef0a1c0

tests: exercise array getters

view details

Pat Hickey

commit sha 48fab12142c971405ab1c56fdceadf78bc2bbff4

Merge pull request #2160 from bytecodealliance/pch/wasi_common_array_writer wasi-common: factor out common string array writer code

view details

push time in a month

delete branch bytecodealliance/wasmtime

delete branch : pch/wasi_common_array_writer

delete time in a month

PR merged bytecodealliance/wasmtime

Reviewers
wasi-common: factor out common string array writer code wasi

The args and environ methods duplicated code, so I factored it into a trait impled on Vec<CString>. It could easily be impled for Vec<String> if we wanted to, but there doesn't seem to be much reason to refactor it further now.

As part of the factoring I added slice accessors get and get_range to wiggle::GuestPtr<[T]>, which seem useful.

My current goal is to make snapshots/wasi_snapshot_preview1.rs as uninteresting as possible. This was one small chunk that could be moved out. We expect this code to work essentially the same across all snapshots, until interface types change the way we write arrays of strings into the guest.

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+551 -222

2 comments

15 changed files

pchickey

pr closed time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 580c236dee05992985e0c5aeb18a632ff78c8640

wiggle: implement array get/get_range in terms of ptr/add/as_array hard to get it wrong when you use the safe primitives i already made!

view details

Pat Hickey

commit sha 776f12ae3c0c21e8cda0b7c251c998d35ef0a1c0

tests: exercise array getters

view details

push time in a month

issue commentbytecodealliance/wasi

Publish witx-bindgen to crates.io

Yes, we should publish it - I will defer to @alexcrichton but if he is busy I can take care of it

abrown

comment created time in a month

Pull request review commentbytecodealliance/wasmtime

wasi-common: factor out common string array writer code

 impl<'a, T> GuestPtr<'a, [T]> {     pub fn as_ptr(&self) -> GuestPtr<'a, T> {         GuestPtr::new(self.mem, self.offset_base())     }++    pub fn get(&self, index: u32) -> Option<GuestPtr<'a, T>> {+        if index < self.len() {+            Some(GuestPtr::new(self.mem, self.offset_base() + index))

Thanks, I completely missed that. Clearly I'm not smart enough to write or maintain this code without tests, and since the only ones i have currently are in wasi-common and use GuestPtr<[u8]>, ill add some others to the wiggle tree that use non-byte-sized elements and make sure its done right.

pchickey

comment created time in a month

PullRequestReviewEvent

pull request commentbytecodealliance/wasmtime

wasi-common: factor out common string array writer code

I followed the struct plan that your comment spurred, which allowed me to simplify the runtime behavior by reporting more errors at wasictx construction time. I moved some of the gnarly construction and error reporting stuff out of ctx.rs which seems like a win.

pchickey

comment created time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 1d410d655995e1116958c6752fecb02c53145f1e

move more constructor stuff into stringarray

view details

push time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 39f1c9716cf50264d8b72afd6c1de90bd2b9c60c

restructure StringArrayWriter trait into StringArray struct

view details

push time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha b63e974014d2f04f2dd5dbaab6f54f5e2136182d

code review fixes

view details

push time in a month

Pull request review commentbytecodealliance/wasmtime

wasi-common: factor out common string array writer code

 impl<'a, T> GuestPtr<'a, [T]> {     pub fn as_ptr(&self) -> GuestPtr<'a, T> {         GuestPtr::new(self.mem, self.offset_base())     }++    pub fn get(&self, index: u32) -> Option<GuestPtr<'a, T>> {+        if index < self.len() {+            Some(GuestPtr::new(self.mem, self.offset_base() + index))

len() is in units (correcting this to elements in the doc strings, not bytes, so I dont think we need to multiply by the size.

pchickey

comment created time in a month

PullRequestReviewEvent

Pull request review commentbytecodealliance/wasmtime

wasi-common: factor out common string array writer code

 impl<'a, T> GuestPtr<'a, [T]> {     pub fn as_ptr(&self) -> GuestPtr<'a, T> {         GuestPtr::new(self.mem, self.offset_base())     }++    pub fn get(&self, index: u32) -> Option<GuestPtr<'a, T>> {+        if index < self.len() {+            Some(GuestPtr::new(self.mem, self.offset_base() + index))+        } else {+            None+        }+    }++    pub fn get_range(&self, r: std::ops::Range<u32>) -> Option<GuestPtr<'a, [T]>> {+        let range_length = r.end - r.start;+        if r.start <= self.len() && r.end <= self.len() {

I was under the mistaken impression that this was guaranteed by Range construction, I'll correct that

pchickey

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentbytecodealliance/wasmtime

wasi-common: factor out common string array writer code

+use crate::{Error, Result};+use std::convert::TryInto;+use std::ffi::CString;+use wiggle::GuestPtr;++pub trait StringArrayWriter {

My thought was we would eventually support different representations than Vec<CString> here as part of modularization. It seemed like a reasonable way to hang three methods onto some existing struct members. But maybe instead of WasiCtx { args: Vec<CString>, env: Vec<CString> } we could make this struct StringArray(Vec<String>) that just has these three pub methods?

pchickey

comment created time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 82b367295634be310ea07813e83b912154167331

delete extra dep

view details

push time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha ddd50f7443ee6f362008e0c302e2d0a489dd3332

fix error report

view details

push time in a month

issue closedbytecodealliance/wasmtime

CI breaks on staticvec compile for lightbeam

CI fails in nightly due to a failure while compiling StaticVec. However when I build with nightly 1.48 2020-08-28 local I do not get this failure and have no problems building. The CI is using nightly 1.48 from 2020-09-01. Staticvec is at it's latest version of v10.2 so nothing to update there. Anyone with pointers here?

https://github.com/bytecodealliance/wasmtime/pull/2180/checks?check_run_id=1062989787 https://github.com/bytecodealliance/wasmtime/pull/2180

closed time in a month

jlb6740

issue commentbytecodealliance/wasmtime

CI breaks on staticvec compile for lightbeam

Fixed by #2182

jlb6740

comment created time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha e98f136adbc40e0f53d4ef400484a619d7f95221

pin nightly toolchain to 2020-08-30 - staticvec is broken with 09-01

view details

Pat Hickey

commit sha f3f61272176586dc68376ea6c4636de5de8c6c77

maybe try nightly 08-25?

view details

Pat Hickey

commit sha 2ef78d0a887530ffd831f13f88a4e15a2c6b6e13

Merge pull request #2182 from bytecodealliance/pch/staticvec_broken_again CI: pin nightly toolchain to 2020-08-31 - staticvec is broken with 09-01

view details

Pat Hickey

commit sha 1047f3ce277023f7cf3f0341c6f183c12487fe19

Merge remote-tracking branch 'origin/main' into pch/wasi_common_array_writer

view details

push time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha e98f136adbc40e0f53d4ef400484a619d7f95221

pin nightly toolchain to 2020-08-30 - staticvec is broken with 09-01

view details

Pat Hickey

commit sha f3f61272176586dc68376ea6c4636de5de8c6c77

maybe try nightly 08-25?

view details

Pat Hickey

commit sha 2ef78d0a887530ffd831f13f88a4e15a2c6b6e13

Merge pull request #2182 from bytecodealliance/pch/staticvec_broken_again CI: pin nightly toolchain to 2020-08-31 - staticvec is broken with 09-01

view details

push time in a month

delete branch bytecodealliance/wasmtime

delete branch : pch/staticvec_broken_again

delete time in a month

PR merged bytecodealliance/wasmtime

CI: pin nightly toolchain to 2020-08-31 - staticvec is broken with 09-01

with nightly-2020-09-01, staticvec fails to build, which breaks CI.

We can revert this in a few days whenever it gets fixed in nightly.

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+4 -4

1 comment

1 changed file

pchickey

pr closed time in a month

pull request commentbytecodealliance/wasmtime

CI: pin nightly toolchain to 2020-08-31 - staticvec is broken with 09-01

I don't know anything about staticvec or nightly, but it is a nightly-only crate that is only used by lightbeam. So, I don't think it being broken, or this fix of CI, will have a negative impact on any production cranelift or wasmtime. We can try reverting it to use the latest nightly, or the latest staticvec release, in a little bit.

pchickey

comment created time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha f3f61272176586dc68376ea6c4636de5de8c6c77

maybe try nightly 08-25?

view details

push time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha e98f136adbc40e0f53d4ef400484a619d7f95221

pin nightly toolchain to 2020-08-30 - staticvec is broken with 09-01

view details

push time in a month

PR opened bytecodealliance/wasmtime

CI: pin nightly toolchain to 2020-08-31 - staticvec is broken with 09-01

with nightly-2020-09-01, staticvec fails to build, which breaks CI.

We can revert this in a few days whenever it gets fixed in nightly.

<!--

Please ensure that the following steps are all taken care of before submitting the PR.

  • [ ] This has been discussed in issue #..., or if not, please tell us why here.
  • [ ] A short description of what this does, why it is needed; if the description becomes long, the matter should probably be discussed in an issue first.
  • [ ] This PR contains test cases, if meaningful.
  • [ ] A reviewer from the core maintainer team has been assigned for this PR. If you don't know who could review this, please indicate so. The list of suggested reviewers on the right can help you.

Please ensure all communication adheres to the code of conduct. -->

+4 -4

0 comment

1 changed file

pr created time in a month

create barnchbytecodealliance/wasmtime

branch : pch/staticvec_broken_again

created branch time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha 7eb607b07679fda289b4dbd8ba18a4184e7d943a

bugfix!

view details

push time in a month

push eventbytecodealliance/wasmtime

Pat Hickey

commit sha fe5d6d59e6989dfc4e76586a1f8b142a1305a901

wasi example: theres lots of useful tracing messages for debugging

view details

Pat Hickey

commit sha 065e2259d481a25a0484bff266480530bfb43871

bugfix!

view details

push time in a month

more