Skip to main content

Crate concinnity_cook

Crate concinnity_cook 

Source
Expand description

concinnity-cook: the build side, kept out of the runtime foundation so that foundation carries none of the build-only dependencies (fbxcel, sha2, kira). This crate turns world.jsonl + source files into the binary blobs the runtime reads; it depends on concinnity-core and core has no edge back into it.

The stages read in order: authoring is the authored model and the type vocabulary it is written in, build_only expands the types that never reach a blob, check validates the expanded world, and the compile path turns what is left into payloads. That path is three groups plus the orchestration that sequences them: import reads the artist-supplied source files, codec decodes the container and image formats they carry, compile turns an asset’s args and sources into its payload, and pipeline / blob / cache at the root drive the whole run.

Bridge: the vocabulary and compute modules below are re-exported crate-wide so code moved here keeps resolving its crate::{components,ecs,gfx,result} paths. crate::components is the runtime half only; the authoring-only types this crate expands away are named from crate::authoring::registry::build_only where they are used, so a use site says which half it works on. The payload decoders and shared payload types live in concinnity_core::bake; this crate’s modules call back into them. The source importers parse artist-supplied files, so a panic here is a crash on a malformed asset rather than a bug. Invariants that genuinely cannot fail use expect with the invariant named; tests unwrap freely.

Re-exports§

pub use build_only::prepare_world;
pub use pipeline::BuildProgress;
pub use pipeline::PipelineResult;
pub use pipeline::build_compiled;
pub use pipeline::build_compiled_with_progress;
pub use pipeline::build_from_path;
pub use pipeline::build_pipeline_from_str;
pub use pipeline::validate_asset;
pub use pipeline::validate_world_jsonl;
pub use pipeline::write_build_outputs;

Modules§

asset_api
Shared asset construction API.
authoring
The authored world model: world.jsonl parsing and I/O, the type vocabulary, the asset cross-reference metadata, the typed spec vocabulary, and the build-only args schemas. Everything the cook reads before it compiles anything. The authored world model: the input side of the cook.
blob
The blob WRITE side (build output): pack compiled payloads + the def table into .cnb files and emit world-lock.json. The byte format itself – the header, the record schema, and the encode_cnb image builder – is owned by the I/O-free concinnity-blob crate; this file owns the packing POLICY (payload distribution across overflow blobs, the size ceiling), the lock, and the writes themselves.
build_only
The build-time expansion passes: one module per build-only asset type, plus preset loading and the build front-half orchestrator.
cache
The build cache: what a cook produced for its own later runs, all of it in the one segment a host anchors.
check
Semantic validation of an expanded world: per-asset arg checks, cross-asset reference checks, and world-shape rules (crate::check::shape). Structural validation (name/type present, known type, unique names) happens earlier in crate::authoring::world::load_world.
compile
The compile path: per-asset payload compilers plus the whole-world passes that run with them. The compile path: what a validated world is turned into once nothing authoring-only is left in it. Most of these map one asset type’s args and sources onto that type’s binary payload; the rest are whole-world passes that the same stage runs (physics_budget counts what the runtime must reserve, scene_partition decides which scene a payload packs into, thumbnail renders previews from finished payloads, and character_shape warns on names that resolve against nothing).
import
Source-file readers: the scene expansion and the container readers it dispatches into. Source-file readers: the artist-supplied formats a build starts from, and the expansion that turns one of them into asset entries.
paths
The project state tree: where the engine’s state is anchored, and the names of the directories hanging off it.
pipeline
Compile stage of the build pipeline. The world is loaded, expanded, and validated upstream by crate::build_only::prepare_world; this module takes the resulting WorldJsonlAsset list and:
platform
The shader Platform vocabulary: which compiled shader form a rendering backend consumes. The enum is pure data with no ambient resolution of its own, so it sits in the runtime foundation and every caller states the platform it means – the engine names the backend it was built for, and the build pipeline is told the backend it cooks for.
resource_handles
Resource handle assignment over an authored world.

Macros§

for_each_build_only_type
The authoring-only list. $cb receives it as a build_only: group shaped exactly like concinnity-core’s groups, so one callback serves both.