Skip to main content

Module wgsl_forge

Module wgsl_forge 

Source
Expand description

Deterministic WGSL generation, validation, certification, and tuning.

WGSL Forge treats shader semantics and hardware scheduling as separate typed inputs. Tuning is therefore allowed to change work distribution without changing the mathematical operation being certified.

Re-exports§

pub use backend::resolve_execution_backend;
pub use cache::ManifestCache;
pub use dispatch::caps;
pub use dispatch::coopmat_usable;
pub use dispatch::fft_f32;
pub use dispatch::gemm_cpu_f64;
pub use dispatch::gemm_f32;
pub use dispatch::gemm_f32_tc;
pub use dispatch::gemm_f32_tc_coopmat;
pub use dispatch::gemm_f32_tc_reduced;
pub use dispatch::gemm_f64;
pub use dispatch::gemm_f64_df64;
pub use dispatch::gemv_cpu_f64;
pub use dispatch::gemv_f32;
pub use dispatch::gemv_f64;
pub use dispatch::pairwise_sq_dist_cpu_f64;
pub use dispatch::pairwise_sq_dist_f64;
pub use dispatch::ComputeCaps;
pub use dispatch::GEMM_GPU_THRESHOLD;
pub use emit::decode_spirv_words;
pub use emit::emit_shader;
pub use emit::matmul_tc_wgsl;
pub use emit::GeneratedShader;
pub use emit::TargetBackend;
pub use ir::BufferAccess;
pub use ir::BufferElement;
pub use ir::BufferSpec;
pub use ir::BuiltinKernel;
pub use ir::KernelSpec;
pub use ir::Op;
pub use ir::P64GpuWords64;
pub use ir::ScalarType;
pub use ir::SharedLen;
pub use ir::SharedMemorySpec;
pub use manifest::AdapterIdentity;
pub use manifest::CertificationManifest;
pub use manifest::HardwareProfile;
pub use manifest::TimingSource;
pub use manifest::TimingSummary;
pub use manifest::TuningManifest;
pub use manifest::ValidationLevel;
pub use oracle::candidate_evaluation;
pub use oracle::certify_builtin;
pub use oracle::compare_f32;
pub use oracle::dft_cpu;
pub use oracle::evaluate_builtin;
pub use oracle::evaluate_ffn;
pub use oracle::evaluate_fft;
pub use oracle::evaluate_matmul_tc;
pub use oracle::evaluate_p64;
pub use oracle::evaluate_topk;
pub use oracle::ffn_cpu;
pub use oracle::ffn_tensors;
pub use oracle::fft_inputs;
pub use oracle::matmul_cpu;
pub use oracle::p64_project_cpu;
pub use oracle::p64_records;
pub use oracle::topk_cpu;
pub use oracle::topk_inputs;
pub use oracle::AffineParams;
pub use oracle::ComparisonReport;
pub use oracle::FfnParams;
pub use oracle::FftParams;
pub use oracle::GpuEvaluation;
pub use oracle::OracleCase;
pub use oracle::OracleTolerance;
pub use oracle::TopKParams;
pub use oracle::evaluate_affine_cuda;
pub use oracle::evaluate_ffn_cuda;
pub use oracle::evaluate_topk_cuda;
pub use roofline::roofline_for;
pub use roofline::RooflineBound;
pub use roofline::RooflineEstimate;
pub use runtime::ForgeRuntime;
pub use schedule::AdapterConstraints;
pub use schedule::Schedule;
pub use schedule::ScheduleSpace;
pub use tune::tune_with;
pub use tune::CandidateEvaluation;
pub use tune::CandidateFailure;
pub use tune::CandidateResult;
pub use tune::TuningConfig;
pub use tune::TuningResult;
pub use validate::validate_native;
pub use validate::validate_wgsl;
pub use validate::ValidationReport;

Modules§

audio
Forge-native audio kernels (GPU compute with a CPU oracle + parity certify).
backend
Automatic native→fallback backend selection (plan §2).
cache
calibration
W10 — Forge calibration pipeline (the training-related upgrade).
dispatch
Capability-aware “best path on this machine” compute dispatcher, keystoned on GEMM.
emit
execute
graph_ops
Native compute-graph op-node kernels — WGSL templates emitted directly from a graph node (not delegated to a legacy BuiltinKernel emitter, since these op-classes have no legacy standalone kernel). Each carries an exact CPU oracle and a GPU differential certify, exactly like the rest of the forge.
ir
manifest
oracle
GPU-forge differential oracle: CPU references, the numeric comparator, the GpuEvaluation evidence bundle, and the per-kernel evaluators that certify emitted shaders against those references.
physics
Certified physics forge kernels — complete, deterministic compute shaders with exact CPU oracles, naga validation, and GPU certification.
roofline
Simple roofline estimates per kernel (plan §6 / §10).
runtime
Consumer-facing runtime for the certified WGSL Forge.
schedule
tune
validate

Enums§

ForgeError

Constants§

CUDARC_API_VERSION
cudarc crate API version the cross-backend (CUDA) oracle is built against. Folded into the tuning/certification cache key (plan §8) so reuse is invalidated when the CUDA toolchain surface changes.
FORGE_SCHEMA_VERSION
NAGA_API_VERSION
WGPU_API_VERSION

Functions§

generate_builtin