Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

cbv trips an internal assertion under -Dsym.debug=true

Open
#15,633 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Domain
compilers

Research direction

Start by reproducing the supplied Lean example with -Dsym.debug=true, then compare it with the run without that option. Trace the failing Lean.Meta.Sym.AlphaShareBuilder assertion at Sym/AlphaShareBuilder:42; done means identifying and fixing the cause so the example succeeds with sym.debug enabled.

Written by the indexing model from the issue text.

Description

bug

The following code:

import Std
open Std
def frequencies (xs : List Nat) : TreeMap Nat Nat (fun a b => compare b a) :=
  xs.foldl (init := ∅) (fun freq x => freq.alter x (fun | none => some 1 | some n => some (n+1)))
def search (xs : List Nat) : Int :=
  let fr := frequencies xs
  let kv := fr.iter |>.map (fun (k, _) => k) |>.first?
  kv.getD (-1)
example : search [3, 2] = 3 := by cbv

Resulted in this output:

error: <SymM default value>
PANIC at Lean.Meta.Sym.Internal.Sym.assertShared Lean.Meta.Sym.AlphaShareBuilder:42:2: assertion violation: isSameExpr prev.expr e

Expected: the proof succeeds, as it does without sym.debug (exit code 0)

Dominant language
Lean
Stars
9.6k
Forks
1.1k
Avg merge
1d 35m
Merged PRs (30d)
269

Getting set up

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.

More from leanprover/lean4

All issues in leanprover/lean4

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.