Stream: wasmtime

Topic: Sanity check for component model's resource


view this post on Zulip Zihang Ye (Mar 05 2025 at 10:07):

Hi, I wonder if it is possible for Wasmtime to add a sanity check mode when running components, to see if all the resources allocated are indeed dropped or consumed as per spec?

This would be helpful for developing SDKs. Also, it might not be an error for leaking resources on wasmtime as they would get cleaned up eventually, but it might be an error on RPC based systems, so it could also be helpful too. But I'm not quite sure if this can be achieved. For example, the OutgoingBody uses a finish to close, but it's not something declared in the standard reflected by type or something.

Any thoughs?

view this post on Zulip Victor Adossi (Mar 05 2025 at 13:22):

I think maybe the first step to this might be adding some way to peek inside runtime internals -- it came up a while back for me in terms of our work on the P3 features:

#wasmtime > test-time introspection for the runtime/Engine

And it looks like it has come up a few other times if you look in the #wasmtime topics.

This idea also came up just yesterday in the guest languages SIG as we were discussing a way to get tests similar to the WAST tests we have now for a sort of WASI conformance. The idea was that there are at least two levels of testing for a conformance suite:

Obviously you don't want to be too restrictive on what runtimes can do, and the most important is the component testing, but I (for one) think it's definitely a good idea to have these.

Would love to have others weigh in here

view this post on Zulip Zihang Ye (Mar 06 2025 at 02:40):

I think the blackbox component testing is something that I look for so that I could tell if I had the correct implementation; and I would expect that the whitebox runtime testing could also serve as an implementation standard that I can learn from.


Last updated: Apr 08 2025 at 05:03 UTC