Skip to main content

qualia_core_db/wgsl_forge/physics/
mod.rs

1//! Certified physics forge kernels — complete, deterministic compute shaders with exact
2//! CPU oracles, naga validation, and GPU certification.
3//!
4//! These formalise the previously-orphan `src/shaders/{molecular_dynamics,kinematics}.wgsl`:
5//! nothing in the codebase loaded them, and as written they were incomplete or unsafe —
6//! the MD shader updated position but left velocity unchanged (half an integrator), and
7//! the kinematics shader read and wrote the *same* buffer (a data race making the result
8//! non-deterministic). The kernels here are corrected (complete velocity-Verlet;
9//! double-buffered, Plummer-softened N-body), embedded from the `.wgsl` via `include_str!`
10//! so there is a single source of truth, graded against a Rust oracle, and runnable on any
11//! wgpu adapter.
12//!
13//! **Deliberately not here (reserved for curation, not faked):**
14//! - `fluid_dynamics.wgsl` — a `velocity *= 0.99` placeholder labelled "mock Navier–Stokes".
15//! - `quantum_bio.wgsl` — non-compiling (invalid inline-struct syntax, builtin shadowing)
16//!   and partly demo-grade (one uniform reused as several unrelated physical quantities).
17//!
18//! Formalising those two requires a decision on the intended physical model (which fluid
19//! scheme; which quantum-biology observables and their real parameterisation) — an
20//! out-of-band call that belongs to Timothy, so they are left for that direction rather
21//! than dressed up as complete.
22
23pub mod kinematics;
24pub mod molecular_dynamics;