nornir-mimir-lens (mimir_lens)
The Mímir lenses of nornir: analyses over a Mímir v2 dump of a Rust workspace (the source graph: nodes, edges, spans, symbols as Arrow files) and over nornir's warehouse tables. dwarves lens and cargo lens are the command-line doors; this crate is the library. The user guide (install, dump, every lens, the target architecture, the reports) is docs/v2/mimir/lens-guide.md; the reference with every lens's math is docs/v2/mimir/lenses.md.
lenses(featurelenses, default): the graph lenses (gate-bypass,size,twins,dispatch-erosion,cycles,single-impl,error-shape,cfg-sprawl,verdict,taint,chokepoints,misplaced,dsm,fail-open, the H1–H11 and B4 / B10 lenses, and the macro lensesreflexion,arch-recover,refactor-price,layer-stack,seam-interface,concept-scatter,ports-adapters,arch-report), the graph loaderlenses::Graphand its exact cache (lenses::cache, the.dwgcsnapshot; another format can be registered as acache::SnapshotStore), and thelens allplan. The graph algebra runs on SuiteSparse:GraphBLAS throughnornir-mimir-graph.coverage,coverage-fat: the coverage index and the Mímir v2 dump adapter.mimir,mimir-fat: the zombie / risk / bloat / collide folds.lens-graph,viz: re-exported from the light cratenornir-mimir-reach(reach over a fn graph, the graph-package file, the package-graph SVG views).
Build requirement
Feature lenses links the system SuiteSparse:GraphBLAS 7.x dynamically (through graphblas-sys); install it first:
sudo apt-get install -y libgraphblas-dev # Ubuntu / Debian: GraphBLAS 7.4
Without it, use default-features = false with lens-graph and/or viz, or depend on nornir-mimir-reach directly.
Example
,no_run
use mimir_lens::lenses::{self, reach_set::ReachArgs};
// A Mímir v2 dump directory (`cargo mimir-dump` writes one); the graph is cached.
let g = lenses::all::loaded(std::path::Path::new("path/to/mimir-dump"))?;
// Reach on GraphBLAS: does every entry reach a target?
let report = lenses::reach_set::run(
&g,
&ReachArgs {
entries: vec!["app main()".into()],
must_reach: vec!["app authorize".into()],
..Default::default()
},
)?;
println!("{}", report.text(0));
# Ok::<(), anyhow::Error>(())
Licence
MIT OR Apache-2.0. SuiteSparse:GraphBLAS (linked, not vendored) is Apache-2.0, Copyright Timothy A. Davis.