Per discussion in the WebAssembly Machine Learning Group, this proposal is a simple extension to the form of errors propagated by ML backends behind the WASI-NN interface.
The core of the proposal adds an error resource return type which is currently comprised of an explicit error code and a backend specific status message string. This allows for consistent marshalling of the base return type and framework specific handling of the extended return.
An alternate proposal could be to use the variant type from the Component Model and provide a more hierarchical or structured return. As the variation is expected to be in vendor specific framework code, the additional expressiveness seems unnecessary.
I also changed "timeout" to "busy" as well as added the "security" and "unknown" error types.
Per discussion in the WebAssembly Machine Learning Group, this proposal is a simple extension to the form of errors propagated by ML backends behind the WASI-NN interface.
The core of the proposal adds an error resource return type which is currently comprised of an explicit error code and a backend specific status message string. This allows for consistent marshalling of the base return type and framework specific handling of the extended return.
An alternate proposal could be to use the variant type from the Component Model and provide a more hierarchical or structured return. As the variation is expected to be in vendor specific framework code, the additional expressiveness seems unnecessary.
I also changed "timeout" to "busy" as well as added the "security" and "unknown" error types.