Skip to content

IxVM: fix false rejections and pathological kernel reductions - #560

Merged
arthurpaulino merged 1 commit into
mainfrom
ap/ixvm3-through-infer
Aug 14, 2026
Merged

IxVM: fix false rejections and pathological kernel reductions#560
arthurpaulino merged 1 commit into
mainfrom
ap/ixvm3-through-infer

Conversation

@arthurpaulino

Copy link
Copy Markdown
Member

Full-environment IxVM sweeps exposed two classes of kernel bugs: valid declarations rejected by canonical/positivity checks, and open def-equality or inference workloads that failed to converge in practical time.

Correct the recursor canonical checker to reconstruct each mutual member from its own index telescope and only permit Prop large elimination for solo blocks. Skip strict-positivity checking for unsafe inductives, matching Lean and the Rust kernel.

Canonicalize open inference memo keys by rebasing subjects to their minimum loose index, then lift inferred types back into the caller context. This prevents irrelevant inner binder frames from poisoning cache reuse.

Keep lazy def-equality reduction bounded and no-delta between steps. Reuse the current lazy budget instead of recursively restarting application congruence, recognize compact Nat offsets, preserve K/projection reductions under no-delta WHNF, and retain a last-resort full-WHNF path for representations that cannot otherwise converge.

Add focused fixtures for the mutual-recursors, unsafe-inductive, inference-rebase, large-offset Char, and indexed Time-cast failure shapes. Regenerate the native IxVM and repin all kernel and shard FFT costs after rebasing onto main.

Validation: lake exe ix codegen; lake build IxTests; lake test -- --ignored ixvm (187.06s, all execution, FFT, exploit, and bytecode/native parity checks passed).

Full-environment IxVM sweeps exposed two classes of kernel bugs: valid declarations rejected by canonical/positivity checks, and open def-equality or inference workloads that failed to converge in practical time.

Correct the recursor canonical checker to reconstruct each mutual member from its own index telescope and only permit Prop large elimination for solo blocks. Skip strict-positivity checking for unsafe inductives, matching Lean and the Rust kernel.

Canonicalize open inference memo keys by rebasing subjects to their minimum loose index, then lift inferred types back into the caller context. This prevents irrelevant inner binder frames from poisoning cache reuse.

Keep lazy def-equality reduction bounded and no-delta between steps. Reuse the current lazy budget instead of recursively restarting application congruence, recognize compact Nat offsets, preserve K/projection reductions under no-delta WHNF, and retain a last-resort full-WHNF path for representations that cannot otherwise converge.

Add focused fixtures for the mutual-recursors, unsafe-inductive, inference-rebase, large-offset Char, and indexed Time-cast failure shapes. Regenerate the native IxVM and repin all kernel and shard FFT costs after rebasing onto main.

Validation: lake exe ix codegen; lake build IxTests; lake test -- --ignored ixvm (187.06s, all execution, FFT, exploit, and bytecode/native parity checks passed).
@arthurpaulino
arthurpaulino enabled auto-merge (squash) August 14, 2026 17:39
@arthurpaulino

Copy link
Copy Markdown
Member Author

!benchmark aiur fresh

@argument-ci-bot

argument-ci-bot Bot commented Aug 14, 2026

Copy link
Copy Markdown

!benchmark — main vs 962af8a

backends: aiur=prove · envs: InitStd · set: primary · shard: 0 · baseline: fresh (base-SHA run, bencher bypassed)

aiur · InitStd · prove — main from: base run @ 97aa19e (fresh — bencher bypassed)

13 constants · 8 with regressions · 7 with improvements (|Δ| > 3.0% on any metric).

comparison table (13 constants)
constant prove-time (main) prove-time (PR) Δ% throughput (const/s) (main) throughput (const/s) (PR) Δ% peak-ram (main) peak-ram (PR) Δ% execute-time (main) execute-time (PR) Δ% verify-time (main) verify-time (PR) Δ% proof-size (main) proof-size (PR) Δ% fft-cost (main) fft-cost (PR) Δ%
ByteArray.utf8DecodeChar?_utf8EncodeChar_append 36.952 s 34.657 s -6.2% (1.07× faster) 🟢 72.820 77.650 +6.6% (1.07× faster) 🟢 72.14 GiB 69.12 GiB -4.2% 🟢 9.538 s 8.652 s -9.3% (1.10× faster) 🟢 192.3 ms 140.6 ms -26.9% (1.37× faster) 🟢 21.63 MiB 21.77 MiB +0.6% 136.87B 126.12B -7.9% (1.09× fewer) 🟢
Char.ofOrdinal_le_of_le 28.449 s 28.171 s -1.0% 93.010 93.930 +1.0% 58.02 GiB 56.33 GiB -2.9% 6.494 s 6.707 s +3.3% ⚠️ 131.3 ms 174.5 ms +32.9% (1.33× slower) ⚠️ 21.58 MiB 21.78 MiB +0.9% 98.00B 99.10B +1.1%
Array.extract_append 37.674 s 24.593 s -34.7% (1.53× faster) 🟢 40.930 62.700 +53.2% (1.53× faster) 🟢 73.15 GiB 47.48 GiB -35.1% (1.54× smaller) 🟢 9.460 s 5.791 s -38.8% (1.63× faster) 🟢 138.3 ms 138.4 ms +0.1% 21.54 MiB 21.60 MiB +0.3% 135.19B 86.05B -36.3% (1.57× fewer) 🟢
Vector.extract_append._proof_2 21.246 s 16.367 s -23.0% (1.30× faster) 🟢 61.280 79.550 +29.8% (1.30× faster) 🟢 39.37 GiB 31.36 GiB -20.3% (1.26× smaller) 🟢 5.135 s 3.499 s -31.9% (1.47× faster) 🟢 127.9 ms 131.7 ms +3.0% 21.24 MiB 21.44 MiB +0.9% 76.48B 53.57B -30.0% (1.43× fewer) 🟢
_private.Init.Data.Range.Polymorphic.SInt.0.Int64.instRxcHasSize_eq 16.967 s 16.251 s -4.2% 🟢 106.790 111.500 +4.4% 🟢 34.28 GiB 32.36 GiB -5.6% (1.06× smaller) 🟢 3.544 s 3.401 s -4.1% 🟢 131.8 ms 130.4 ms -1.1% 21.42 MiB 21.62 MiB +0.9% 54.00B 51.47B -4.7% 🟢
String.split 16.020 s 15.743 s -1.7% 110.170 112.120 +1.8% 32.24 GiB 31.71 GiB -1.6% 3.287 s 3.179 s -3.3% 🟢 134.8 ms 134.7 ms -0.1% 21.62 MiB 21.78 MiB +0.7% 49.51B 48.07B -2.9%
List.mergeSort 11.979 s 12.377 s +3.3% ⚠️ 120.880 116.990 -3.2% ⚠️ 23.48 GiB 24.60 GiB +4.8% ⚠️ 2.360 s 2.420 s +2.5% 133.0 ms 139.2 ms +4.7% ⚠️ 21.48 MiB 21.68 MiB +0.9% 35.52B 35.66B +0.4%
Vector.append 3.873 s 4.277 s +10.4% (1.10× slower) ⚠️ 125.240 113.390 -9.5% (1.10× slower) ⚠️ 6.37 GiB 6.95 GiB +9.1% (1.09× larger) ⚠️ 656.0 ms 704.1 ms +7.3% (1.07× slower) ⚠️ 128.4 ms 125.1 ms -2.5% 20.08 MiB 20.25 MiB +0.9% 7.90B 8.67B +9.8% (1.10× more) ⚠️
Nat.gcd_comm 3.142 s 3.267 s +4.0% ⚠️ 124.140 119.360 -3.9% ⚠️ 4.96 GiB 5.10 GiB +2.7% 517.8 ms 533.5 ms +3.0% ⚠️ 122.7 ms 124.4 ms +1.5% 19.84 MiB 20.08 MiB +1.2% 5.15B 5.48B +6.4% (1.06× more) ⚠️
String.append 2.367 s 2.417 s +2.1% 128.430 125.760 -2.1% 5.59 GiB 4.68 GiB -16.3% (1.19× smaller) 🟢 391.4 ms 423.3 ms +8.2% (1.08× slower) ⚠️ 118.2 ms 115.7 ms -2.1% 19.12 MiB 19.34 MiB +1.2% 2.85B 3.04B +6.7% (1.07× more) ⚠️
Int.gcd 1.962 s 2.056 s +4.8% ⚠️ 105.990 101.170 -4.5% ⚠️ 4.51 GiB 4.61 GiB +2.1% 348.9 ms 355.0 ms +1.7% 113.1 ms 118.1 ms +4.4% ⚠️ 18.67 MiB 18.91 MiB +1.3% 1.83B 1.96B +6.6% (1.07× more) ⚠️
Nat.sub_le_of_le_add 1.753 s 1.882 s +7.4% (1.07× slower) ⚠️ 96.970 90.320 -6.9% (1.07× slower) ⚠️ 5.20 GiB 4.67 GiB -10.2% (1.11× smaller) 🟢 343.7 ms 352.2 ms +2.5% 114.1 ms 126.6 ms +11.0% (1.11× slower) ⚠️ 19.03 MiB 19.29 MiB +1.4% 1.58B 1.70B +7.7% (1.08× more) ⚠️
Nat.add_comm 1.022 s 1.102 s +7.8% (1.08× slower) ⚠️ 41.090 38.110 -7.3% (1.08× slower) ⚠️ 3.86 GiB 3.97 GiB +2.8% 248.7 ms 254.9 ms +2.5% 105.9 ms 111.2 ms +5.0% ⚠️ 17.20 MiB 17.67 MiB +2.8% 268.28M 274.30M +2.2%

Workflow logs

@arthurpaulino
arthurpaulino merged commit 34ca818 into main Aug 14, 2026
11 checks passed
@arthurpaulino
arthurpaulino deleted the ap/ixvm3-through-infer branch August 14, 2026 18:24
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