You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* IxVM kernel: native unconstrained_big_uint_div_mod Aiur op + small wins
* Aiur op `unconstrained_big_uint_div_mod(a: KLimbs, b: KLimbs) -> (KLimbs, KLimbs)`:
runtime computes (q, r) via `num_bigint::BigUint::div_rem` and inserts
both result lists into `memory[10]` content-addressed with
multiplicity 0; no constraints emitted. Wired through
bytecode/execute/constraints/trace + FFI decoder +
Source/Typed/Simple/Concrete/Bytecode stages + Meta syntax +
Compiler/{Check, Concretize, Simple, Match, Lower, Layout}. Lean
reference evaluators (Interpret/SourceEval/BytecodeEval) are stubbed
with TODOs; src/aiur/execute.rs is the authoritative impl.
* Primitive.lean: `klimbs_div_mod` now reads (q, r) from the op then
verifies `klimbs_normalize(klimbs_add(klimbs_mul(q, b), r)) == klimbs_normalize(a)`
and `klimbs_lt(r, b) == 1` when `b != 0`. Drops recursive
`klimbs_div_mod_go`: its 2^24-step memo growth on (2^32, 256) was the
klimbs OOM driver.
* Core.lean: route list_lookup through list_drop so sublist ptrs dedup
via Aiur's content-addressed store.
* Infer.lean: collapse App-spine inference into one helper that peels
the head's Forall telescope arg-by-arg using a single expr_inst_many
per step on the ORIGINAL dom (with a growing innermost-first subs
list) instead of N consecutive expr_inst1 rewalks of a residual cod.
* Tests/Ix/IxVM.lean: re-pin 37 FFT costs.
lake exe check Nat.add_comm: 55_504_714 -> 54_350_107 FFT (-2.1%).
lake exe check '_private.Init.Data.String.Decode.0.ByteArray.utf8DecodeChar?.helper₃':
previously OOM (~1.2 GB single allocation inside klimbs_div_mod_go);
now passes at 37_793_684_978 FFT.
* IxVM kernel: fix klimbs_to_ctor_form to single-step expansion
`klimbs_to_ctor_form` recursively unfolded a Nat literal `n` into the
full ctor chain `Nat.succ^n(Nat.zero)`. For large `n` the recursion
created O(n) memo entries (one per `klimbs_dec`, one per
`klimbs_normalize`, one per the recursive `klimbs_to_ctor_form` call)
and OOM'd the per-fn function_queries before completing.
Rust's `nat_to_constructor` (src/ix/kernel/whnf.rs:1664-1687) does the
right thing: produce `Nat.succ(Lit(n-1))` — a single ctor wrap whose
predecessor stays a `Lit(Nat)`. Subsequent iota reductions re-trigger
expansion only as needed. Mirror that semantics in Aiur.
`lake exe check '_private.Init.Data.String.Decode.0.ByteArray.utf8DecodeChar?.<bomb>'`
with `ulimit -v 20000000`:
* assemble₂._proof_1: OOM → 11_936_582_540 FFT
* assemble₃._proof_3: OOM → 11_934_210_486 FFT
* assemble₃._proof_4: OOM → 11_968_289_150 FFT
* assemble₄_eq_some_iff_..._proof_1_13: OOM → 8_510_124_580 FFT
* helper₃: 37_793_684_978 → 16_870_284_540 FFT (-55.4%)
`lake exe check 'ByteArray.utf8DecodeChar?_utf8EncodeChar_append'` with
`ulimit -v 22000000`: passes at 43_544_984_712 FFT (the full theorem,
which was the original UTF-8 blocker).
Tests/Ix/IxVM.lean: 18 small FFT pin increases — every const whose
WHNF path now eagerly synthesizes a `Lit(n-1)` predecessor (one extra
`mk_nat_lit` per ctor-form coercion instead of zero in the old
recursive body that walked the whole chain anyway).
0 commit comments