Skip to main content

Module ifds_gpu

Module ifds_gpu 

Source
Expand description

GPU-native IFDS/IDE driver (G3).

Build a BFS step over the exploded supergraph:

use weir::ifds_gpu::{ifds_gpu_step, IfdsShape};

let shape = IfdsShape {
    num_procs: 1, blocks_per_proc: 4, facts_per_proc: 4, edge_count: 4,
};
let step = ifds_gpu_step(shape, "fin", "fout").unwrap();

GPU-native IFDS/IDE driver (G3).

§What this does

IFDS / IDE reframes interprocedural dataflow as reachability on the exploded supergraph: each (proc, block, fact) triple is a graph vertex; the analysis reduces to BFS + bitset-fixpoint

  • primitives vyre already owns.

The pieces live in vyre_primitives::graph::exploded (node encoding + CSR builder), vyre_primitives::graph::csr_forward_traverse (BFS step), and vyre_primitives::fixpoint::bitset_fixpoint (convergence loop). This module composes them.

§Entry points

  • solve_cpu - in-process CPU reference. Conformance tests run this against the GPU output bit-for-bit.
  • [solve_borrowed_via] - production solver route: builds the exploded CSR through GPU dispatch and reuses borrowed ProgramGraph buffers through the fixpoint loop.
  • [ifds_gpu_step] - one BFS step over the exploded supergraph as a GPU [Program]. Caller dispatches this in a loop over (frontier_in, frontier_out) until the frontier stops growing (classic BFS-to-fixpoint). Allocates the exploded supergraph’s ProgramGraph buffers internally - the caller only provides the two frontier buffer names.

Structs§

IfdsBorrowedSolveScratch
Caller-owned host scratch for repeated one-shot IFDS solves.
IfdsGpu
Marker type for the GPU-native IFDS dataflow primitive.
IfdsPrepareScratch
Caller-owned host scratch for repeated IFDS CSR preparation.
IfdsShape
Dispatch geometry for one IFDS BFS step on the GPU.
IfdsSolveScratch
Caller-owned host scratch for repeated prepared IFDS solves.
PreparedIfdsCsr
Reusable IFDS exploded-supergraph CSR prepared once for many seed queries.
ResidentIfdsHostScratch
Caller-owned host scratch for repeated resident IFDS single-query solves.
ResidentIfdsParallelHostScratch
Caller-owned host scratch for repeated resident IFDS parallel solves.
ResidentIfdsParallelScratch
Reusable resident scratch buffers for parallel IFDS query batches.
ResidentIfdsScratch
Reusable resident IFDS scratch buffers.
ResidentPreparedIfdsCsr
IFDS CSR and invariant ProgramGraph buffers uploaded once to a backend.

Constants§

OP_ID
Stable primitive id for Weir’s GPU-native IFDS fixpoint route.

Traits§

IfdsResidentDispatch
Backend-neutral resident dispatch hooks for IFDS.

Functions§

allocate_resident_ifds_parallel_scratch
Allocate reusable resident scratch buffers for parallel IFDS batch solves.
allocate_resident_ifds_parallel_scratch_with_capacities
Allocate reusable resident scratch buffers for parallel IFDS batch solves with explicit query, iteration, and seed staging capacities.
allocate_resident_ifds_parallel_scratch_with_iterations
Allocate reusable resident scratch buffers for parallel IFDS batch solves with an explicit convergence iteration budget.
allocate_resident_ifds_scratch
Allocate reusable resident scratch buffers for IFDS solves.
allocate_resident_ifds_scratch_with_seed_capacity
Allocate reusable resident scratch buffers for IFDS solves with an explicit per-query seed fact staging capacity.
free_resident_ifds_parallel_scratch
Free reusable parallel IFDS scratch buffers.
free_resident_ifds_scratch
Free reusable IFDS scratch buffers created by allocate_resident_ifds_scratch.
free_resident_prepared_ifds_csr
Free invariant resident buffers created by upload_prepared_ifds_csr_resident or prepare_ifds_csr_resident_via.
ifds_gpu
Backwards-compatible three-string shim over ifds_gpu_step. The _exploded_adj argument is the ProgramGraph’s pg_edge_targets buffer; it is ignored here because the step kernel binds pg_edge_* at the canonical names. Kept so older call sites compile unchanged.
ifds_gpu_step
Emit one GPU BFS step over the exploded supergraph.
prepare_ifds_csr_borrowed_via
Build and pack the invariant IFDS CSR once for repeated GPU solves.
prepare_ifds_csr_borrowed_with_scratch_via
Prepare IFDS CSR buffers while reusing caller-owned dispatch output storage.
prepare_ifds_csr_resident_via
Build, pack, and upload IFDS invariant CSR buffers once for resident solves.
solve_borrowed_many_via
Solve several IFDS seed sets through one borrowed-buffer GPU preparation.
solve_borrowed_many_with_scratch_via
Solve several IFDS seed sets through one borrowed-buffer GPU preparation, reusing all host-side preparation and fixpoint scratch across queries.
solve_borrowed_via
Solve IFDS reachability through a caller-provided borrowed-buffer GPU dispatch.
solve_borrowed_with_scratch_via
Solve IFDS reachability through a borrowed-buffer GPU dispatch while reusing all host-side preparation and fixpoint scratch across calls.
solve_prepared_borrowed_into_via
Solve IFDS reachability over a prepared CSR while reusing caller-owned dispatch output storage across fixpoint iterations.
solve_prepared_borrowed_many_with_scratch_into_via
Solve several IFDS seed sets over one prepared CSR into caller-owned result rows while reusing all host-side solve scratch between queries.
solve_prepared_borrowed_many_with_scratch_via
Solve several IFDS seed sets over one prepared CSR while reusing all host-side solve scratch between queries.
solve_prepared_borrowed_via
Solve IFDS reachability over a CSR prepared by [prepare_ifds_csr_borrowed_via].
solve_prepared_borrowed_with_adapter_scratch_via
Solve IFDS reachability over a prepared CSR while adapting a borrowed Vec-returning dispatch into caller-owned solve scratch.
solve_prepared_borrowed_with_scratch_into_via
Solve IFDS reachability over a prepared CSR into caller-owned result storage while reusing all host-side solve scratch across calls.
solve_prepared_borrowed_with_scratch_via
Solve IFDS reachability over a prepared CSR while reusing all host-side frontier, decode, and backend-output scratch across calls.
solve_resident_prepared_many_parallel_via
Solve several IFDS seed queries against one resident CSR in parallel.
solve_resident_prepared_many_parallel_with_scratch_and_host_into_via
Solve several IFDS seed queries in parallel using caller-owned reusable resident buffers, host packing/readback scratch, and result storage.
solve_resident_prepared_many_parallel_with_scratch_and_host_via
Solve several IFDS seed queries in parallel using caller-owned reusable resident buffers and caller-owned host packing/readback scratch.
solve_resident_prepared_many_parallel_with_scratch_via
Solve several IFDS seed queries in parallel using caller-owned reusable parallel-batch scratch buffers.
solve_resident_prepared_many_via
Solve several IFDS seed queries against one resident CSR with one scratch frontier allocation and one scratch changed-flag allocation.
solve_resident_prepared_many_with_scratch_and_host_into_via
Solve several IFDS seed queries against one resident CSR using caller-owned reusable resident buffers, host packing/readback scratch, and result storage.
solve_resident_prepared_many_with_scratch_into_via
Solve several IFDS seed queries against one resident CSR using caller-owned reusable scratch buffers and caller-owned result storage.
solve_resident_prepared_many_with_scratch_via
Solve several IFDS seed queries against one resident CSR using caller-owned reusable scratch buffers.
solve_resident_prepared_via
Solve IFDS reachability using resident CSR/frontier buffers.
solve_via
Solve IFDS reachability through a caller-provided owned-buffer GPU dispatch.
upload_prepared_ifds_csr_resident
Upload an already prepared IFDS CSR into backend-resident buffers.
validate_ifds_problem