MCPcopy Create free account
hub / github.com/argumentcomputer/ix / profile_anon_ixe

Function profile_anon_ixe

crates/ffi/src/kernel.rs:1851–1895  ·  view source on GitHub ↗

Profile a `.ixe` out of circuit and write the `.ixprof` sidecar. Pure-Rust entry point (used by the FFI wrapper and Rust tests).

(
  path: &str,
  out: &str,
  isolate: bool,
  quiet: bool,
)

Source from the content-addressed store, hash-verified

1849 KItem::Block { block_addr, .. } => closure.contains(block_addr),
1850 })
1851 .cloned()
1852 .collect()
1853}
1854
1855/// FFI: anon-mode type-check of named constants with (by default) their full
1856/// dependency closures — the same mode and scope as the zkVM hosts' `--consts`
1857/// execute path, so an out-of-circuit run is directly comparable to the
1858/// in-circuit one. `skip_deps` restricts the check to each name's own work
1859/// item (subject-only; deps trusted), mirroring `zisk-host --skip-deps`.
1860///
1861/// Names resolve through the env's `named` metadata by displayed form (the
1862/// same string match the zkVM hosts use), then the metadata is dropped and
1863/// the check runs on the anon view — the kernel never sees names. A member
1864/// of a mutual block selects the whole block's work item (blocks check
1865/// atomically). Multiple names union their closures into one check set.
1866///
1867/// `json_path` (empty = off) additionally emits per-name benchmark results
1868/// rows. With it set, each name is checked as its own closure run — the
1869/// per-constant scope the zkVM hosts measure — instead of one union set:
1870/// the env still loads once, and each row's `check-time`/`peak-rss` window
1871/// wraps only that name's closure selection + check. Rows are flushed per
1872/// name, so a killed run keeps completed rows; a rejected name gets
1873/// `status: rejected` and the loop continues.
1874///
1875/// Returns `(hex_address, Option CheckError)` pairs, one per checked target,
1876/// exactly like `rs_kernel_check_anon` (concatenated across names when
1877/// per-name rows are on — shared deps then appear once per name that
1878/// re-checked them).
1879#[unsafe(no_mangle)]
1880pub extern "C" fn rs_kernel_check_anon_consts(
1881 env_path: LeanString<LeanBorrowed<'_>>,
1882 names: LeanArray<LeanBorrowed<'_>>,
1883 skip_deps: LeanBool<LeanBorrowed<'_>>,
1884 quiet: LeanBool<LeanBorrowed<'_>>,
1885 fail_out: LeanString<LeanBorrowed<'_>>,
1886 json_path: LeanString<LeanBorrowed<'_>>,
1887) -> LeanIOResult<LeanOwned> {
1888 let total_start = Instant::now();
1889 let quiet = quiet.to_bool();
1890 let skip_deps = skip_deps.to_bool();
1891 let path = env_path.to_string();
1892 let fail_out_path = fail_out.to_string();
1893 let fail_out_path =
1894 if fail_out_path.is_empty() { None } else { Some(fail_out_path) };
1895 let json_path = json_path.to_string();
1896 let names_vec: Vec<String> = names.map(|obj| obj.as_string().to_string());
1897 if names_vec.is_empty() {
1898 return LeanIOResult::error_string(

Callers 1

rs_kernel_profile_anonFunction · 0.85

Calls 8

build_block_profileFunction · 0.85
print_profile_summaryFunction · 0.85
num_blocksMethod · 0.80
num_edgesMethod · 0.80
build_anon_workFunction · 0.70
lenMethod · 0.45
to_bytesMethod · 0.45

Tested by

no test coverage detected