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

Function rs_kernel_roundtrip

crates/ffi/src/kernel.rs:3063–3172  ·  view source on GitHub ↗
(
  env_consts: LeanList<LeanBorrowed<'_>>,
)

Source from the content-addressed store, hash-verified

3061 kenv: &mut KEnv<M>,
3062 mut before_kernel_check: F,
3063) -> CheckOutcome
3064where
3065 F: FnMut(&str),
3066 M::MField<Vec<Name>>: CheckDupLevelParams,
3067{
3068 let name = &names[i];
3069 let should_pass = expect_pass.get(i).copied().unwrap_or(true);
3070 // In anon mode, surface the content address in the per-constant log
3071 // line — the kernel itself doesn't see names. We still accept names
3072 // as input (and resolve them via `ixon_env.named` at the FFI
3073 // scheduling layer), so the user's identifier is preserved in the
3074 // CLI surface; only the kernel-visible progress label switches to a
3075 // hash. Falls back to the name if the address lookup fails.
3076 let display = if M::HAS_META {
3077 name.pretty()
3078 } else {
3079 match ixon_env.lookup_name(name) {
3080 Some(named) => format!("#{}", named.addr.hex()),
3081 None => name.pretty(),
3082 }
3083 };
3084
3085 if let Some(msg) = ungrounded.get(name) {
3086 return CheckOutcome {
3087 progress_index,
3088 progress_total,
3089 display,
3090 should_pass,
3091 result: Err((ErrKind::Compile, msg.clone())),
3092 status: CheckStatus::CompileFailed,
3093 elapsed: None,
3094 peak: None,
3095 };
3096 }
3097
3098 let prefix =
3099 format!(" [{}/{}] {display}", progress_index + 1, progress_total);
3100 before_kernel_check(&prefix);
3101
3102 let tc_start = Instant::now();
3103 let kid = match ingress_const_shallow_into_kenv_with_lookups(
3104 kenv, ixon_env, lookups, name,
3105 ) {
3106 Ok(kid) => kid,
3107 Err(msg) => {
3108 let elapsed = tc_start.elapsed();
3109 let status = if msg.contains("missing Named entry") {
3110 CheckStatus::NotFound
3111 } else {
3112 CheckStatus::Checked
3113 };
3114 return CheckOutcome {
3115 progress_index,
3116 progress_total,
3117 display,
3118 should_pass,
3119 result: Err((ErrKind::Kernel, msg)),
3120 status,

Callers

nothing calls this directly

Calls 11

decode_envFunction · 0.85
compile_env_with_optionsFunction · 0.85
ixon_egressFunction · 0.85
decompile_envFunction · 0.85
compare_envsFunction · 0.85
keyMethod · 0.80
valueMethod · 0.80
build_string_arrayFunction · 0.70
iterMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected