Expand description
Interval range propagation (DF-7).
Build a range-propagation Program:
use weir::range::range_propagate;
let program = range_propagate("defs_in", "edges_in", "ranges_out");DF-7 - value-range and symbolic-length lattice.
Interval abstract domain over integer-typed variables:
⟨lo, hi⟩ ∈ {−∞, ℤ, +∞}². Overflow tracked as a separate flag
so the domain is sound under wrap-around arithmetic.
Extended with symbolic-length expressions: len(buf) + k, where
k is a range constant. Critical for C05 (integer trunc →
undersized alloc → OOB) and C19 (ioctl size fields that bypass
copy_from_user bound checks when the lattice concretizes to a
non-trivial range).
§Implementation
Each variable occupies two consecutive u32 slots [lo, hi]
in the flat buffer. One invocation per variable, indexed by
InvocationId axis 0. The edge transfer is an additive shift
per variable (lo' = lo + t_lo, hi' = hi + t_hi) - the
simplest interval transfer that covers assign, add-const, and
symbolic-length-plus-k.
Meet at join points is the caller’s responsibility: join two
runs of this primitive with an element-wise min(lo, lo') /
max(hi, hi') kernel (built via vyre_primitives::math ops).
Soundness: MayOver in the standard
abstract-interpretation sense. Zero-FP rules that consume this
lattice must pair with DF-3 + an aliasing filter.
Structs§
- Range
- Marker type for the interval-range dataflow primitive.
- Range
Propagate Scratch - Caller-owned staging for repeated range propagation dispatches.
Functions§
- range_
propagate - Build one forward interval-propagation step.
- range_
propagate_ borrowed_ into_ result_ with_ scratch_ via - GPU range propagation using caller-owned staging/output scratch and caller-owned decoded result storage.
- range_
propagate_ borrowed_ into_ via - GPU range propagation using borrowed dispatch inputs and caller-owned output storage.
- range_
propagate_ borrowed_ via - GPU range propagation using borrowed dispatch inputs.
- range_
propagate_ borrowed_ with_ scratch_ via - GPU range propagation using borrowed dispatch inputs and caller-owned staging/output scratch.
- range_
propagate_ via - try_
range_ propagate - Checked version of
range_propagatefor callers that want uniform fallible construction. - try_
range_ propagate_ with_ count - Checked version that takes
var_countexplicitly.