Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

winch: Epoch based interruption #8091

Closed
saulecabrera opened this issue Mar 12, 2024 · 0 comments · Fixed by #9737
Closed

winch: Epoch based interruption #8091

saulecabrera opened this issue Mar 12, 2024 · 0 comments · Fixed by #9737
Assignees
Labels
winch Winch issues or pull requests

Comments

@saulecabrera
Copy link
Member

Winch is missing support for some of Wasmtime's features. The objective of this issue is to track progress of adding epoch based interruption to Winch.

@saulecabrera saulecabrera converted this from a draft issue Mar 12, 2024
@saulecabrera saulecabrera added the winch Winch issues or pull requests label Mar 12, 2024
@saulecabrera saulecabrera self-assigned this Mar 20, 2024
@saulecabrera saulecabrera moved this to In Progress in Winch Nov 5, 2024
saulecabrera added a commit to saulecabrera/wasmtime that referenced this issue Dec 2, 2024
This commit addresses issues identified while working on issue bytecodealliance#8091. It
improves the frame handling in Winch to prevent subtle bugs and enhance
the robustness of the code generation process.

Previously, there was no clear mechanism to verify when the frame was
fully set up and safe to access the local slots allocated for register
arguments, including the special slots used for the `VMContext`. As
a result, it was possible to inadvertently read from uninitialized
memory if calls were made before the frame was properly set up and
sealed.

This commit introduces two main changes with the objective to help
reduce the risk of introducing bugs related to the above:

* A `CodeGenPhase` trait, used via the type state pattern to clearly
  gate the operations allowed during each phase of the code generation
  process.

* Improve the semantics of locals, by clearly separating the notion of
  Wasm locals and special locals used by the compiler. This
  specialization allows a more accurate representation of the semantics
  of Wasm locals and their index space.
saulecabrera added a commit to saulecabrera/wasmtime that referenced this issue Dec 4, 2024
This commit addresses issues identified while working on issue bytecodealliance#8091. It
improves the frame handling in Winch to prevent subtle bugs and enhance
the robustness of the code generation process.

Previously, there was no clear mechanism to verify when the frame was
fully set up and safe to access the local slots allocated for register
arguments, including the special slots used for the `VMContext`. As
a result, it was possible to inadvertently read from uninitialized
memory if calls were made before the frame was properly set up and
sealed.

This commit introduces two main changes with the objective to help
reduce the risk of introducing bugs related to the above:

* A `CodeGenPhase` trait, used via the type state pattern to clearly
  gate the operations allowed during each phase of the code generation
  process.

* Improve the semantics of locals, by clearly separating the notion of
  Wasm locals and special locals used by the compiler. This
  specialization allows a more accurate representation of the semantics
  of Wasm locals and their index space.
github-merge-queue bot pushed a commit that referenced this issue Dec 4, 2024
This commit addresses issues identified while working on issue #8091. It
improves the frame handling in Winch to prevent subtle bugs and enhance
the robustness of the code generation process.

Previously, there was no clear mechanism to verify when the frame was
fully set up and safe to access the local slots allocated for register
arguments, including the special slots used for the `VMContext`. As
a result, it was possible to inadvertently read from uninitialized
memory if calls were made before the frame was properly set up and
sealed.

This commit introduces two main changes with the objective to help
reduce the risk of introducing bugs related to the above:

* A `CodeGenPhase` trait, used via the type state pattern to clearly
  gate the operations allowed during each phase of the code generation
  process.

* Improve the semantics of locals, by clearly separating the notion of
  Wasm locals and special locals used by the compiler. This
  specialization allows a more accurate representation of the semantics
  of Wasm locals and their index space.
saulecabrera added a commit to saulecabrera/wasmtime that referenced this issue Dec 4, 2024
Closes bytecodealliance#8091

This commit introduces support for epoch interruption to Winch. The
heuristics around epoch check emission are identical to Cranelift's
except for the fact that the current implementation doesn't introduce
a local-based cache for the current epoch deadline. This is an
intentional decision given Winch's focus on compilation performance.
However, if needed in the future, knobs could be introduced to
optionally introduce a local cache at the cost of reduced compilation
performance.
saulecabrera added a commit to saulecabrera/wasmtime that referenced this issue Dec 6, 2024
Closes bytecodealliance#8091

This commit introduces support for epoch interruption to Winch. The
heuristics around epoch check emission are identical to Cranelift's
except for the fact that the current implementation doesn't introduce
a local-based cache for the current epoch deadline. This is an
intentional decision given Winch's focus on compilation performance.
However, if needed in the future, knobs could be introduced to
optionally introduce a local cache at the cost of reduced compilation
performance.
github-merge-queue bot pushed a commit that referenced this issue Dec 6, 2024
* winch: Epoch-based interruption

Closes #8091

This commit introduces support for epoch interruption to Winch. The
heuristics around epoch check emission are identical to Cranelift's
except for the fact that the current implementation doesn't introduce
a local-based cache for the current epoch deadline. This is an
intentional decision given Winch's focus on compilation performance.
However, if needed in the future, knobs could be introduced to
optionally introduce a local cache at the cost of reduced compilation
performance.

* Add disas tests for x64/epoch

* Refactor to `maybe_emit_epoch_check`

* Generate expected output for disas
@github-project-automation github-project-automation bot moved this from In Progress to Done in Winch Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
winch Winch issues or pull requests
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant