Skip to main content

Module summary

Module summary 

Source
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:

  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.

Structs§

SummarizeFunctionScratch
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.