1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! DF-9 - persistent procedure summaries.
//!
//! Bottom-up fixpoint: compute a summary for each function describing
//! its effect on caller state (inputs tainted → outputs tainted,
//! inputs ranged → outputs ranged, etc.). Persist to the pipeline
//! cache keyed by function AST hash so unchanged functions are not
//! reanalysed across scans.
//!
//! This is the performance gate for the whole dataflow stack - Linux
//! has ~450k functions; reanalysing per-rule is infeasible without
//! summaries.
//!
//! # Implementation
//!
//! Two-layer composition:
//!
//! 1. **Kernel:** a single-dispatch Program that reads the
//! per-function input-bitset (`fn_ast_in`), unions callee
//! summaries from the callgraph (`callgraph_in`), falls back
//! to the previous iteration's cached summary
//! (`cached_summary_in`), and writes the new summary.
//!
//! 2. **Host loop:** the caller drives this Program in a
//! bottom-up order (callees before callers) using the topsort
//! primitive; once a function's summary is unchanged across two
//! consecutive passes it is written to the pipeline cache
//! (G8's blake3-keyed content cache) keyed by AST hash +
//! callee-summary hash.
//!
//! Soundness: inherited from the underlying primitives.
#[cfg(any(test, feature = "cpu-parity"))]
mod cpu_oracle;
mod dispatch;
mod program;
mod scratch;
mod soundness;
#[cfg(test)]
mod tests;
pub(crate) const OP_ID: &str = "weir::summary";
#[cfg(any(test, feature = "cpu-parity"))]
#[allow(deprecated)]
pub(crate) use cpu_oracle::summarize_function_cpu;
pub use dispatch::{
summarize_function_borrowed_into_result_with_scratch_via, summarize_function_borrowed_into_via,
summarize_function_borrowed_via, summarize_function_borrowed_with_scratch_via,
summarize_function_evidence_via, summarize_function_via,
};
pub use program::{summarize_function, summarize_function_with_count};
pub use scratch::SummarizeFunctionScratch;
pub use soundness::Summary;