Skip to content

Add structural CLVM debug metadata and stack symbolization - #579

Open
bramcohen wants to merge 21 commits into
mainfrom
feature/structural-clvm-debug-metadata
Open

bramcohen wants to merge 21 commits into
mainfrom
feature/structural-clvm-debug-metadata

Conversation

@bramcohen

@bramcohen bramcohen commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • emit versioned .debug.clvm.bin sidecars containing deduplicated source files, source text, spans, structural shadow trees, formal parameters, and inferred constraints
  • symbolize exact, nested, recursively-curried, and unknown serialized evaluator frames across a collection of sidecars
  • decode proper and improper captured environments, preserve rest tails, handle compiler left_env, and unwrap nested @ capture aliases before parameter binding
  • render oldest-to-newest captured stacks with bound/runtime parameter values and omitted-frame markers
  • expose metadata compilation, decoding, verification, and typed stack rendering through Rust, Python, WASM, and CLI APIs
  • index structural identities once so consumers do not scan every metadata tree per frame

The sidecar stores structure rather than persisted tree hashes. Host applications retain control of capture policy, frame serialization, registry limits, lazy loading, and original EvalErr presentation.

Dependencies

Depends on clvm_rs #845. Because downstream chia-gaming currently uses the Chia 0.38 dependency family, this PR temporarily pins the equivalent tested clvmr 0.17.7 integration backport while retaining the version requirement needed for package verification.

The Chia Gaming integration workflow is pinned to the captured-frame implementation from chia-gaming #437 and runs that repository's authoritative Chialisp build rather than maintaining a duplicate build helper.

Verification

  • cargo +1.97.1 clippy --workspace -- -D warnings
  • cargo +1.97.1 check
  • cargo +1.97.1 check --manifest-path wasm/Cargo.toml
  • cargo +1.97.1 test — 732 passed, 1 ignored after the nested-capture regression
  • cargo publish --dry-run
  • all PR checks pass, including crate packaging, NPM, exhaustive tests, all wheel targets, coverage, and the full chia-gaming integration

Comment thread src/compiler/debug_metadata.rs Fixed

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/compiler/debug_metadata.rs Outdated
Comment thread src/compiler/debug_metadata.rs
Comment thread src/classic/clvm_tools/cmds.rs
Comment thread src/compiler/debug_metadata.rs
Comment thread src/compiler/debug_metadata.rs Fixed
Comment thread src/compiler/debug_metadata.rs Fixed
Comment thread src/compiler/debug_metadata.rs Fixed
Comment thread src/compiler/debug_metadata.rs Fixed

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread wasm/src/objects.rs Outdated

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread src/compiler/debug_metadata.rs
Comment thread src/compiler/debug_metadata.rs

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3927a8f. Configure here.

Comment thread support/chia-gaming-build.rs Outdated

This branch has not been deployed

No deployments
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.

2 participants