#pragma once #include "evo/world/coordinates.hpp" #include #include #include #include namespace evo::world { inline constexpr std::uint32_t base_chunk_edge = 16; inline constexpr std::uint32_t base_chunk_cells = 4096; // Raw request, validated on every entry. No implicit upgrade to newer versions. struct BaseDescriptor { std::uint64_t seed{}; std::uint32_t coordinate_version{1}; std::uint32_t generator_version{1}; std::uint32_t material_version{1}; std::uint32_t edge{base_chunk_edge}; auto operator<=>(const BaseDescriptor&) const = default; }; enum class GenerationError : std::uint8_t { unsupported_coordinates, unsupported_generator, unsupported_materials, unsupported_edge, invalid_voxel, invalid_chunk, unknown_material }; // Names carry no biological/chemical inventory or density. [[nodiscard]] std::expected material_name(std::uint32_t table_version, MaterialId id) noexcept; [[nodiscard]] std::expected base_sample(BaseDescriptor descriptor, VoxelAddress address) noexcept; // Bounded X-fast staging output, not resident chunk ownership or a wire record. // Allocation exceptions propagate to the host boundary. No partial result escapes. [[nodiscard]] std::expected, GenerationError> generate_base_chunk(BaseDescriptor descriptor, ChunkAddress address); } // namespace evo::world