qualia_core_db/render/mod.rs
1//! Renderer / engine — the manifold projection + WebGPU viewport.
2//!
3//! Phase 0.2a (`RENDERER_IMPLEMENTATION_PLAN.md`): the formerly-flat `portal_*` modules are
4//! consolidated under one `render` tree. The platform-agnostic pieces (camera, PGA oracle,
5//! projection, telemetry, standpoint, spectral, acoustic, control, contract, asset import) compile
6//! everywhere. The WebGPU renderer core (`gpu`) compiles wherever `gpu-runtime` is enabled; only
7//! the browser facade (`portal`, `portal_wasm`) remains gated to wasm + `portal`.
8
9/// Cross-platform measured capability evidence and fail-closed acceptance gates.
10pub mod acceptance_contract;
11pub mod acoustic;
12/// Browser Anatomy render backends. Shared pack metadata remains in `anatomy_pack`.
13pub mod anatomy;
14/// Shared metadata schema for a `.hmc` anatomy asset pack (per-organ system /
15/// position / neutral colour). Platform-agnostic (native + WASM consumers).
16pub mod anatomy_pack;
17/// Bounded screen-space ambient occlusion quality profiles and bilateral reconstruction.
18pub mod ao_quality;
19/// HMC packaging and digest-verified resolution for compiled render assets.
20pub mod asset_package;
21/// Asset import: OBJ / STL / GLB → `Mesh` + semantic NQuins (Phase 1.3).
22pub mod assets;
23/// Shared authored sky, lighting and analytic-atmosphere presets.
24pub mod atmosphere;
25/// Authoring vocabulary + render planner (Phase 5): a qapp declares 3D + 2D views over one
26/// manifold; the planner enforces attestation gates, rights-bounded contexts, and budget-driven
27/// 3D→2D degradation before drawing. Gated like `place_time` (needs `crate::modalities`).
28#[cfg(any(
29 not(target_arch = "wasm32"),
30 feature = "wasm-logic",
31 feature = "wasm-scientific",
32 feature = "wasm-full"
33))]
34pub mod authoring;
35/// Validate-before-render barrier needs full `modalities::logic::geometry_asset_shacl`
36/// (not modalities_lite / wasm-ontology-only).
37#[cfg(any(
38 not(target_arch = "wasm32"),
39 feature = "wasm-scientific",
40 feature = "wasm-full"
41))]
42pub mod barrier;
43/// Person-authored body fit applied to decoded organ vertices (CCF space).
44pub mod body_fit;
45pub mod camera;
46pub mod camera_mount;
47/// Compile a `Mesh` into a sealed `.10d` container (the dense compiled-geometry sidecar)
48/// and read it back — the "mesh → `.10d`" step of the 3-D-anatomy asset pipeline.
49pub mod compile_10d;
50/// Attach the opt-in v2 identity manifest to an existing sealed `.10d` container.
51pub mod compile_10d_manifest;
52pub mod contract;
53pub mod control;
54/// Caller-buffered CPU RGBA8 mip reducer and format-specific reference filtering.
55pub mod cpu_texture_mips;
56/// Deferred resolve CPU reference oracle and continuous EMF spectral PBR integration.
57pub mod deferred_resolve;
58pub mod derivation;
59/// Deterministic validation gates and TAA Oklab perceptual clamping for entity compilation.
60pub mod entity_compile_gates;
61/// Allocation-free frame graph resource and pass dependency model.
62pub mod frame_graph;
63/// P7.2 — Gamut / object-colour solid + closest-point gamut mapping.
64pub mod gamut;
65/// P7.4 — GPU colour-projection / gamut batch kernel + CPU oracle.
66pub mod gpu_colour_kernel;
67/// Dynamic GPU memory & compute throughput governor.
68pub mod hardware_governor;
69/// Browser HMC mesh source verification and resident-upload lifecycle.
70pub mod hmc_playback;
71/// Generic, canvas-backed interactive HUD surface for browser render clients.
72#[cfg(all(target_arch = "wasm32", feature = "portal"))]
73pub mod hud;
74/// Caller-buffered CPU frustum visibility lists with stable source-index indirection.
75pub mod instance_culling;
76/// Physically-based and stylized cinematic lighting evaluation.
77pub mod lighting;
78/// Material-section compilation and readback helpers for versioned `.10d` assets.
79pub mod material_compile;
80/// Caller-buffered seam-aware box projection and source normal generation.
81pub mod mesh_surface_frames;
82/// Caller-buffered UV-aligned tangent frames for authored normal maps.
83pub mod mesh_tangent_frames;
84/// P7.1 — Metamers as the affine fibre of the colour-matching projection.
85pub mod metamer;
86/// Model-as-substrate (Phase 6, §F): one buffer holds a renderable manifold AND the transcoded
87/// P64 weights; the renderer projects the manifold while the weights are co-resident. Gated to
88/// where `crate::p64_weight` (the transcoder) compiles.
89#[cfg(any(not(target_arch = "wasm32"), feature = "wasm-llm"))]
90pub mod model_substrate;
91pub mod navigation;
92/// Scene-linear display output and manual exposure controls.
93pub mod output;
94pub mod pga;
95/// Physics of artefacts — bbox admission, kinematic joints, material/mass/momentum (Phase 2).
96pub mod physics;
97/// Place / space / time binding — an artefact NQuin queried by the spatio-temporal AND deontic
98/// modalities over one shared identity (Phase 3); delegates to the inherited modality stack.
99/// Gated to exactly the configs where `crate::modalities` (the values/logic layer it builds on)
100/// is compiled — native always; on wasm only with the logic/scientific/full feature sets, not the
101/// minimal `portal` bundle.
102#[cfg(any(
103 not(target_arch = "wasm32"),
104 feature = "wasm-logic",
105 feature = "wasm-scientific",
106 feature = "wasm-full"
107))]
108pub mod place_time;
109/// Unified manifold projection — one `project()`, many views (Phase 1.4).
110pub mod projection;
111/// Deterministic native/WASM render-quality admission and graceful-degradation budgets.
112pub mod quality_profiles;
113/// Fixed-memory adaptation policy with sustained-load hysteresis and bounded decision receipts.
114pub mod quality_runtime;
115/// N7: Scene graph — node hierarchy, lights, semantic links, duplication, IK, smooth damp.
116pub mod scene_graph;
117/// Bounded cold-path primitive assembly for authored interactive scenes.
118#[cfg(any(
119 not(target_arch = "wasm32"),
120 feature = "wasm-scientific",
121 feature = "wasm-full"
122))]
123pub mod scene_primitives;
124/// Screen-space visual angle error, retinal slip acuity, and 4-tier virtualization classifier.
125pub mod screen_metric;
126/// Sense path — the input twin (Phase 4): microphone PCM → forward DSP → the `∫Ψ > τ → Fact`
127/// bridge, every capture under the deontic/standpoint consent gate (surveillance-refusal default).
128/// Gated like `place_time` (needs `crate::modalities`).
129#[cfg(any(
130 not(target_arch = "wasm32"),
131 feature = "wasm-logic",
132 feature = "wasm-scientific",
133 feature = "wasm-full"
134))]
135pub mod sense;
136/// Caller-buffered VibeScript motor rig sampling, attachments and skinning.
137pub mod skeletal;
138pub mod spectral;
139/// Continuous EMF spectral basis functions (Jakob-Hanika), closed-form Gaussian moments, and wave optics.
140pub mod spectral_basis;
141/// P7.3 — σ spectral blend as interpolation on the spectral manifold.
142pub mod spectral_blend;
143#[cfg(test)]
144pub mod spectral_harness;
145/// P7.0 — Spectral-space kernel: SPD/CMF POD types + CIE linear-projection.
146pub mod spectral_kernel;
147/// Pure-Rust Levenberg-Marquardt spectral inversion solver, 32x32x32 LUT baker, and zero-heap trilinear sampler.
148pub mod spectral_lut;
149/// P7.7 — Unified spectral-operator API surface.
150pub mod spectral_operator;
151/// P7.8 — golden-oracle + CPU/GPU differential + determinism harness.
152pub mod spectral_oracle;
153pub mod standpoint;
154/// Bounded authored surface maps and planar UV projection, native and WASM.
155pub mod surface_authoring;
156pub mod telemetry;
157/// Reference math and host producer models for temporal accumulation.
158pub mod temporal_producers;
159/// Bounded temporal resolve policy, history lifecycle, and CPU reference oracle.
160pub mod temporal_resolve;
161/// Bounded, caller-buffered PNG/JPEG decode from verified external texture resources.
162pub mod texture_decode;
163pub mod texture_ingestion;
164/// Allocation-free KTX2 container metadata and level-range parser (native + WASM).
165pub mod texture_ktx2;
166/// Allocation-free decoder for uncompressed single-face RGBA8 KTX2 base levels.
167pub mod texture_ktx2_rgba8;
168/// Deterministic caller-buffered texture mip residency planning and budget admission.
169pub mod texture_stream_policy;
170pub mod texture_streaming_plan;
171/// Bounded zero-heap compressed texture transcode and block decode bridge.
172pub mod texture_transcode;
173/// Bounded zero-heap vegetation instance pool and dynamic collision bending.
174pub mod vegetation;
175pub mod water_surface;
176pub use entity_compile_gates as twin_compile_gates;
177
178#[cfg(test)]
179#[path = "terrain_seam_tests.rs"]
180mod terrain_seam_tests;
181
182#[cfg(test)]
183#[path = "texture_transcode_tests.rs"]
184mod texture_transcode_tests;
185
186/// LOD chain (P5.8): author mesh → decimate N LODs → serialize to `.10d` →
187/// renderer parses each level → `plan_view` selects the expected LOD. Gated
188/// like the scientific geometry stack (needs `crate::specialized_libs`).
189#[cfg(any(
190 not(target_arch = "wasm32"),
191 feature = "wasm-scientific",
192 feature = "wasm-full"
193))]
194pub mod lod_chain;
195
196/// WebGPU renderer (`PortalGpu`) — depth, bloom, tensor-node projection, mesh surfaces.
197#[cfg(feature = "gpu-runtime")]
198pub mod gpu;
199/// RDF / NQuin → 96-byte holographic node layout (10D fold, RGBA32F atlas).
200#[cfg(feature = "gpu-runtime")]
201pub mod rdf_holograph;
202/// VibeScript theatre adapter: eval `construct_theatre`, pack via `layout_placed_into`.
203#[cfg(feature = "gpu-runtime")]
204pub mod rdf_holograph_vibe;
205/// Naga bridge: WGSL → naga IR → GLSL ES 300 compilation.
206#[cfg(any(feature = "webgl2", feature = "wgsl-forge"))]
207pub mod naga_bridge;
208/// Naga IR sanitizer for WebGL2 (GLSL ES 300) compatibility.
209#[cfg(any(feature = "webgl2", feature = "wgsl-forge"))]
210pub mod naga_sanitize;
211/// The `#[wasm_bindgen]` portal facade (`QualiaPortal`) driving the browser viewport.
212#[cfg(all(target_arch = "wasm32", feature = "portal"))]
213pub mod portal;
214/// CPU decode for QualiaPortal `load_10d` (SurfaceReading + UV01 + MAT3/MAT4 + orbit-frame mesh).
215/// Lives outside the wasm-only `portal` facade so native tests can cover the colour/UV/MAT path.
216pub mod portal_load_10d;
217/// PNG/KTX2 ingest for `load_10d` materials. Decode budgets are not the Prolog sentinel.
218pub mod portal_load_textures;
219/// CPU admission of current EMF and explicit local-grid display projection.
220pub mod portal_load_emf;
221/// Bounded field ownership and GPU adoption/recovery state, testable natively.
222pub mod portal_emf_state;
223/// Admitted current QAC source and bounded exact-sample windows.
224pub mod portal_qac;
225#[cfg(all(target_arch = "wasm32", feature = "portal"))]
226pub mod portal_wasm;
227/// Borrowed source-bound pose contract and cold canonical model admission.
228pub mod source_frame;
229
230/// 4-Scale Botanical `.10d` Organ & Histology Dissection (`FLOWER` / `LEAF` / `WOOD` / `ROOT`).
231pub mod botanical_anatomy;
232/// Scale-5 Comparative Vertebrate 3-Layer `.10d` Anatomy (Skeletal / Muscular / Integument).
233pub mod vertebrate_anatomy;
234mod vertebrate_layer_materials;
235pub use vertebrate_anatomy as zoological_anatomy;