Expand description
Persistent procedure summaries (DF-9).
Build a summary-computation Program:
use weir::summary::summarize_function;
let program = summarize_function(
"fn_ast_in", "callgraph_in", "cached_summary_in", "summary_out",
);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:
-
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. -
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.
Structs§
- Summarize
Function Scratch - Caller-owned staging for repeated function-summary dispatches.
- Summary
- Marker type for the persistent-summary dataflow primitive.
Functions§
- summarize_
function - One summary-update step for a single function.
- summarize_
function_ borrowed_ into_ result_ with_ scratch_ via - GPU function-summary projection using caller-owned staging/output scratch and caller-owned decoded result storage.
- summarize_
function_ borrowed_ into_ via - GPU function-summary projection using borrowed dispatch inputs and caller-owned output storage.
- summarize_
function_ borrowed_ via - GPU function-summary projection using borrowed dispatch inputs.
- summarize_
function_ borrowed_ with_ scratch_ via - GPU function-summary projection using borrowed dispatch inputs and caller-owned staging/output scratch.
- summarize_
function_ evidence_ via - summarize_
function_ via - summarize_
function_ with_ count - Version that takes the bit-lane count explicitly.