leanprover / leanprover/lean4

error: Error: tag for constructor 'ast.ZIMOP_MOP_RR' is too big, this is a limitation of the current runtime

Open
#8,930 8 comments 3 reactions 1 assignee View on GitHub

@zwarich is already working on this.

Since Jun 26, 2025.

bug P-high
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

When compiling https://github.com/opencompl/sail-riscv-lean-executable with the latest lean nightly 2025-06-21, I get the error:

error: LeanRV64DExecutable/RiscvInstsEnd.lean:4057:4: failed to compile definition, compiler IR check failed at 'LeanRV64DExecutable.Functions.encdec_backwards'. Error: tag for constructor 'ast.ZIMOP_MOP_RR' is too big, this is a limitation of the current runtime
error: LeanRV64DExecutable/RiscvInstsEnd.lean:32240:4: failed to compile definition, compiler IR check failed at 'LeanRV64DExecutable.Functions.encdec_backwards_matches'. Error: depends on declaration 'LeanRV64DExecutable.Functions.encdec_backwards._closed_0', which has no executable code; consider marking definition as 'noncomputable'
error: LeanRV64DExecutable/RiscvInstsEnd.lean:58021:4: failed to compile definition, compiler IR check failed at 'LeanRV64DExecutable.Functions.encdec_compressed_backwards'. Error: tag for constructor 'ast.ZCMOP' is too big, this is a limitation of the current runtime
error: LeanRV64DExecutable/RiscvInstsEnd.lean:60965:4: failed to compile definition, compiler IR check failed at 'LeanRV64DExecutable.Functions.encdec_compressed_backwards_matches._lam_4'. Error: depends on declaration 'LeanRV64DExecutable.Functions.encdec_backwards_matches._lam_1._closed_0', which has no executable code; consider marking definition as 'noncomputable'
error: Lean exited with code 1
Some required builds logged failures:
- LeanRV64DExecutable.RiscvInstsEnd
error: build failed
Context

I chatted with @nomeata a week ago. He suggested reporting a bug. I have not yet created a minimal test case, as the machine-generated code comprises 100,000 lines, and I am unsure how to generate a synthetic reproducer manually. For the same reason, I did not test this online. Yet, I assume that would be possible based on the error for someone who knows the compiler. While we can try to create smaller inductives, it seems Lean should nevertheless not error out.

Steps to Reproduce
  1. git clone https://github.com/opencompl/sail-riscv-lean-executable
  2. Lake build (and wait 6 hours)

Expected behavior:

The compilation should terminate without error.

*Actual behavior:

Error: tag for constructor 'ast.ZCMOP' is too big, this is a limitation of the current runtime

Versions

Lean nightly 2025-05-21

Impact

Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.