indicatrix 0.1.0

A physically-based spectral gemstone renderer that turns GemCAD-style cutting schedules into rendered output.
Documentation
//! GPU compute infrastructure for `indicatrix` (behind the `gpu` feature).
//!
//! Adapter/device acquisition, a minimal compute-pipeline harness, buffer
//! upload/readback helpers, and the struct-layout/RNG/self-determinism
//! self-tests any physics port must pass before its output can be trusted.
//! Nothing here ports `optics::raytracer::trace_spectral_ray`; a real GPU
//! raytracer does not exist yet (`renderer::pipeline::IndicatrixRaytracerPipeline`
//! still panics unconditionally) and this module only provides the plumbing
//! and verification harness for a future port.
//!
//! # Modules
//!
//! - [`context`]: adapter/device acquisition ([`GpuContext`]).
//! - [`compute`]: generic compute-pipeline/buffer helpers.
//! - [`layout_check`]: struct-layout GPU echo test.
//! - [`rng_check`]: RNG/integer bit-exactness test against the CPU.
//! - [`determinism_check`]: GPU self-determinism test.
//!
//! `examples/gpu_equivalence_harness.rs` (gated on `gpu`, needs a real adapter
//! so it isn't a `cargo test` target) runs all three self-tests together.

pub mod compute;
pub mod context;
pub mod determinism_check;
pub mod layout_check;
pub mod rng_check;

// Geometry/environment self-tests: camera rays, `intersect_polyhedron`'s slab test,
// studio environment sampling, CIE 1931 CMF integration, von Kries white balance, and
// a furnace anchor checking all of those against analytic truth. No transport physics.
pub mod camera_check;
pub mod environment_check;
pub mod furnace_check;
pub mod polyhedron_check;
pub(crate) mod ulp;

// The full isotropic spectral estimator (Fresnel/TIR, Stokes-Mueller polarized
// transport, pleochroic Beer-Lambert absorption, Russian roulette, spectral MIS) --
// cubic materials only; birefringence is not covered here.
pub mod estimator_check;
pub mod transport_check;

// Self-test for `shading_normal_near_edge`, in its own file (own `planes` binding)
// rather than inside `transport_check`/`transport_functions.wgsl`.
pub mod shading_normal_check;

// The one module here that is NOT a self-test: renders an arbitrary scene with the
// megakernel every module above verifies, via the dispatch routine `estimator_check` uses.
pub mod frame;

// CPU+GPU hybrid rendering: GPU and every CPU core trace disjoint sample ranges of the
// same frame concurrently, merging into one image, on top of `frame`'s
// `GpuFrameRenderer`/`sample_offset` plumbing.
//
// Excluded on wasm32: racing the GPU via `std::thread::scope` needs real OS threads
// (absent on `wasm32-unknown-unknown`), and is a hard compile error there regardless --
// `s.spawn`'s closure captures `&mut GpuFrameRenderer`, and on the `webgpu` backend
// `wgpu::Device`'s internals hold `Rc`-based handles that aren't `Send`.
// `apps/indicatrix-web` never calls this module.
#[cfg(not(target_arch = "wasm32"))]
pub mod hybrid;

pub use context::{GpuAcquireError, GpuContext};
pub use frame::{AccumulateOutcome, GpuFrameError, GpuFrameRenderer, GpuFrameScene};