Skip to content

Replace chialisp with rue-clvm, bump clvmr to 0.21, release 0.11.0 - #103

Merged
Rigidity merged 2 commits into
mainfrom
rue-clvm
Oct 12, 2026
Merged

Rigidity merged 2 commits into
mainfrom
rue-clvm

Conversation

@Rigidity

@Rigidity Rigidity commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Adds rue-clvm, a small crate for converting CLVM to and from text. It replaces chialisp, which is no longer a dependency anywhere in the workspace.
  • Bumps clvmr from 0.16 to 0.21, and clvm-traits and clvm-utils to 0.51.
  • Bumps Rue to 0.11.0.

Text format changes

The new format is not 1:1 with chialisp. It is meant to be easier to read:

  • Programs vs. values. disassemble_program uses operator names for the first item of every list. disassemble_value never uses operator names, so run outputs, raise values and debug prints show data as data. For example, (q 2 3) is now (1 2 3), and condition lists show (51 …) instead of (g1_negate …).
  • Integers up to 8 bytes print as decimal, e.g. 1000000 instead of 0x0f4240. Larger atoms such as hashes and keys stay hex.
  • Strings round-trip. " and \ are escaped; before, a string containing " printed as hex, and one containing \ didn't parse back to the same value.
  • The secp operators print by name. Before, operator names were limited to 2-byte atoms.
  • The parser is stricter. It rejects trailing input, a stray ), malformed numbers like 1abc, and a . with nothing before it. ; always starts a comment, even directly after an atom. 0x parses as empty bytes. The # prefix is gone.

A randomized round-trip test checks that 100,000 random values print and then parse back to the same value, in both modes.

clvmr 0.21

  • Flags are now the ClvmFlags bitflags type. The flags used to run programs now live in one place, rue_lir::CLVM_FLAGS.
  • MEMPOOL_MODE now includes DISABLE_OP, which turns off modpow unless NEW_COST_MODEL is set. CLVM_FLAGS leaves out DISABLE_OP, so Rue behaves the same as before. Otherwise the modpow builtin test fails with unimplemented operator. We may want to revisit this to match current mempool rules.
  • No costs changed in any snapshot.

Snapshot changes

The YAML changes come from the format changes above. The output fields change the most. Where a test returns a function, its output now shows opcodes as numbers.

Testing

  • cargo test --workspace, cargo clippy --all-targets, cargo fmt --check, cargo machete and rue fmt --check all pass locally.
  • Not built for wasm32-unknown-unknown locally (target not installed).

Note

Medium Risk
Large dependency and CLVM-runtime surface-area change (crypto ops, flags, text I/O) with behavior preserved via snapshots, but stricter parsing and different disassembly can break external tooling that assumed chialisp format.

Overview
Releases Rue 0.11.0 and drops the chialisp dependency in favor of a new in-tree rue-clvm crate that parses and prints CLVM text (assemble, disassemble_program, disassemble_value), with operator tables, unit tests, and a 100k-value round-trip test.

clvmr is upgraded to 0.21 (with clvm-traits / clvm-utils 0.51). Call sites switch to ClvmFlags and shared rue_lir::CLVM_FLAGS (mempool mode + keccak, explicitly not clearing modpow via DISABLE_OP). CLI, tests, WASM, const eval, and debug dialect all route through rue-clvm instead of chialisp binutils.

The text format is intentionally different: programs use operator keywords; run outputs and debug prints use value mode (numeric opcodes, decimal ints ≤8 bytes, named secp ops, stricter parsing). Expect widespread YAML snapshot updates to output / program strings only—execution costs in snapshots are unchanged.

Reviewed by Cursor Bugbot for commit 5866ffa. Bugbot is set up for automated code reviews on this repo. Configure here.

Adds a small rue-clvm crate for converting CLVM to and from text, and
removes the chialisp dependency from the workspace.

The text format is clearer than chialisp's:
- Programs and values are written separately. Values never use
  operator keywords, so condition lists and data print as numbers.
- Integers up to 8 bytes are written as decimal rather than hex.
- Strings escape `"` and `\`, so every value round-trips.
- Operators longer than 2 bytes (the secp ops) are written by name.
- The parser rejects trailing input, stray `)`, malformed numbers, and
  a `.` with nothing before it, and `;` always starts a comment.

Also bumps clvmr to 0.21 along with clvm-traits and clvm-utils 0.51.
The flags used to run programs now live in rue_lir::CLVM_FLAGS, which
leaves out DISABLE_OP so that modpow keeps working.
@Rigidity
Rigidity merged commit 7db7e5b into main Oct 12, 2026
2 checks passed
@Rigidity
Rigidity deleted the rue-clvm branch October 12, 2026 20:20
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