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

Function build_check_work

crates/ffi/src/kernel.rs:950–976  ·  view source on GitHub ↗
(
  ixon_env: &IxonEnv,
  names: &[Name],
  expect_pass: &[bool],
  ungrounded: &FxHashMap<Name, String>,
)

Source from the content-addressed store, hash-verified

948 Compile,
949}
950
951impl ErrKind {
952 fn tag(self) -> u8 {
953 match self {
954 ErrKind::Kernel => KERNEL_EXCEPTION_TAG,
955 ErrKind::Compile => COMPILE_ERROR_TAG,
956 }
957 }
958}
959
960/// Per-constant result: `Ok(())` on pass, `Err((kind, msg))` on rejection.
961type CheckRes = Result<(), (ErrKind, String)>;
962
963const KERNEL_CHECK_STACK_SIZE: usize = 256 * 1024 * 1024;
964
965unsafe extern "C" {
966 /// Lean runtime (`src/util/thread.cpp`): stack size, in bytes, for
967 /// subsequently spawned `lthread`s — dedicated task threads and new
968 /// task-pool workers. This is the knob behind `lean --tstack`.
969 fn lean_internal_set_thread_stack_size(size: usize);
970}
971
972/// `Ix.Tc.setLeanThreadStackSize : USize → BaseIO Unit`
973///
974/// ABI adapter: the runtime setter is a bare `void(size_t)`, so Lean can't
975/// `@[extern]` it directly. The pure-Lean parallel checker calls this before
976/// spawning its `.dedicated` workers so they get `KERNEL_CHECK_STACK_SIZE`-
977/// class stacks — deep recursor expansions overflow the default 8 MB
978/// `lthread` stack just like they would the Rust workers' (see above).
979#[unsafe(no_mangle)]

Callers 1

Calls 6

pushMethod · 0.80
lenMethod · 0.45
iterMethod · 0.45
getMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected