Skip to main content

Crate vyre_self_substrate

Crate vyre_self_substrate 

Source
Expand description

Self-substrate — vyre using its own primitives to compile/dispatch vyre.

These modules realize the recursion thesis (#30): every Tier-2.5 primitive shipped in vyre-primitives also has a vyre-self consumer here that uses the same Program at compile / dispatch time.

§Layering (audit cleanup A10, 2026-04-30)

Extracted from vyre-driver/src/self_substrate/ into a dedicated crate so the substrate-self-uses live at a layer that depends only on vyre-foundation + vyre-primitives — eliminating the layering muddle where backend-specific dispatch code and substrate self-uses shared one home in vyre-driver.

  vyre-foundation
        ↑
  vyre-primitives
        ↑
  vyre-self-substrate          ← THIS CRATE (no driver deps)
        ↑
  vyre-driver / vyre-runtime / vyre-libs / vyre-driver-{cuda,wgpu}

No cycles. Every consumer above this crate reaches the substrate via vyre_self_substrate::* directly.

vyre-foundation cannot consume self_substrate from here because self_substrate depends on vyre-primitives which depends on vyre-foundation — that’s the cycle that justifies the dedicated crate. Foundation has its own smaller substrate at vyre_foundation::pass_substrate (with the math kernels it needs inlined locally — same pattern Linux uses for arch-local libs vs lib/).

§Module list

  • dataflow_fixpoint (#26) — Region-graph dataflow fixpoint via vyre-primitives::math::semiring_gemm over the Region adjacency.
  • cost_model (#28) — probabilistic dispatch cost model via vyre-primitives::graph::sum_product_circuit + conformal intervals from vyre-primitives::math::conformal.
  • vsa_fingerprint (#29) — VSA op-cache key via vyre-primitives::hash::hypervector.
  • spectral_schedule (#23) — spectral clustering of dispatch graph via vyre-primitives::graph::chebyshev_filter + vyre-primitives::math::spectral_shape.
  • differentiable_autotune (#27) — differentiable autotuner via vyre-primitives::math::differentiable.
  • polyhedral_fusion (#19) — polyhedral / affine fusion via vyre-primitives::math::semiring_gemm on the affine-dependency adjacency.
  • megakernel_schedule (#22) — megakernel ILP relaxation via vyre-primitives::opt::homotopy continuation.
  • tensor_train_chain_fusion (#6) — chain-shaped Region fusion via vyre-primitives::math::tensor_train::tt_contract_step contraction.
  • do_calculus_change_impact (#36) — rule-graph change-impact analysis via vyre-primitives::graph::do_calculus graph surgery.
  • scallop_provenance (#39) — GPU-resident rule provenance closure via vyre-primitives::math::scallop_join Datalog fixpoint.
  • matroid_megakernel_scheduler (#46) — discrete fusion-grouping via matroid intersection augmenting paths. Complements megakernel_schedule (#22 homotopy continuous solver) with the exact combinatorial selection.
  • mori_zwanzig_region_coarsen (#58) — Region-tree coarse-graining via Mori-Zwanzig projection. Reduces O(N²) all-pairs analyses to O(K²) at workspace scale with quantified projection error.
  • fmm_polyhedral_compress (#51) — FMM hierarchical compression of #19 polyhedral fusion’s all-pairs affinity. Drops cost from O(N²) to O(N log N) at workspace scale.
  • submodular_cache_eviction (#45) — pipeline-cache eviction via submodular maximization. Replaces LRU’s heuristic with the provably-(1-1/e) greedy approximation.
  • qsvt_matrix_function_fusion (#34) — transport-based fusion analysis via QSVT-applied matrix functions. Computes Wasserstein distances on dispatch graphs in O(K·N²) instead of O(N³).
  • persistent_homology_loop_signature (#15) — Region-tree loop topology via Vietoris-Rips filtration. Fusion-vs-fission decision informed by H₁ persistent features.
  • adjustment_set_pass_dependency (#37) — optimizer pass-ordering validity via causal back-door analysis on the rewrite-precondition graph.
  • functorial_pass_composition (#52) — IR transform passes as categorical functors. Compositionality, equational reasoning, free adjoint pairs — pass framework moves from hand-managed DAG to a typed functor-category.
  • string_diagram_ir_rewrite (#53) — Vyre IR Region tree IS a string diagram in Cat(GPU buffers, Programs). Optimizer rewrites become string-diagram rewrites; coherence theorems give free correctness proofs.
  • planar_rewrite_pass_scheduler (#11) — schedule batch IR rewrites onto disjoint sub-trees via planar non-overlapping selection. Drops dispatch count from O(N) sequential to O(log N) batched.

Modules§

adjustment_set_pass_dependency
Optimizer pass-ordering validity via causal adjustment-set analysis.
alias_registry
Alias-registry substrate consumer.
amg_pass_solver
Algebraic-multigrid V-cycle for matroid-intersection LP relaxation.
bellman_tn_order
Tensor-network contraction order via shortest-path on the contraction-cost graph.
bitset_summary
Bitset summary substrate consumer.
categorical_check
Categorical-substrate consumer (P-PRIM-16/17/18).
cost_model
Probabilistic dispatch cost model via #10 sum_product_circuit (#28).
csr_bidirectional
Region-graph bidirectional one-step reach substrate consumer.
csr_forward_or_changed
In-place expand-with-change-flag substrate consumer.
dataflow_fixpoint
Region-graph dataflow fixpoint via #1 semiring_gemm (#26 substrate).
decision_telemetry
Substrate-decision telemetry (P-OBS-2).
differentiable_autotune
Differentiable autotuner via #7 differentiable softmax / argmax (#27).
dnnf_compile
d-DNNF compilation substrate consumer (P-PRIM-6).
do_calculus_change_impact
Rule-graph change-impact as a Pearl do-calculus query (#36 substrate).
dominator_frontier
Region-graph dominance-frontier substrate consumer.
effect_signature_check
Effects-typed signature checker substrate consumer (P-PRIM-13).
exploded
Exploded-supergraph (IFDS encoding) substrate consumer.
fmm_polyhedral_compress
Polyhedral-fusion all-pairs compression via #51 FMM (#19+#51 self-consumer).
functorial_pass_composition
IR transform passes as categorical functors (#52 self-consumer).
kfac_autotune_step
K-FAC step inside vyre’s natural-gradient autotuner.
knowledge_compile_pass_precondition
Pass-precondition compilation via #38 knowledge compilation (#38 self-consumer).
level_wave_pass
Interprocedural callee-before-caller pass dispatch via #74 level_wave (#74 self-consumer).
linear_type_check
Substructural-type discipline substrate consumer (P-PRIM-14).
matroid_exact_megakernel
Exact (Edmonds) matroid intersection for megakernel fusion-grouping.
matroid_megakernel_scheduler
Megakernel fusion-grouping via #46 matroid intersection (#22 self-consumer).
megakernel_schedule
Megakernel auto-scheduler via #9 homotopy continuation (#22).
mori_zwanzig_region_coarsen
Region-tree coarse-graining via #58 Mori-Zwanzig projection (#58 self-consumer).
motif
Region-graph motif-matching substrate consumer.
multigrid_matroid_solver
Sparse linear-system solver for matroid intersection via #50 algebraic multigrid (#50 self-consumer).
natural_gradient_autotuner
Autotuner gradient direction via #56 natural_gradient (#56 self-consumer).
observability
Substrate-call observability counters.
path_reconstruct
Path-reconstruction substrate consumer.
persistent_bfs
Multi-step BFS frontier expansion substrate consumer.
persistent_fixpoint_program
Persistent-fixpoint Program builder for runtime and driver scheduling loops.
persistent_homology_loop_signature
Region-tree loop topology via #15 vietoris_rips (#15 self-consumer).
planar_rewrite_pass_scheduler
IR rewrite-batch scheduler via #11 planar_rewrite (#11 self-consumer).
polyhedral_fusion
Polyhedral / affine fusion via #1 semiring_gemm on the affine dependency adjacency (#19 substrate).
qsvt_matrix_function_fusion
Transport-based fusion analysis via #34 QSVT (#34 self-consumer).
scallop_provenance
GPU-resident rule-provenance tracking via #39 scallop_join (#39 substrate).
scallop_provenance_wide
Provenance closure tracking up to W·32 source rules.
shape_smt_check
Shape-predicate / liquid-type SMT substrate consumer (P-PRIM-15).
sheaf_heterophilic_dispatch
Heterophilic dispatch-graph analysis via #31 sheaf diffusion (#31 self-consumer).
sheaf_spectral_clustering
Sheaf-spectral clustering of dispatch graphs.
sinkhorn_dispatch_clustering
Dispatch-graph clustering via #2 sinkhorn (#30 substrate).
sinkhorn_full_clustering
Full Sinkhorn-balanced dispatch-graph clustering.
spectral_schedule
Spectral analysis of dispatch graph via #5 chebyshev_filter + #17 spectral_shape (#23 substrate).
string_diagram_ir_rewrite
Vyre IR Region tree as a string diagram (#53 self-consumer).
submodular_cache_eviction
Pipeline-cache eviction via #45 submodular maximization (#45 self-consumer).
tensor_network_fusion_order
Re-export foundation substrate for unified fusion planning (Item #68).
tensor_train_chain_fusion
Tensor-train chain fusion analyzer (#6 substrate).
tensor_train_compression
Tensor-train compression of the dispatch-graph cost tensor.
toposort
DAG topological-sort substrate consumer.
union_find_emit
Union-find substrate consumer.
vsa_fingerprint
VSA-based op cache key via #13 hypervector primitives (#29).
zx_rewrite
ZX-rewriter substrate consumer (P-PRIM-5).