Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
776cc63
shard: measured-ingress Aiur planner — touch graph, cost model, RAM p…
samuelburnham Aug 3, 2026
3d481b4
prove: batched, resumable all-shards mode with composed verdict
samuelburnham Aug 3, 2026
19ad8aa
bench: aiur-shard backend, Init env, shard-pipeline E2E test
samuelburnham Aug 3, 2026
f782071
shard: per-shard rebudget — surgical split of one shard, cached proof…
samuelburnham Aug 3, 2026
9427ae7
shard: recalibrate the Aiur cost model as a two-stage counters->FFT->…
samuelburnham Aug 3, 2026
600ab7f
aiur: lazy witness fault-in — IOBuffer faults env bytes on demand
samuelburnham Aug 4, 2026
1de5c72
shard scan: measured scan-and-cut sharding for Aiur
samuelburnham Aug 4, 2026
f5bab27
shard scan: batched measurement claims — one CheckEnv per 128 blocks
samuelburnham Aug 5, 2026
2705c4a
aiur: drop in-execution RAM tracking; ix check --execute whole-env mode
samuelburnham Aug 5, 2026
05e8b8b
aiur: analytic peak-prove-RAM model from circuit shapes
samuelburnham Aug 5, 2026
e82f047
scan: analytic RAM cut, cgroup process pool, width-first fast planning
samuelburnham Aug 5, 2026
806e9bc
scan: systemd-run worker caps, order-file startup, retuned pool plan
samuelburnham Aug 5, 2026
f0ee2a4
scan: bound the big lane by remaining headroom, not the pool
samuelburnham Aug 5, 2026
1b177e0
scan: drop the cold retry; size caps for a cold first batch
samuelburnham Aug 6, 2026
93df5fc
scan: exact record accounting; slice-derived sizing; continue-on-death
samuelburnham Aug 6, 2026
a06a5c1
name-of: batch --addrs-file resolution over one env decode
Aug 7, 2026
19fea11
scan: growth-derived claims, worker recycling, --defer-infeasible nam…
Aug 7, 2026
181dbaa
bench: whole-env aiur execute rows via envRows; drop aiur-shard backe…
Aug 7, 2026
e1a6f27
scan: union pricing — per-circuit membership sketches replace the col…
Aug 7, 2026
2d59e12
prove: closure-shard pipeline for heavy constants — per-shard RAM at …
Aug 8, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Ix/Aiur/Protocol.lean
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,27 @@ opaque vkBytes : @& AiurSystem → ByteArray
@[extern "rs_aiur_system_circuit_shapes"]
opaque circuitShapes : @& AiurSystem → Array CircuitShape

/-- Scan-and-cut sharding against a Rust-owned `EnvHandle`, cutting on
the system's analytic peak-prove-RAM prediction (the system carries
the toplevel, so none is passed). Numeric params are decimal strings:
budget (GiB), eps (percent), workers (0 = autoscale), fail-fast ("0"
skips kernel-rejected blocks into a `.failed.csv`). Writes the `.ixes`
manifest and its costs sidecar to the output path. -/
@[extern "rs_aiur_scan_shards_with_env"]
opaque scanShardsWithEnv : @& AiurSystem →
@& Bytecode.FunIdx → @& EnvHandle → @& String → @& String → @& String →
@& String → @& String → @& String → @& String → Except String Unit

/-- The child side of the scan's process pool: run the stdin/stdout
worker loop until EOF (see `crates/ffi/src/aiur/scan.rs`,
`scan_worker`). Spawned by the parent scan as `ix shard-worker`;
numeric params are decimal strings: cut (GiB), batch blocks, soft
record cut (GiB), schedule pieces, exec-only ("1"/"0"). -/
@[extern "rs_aiur_scan_worker"]
opaque scanWorker : @& AiurSystem →
@& Bytecode.FunIdx → @& EnvHandle → @& String → @& String → @& String →
@& String → @& String → Except String Unit

@[extern "rs_aiur_system_prove"]
private opaque prove' : @& AiurSystem →
@& Bytecode.FunIdx → @& Array G →
Expand Down
10 changes: 10 additions & 0 deletions Ix/Aiur/Semantics/BytecodeFfi.lean
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,16 @@ def shardCheckWithEnv (toplevel : @& Bytecode.Toplevel)
(shardCheckWithEnv' toplevel funIdx envHandle ownedBlob useBytecode).map
fun r => (r.output, .ofArrays r.ioData r.ioMap, r.queryCounts)

/-- Execute-only whole-env check through the codegen'd Aiur kernel: no
partition, no manifest — the check verdict plus measured totals,
reported on stderr. Args: workers (0 = autoscale), fail-fast ("0"
records and skips kernel-rejected blocks; anything else aborts on
the first). -/
@[extern "rs_aiur_execute_env_with_env"]
opaque executeEnvWithEnv : @& Bytecode.Toplevel →
@& Bytecode.FunIdx → @& EnvHandle → @& String → @& String → @& String →
@& String → Except String Unit

end Bytecode.Toplevel

end Aiur
Expand Down
41 changes: 36 additions & 5 deletions Ix/Cli/AddrOfCmd.lean
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
/-
`ix addr-of <Lean.Name> [--ixe <path>]`: resolve a Lean.Name to its
32-byte content address. Without `--ixe`, the lookup compiles the
name's transitive closure from the compiled-in Lean env (via
`IxVM.ClaimHarness.loadIxonEnv` → `lookupAddr`). With `--ixe`, the
`ix addr-of <Lean.Name> [--ixe <path>] [--ixes <manifest>]`: resolve a
Lean.Name to its 32-byte content address. Without `--ixe`, the lookup
compiles the name's transitive closure from the compiled-in Lean env
(via `IxVM.ClaimHarness.loadIxonEnv` → `lookupAddr`). With `--ixe`, the
lookup reads the env from disk and dispatches `Ixon.Env.getAddr?`.

Prints the resulting address hex on stdout (one line, no prefix), so
the output can be piped into `ix claim check $(ix addr-of …)` etc.
With `--ixes` (requires `--ixe`), a second line reports which shard of
the manifest's partition owns the name's check-schedule block — the
shard whose prove type-checks this constant.
-/
module
public import Cli
Expand All @@ -16,6 +19,7 @@ public import Ix.Environment
public import Ix.IxVM.ClaimHarness
public import Ix.Ixon
public import Ix.Meta
public import Ix.Cli.CheckCmd
public import Ix.Cli.NameResolve

public section
Expand All @@ -42,7 +46,33 @@ def runAddrOfCmd (p : Cli.Parsed) : IO UInt32 := do
| none =>
IO.eprintln s!"error: {name} not found in {path}"; return 1
| some addr =>
IO.println (toString addr); return 0
IO.println (toString addr)
if let some manifestPath := (p.flag? "ixes").map (·.as! String) then
-- Owning-shard lookup: the constant's check-schedule block (a
-- projection collapses to its SCC/Muts wrapper), searched in the
-- manifest's owned-block lists.
let c? : Option Ixon.Constant := Id.run do
for (a, lc) in ixonEnv.consts do
if a == addr then return lc.get?
return none
let some c := c?
| IO.eprintln s!"error: {addr} has no parseable constant in {path}"
return 1
let block := Ix.Cli.CheckCmd.blockAddrOf addr c
match Ix.Cli.CheckCmd.parseIxesShards
(← IO.FS.readBinFile manifestPath) with
| .error e =>
IO.eprintln s!"error: {manifestPath}: {e}"; return 1
| .ok shards =>
match (shards.mapIdx (fun k s => (s, k))).find?
(fun (s, _) => s.blocks.contains block) with
| some (s, k) =>
IO.println s!"block {block} → shard {k} \
({s.blocks.size} blocks, cost {s.cost})"
| none =>
IO.println s!"block {block} → no owning shard \
(excluded from the partition)"
return 0
| none =>
let env ← get_env!
if !env.constants.contains name then
Expand All @@ -62,6 +92,7 @@ def addrOfCmd : Cli.Cmd := `[Cli|

FLAGS:
"ixe" : String; "Path to a serialized `.ixe` env to resolve the name in. Without this, the name is looked up in the compiled-in Lean env (via `loadIxonEnv` → `lookupAddr`)."
"ixes" : String; "Path to a `.ixes` shard manifest (requires --ixe): also report which shard owns the name's check-schedule block — the shard whose prove type-checks this constant."

ARGS:
name : String; "Fully-qualified Lean.Name to resolve (e.g. `Nat.add_comm` or `Tests.Ix.Kernel.TutorialDefs.basicDef`)."
Expand Down
Loading
Loading