Repository navigation
Keep IxVM lazy defeq bounded on open Nat terms - #562
Merged
Merged
Conversation
Add a CompileBatteries library alongside the existing environment compilation targets so Batteries can be compiled into an Ix environment for sharding and sweeps.
Distill the IxVM reduction changes into a bounded lazy-defeq path that avoids eagerly unfolding open Nat primitives while retaining the recursor correctness fixes already on main. Normalize structural heads before primitive dispatch, keep delta and projection retries within one fuel budget, and preserve compact symbolic Nat expressions instead of expanding their logical implementations. Regenerate the native IxVM executor and update the affected FFT pins. Validation: all 600 shards across Init, InitStd, Lean, Batteries, Mathlib, and FLT completed successfully with no timeouts or check failures.
arthurpaulino
force-pushed
the
ap/ixvm-distill
branch
from
August 16, 2026 15:07
d93220e to
9998026
Compare
arthurpaulino
enabled auto-merge (squash)
August 16, 2026 15:12
johnchandlerburnham
approved these changes
Aug 17, 2026
samuelburnham
added a commit
that referenced
this pull request
Aug 18, 2026
Whole-env checking through the codegen'd IxVM kernel over ONE shared QueryRecord: worker threads warm-execute a verify_block claim per schedule block (min-cut linearization keeps closure-overlapping blocks adjacent), every shared dependency cone derives once, and each sealed segment runs one verify_segment claim over the digest-bound block list whose calls memo-hit the warm work. The record is an insert-once SET under concurrency: lock-free entry reservation (fetch_add), the stored key hash doubles as the completion marker (Release-stored last), and every multiplicity is DERIVED at seal from the unique-query set — racing speculative execution is confluent because nothing accumulated at runtime enters the witness. Storage is a mono-typed atomic Segment arena on plain 4 KiB anonymous mmap (hugepage schemes measured out), with a per-thread probe cache and striped hashbrown index. Planning is measurement: one whole-env execution cut into fine segments at a measured threshold, each segment's per-circuit raw heights taken at seal, then grouped into shard-sized proof units under the exact peak-prove-RSS model's bound (calibrated against real STARK proves). Manifest verify/prove re-executes each shard standalone and gates on the exact measured peak. Diagnostics: IX_WATCH_DUMP, IX_QM_LEN_PANIC, IX_SEG_DUMP_COUNTS, IX_EXEC_DUMP_COUNTS/KEYS, stall detection naming stuck blocks. Includes bench envs and campaign manifests, and the IxVM codegen regenerated against the merged #562 kernel.
samuelburnham
added a commit
that referenced
this pull request
Aug 20, 2026
Whole-env checking through the codegen'd IxVM kernel over ONE shared QueryRecord: worker threads warm-execute a verify_block claim per schedule block (min-cut linearization keeps closure-overlapping blocks adjacent), every shared dependency cone derives once, and each sealed segment runs one claim over the digest-bound block list whose calls memo-hit the warm work. The record is an insert-once SET under concurrency: lock-free entry reservation (fetch_add), the stored key hash doubles as the completion marker (Release-stored last), and every multiplicity is DERIVED at seal from the unique-query set — racing speculative execution is confluent because nothing accumulated at runtime enters the witness. Storage is a mono-typed atomic Segment arena on plain 4 KiB anonymous mmap (hugepage schemes measured out), with a per-thread probe cache and striped hashbrown index. Planning is measurement: one whole-env execution cut into fine segments at a measured threshold, each segment's per-circuit raw heights taken at seal, then grouped into shard-sized proof units under the exact peak-prove-RSS model's bound (calibrated against real STARK proves). Manifest prove does not trust the manifest: a shard that seals clean but measures over budget is bisected in place with the plan's partitioner and its halves re-execute, re-measure, and prove recursively; only a single block over budget is irreducible. The RAM budget is measured, not assembled from guesses: MemAvailable at run start times 1 - MODEL_RESIDUAL, where the residual (2%) is the campaign-measured gap between peak_prove_bytes and real prove RSS. Cutting belongs to the workers: each tests the mode's metric between blocks (exec: record_retained_bytes; plan/prove: the RAM model), so no polling gap exists; the watcher is a stall detector only. Remaining constants each carry one justification: CUT_FRAC (drain slack), PLAN_TRIGGER_FRAC (grouping resolution), MODEL_RESIDUAL (measured). IX_SCAN_RAM_GIB overrides the budget directly. CLI surface: `ix shard --backend aiur` (default) is the measured planner writing the `.ixes` manifest; `--backend zisk` keeps the static/profiled partitioners. Input flags: --env for the `.ixe`, --shards for the manifest, across check/prove/verify/addr-of/name-of/ validate-lean. Diagnostics: IX_WATCH_DUMP, IX_QM_LEN_PANIC, IX_SEG_DUMP_COUNTS, IX_EXEC_DUMP_COUNTS/KEYS, stall detection naming stuck blocks. Includes bench envs and campaign manifests, and the IxVM codegen regenerated against the merged #562 kernel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the IxVM's lazy definitional-equality path both more selective and strictly bounded. It avoids eagerly expanding symbolic
Natprimitives such as large-offset comparisons, while preventing projection/constant reduction cycles from silently refreshing their fuel budget.It also adds Batteries as a compile-environment benchmark target so the environment can be included in sharding and compatibility sweeps.
Details
Natprimitives in compact symbolic form. Closed primitive applications still dispatch normally, but applications containing bound variables no longer expand into potentially enormous successor/recursive terms.Natoffsets, projected/indexed values, and theInt8.toInt64_ne_minValueproof shape that exercises the eager compatibility path.CompileBatteriesalongside the existing compile-environment targets.Validation
6,097,645,626to6,098,300,309.