Skip to content

Bound RVM diagnostics without losing HostAwait payloads - #936

Draft
Anand Krishnamoorthi (anakrish) wants to merge 1 commit into
microsoft:mainfrom
anakrish:fix/rvm-diagnostics
Draft

Anand Krishnamoorthi (anakrish) wants to merge 1 commit into
microsoft:mainfrom
anakrish:fix/rvm-diagnostics

Conversation

@anakrish

Copy link
Copy Markdown
Collaborator

Scope

First independent extraction from #934, based directly on main. Related to #932; this preparatory PR does not fix or close that issue.

This PR contains no rule-error propagation, conflict-detection, comparison-budget, compiler, or bytecode-format changes. #934 remains unchanged.

Changes

  • Reuse Value::diagnostic() for VM errors, execution states, suspension reasons, and the affected aggregate/set/time builtin errors, avoiding expansion of shared values.
  • Add a reusable streaming formatter that limits owned error strings to 256 UTF-8 bytes plus ...; bound generic anyhow-to-VM conversion and affected network parse-error messages.
  • Borrow stored execution states when inspecting them or rejecting invalid resumes, rather than cloning potentially large error payloads.
  • Preserve full HostAwait payload access independently of diagnostic text: add Python/Java/WASM compact-JSON accessors and C++/Go wrappers around the existing C accessors.
  • Add shared-value, large-string, UTF-8, strict/non-strict, execution-mode, FFI, and binding regressions; update four YAML diagnostic expectations.

Structured Rust values remain intact. Debug text intentionally changes and is not a payload serialization API. These changes cover VM diagnostic formatting and the builtin producers touched here, not every third-party error constructor.

Validation — debug builds only

  • cargo xtask ci-debug --frozen — passed, including OPA conformance and feature combinations.
  • All-feature diagnostic unit/integration tests — passed.
  • cargo xtask test-no-std --frozen — passed for thumbv7m-none-eabi.
  • FFI suite — 78 passed, run serially.
  • Python, Java, WASM/Node, Go RVM, and C++ RVM smoke tests — passed against debug libraries; WASM used --dev --no-opt, C++ used -O0.
  • cargo xtask fmt --check and git diff --check — passed.

Builds used at most two Rust jobs. The installed toolchain needs --force-warn deprecated_in_future for two existing Azure builtin deprecations. Strict Clippy also encounters five existing findings in unchanged files (question_mark, for_kv_map, and useless_borrows_in_formatting); the complete workspace/binding Clippy task is checked with only those categories downgraded to warnings. No repository lint settings are changed.

Extract diagnostic safety independently of rule propagation and conflict handling. Related to microsoft#932 and microsoft#934.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 4a5b6b76-47ed-4d59-8b05-4cca089961b9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant