Back to Eqiora docs Skip to main content

eqiora/
lib.rs

1//! **eqiora** — the public facade.
2//!
3//! This is the only crate downstream users and physics packages depend on.
4//! Its stable and transitional exports are enumerated in
5//! `api/eqiora-facade-v1.json`; internal crates may refactor without silently
6//! expanding the curated surface. Physics packages must not depend on
7//! `eqiora-*` crates directly; that rule is enforced socially now and by the
8//! package toolchain later.
9//! The repository's `docs/architecture.md#dependency-layers` section is the
10//! human-readable contract; `cargo xtask check-layers` and
11//! `cargo xtask check-facade` enforce the two boundaries.
12//!
13//! Each underlying crate is also independently usable: depending on
14//! `eqiora-core` alone for its unit system is a legitimate use of Eqiora.
15
16mod release_identity {
17    pub const VERSION: &str = env!("CARGO_PKG_VERSION");
18}
19
20pub use eqiora_core::diagnostic::{self, Code, Diagnostic, GraphPath, Patch, Severity, Span};
21pub use eqiora_core::entity::{self, Entity, EntityKind, GraphClass, GraphKind, kinds};
22pub use eqiora_core::id::{Id, RawId};
23pub use eqiora_core::quantity::{
24    self, DimExponents, Dimension, DynQuantity, Quantity, Scalar, aliases, dim,
25};
26pub use eqiora_core::{
27    FiniteBasis, InvalidValueLiteral, InvalidValueShape, InvalidValueType, ScalarDomain,
28    ScalarType, TimeStateCoordinate, ValueFrame, ValueLiteral, ValueShape, ValueType,
29};
30/// Exact Cargo SemVer release identity of the public Eqiora facade.
31pub use release_identity::VERSION;
32
33/// Shared application operations used by thin language and Studio clients.
34///
35/// [`crate::api::ModelDocument::compile`] owns transport-neutral compilation;
36/// client adapters may apply their own admission and projection without
37/// redefining it.
38pub mod api {
39    pub use eqiora_api::editor::{
40        EditorDefinition, EditorPosition, EditorReference, EditorService, EditorSnapshot,
41        EditorSymbol, EditorSymbolKind, EditorWorkspaceService, EditorWorkspaceSnapshot,
42    };
43    pub use eqiora_api::{
44        CadBoxIntentV1, CadBoxPlanV1, CadRegenerationPlanV1, CadRenderProjectionV1,
45        CadRenderTriangleV1, CadSelectionRequestV1, CadSemanticEntityKindV1, CadSemanticEntityV1,
46        CadSemanticSelectionV1, CartesianDomainEditPlan, CartesianDomainEditResult,
47        CompleteEvaluationMap, DerivativeImplementation, DifferentiableCotangent,
48        DifferentiableEvaluation, DifferentiableProgram, DifferentiableProgramIdentity,
49        DifferentiableResult, DifferentiableTangent, DifferentiableValue,
50        DifferentiableValueSignature, DifferentiableValues, DifferentiationEvidence,
51        DifferentiationMode, EvaluationCollection, EvaluationCollectionGroup,
52        EvaluationMapExecutionPolicy, EvaluationMapOccurrence, EvaluationMapOccurrenceId,
53        EvaluationMapPlan, EvaluationMapProducts, EvaluationMapResult, EvaluationMapRetention,
54        EvaluationMapTerminalReport, GradientEstimator, LinearizationState, MathReference,
55        MathRendering, MlDatasetArtifactsV1, MlDatasetBlockArrayV1, MlDatasetDerivationPlanV1,
56        MlDatasetFieldSelectionV1, MlDatasetMaterializationLimitsV1, MlDatasetMaterializationV1,
57        MlDatasetSampleArraysV1, MlDatasetSampleSelectionV1, ModelDocument, ModelEntityRef,
58        MomentEstimator, MomentReduction, ParameterGeometryRegenerationPlan,
59        ParameterGeometryRegenerationResult, ParameterSampler, RecordedDifferentiableEvaluation,
60        RecordedEvaluationOutcome, RecordedMomentEstimator, RemeshingTrajectoryReplayInput,
61        RunRequest, SampledParameterPoint, ValueEditPlan, ValueEditResult, VerifiedMlDatasetV1,
62        derive_ml_dataset_v1, verify_ml_dataset_v1,
63    };
64    pub use eqiora_api::{DiagnosticRecord, DiagnosticSource};
65    pub use eqiora_numerics::SamplingIdentity;
66
67    /// Fresh XDMF artifact derivation and verified persisted replay.
68    #[cfg(feature = "xdmf")]
69    pub use eqiora_api::{
70        VerifiedXdmfImportV1, XdmfImportArtifactsV1, import_xdmf_v1, verify_xdmf_import_v1,
71    };
72
73    /// Fresh VTU artifact derivation and verified persisted replay.
74    #[cfg(feature = "vtu")]
75    pub use eqiora_api::{
76        VerifiedVtuImportV1, VtuImportArtifactsV1, import_vtu_v1, verify_vtu_import_v1,
77    };
78
79    /// Native HDF5-backed XDMF import and remeshing-trajectory export.
80    #[cfg(feature = "hdf5")]
81    pub use eqiora_api::{
82        VerifiedXdmfHdf5TrajectoryExportV1, XdmfHdf5ExportLimits,
83        XdmfHdf5TrajectoryExportArtifactsV1, export_common_result_xdmf_hdf5,
84        export_common_trajectory_xdmf_hdf5, import_xdmf_hdf5_v1, verify_xdmf_hdf5_import_v1,
85    };
86}
87
88/// Versioned control-v2 wire values and adapter for thin clients.
89///
90/// Compilation meaning remains owned by [`api::ModelDocument::compile`].
91pub mod control {
92    pub use eqiora_api::control::{
93        COMPILE_COMMAND_V1, COMPILE_V2_SCHEMA_JSON, CONTROL_PROTOCOL_V2, CompileControlExecutionV2,
94        CompileModelDescriptorV2, CompileOutcomeV2, CompileRequestV2, CompileResponseV2,
95        MAX_COMPILE_FILENAME_BYTES_V2, MAX_COMPILE_REQUEST_BYTES_V2, MAX_COMPILE_RESPONSE_BYTES_V2,
96        MAX_COMPILE_SOURCE_BYTES_V2, MAX_CONTROL_REQUEST_ID_BYTES_V2, execute_compile_v2,
97    };
98}
99
100/// Closed Semantic Kernel node definitions and residual expressions.
101pub mod kernel {
102    pub use eqiora_schema::kernel::*;
103}
104
105/// Standard Ontology: typed named subgraphs, never graph nodes.
106pub mod ontology {
107    pub use eqiora_core::{NamedSubgraph, OntologyId, OntologySchema, OntologyView, RawOntologyId};
108    pub use eqiora_schema::{
109        Coupling, CouplingView, EvidenceSet, EvidenceSetView, Model, ModelView, Objective,
110        ObjectiveView, Scale, ScaleView, Solver, SolverView,
111    };
112}
113
114/// Graph Federation: stores, typed transactions, semantic diff.
115pub mod graph {
116    pub use eqiora_graph::{
117        CommitRecord, Committed, Edge, EdgeKind, GraphStore, InMemoryGraphStore, Node, Op,
118        Precondition, Revision, Snapshot, Transaction,
119    };
120}
121
122/// Eqiora Language syntax, lossless tokens, parser, and canonical formatter.
123pub mod language {
124    pub use eqiora_lang::*;
125}
126
127/// Typed Eqiora Language lowering to Graph Federation transactions.
128pub mod compiler {
129    pub use eqiora_compiler::*;
130}
131
132/// Exact, offline model-package contracts and the locked compilation facade.
133pub mod package {
134    pub use eqiora_api::package::*;
135    pub use eqiora_package::*;
136}
137
138/// Backend-independent lowered representations.
139pub mod ir {
140    pub use eqiora_ir::{
141        BoundAffineFailure, BoundAffineScalarIr, ComponentLinearization, ComponentScalarRow,
142        ComponentScalarization, ConstantSymbolJacobian, DenseOutputLinearization,
143        DifferentiationRole, DiscreteStepLinearization, LinearizedOutput, LinearizedRelation,
144        LocalLinearActionIr, RelationCotangent, RelationTangent, ScalarInputSlot,
145        ScalarLinearization, ScalarOperatorIr, ScalarSymbolCoordinate, SymbolicLinearityFailure,
146    };
147}
148
149/// Implicit forward and adjoint differentiation over lowered relations.
150pub mod differentiation {
151    pub use eqiora_differentiation::*;
152}
153
154/// Backend-neutral local contributions, assembly maps, and sparse algebra.
155pub mod assembly {
156    pub use eqiora_assembly::*;
157}
158
159/// Backend-neutral device identity, capability, residency, and evidence.
160pub mod device {
161    pub use eqiora_device::*;
162}
163
164/// Numerical realizations kept separate from canonical model meaning.
165pub mod numerics {
166    pub use eqiora_numerics::ale::{
167        AleFsiCartesianModel, FinalizedResolvedFixedTopologyAleFsi,
168        finalize_resolved_fixed_topology_ale_fsi_2d, lower_ale_fsi_cartesian,
169    };
170    pub use eqiora_numerics::fluid::{
171        FinalizedSteadyStokesMini2dProblem, IncompressibleFlowScaleProfile2d,
172        SteadyIncompressibleStokesModel2d, SteadyStokesMiniSolution2d,
173        finalize_resolved_steady_stokes_mini_2d, lower_steady_incompressible_stokes_cartesian_2d,
174        solve_resolved_steady_stokes_mini_2d,
175    };
176    pub use eqiora_numerics::scalar::{
177        FinalizedScalarEllipticCartesianProblem, ResolvedScalarEllipticCartesianSolution,
178        ScalarEllipticCartesianModel, finalize_scalar_elliptic_cartesian,
179        lower_scalar_elliptic_cartesian, solve_resolved_scalar_elliptic_cartesian,
180    };
181    pub use eqiora_numerics::solid::{
182        CartesianLinearElasticity2dSolution, FinalizedIsotropicElasticityCartesian2dProblem,
183        IsotropicElasticityContinuum, finalize_resolved_isotropic_elasticity_cartesian_2d,
184        lower_isotropic_elasticity_cartesian_2d, solve_resolved_isotropic_elasticity_cartesian_2d,
185    };
186}
187
188/// Backend-neutral mesh topology, affine geometry, and quality contracts.
189pub mod meshing {
190    pub use eqiora_meshing::*;
191}
192
193/// Geometry identity, geometry-to-mesh correspondence, and kernel-neutral CAD
194/// contracts.
195pub mod geometry {
196    pub use eqiora_geometry::*;
197
198    /// Concrete bounded Truck STEP/B-rep implementation of the CAD contracts.
199    #[cfg(feature = "cad-truck")]
200    pub mod truck {
201        pub use eqiora_cad_truck::*;
202    }
203}
204
205/// External-format adapters. Imported data is always reconstructed
206/// through the backend-neutral contracts exposed by [`meshing`].
207pub mod io {
208    /// Bounded ASCII and binary Gmsh MSH 4.1 simplex import.
209    pub use eqiora_io_gmsh as gmsh;
210
211    /// Pure, bounded VTU and XDMF adapters with caller-owned replay.
212    #[cfg(any(feature = "vtu", feature = "xdmf"))]
213    pub use eqiora_io_xml as xml;
214
215    /// Native HDF5 file-image resolution with no caller path authority.
216    #[cfg(feature = "hdf5")]
217    pub mod hdf5 {
218        pub use eqiora_io_hdf5::*;
219    }
220}
221
222/// Backend-neutral solver plans, operators, capabilities, and evidence.
223pub mod solver {
224    pub use eqiora_solver::*;
225}
226
227/// Backend-neutral lowered time problems, adaptive plans, and evidence.
228pub mod time {
229    pub use eqiora_time::*;
230}
231
232/// Transport-neutral distributed ownership, halo, and collective contracts.
233pub mod distributed {
234    pub use eqiora_distributed::*;
235}
236
237/// Optional production execution adapters.
238pub mod backends {
239    /// faer host linear-algebra adapter.
240    #[cfg(feature = "faer")]
241    pub mod faer {
242        pub use eqiora_backend_faer::*;
243    }
244
245    /// MPI distributed-transport adapter.
246    #[cfg(feature = "mpi")]
247    pub mod mpi {
248        pub use eqiora_backend_mpi::*;
249    }
250
251    /// Diffsol adaptive ODE and mass-matrix DAE adapter.
252    #[cfg(feature = "diffsol")]
253    pub mod diffsol {
254        pub use eqiora_backend_diffsol::*;
255    }
256
257    /// Dynamically loaded single-device CUDA adapter.
258    #[cfg(feature = "cuda")]
259    pub mod cuda {
260        pub use eqiora_backend_cuda::{
261            CUDA_ADAPTER_VERSION, CUDA_BINDING_TOOLKIT, CUDA_LINEAR_EXECUTION,
262            CUDA_LINEAR_EXECUTION_PROVIDER, CUDA_LINEAR_SOLVER_BACKEND,
263            CUDA_LINEAR_SOLVER_PROVIDER, CUDA_RUNTIME_ID, CUDARC_VERSION, CudaComputeCapability,
264            CudaCsrActionEvidence, CudaCsrActionResult, CudaCsrTransferEvidence,
265            CudaLibraryVersions, CudaLinearSolveEvidence, CudaLinearSolveResult, CudaLinearSolver,
266            CudaLinearTransferEvidence, CudaRuntime, verify_csr_action, verify_csr_action_against,
267        };
268    }
269
270    /// Explicit host-staged MPI plus rank-local CUDA composition adapter.
271    #[cfg(feature = "mpi-cuda")]
272    pub mod mpi_cuda {
273        pub use eqiora_backend_mpi_cuda::*;
274    }
275
276    /// Run-owned Rayon CPU adapter.
277    #[cfg(feature = "rayon")]
278    pub mod rayon {
279        pub use eqiora_backend_rayon::*;
280    }
281}
282
283/// Versioned model/run artifacts and deterministic content identity.
284pub mod artifact {
285    pub use eqiora_artifact::*;
286}
287
288/// Typed Realization Graph policies kept separate from model meaning.
289pub mod realization {
290    pub use eqiora_realization::*;
291}
292
293/// Lowered Rust CPU execution and backend conformance.
294pub mod runtime {
295    pub use eqiora_runtime::*;
296}
297
298/// Reference semantics: the interpreter that defines what programs mean.
299pub mod sem {
300    pub use eqiora_sem::{
301        ComposedResidualSystem, ExecutionProgress, ExecutionSession, Interpreter, KernelProgram,
302        PhysicalUnknown, ReferenceConfig, Sample, ScalarPhysicalSubsystemId, Trajectory,
303    };
304}