//! ANE Probe โ€” reverse engineering Apple Neural Engine from pure Rust
//!
//! Level 1: IOKit service discovery โ€” find the ANE driver
//! Level 2: Open user client โ€” establish connection
//! Level 3: Probe selectors โ€” discover the IOKit command interface
//! Level 4: IOSurface creation โ€” prepare data buffers
//! Level 5: Attempt communication

#![allow(
    non_camel_case_types,
    non_upper_case_globals,
    non_snake_case,
    dead_code,
    clippy::too_many_arguments,
    clippy::unnecessary_cast,
    clippy::missing_transmute_annotations
)]

mod compile;
mod discovery;
mod eval;
mod ffi;
mod frameworks;

use ffi::*;

fn main() {
    println!("โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—");
    println!("โ•‘   ANE PROBE โ€” Pure Rust โ†’ Apple Neural Engine    โ•‘");
    println!("โ•‘   Target: M1 Pro / H11ANEIn / ane,t8020          โ•‘");
    println!("โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\n");

    // Level 1: Find the ANE driver in IORegistry
    let service = discovery::level1_discover();

    // Level 2: Try to open user client
    let connect = if let Some(svc) = service {
        let conn = discovery::level2_open(svc);
        unsafe {
            IOObjectRelease(svc);
        }
        conn
    } else {
        println!("\n  [!] No ANE service found in IORegistry");
        None
    };

    // Level 3: Probe selectors if we got a connection
    if let Some(conn) = connect {
        discovery::level3_probe(conn);
    } else {
        println!("\n  [!] No user client โ€” will still probe IOSurface and symbols");
    }

    // Level 4: IOSurface โ€” works regardless of ANE access
    let _surface = discovery::level4_surface();

    // Level 5: Load frameworks and enumerate C API
    let _fw = frameworks::level5_frameworks();

    // Level 6: Try ANEServices direct C calls
    frameworks::level6_direct_api();

    // Level 7: Compile MIL โ†’ ANE bytecode
    compile::level7_mil_compile();

    // Cleanup
    if let Some(conn) = connect {
        unsafe {
            IOServiceClose(conn);
        }
    }

    println!("\nโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•");
    println!("  PROBE COMPLETE");
    println!("โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•");
}

Synonyms

nox/cli/main.rs
optica/src/main.rs
trident/src/main.rs
hemera/cli/src/main.rs
rs/rsc/src/main.rs
radio/iroh-dns-server/src/main.rs
radio/iroh-relay/src/main.rs
radio/radio-cli/src/main.rs
nox/metal/src/main.rs
radio/particle/src/main.rs
cyb/cyb-boot/src/main.rs
cyb/src-tauri/src/main.rs
bostrom-mcp/rust/src/main.rs
strata/jali/cli/src/main.rs
strata/kuro/cli/src/main.rs
cyb/cyb/cyb-portal/src/main.rs
strata/genies/cli/src/main.rs
strata/trop/cli/src/main.rs
cyb/cyb/cyb-shell/src/main.rs
strata/nebu/cli/src/main.rs
honeycrisp/acpu/src/probe/main.rs
cyb/cyb/cyb-ui/src/main.rs
honeycrisp/unimem/experiments/iosurface_probe/src/main.rs
honeycrisp/unimem/experiments/hyp_probe/src/main.rs
honeycrisp/unimem/experiments/dext_contiguous_alloc/client/src/main.rs
honeycrisp/unimem/experiments/dext_iosurface_pa/client/src/main.rs

Neighbours