profile
viewpoint

alanz/Blobs 5

Blobs from http://www.cs.york.ac.uk/fp/darcs/Blobs/

alanz/cabal-ast-play 4

Playing with annotations on experimental cabal AST

alanz/authenticate 2

Authentication methods for Haskell web applications.

alanz/brittany 2

haskell source code formatter

alanz/cloud-haskell-play 2

Playing with cloud haskell http://haskell-distributed.github.io/

alanz/aeon 1

An HD interface for XBMC

alanz/annotations-play 1

Playing with http://hackage.haskell.org/package/Annotations-0.2

alanz/aws-dynamodb-play 1

Working through AWS getting started example

alanz/bnfc 1

BNF Converter

PR closed wasmerio/wasmer

Reviewers
Improved Metering

Description

This PR refactors the Metering middleware to address the issues described in #999. In short, the current metering does not prevent execution of code segments that exceed the limit, but instead only checks if limits are exceeded after execution of the code segment. Additionally the current metering does not catch some situations where the limit exceeded in the last few instructions of a function.

This metering injects limit checks prior to each code segment, ensure that execution does not proceed if there is not enough gas to reach the next branching instruction. Although after an ExecutionLimitExceededError the reported gas used will be greater than the limit, the execution will not have actually proceeded through that code segment.

Additionally, this metering will check further ahead than eWasm metering in certain circumstances.

For example if we have multiple nested loops in a block without any branching instructions,

METER
Block
    ... // no branching ops
    Loop
        METER
        ... // no branching ops
        Loop
            METER
            ...
            IF // first branching op since first METER
                ...
            END
        End
    End
End

Each METER represents injected metering code that adds the cost of the next segment to the used points and checks it against the limit, trapping if exceeded.

Each METER that I listed will actually ensure that there is enough gas to reach the first branching op, which in my above example is IF.

I'm happy to answer more questions about the Metering design. I believe it would benefit from additional tests that use more complex wasm code.

Implementation details

In order to implement this metering as such, a refactor of parse::read_module() and codegen::MiddlewareChain.run() and codegen::EventSink was required.

This metering algorithm requires the ability to modify previously seen Events that have already been pushed onto the EventSink inside of feed_event. This means that this middleware chain needs to see all of the Events within a function prior to any subsequent chains seeing any of the Events. Additionally this means that all ParserState(Operator) events for a given function need to all be loaded into memory at the same time.

In parse::read_module, I clone each Operator and store them in an events Vec<Event>. I load a complete function and then I pass the whole events Ven to MiddlewareChain.run(), which passes all events through each middleware chain.

Unfortunately wasmparser::Operator does not implement clone, so I had to fork it and add the trait. I have opened an issue on the latest wasmparser but for compatability I applied my patch to the version that is currently being used.

Issues

Currently my refactor of parse::read_module and codegen::MiddlewareChain.run breaks the singlepass backend. This is not due to the metering code but due to my refactor of the runtime-core, as I have isolated that patch in testing. Alternatively you can just comment out the line that adds the metering middleware entirely from the middleware-common-tests to show that the issue lies deeper.

When running the middleware-common-tests compilation fails with singlepass I get the following failure:

Errors were encountered when committing before finalization: UnknownLabel(Dynamic(DynamicLabel(3)))

https://gist.github.com/AdamSLevy/455d2a50ec1211d20efaebcd9c06eb1c#file-gistfile1-txt-L42-L102

I have compared my code very closely with the master branch and I am 99% certain that all mcg and fcg functions are being called in the proper order in my refactor. The only difference I can see is that the Events are now all WasmOwned.

However my metering code works perfectly with the LLVM backend. I have been working with @MarkMcCaskey to come up with this refactor and I have run into this issue and can't work past it as I believe it would require me to learn the singlepass backend and the dynasmrt Assembler.

Review

  • [ ] Add a short description of the the change to the CHANGELOG.md file
+333 -111

24 comments

8 changed files

AdamSLevy

pr closed time in 3 minutes

pull request commentwasmerio/wasmer

Improved Metering

Yeah, this PR is outdated now as is based on the Wasmer 0.x codebase which doesn't include the new structure brought by the refactor for 1.0.

I believe the essence is in included in the new metering schema. Here's the new code in case is useful for review: https://github.com/wasmerio/wasmer/blob/master/lib/middlewares/src/metering.rs#L182-L216

New PRs would be more than welcome for improving the current metering middleware. Closing this PR now :)

AdamSLevy

comment created time in 3 minutes

push eventwasmerio/wasmer

Ivan Enderlin

commit sha 5c9d0230232cd6683e915f3c12747d501ee985ec

chore(vm) Extract `InstanceRef` into its own module.

view details

Ivan Enderlin

commit sha b802d08d79dcebb117e7e51629b6d49966c85f97

chore(vm) Remove a warning.

view details

Ivan Enderlin

commit sha 6fcb7de4c673f41e40475af560e40f502978d580

feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets`. The idea is to share the `VMOffsets` of a given `Instance` through `InstanceHandle` for advanced users. See https://github.com/wasmerio/wasmer/issues/2032.

view details

Ivan Enderlin

commit sha 29ae67da996d3c60bd18776f8dffd201ea508e4c

doc(changelog) Add #2040.

view details

Mark McCaskey

commit sha 0c1331417903e111e1f879591d1eddc49f33cdd0

Add `wasm_config_delete` to the Wasm C API

view details

dependabot[bot]

commit sha 24751ab85bf2996d2fa0466c0cf1db74e5b3e69c

Bump orbclient from 0.3.27 to 0.3.30 Bumps orbclient from 0.3.27 to 0.3.30. Signed-off-by: dependabot[bot] <support@github.com>

view details

bors[bot]

commit sha fa0938ca96399368e6eac8f1d8c2230cdd3b333c

Merge #2040 2040: feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets` r=Hywan a=Hywan # Description This PR adds `Instance::offets` and `InstanceHandle::vmoffsets`. It fixes #2032. This PR also cleans up the `mod.rs` module by extracting the `InstanceRef` implementation into its own `ref.rs` module. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Ivan Enderlin

commit sha 70c31068be86c2c0d9bfbcc278817f7d541888f4

fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr`. First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before.

view details

Ivan Enderlin

commit sha 79e55927b412bebad88ba8990e038ac31367a001

chore(c-api) Update headers.

view details

Ivan Enderlin

commit sha 63107661a525dba92c94822c0fef6de08e15a784

Merge branch 'master' into fix-c-api-wasi-inherited-std

view details

Ivan Enderlin

commit sha ec6424d5dc2bbef48ed0609399952fb41eaebc87

doc(changelog) Add #2059.

view details

Ivan Enderlin

commit sha 4688d9b369bda6d1881f4e1fdedc1127af36ef80

chore(c-api) Disable `wasi_config_capture_stdin` for the moment`.

view details

Ivan Enderlin

commit sha 07e5758c93b7522a53b82349dcb24b30d6cf2afd

doc(changelog) Update #2059.

view details

bors[bot]

commit sha ee328e064ccc4f32ac1f59c7972b715818dc250d

Merge #2059 2059: fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr` r=Hywan a=Hywan # Description This patch is both a fix and a feature! First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Mark McCaskey

commit sha c84059fe377acc9c9e1af74aa560370585f55c9c

Add `wasm_config_delete` addition to changelog

view details

bors[bot]

commit sha 2d57f310374dd95f5728b6cfa806e7c8f020761f

Merge #2054 2054: Add `wasm_config_delete` to the Wasm C API r=MarkMcCaskey a=MarkMcCaskey Fixes 1 missing import reported in #2052 This function is relatively new to the Wasm C API and its implementation is trivial Co-authored-by: Mark McCaskey <mark@wasmer.io>

view details

Syrus Akbary

commit sha ff237fb1dbaf8eec7b432e897a4f307251e4c9a2

Merge pull request #2057 from wasmerio/dependabot/cargo/orbclient-0.3.30 Bump orbclient from 0.3.27 to 0.3.30

view details

dependabot[bot]

commit sha 2bdb6392d1530c5d37d175b9286e6534ab4370fc

Bump wast from 24.0.0 to 28.0.0 Bumps [wast](https://github.com/bytecodealliance/wasm-tools) from 24.0.0 to 28.0.0. - [Release notes](https://github.com/bytecodealliance/wasm-tools/releases) - [Commits](https://github.com/bytecodealliance/wasm-tools/compare/wast-24.0.0...wast-28.0.0) Signed-off-by: dependabot[bot] <support@github.com>

view details

push time in 6 minutes

push eventwasmerio/wasmer

Ivan Enderlin

commit sha 5c9d0230232cd6683e915f3c12747d501ee985ec

chore(vm) Extract `InstanceRef` into its own module.

view details

Ivan Enderlin

commit sha b802d08d79dcebb117e7e51629b6d49966c85f97

chore(vm) Remove a warning.

view details

Ivan Enderlin

commit sha 6fcb7de4c673f41e40475af560e40f502978d580

feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets`. The idea is to share the `VMOffsets` of a given `Instance` through `InstanceHandle` for advanced users. See https://github.com/wasmerio/wasmer/issues/2032.

view details

Ivan Enderlin

commit sha 29ae67da996d3c60bd18776f8dffd201ea508e4c

doc(changelog) Add #2040.

view details

Mark McCaskey

commit sha 0c1331417903e111e1f879591d1eddc49f33cdd0

Add `wasm_config_delete` to the Wasm C API

view details

dependabot[bot]

commit sha 24751ab85bf2996d2fa0466c0cf1db74e5b3e69c

Bump orbclient from 0.3.27 to 0.3.30 Bumps orbclient from 0.3.27 to 0.3.30. Signed-off-by: dependabot[bot] <support@github.com>

view details

bors[bot]

commit sha fa0938ca96399368e6eac8f1d8c2230cdd3b333c

Merge #2040 2040: feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets` r=Hywan a=Hywan # Description This PR adds `Instance::offets` and `InstanceHandle::vmoffsets`. It fixes #2032. This PR also cleans up the `mod.rs` module by extracting the `InstanceRef` implementation into its own `ref.rs` module. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Ivan Enderlin

commit sha 70c31068be86c2c0d9bfbcc278817f7d541888f4

fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr`. First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before.

view details

Ivan Enderlin

commit sha 79e55927b412bebad88ba8990e038ac31367a001

chore(c-api) Update headers.

view details

Ivan Enderlin

commit sha 63107661a525dba92c94822c0fef6de08e15a784

Merge branch 'master' into fix-c-api-wasi-inherited-std

view details

Ivan Enderlin

commit sha ec6424d5dc2bbef48ed0609399952fb41eaebc87

doc(changelog) Add #2059.

view details

Ivan Enderlin

commit sha 4688d9b369bda6d1881f4e1fdedc1127af36ef80

chore(c-api) Disable `wasi_config_capture_stdin` for the moment`.

view details

Ivan Enderlin

commit sha 07e5758c93b7522a53b82349dcb24b30d6cf2afd

doc(changelog) Update #2059.

view details

bors[bot]

commit sha ee328e064ccc4f32ac1f59c7972b715818dc250d

Merge #2059 2059: fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr` r=Hywan a=Hywan # Description This patch is both a fix and a feature! First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Mark McCaskey

commit sha c84059fe377acc9c9e1af74aa560370585f55c9c

Add `wasm_config_delete` addition to changelog

view details

bors[bot]

commit sha 2d57f310374dd95f5728b6cfa806e7c8f020761f

Merge #2054 2054: Add `wasm_config_delete` to the Wasm C API r=MarkMcCaskey a=MarkMcCaskey Fixes 1 missing import reported in #2052 This function is relatively new to the Wasm C API and its implementation is trivial Co-authored-by: Mark McCaskey <mark@wasmer.io>

view details

Syrus Akbary

commit sha ff237fb1dbaf8eec7b432e897a4f307251e4c9a2

Merge pull request #2057 from wasmerio/dependabot/cargo/orbclient-0.3.30 Bump orbclient from 0.3.27 to 0.3.30

view details

dependabot[bot]

commit sha bf540d86c3398e9a911a3611e77a973c6143587d

Bump gimli from 0.22.0 to 0.23.0 Bumps [gimli](https://github.com/gimli-rs/gimli) from 0.22.0 to 0.23.0. - [Release notes](https://github.com/gimli-rs/gimli/releases) - [Changelog](https://github.com/gimli-rs/gimli/blob/master/CHANGELOG.md) - [Commits](https://github.com/gimli-rs/gimli/compare/0.22.0...0.23.0) Signed-off-by: dependabot[bot] <support@github.com>

view details

push time in 6 minutes

push eventwasmerio/wasmer

Ivan Enderlin

commit sha 5c9d0230232cd6683e915f3c12747d501ee985ec

chore(vm) Extract `InstanceRef` into its own module.

view details

Ivan Enderlin

commit sha b802d08d79dcebb117e7e51629b6d49966c85f97

chore(vm) Remove a warning.

view details

Ivan Enderlin

commit sha 6fcb7de4c673f41e40475af560e40f502978d580

feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets`. The idea is to share the `VMOffsets` of a given `Instance` through `InstanceHandle` for advanced users. See https://github.com/wasmerio/wasmer/issues/2032.

view details

Ivan Enderlin

commit sha 29ae67da996d3c60bd18776f8dffd201ea508e4c

doc(changelog) Add #2040.

view details

Mark McCaskey

commit sha 0c1331417903e111e1f879591d1eddc49f33cdd0

Add `wasm_config_delete` to the Wasm C API

view details

dependabot[bot]

commit sha 24751ab85bf2996d2fa0466c0cf1db74e5b3e69c

Bump orbclient from 0.3.27 to 0.3.30 Bumps orbclient from 0.3.27 to 0.3.30. Signed-off-by: dependabot[bot] <support@github.com>

view details

bors[bot]

commit sha fa0938ca96399368e6eac8f1d8c2230cdd3b333c

Merge #2040 2040: feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets` r=Hywan a=Hywan # Description This PR adds `Instance::offets` and `InstanceHandle::vmoffsets`. It fixes #2032. This PR also cleans up the `mod.rs` module by extracting the `InstanceRef` implementation into its own `ref.rs` module. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Ivan Enderlin

commit sha 70c31068be86c2c0d9bfbcc278817f7d541888f4

fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr`. First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before.

view details

Ivan Enderlin

commit sha 79e55927b412bebad88ba8990e038ac31367a001

chore(c-api) Update headers.

view details

Ivan Enderlin

commit sha 63107661a525dba92c94822c0fef6de08e15a784

Merge branch 'master' into fix-c-api-wasi-inherited-std

view details

Ivan Enderlin

commit sha ec6424d5dc2bbef48ed0609399952fb41eaebc87

doc(changelog) Add #2059.

view details

Ivan Enderlin

commit sha 4688d9b369bda6d1881f4e1fdedc1127af36ef80

chore(c-api) Disable `wasi_config_capture_stdin` for the moment`.

view details

Ivan Enderlin

commit sha 07e5758c93b7522a53b82349dcb24b30d6cf2afd

doc(changelog) Update #2059.

view details

bors[bot]

commit sha ee328e064ccc4f32ac1f59c7972b715818dc250d

Merge #2059 2059: fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr` r=Hywan a=Hywan # Description This patch is both a fix and a feature! First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Mark McCaskey

commit sha c84059fe377acc9c9e1af74aa560370585f55c9c

Add `wasm_config_delete` addition to changelog

view details

bors[bot]

commit sha 2d57f310374dd95f5728b6cfa806e7c8f020761f

Merge #2054 2054: Add `wasm_config_delete` to the Wasm C API r=MarkMcCaskey a=MarkMcCaskey Fixes 1 missing import reported in #2052 This function is relatively new to the Wasm C API and its implementation is trivial Co-authored-by: Mark McCaskey <mark@wasmer.io>

view details

Syrus Akbary

commit sha ff237fb1dbaf8eec7b432e897a4f307251e4c9a2

Merge pull request #2057 from wasmerio/dependabot/cargo/orbclient-0.3.30 Bump orbclient from 0.3.27 to 0.3.30

view details

dependabot[bot]

commit sha c2a3b49c257a5b4b032831bc09c87949f953873a

Bump wasmparser from 0.65.0 to 0.73.0 Bumps [wasmparser](https://github.com/bytecodealliance/wasm-tools) from 0.65.0 to 0.73.0. - [Release notes](https://github.com/bytecodealliance/wasm-tools/releases) - [Commits](https://github.com/bytecodealliance/wasm-tools/commits/wasmparser-0.73.0) Signed-off-by: dependabot[bot] <support@github.com>

view details

push time in 6 minutes

push eventwasmerio/wasmer

Ivan Enderlin

commit sha 5c9d0230232cd6683e915f3c12747d501ee985ec

chore(vm) Extract `InstanceRef` into its own module.

view details

Ivan Enderlin

commit sha b802d08d79dcebb117e7e51629b6d49966c85f97

chore(vm) Remove a warning.

view details

Ivan Enderlin

commit sha 6fcb7de4c673f41e40475af560e40f502978d580

feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets`. The idea is to share the `VMOffsets` of a given `Instance` through `InstanceHandle` for advanced users. See https://github.com/wasmerio/wasmer/issues/2032.

view details

Ivan Enderlin

commit sha 29ae67da996d3c60bd18776f8dffd201ea508e4c

doc(changelog) Add #2040.

view details

Mark McCaskey

commit sha 0c1331417903e111e1f879591d1eddc49f33cdd0

Add `wasm_config_delete` to the Wasm C API

view details

dependabot[bot]

commit sha 24751ab85bf2996d2fa0466c0cf1db74e5b3e69c

Bump orbclient from 0.3.27 to 0.3.30 Bumps orbclient from 0.3.27 to 0.3.30. Signed-off-by: dependabot[bot] <support@github.com>

view details

bors[bot]

commit sha fa0938ca96399368e6eac8f1d8c2230cdd3b333c

Merge #2040 2040: feat(vm) Add `Instance::offsets` and `InstanceHandle::vmoffsets` r=Hywan a=Hywan # Description This PR adds `Instance::offets` and `InstanceHandle::vmoffsets`. It fixes #2032. This PR also cleans up the `mod.rs` module by extracting the `InstanceRef` implementation into its own `ref.rs` module. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Ivan Enderlin

commit sha 70c31068be86c2c0d9bfbcc278817f7d541888f4

fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr`. First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before.

view details

Ivan Enderlin

commit sha 79e55927b412bebad88ba8990e038ac31367a001

chore(c-api) Update headers.

view details

Ivan Enderlin

commit sha 63107661a525dba92c94822c0fef6de08e15a784

Merge branch 'master' into fix-c-api-wasi-inherited-std

view details

Ivan Enderlin

commit sha ec6424d5dc2bbef48ed0609399952fb41eaebc87

doc(changelog) Add #2059.

view details

Ivan Enderlin

commit sha 4688d9b369bda6d1881f4e1fdedc1127af36ef80

chore(c-api) Disable `wasi_config_capture_stdin` for the moment`.

view details

Ivan Enderlin

commit sha 07e5758c93b7522a53b82349dcb24b30d6cf2afd

doc(changelog) Update #2059.

view details

bors[bot]

commit sha ee328e064ccc4f32ac1f59c7972b715818dc250d

Merge #2059 2059: fix(wasi) Fix the logic behind inherited/captured `stdin`, `stdout` and `stderr` r=Hywan a=Hywan # Description This patch is both a fix and a feature! First, let's no longer derive from `Default` for `wasi_config_t`. By default, we want to inherit `stdin`, `stdout` and `stderr`. The default for `bool` is `false`; we want `true` here. Second, let's update `wasi_config_new` to correctly set `inherit_*` fields to `true`. Third, lets' create `wasi_config_capture_*` functions. By default, `std*` are inherited, so we need functions to capture them. That's the new feature this patch introduces. The `wasi_config_inherit_*` functions are kept for the sake of backward compatibility. Ideally, we would want an API like `wasi_config_capture_*(capture: bool)`, but it would duplicate the API somehow. Fourth, let's fix `wasi_env_new`. We want to capture `stdout` and `stderr` if and only if the `inherit_*` fields are set to `false`. There was bug here. That's why everything was working correctly by the way: `bool::default()` is `false`, and we have this inverted condition here, so everything was working as expected because of a double error. The only bug was that it wasn't possible to capture `std*` before. # Review - [x] Add a short description of the the change to the CHANGELOG.md file Co-authored-by: Ivan Enderlin <ivan@mnt.io>

view details

Mark McCaskey

commit sha c84059fe377acc9c9e1af74aa560370585f55c9c

Add `wasm_config_delete` addition to changelog

view details

bors[bot]

commit sha 2d57f310374dd95f5728b6cfa806e7c8f020761f

Merge #2054 2054: Add `wasm_config_delete` to the Wasm C API r=MarkMcCaskey a=MarkMcCaskey Fixes 1 missing import reported in #2052 This function is relatively new to the Wasm C API and its implementation is trivial Co-authored-by: Mark McCaskey <mark@wasmer.io>

view details

Syrus Akbary

commit sha ff237fb1dbaf8eec7b432e897a4f307251e4c9a2

Merge pull request #2057 from wasmerio/dependabot/cargo/orbclient-0.3.30 Bump orbclient from 0.3.27 to 0.3.30

view details

dependabot[bot]

commit sha 70b004d6e6d7634f968c6e2adbfb6a06e7414c84

Bump cbindgen from 0.15.0 to 0.16.0 Bumps [cbindgen](https://github.com/eqrion/cbindgen) from 0.15.0 to 0.16.0. - [Release notes](https://github.com/eqrion/cbindgen/releases) - [Changelog](https://github.com/eqrion/cbindgen/blob/master/CHANGES) - [Commits](https://github.com/eqrion/cbindgen/compare/v0.15.0...v0.16.0) Signed-off-by: dependabot[bot] <support@github.com>

view details

push time in 6 minutes

create barnchwasmerio/wasmer

branch : dependabot/cargo/thread_local-1.1.2

created branch time in 7 minutes

PR opened wasmerio/wasmer

Bump thread_local from 1.0.1 to 1.1.2

Bumps thread_local from 1.0.1 to 1.1.2. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/322cf34816a62f1519d005cc44d623741740324e"><code>322cf34</code></a> Bump version to 1.1.2</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/dca4007eafb16fe189caea4fe08a6b80223b3fb1"><code>dca4007</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Amanieu/thread_local-rs/issues/29">#29</a> from Kestrer/raw-iter</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/33ad4052309ba8b48b7436bf82d66be07103fa3f"><code>33ad405</code></a> Add #[inline] to non-generic functions</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/810c043ff71ef66b96ca5d92319df4aa7134bf44"><code>810c043</code></a> Implement iterator logic in RawIter</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/7ee722e308be3cdccbdbcb539db7448000425eca"><code>7ee722e</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Amanieu/thread_local-rs/issues/28">#28</a> from Kestrer/iter-traits</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/5b377410743a86dc5197eba779d53830e0ddfbfe"><code>5b37741</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Amanieu/thread_local-rs/issues/27">#27</a> from Kestrer/into-iter</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/4bedfff87bb89f7eefd2dff005b31f3c34431812"><code>4bedfff</code></a> Implement missing traits on iterators</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/d779c7dfcf20eb9d6e4b01c7bbe431270fb3b106"><code>d779c7d</code></a> Implement IntoIterator for &ThreadLocal</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/c994299ec16b7d0f9af77e01dd9f8b0b67bf13d9"><code>c994299</code></a> Bump version to 1.1.1</li> <li><a href="https://github.com/Amanieu/thread_local-rs/commit/6463a4ceb9c165a10c5ccd122f7065c0e87a7371"><code>6463a4c</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/Amanieu/thread_local-rs/issues/24">#24</a> from Koxiaet/iter</li> <li>Additional commits viewable in <a href="https://github.com/Amanieu/thread_local-rs/compare/v1.0.1...v1.1.2">compare view</a></li> </ul> </details> <br />

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually

</details>

+109 -196

0 comment

1 changed file

pr created time in 7 minutes

delete branch wasmerio/wasmer

delete branch : dependabot/cargo/orbclient-0.3.30

delete time in 8 minutes

push eventwasmerio/wasmer

dependabot[bot]

commit sha 24751ab85bf2996d2fa0466c0cf1db74e5b3e69c

Bump orbclient from 0.3.27 to 0.3.30 Bumps orbclient from 0.3.27 to 0.3.30. Signed-off-by: dependabot[bot] <support@github.com>

view details

Syrus Akbary

commit sha ff237fb1dbaf8eec7b432e897a4f307251e4c9a2

Merge pull request #2057 from wasmerio/dependabot/cargo/orbclient-0.3.30 Bump orbclient from 0.3.27 to 0.3.30

view details

push time in 8 minutes

PR merged wasmerio/wasmer

Bump orbclient from 0.3.27 to 0.3.30 dependencies

Bumps orbclient from 0.3.27 to 0.3.30.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


<details> <summary>Dependabot commands and options</summary> <br />

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually

</details>

+104 -189

0 comment

1 changed file

dependabot[bot]

pr closed time in 8 minutes

PR opened erlang/otp

jinterface: make OtpErlangExternalFun transparent

Not being able to access the internals of OtpErlangExternalFun is problematic. The real use case: performing some analysis of cerl from inside java/scala - the construct fun module:fun/arity is represented as "itself", and when accessing cerl forms from jinterface - it's represented as OtpErlangExternalFun correspondingly. Unfortunately, - the internals are private, - which makes some forms of Erlang core not analysable through jinterface.

Also, - since all module, function and arity fields are final/immutable - it doesn't make much sense to hide/incapsulate them.

+3 -3

0 comment

1 changed file

pr created time in 9 minutes

issue commentwasmerio/wasmer

Make `Module::deserialize_from_file` and `Module::serialize_to_file` return (serialized) module size

Am I missing something here?

No, not really.

I wouldn't add a function to get the module size, except if it reports the exact in-memory module size.

maurolacy

comment created time in 10 minutes

issue openedbraid-work/braid-spec

When can a server clean up after subscriptions whose connections are lost?

In section 3.1 it says:

   If a client requests "Subscribe: keep-alive", then the subscription will be
   remembered even after the GET connection closes.  A subscription can
   be resumed by the client issuing another GET with a Subscribe header.

Two concerns:

  1. This seems like it could open a DDoS attack surface--if many clients start subscribing and dropping connections, the server seems obligated to keep (possibly millions of) maybe-the-client-will-reconnect data around.
  2. Shouldn't the client always have enough information to tell the server, on subscribe, where to start? In this case, why make the server remember state at all?

created time in 14 minutes

issue commenthaskell/haskell-language-server

Error with kate (Add URI support?)

It looks like HLS works well, and I cannot reproduce such an error. Maybe some latest commits of HLS or Kate has fixed problems?

hololeap

comment created time in 15 minutes

push eventiggredible/Learn-Vim

Igor Irianto

commit sha a5bfb10422baee65fa15f04739c0c038bfcad684

Update copyright year

view details

push time in 18 minutes

issue openedPharoJS/PharoJS

provide a way to define javascript method aliases (without js_ prefix)

using a pragma might be a proper way to define the aliases

foo: foo bar: bar
    <jsAliases: #(fooBar foo-bar)>
    ^foo + bar

created time in 22 minutes

created tagp-org/P

tagp-1.0.5

The P programming language.

created time in 24 minutes

issue commentfpco/stackage-server

Search shows wrong snapshot version

Ouch that's a shame but understandable

dten

comment created time in 27 minutes

issue commentemacs-lsp/dap-mode

Deserialization exception on working launch.json file

in general, an empty vector will be serialized to [] in json while empty list will end up nil. So this might potentially break the java server.

xgroleau

comment created time in 28 minutes

pull request commentbraid-work/braid-spec

Remove chunked encoding from patches

FWIW I was re-reading the spec today and having either one of "Content-Length" or "Transfer-Encoding: chunked" in a patch was a point of confusion. Simplifying to just "Content-Length", if possible, would be an improvement IMO.

toomim

comment created time in 30 minutes

issue commentemacs-lsp/dap-mode

Deserialization exception on working launch.json file

Specifically dap-java.

xgroleau

comment created time in 33 minutes

pull request commenthaskell/cabal

Bump upper bound on bytestring

With GHC-9.0 not even released...

At least in theory these are independent processes. Given how overdue is 9.0, I would not be terribly surprised if 9.2 change freeze comes pretty soon after 9.0 release.

though it would be nice to have things moving

All right, what is missing now? I'm keen to get it moving.

bgamari

comment created time in 34 minutes

issue commentwasmerio/wasmer

Make `Module::deserialize_from_file` and `Module::serialize_to_file` return (serialized) module size

I'm not sure if I see the value added vs having a function that gets the length in bytes of a file / byte stream.

In general, the more functional (in the pure sense) our API is, the better. That means, that if for retrieving two things we can have two functions instead of one that would be preferred as it increases maintainability.

That means, that if we want to have the size of a module and the contents of the module we would have:

  • function to serialize a module (get the contents)
  • function to get the length of a serialized module.

For the last bullet, I believe rust fs can be used. So I'm unsure if we really to need that in Wasmer.

Perhaps might be interesting to have a "module size estimator" for a given compiler/settings but I believe that would not be trivial to do (without computing the serialized value).

Am I missing something here?

maurolacy

comment created time in 34 minutes

issue commentemacs-lsp/dap-mode

Deserialization exception on working launch.json file

I have no idea why the branch was deleted, and I have recreated it in my fork.

@yyoncho do you think something might break in dap-mode if an array is passed instead of a list, e.g. for some :args field?

xgroleau

comment created time in 34 minutes

PR opened haskell/haskell-language-server

Fix a bug in completions

The bug, introduced in #1256, was preventing completions from refreshing on input

+9 -2

0 comment

1 changed file

pr created time in 35 minutes

create barnchhaskell/haskell-language-server

branch : bool-blindness

created branch time in 36 minutes

PR opened org-roam/org-roam-bibtex

Maintenance badge should link to same project

…probably ;-)

+1 -1

0 comment

1 changed file

pr created time in 38 minutes

push eventghc/ghc

Cheng Shao

commit sha 6cfdca9f014895a9962e1d077719a96842383000

Correct documentation in System.Mem.Weak [ci skip] Since #13167 is closed, exceptions thrown in finalizers are ignored and doesn't affect other finalizers in the same batch. This MR updates the documentation in System.Mem.Weak to reflect that.

view details

Sylvain Henry

commit sha 1ff61314fae7a0ffb69e3cc2bc37f9715bf8c883

Fix wrong comment about UnitState [CI skip]

view details

Andreas Klebinger

commit sha 092f05321b064e1949e1dabd1867ec5078fbc575

When deriving Eq always use tag based comparisons for nullary constructors Instead of producing auxiliary con2tag bindings we now rely on dataToTag#, eliminating a fair bit of generated code. Co-Authored-By: Ben Gamari <ben@well-typed.com>

view details

Ben Gamari

commit sha 2ed96c68becbb913d9c0a002872fb4cba1877458

Use pointer tag in dataToTag# While looking at !2873 I noticed that dataToTag# previously didn't look at a pointer's tag to determine its constructor. To be fair, there is a bit of a trade-off here: using the pointer tag requires a bit more code and another branch. On the other hand, it allows us to eliminate looking at the info table in many cases (especially now since we tag large constructor families; see #14373).

view details

Ben Gamari

commit sha b4b2be610654d0b6a9bcdaa956261655eadd6b4d

dataToTag#: Avoid unnecessary entry When the pointer is already tagged we can avoid entering the closure.

view details

Sylvain Henry

commit sha 01ea56a22d7cf55f5285b130b357d3112c92de5b

Arrows: collect evidence binders Evidence binders were not collected by GHC.HsToCore.Arrows.collectStmtBinders, hence bindings for dictionaries were not taken into account while computing local variables in statements. As a consequence we had a transformation similar to this: data Point a where Point :: RealFloat a => a -> Point a do p -< ... returnA -< ... (Point 0) ===> { Type-checking } do let $dRealFloat_xyz = GHC.Float.$fRealFloatFloat p -< ... returnA -< ... (Point $dRealFloat_xyz 0) ===> { Arrows HsToCore } first ... >>> arr (\(p, ()) -> case p of ... -> let $dRealFloat_xyz = GHC.Float.$fRealFloatFloat in case .. of () -> ()) >>> \((),()) -> ... (Point $dRealFloat_xyz 0) -- dictionary not in scope Now evidences are passed in the environment if necessary and we get: ===> { Arrows HsToCore } first ... >>> arr (\(p, ()) -> case p of ... -> let $dRealFloat_xyz = GHC.Float.$fRealFloatFloat in case .. of () -> $dRealFloat_xyz) >>> \(ds,()) -> let $dRealFloat_xyz = ds in ... (Point $dRealFloat_xyz 0) -- dictionary in scope Note that collectStmtBinders has been copy-pasted from GHC.Hs.Utils. This ought to be factorized but Note [Dictionary binders in ConPatOut] claims that: Do *not* gather (a) dictionary and (b) dictionary bindings as binders of a ConPatOut pattern. For most calls it doesn't matter, because it's pre-typechecker and there are no ConPatOuts. But it does matter more in the desugarer; for example, GHC.HsToCore.Utils.mkSelectorBinds uses collectPatBinders. In a lazy pattern, for example f ~(C x y) = ..., we want to generate bindings for x,y but not for dictionaries bound by C. (The type checker ensures they would not be used.) Desugaring of arrow case expressions needs these bindings (see GHC.HsToCore.Arrows and arrowcase1), but SPJ (Jan 2007) says it's safer for it to use its own pat-binder-collector: Accordingly to the last sentence, this patch doesn't make any attempt at factorizing both codes. Fix #18950

view details

Sylvain Henry

commit sha 29173f888892f18f3461880ef81ee7ba5fd539db

Factorize and document binder collect functions Parameterize collect*Binders functions with a flag indicating if evidence binders should be collected. The related note in GHC.Hs.Utils has been updated. Bump haddock submodule

view details

Matthew Pickering

commit sha a255b4e38918065ac028789872e53239ac30ae1a

ghc-heap: Allow more control about decoding CCS fields We have to be careful not to decode too much, too eagerly, as in ghc-debug this will lead to references to memory locations outside of the currently copied closure. Fixes #19038

view details

Simon Peyton Jones

commit sha 34950fb84b85d964e30ae9eca995b84fbf4fd165

Fix error recovery in solveEqualities As #19142 showed, with -fdefer-type-errors we were allowing compilation to proceed despite a fatal kind error. This patch fixes it, as described in the new note in GHC.Tc.Solver, Note [Wrapping failing kind equalities] Also fixes #19158 Also when checking default( ty1, ty2, ... ) only consider a possible default (C ty2) if ty2 is kind-compatible with C. Previously we could form kind-incompatible constraints, with who knows what kind of chaos resulting. (Actually, no chaos results, but that's only by accident. It's plain wrong to form the constraint (Num Either) for example.) I just happened to notice this during fixing #19142.

view details

Alfredo Di Napoli

commit sha a64f21e9f6bd949847d3c8fa1e427e5c763ccd7f

Parameterise Messages over e This commit paves the way to a richer and more structured representation of GHC error messages, as per GHC proposal #306. More specifically 'Messages' from 'GHC.Types.Error' now gains an extra type parameter, that we instantiate to 'ErrDoc' for now. Later, this will allow us to replace ErrDoc with something more structure (for example messages coming from the parser, the typechecker etc).

view details

Alfredo Di Napoli

commit sha c36a4f6389e5607b1608682c2fcdb0866cac31d0

Fix tests relying on same-line diagnostic ordering This commit fixes 19 tests which were failing due to the use of `consBag` / `snocBag`, which have been now replaced by `addMessage`. This means that now GHC would output things in different order but only for /diagnostics on the same line/, so this is just reflecting that. The "normal" order of messages is still guaranteed.

view details

John Ericson

commit sha 2267d42a0bf50cb1bc3b5bb6660589eb05903c84

Add 32-bit ops to T file I forgot to add before

view details

John Ericson

commit sha 22d01924b1c09c4bf3e9b602a2c6efbc46ca070f

C-- shift amount is always native size, not shiftee size This isn't a bug yet, because we only shift native-sized types, but I hope to change that.

view details

John Ericson

commit sha faf164db1e03d52d44167bd3d24420dd17fe0f48

Cleanup primop constant folding rules in a few ways - `leftZero`, `rightZero` and `zeroElem` could all be written using `isZeroLit` - "modulo 1" rules could be written with `nonOneLit 1 $> Lit zero<type>` All are due to @hsyl20; thanks!

view details

John Ericson

commit sha 0eaf63b6017b173ebfc848985aa6429bb9d0a55c

Add missing fixed-sized primops and constant folding - `inversePrimOp` is renamed to `semiInversePrimOp` to indicate the given primop is only a right inverse, not left inverse (and contra-wise for the primop which we are giving rules for). This explains why are new usage is not incorrect. - The removed `subsumedByPrimOp` calls were actually dead as the match on ill-typed code. @hsyl20 pointed this out in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4390#note_311912, Metric Decrease: T13701

view details

John Ericson

commit sha 6fbfde95d3612fdd747b9785d409dc32e3fdd744

Test constant folding for sized types

view details

Sylvain Henry

commit sha 887eb6ec23eed243604f71c025d280c0b854f4c4

Enhance Data instance generation Use `mkConstrTag` to explicitly pass the constructor tag instead of using `mkConstr` which queries the tag at runtime by querying the index of the constructor name (a string) in the list of constructor names. Perf improvement: T16577(normal) ghc/alloc 11325573876.0 9249786992.0 -18.3% GOOD Thanks to @sgraf812 for suggesting an additional list fusion fix during reviews. Metric Decrease: T16577

view details

Sylvain Henry

commit sha 957b53760e50d072accc17c77948f18a10a4bb53

Core: introduce Alt/AnnAlt/IfaceAlt datatypes Alt, AnnAlt and IfaceAlt were using triples. This patch makes them use dedicated types so that we can try to make some fields strict (for example) in the future.

view details

Sylvain Henry

commit sha db16302cfd0624b71c5914400949f1f6799e87e9

LLVM: fix sized shift primops (#19215) Ensure that shift amount parameter has the same type as the parameter to shift.

view details

Ben Gamari

commit sha fcbf21aae2ce37854552b9313ca4c908c039a2d1

gitlab-ci: Fix perf metric pushing Previously we would inexplicably append the key to id_rsa. Fixes #19225.

view details

push time in 39 minutes

more