Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::sim::nest_detail Namespace Reference

Classes

struct  CpuTree
struct  BlockStepResult
class  CellThermals

Functions

std::vector< uint8_t > MarkConductionWants (MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > stepped, const MultiresStepOptions &options)
void ComputeConduction (MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > stepped, std::span< const uint8_t > frozen, std::span< const uint8_t > wantsFraction, std::span< const uint8_t > implicitBlocks, const MultiresStepOptions &options, std::span< MrEnergyDelta > deltas)
std::vector< MrEnergyDelta > StepConduction (MultiresNest &nest, const ReactionTableView &view, std::span< uint8_t > stepped, const MultiresStepOptions &options, uint32_t wakeMark, std::span< BlockStepResult > results)
bool InImplicitConduction (const MultiresNest &nest, uint32_t slot, const MultiresStepOptions &options)
bool IsImplicitBlock (std::span< const uint8_t > implicitBlocks, uint32_t slot)
std::vector< uint8_t > MarkImplicitBlocks (MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > frozen, const MultiresStepOptions &options)
void AddImplicitConduction (MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > frozen, std::span< const uint8_t > implicitBlocks, const MultiresStepOptions &options, std::span< MrEnergyDelta > deltas)
void ApplyEnergyDelta (MultiresNest &nest, uint32_t slot, uint32_t index, RxCell &cell, const MrEnergyDelta &delta)
std::vector< uint8_t > ExpandForStep (MultiresNest &nest, std::span< BlockStepResult > results)
std::vector< BlockStepResult > StepBlocks (MultiresNest &nest, const ReactionTableView &view, std::span< uint8_t > stepped, uint64_t worldSeed, uint64_t tick, const MultiresStepOptions &options, uint32_t wakeMark)
void ResolvePokes (MultiresNest &nest, uint64_t tick)
void RecordWaitResults (MultiresNest &nest, std::span< const BlockStepResult > results, uint64_t tick)
std::vector< uint32_t > ExpandWantedPages (MultiresNest &nest)
reaction::RxCell & UniformAt (MultiresNest &nest, uint32_t slot)
const reaction::RxCell & UniformAt (const MultiresNest &nest, uint32_t slot)
reaction::RxCell & PageCellAt (MultiresNest &nest, uint32_t page, uint32_t index)
reaction::RxCell & CellAt (MultiresNest &nest, uint32_t slot, uint32_t index)
uint32_t & FreePageAt (MultiresNest &nest, uint32_t position)
uint32_t PopPage (MultiresNest &nest)
multires::MrFraction FractionAt (const MultiresNest &nest, uint32_t fractionSlot, uint32_t index)
void SetFraction (MultiresNest &nest, uint32_t fractionSlot, uint32_t index, const multires::MrFraction &fraction)
size_t PageCellAddress (const MultiresNest &nest, uint32_t page, uint32_t index)
void ApplyEnergyDelta (MultiresNest &nest, uint32_t slot, uint32_t index, reaction::RxCell &cell, const multires::MrEnergyDelta &delta)
void WakeAround (MultiresNest &nest, uint32_t slot, uint32_t mark)
void ComputeConduction (MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > stepped, std::span< const uint8_t > frozen, std::span< const uint8_t > wantsFraction, std::span< const uint8_t > implicitBlocks, const MultiresStepOptions &options, std::span< multires::MrEnergyDelta > deltas)
void AddImplicitConduction (MultiresNest &nest, CellThermals &thermals, std::span< const uint8_t > frozen, std::span< const uint8_t > implicitBlocks, const MultiresStepOptions &options, std::span< multires::MrEnergyDelta > deltas)
void PokeBlock (MultiresNest &nest, uint32_t slot)

Function Documentation

◆ AddImplicitConduction() [1/2]

void bicameral::sim::nest_detail::AddImplicitConduction ( MultiresNest & nest,
CellThermals & thermals,
std::span< const uint8_t > frozen,
std::span< const uint8_t > implicitBlocks,
const MultiresStepOptions & options,
std::span< MrEnergyDelta > deltas )

◆ AddImplicitConduction() [2/2]

void bicameral::sim::nest_detail::AddImplicitConduction ( MultiresNest & nest,
CellThermals & thermals,
std::span< const uint8_t > frozen,
std::span< const uint8_t > implicitBlocks,
const MultiresStepOptions & options,
std::span< multires::MrEnergyDelta > deltas )

◆ ApplyEnergyDelta() [1/2]

void bicameral::sim::nest_detail::ApplyEnergyDelta ( MultiresNest & nest,
uint32_t slot,
uint32_t index,
reaction::RxCell & cell,
const multires::MrEnergyDelta & delta )

◆ ApplyEnergyDelta() [2/2]

void bicameral::sim::nest_detail::ApplyEnergyDelta ( MultiresNest & nest,
uint32_t slot,
uint32_t index,
RxCell & cell,
const MrEnergyDelta & delta )

Definition at line 246 of file multires_nest.cpp.

References bicameral::sim::MultiresNest::blocks, FractionAt(), and SetFraction().

Referenced by bicameral::sim::anonymous_namespace{multires_conduction.cpp}::ApplyEndingDeltas(), and bicameral::sim::anonymous_namespace{multires_nest.cpp}::StepPagedBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CellAt()

reaction::RxCell & bicameral::sim::nest_detail::CellAt ( MultiresNest & nest,
uint32_t slot,
uint32_t index )
inline

Definition at line 40 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::blocks, and PageCellAt().

Referenced by bicameral::sim::anonymous_namespace{multires_conduction.cpp}::ApplyEndingDeltas(), bicameral::sim::ApplyLabCommands(), and bicameral::sim::MakeLabBoxNest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeConduction() [1/2]

void bicameral::sim::nest_detail::ComputeConduction ( MultiresNest & nest,
CellThermals & thermals,
std::span< const uint8_t > stepped,
std::span< const uint8_t > frozen,
std::span< const uint8_t > wantsFraction,
std::span< const uint8_t > implicitBlocks,
const MultiresStepOptions & options,
std::span< MrEnergyDelta > deltas )

Definition at line 290 of file multires_conduction.cpp.

References bicameral::sim::MultiresNest::blocks, and IsImplicitBlock().

Referenced by StepConduction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ComputeConduction() [2/2]

void bicameral::sim::nest_detail::ComputeConduction ( MultiresNest & nest,
CellThermals & thermals,
std::span< const uint8_t > stepped,
std::span< const uint8_t > frozen,
std::span< const uint8_t > wantsFraction,
std::span< const uint8_t > implicitBlocks,
const MultiresStepOptions & options,
std::span< multires::MrEnergyDelta > deltas )

◆ ExpandForStep()

std::vector< uint8_t > bicameral::sim::nest_detail::ExpandForStep ( MultiresNest & nest,
std::span< BlockStepResult > results )

Definition at line 265 of file multires_nest.cpp.

References bicameral::sim::MultiresNest::blocks, and ExpandWantedPages().

Referenced by StepBlocks(), and StepConduction().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExpandWantedPages()

std::vector< uint32_t > bicameral::sim::nest_detail::ExpandWantedPages ( MultiresNest & nest)

Definition at line 355 of file multires_nest.cpp.

References bicameral::sim::MultiresNest::blocks, bicameral::sim::MultiresNest::capacity, bicameral::sim::MultiresNest::counters, PageCellAt(), PopPage(), bicameral::sim::MultiresNest::seeds, UniformAt(), and bicameral::sim::MultiresCapacity::worldBlocks.

Referenced by ExpandForStep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FractionAt()

multires::MrFraction bicameral::sim::nest_detail::FractionAt ( const MultiresNest & nest,
uint32_t fractionSlot,
uint32_t index )
inline

Definition at line 59 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::fractions.

Referenced by ApplyEnergyDelta(), and bicameral::sim::anonymous_namespace{multires_activity.cpp}::ReturnFractionsToLedger().

Here is the caller graph for this function:

◆ FreePageAt()

uint32_t & bicameral::sim::nest_detail::FreePageAt ( MultiresNest & nest,
uint32_t position )
inline

Definition at line 47 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::capacity, bicameral::sim::MultiresNest::freeBlocks, and bicameral::sim::MultiresCapacity::worldBlocks.

Referenced by bicameral::sim::MakeMultiresNest(), and PopPage().

Here is the caller graph for this function:

◆ InImplicitConduction()

bool bicameral::sim::nest_detail::InImplicitConduction ( const MultiresNest & nest,
uint32_t slot,
const MultiresStepOptions & options )
nodiscard

◆ IsImplicitBlock()

bool bicameral::sim::nest_detail::IsImplicitBlock ( std::span< const uint8_t > implicitBlocks,
uint32_t slot )
nodiscard

Definition at line 218 of file multires_implicit_conduction.cpp.

Referenced by bicameral::sim::anonymous_namespace{multires_conduction.cpp}::CollectCellFaces(), ComputeConduction(), and bicameral::sim::anonymous_namespace{multires_implicit_conduction.cpp}::MakeSystem().

Here is the caller graph for this function:

◆ MarkConductionWants()

std::vector< uint8_t > bicameral::sim::nest_detail::MarkConductionWants ( MultiresNest & nest,
CellThermals & thermals,
std::span< const uint8_t > stepped,
const MultiresStepOptions & options )

Definition at line 279 of file multires_conduction.cpp.

References bicameral::sim::MultiresNest::blocks.

Referenced by StepConduction().

Here is the caller graph for this function:

◆ MarkImplicitBlocks()

std::vector< uint8_t > bicameral::sim::nest_detail::MarkImplicitBlocks ( MultiresNest & nest,
CellThermals & thermals,
std::span< const uint8_t > frozen,
const MultiresStepOptions & options )
nodiscard

◆ PageCellAddress()

size_t bicameral::sim::nest_detail::PageCellAddress ( const MultiresNest & nest,
uint32_t page,
uint32_t index )
inline

Definition at line 76 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::blocks.

Referenced by bicameral::sim::anonymous_namespace{multires_conduction.cpp}::AddCellFlows(), AddImplicitConduction(), bicameral::sim::anonymous_namespace{multires_conduction.cpp}::ApplyEndingDeltas(), and bicameral::sim::anonymous_namespace{multires_nest.cpp}::StepPagedBlock().

Here is the caller graph for this function:

◆ PageCellAt()

reaction::RxCell & bicameral::sim::nest_detail::PageCellAt ( MultiresNest & nest,
uint32_t page,
uint32_t index )
inline

Definition at line 35 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::blocks, and bicameral::sim::MultiresNest::cells.

Referenced by CellAt(), and ExpandWantedPages().

Here is the caller graph for this function:

◆ PokeBlock()

void bicameral::sim::nest_detail::PokeBlock ( MultiresNest & nest,
uint32_t slot )
inline

Definition at line 171 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::blocks, and bicameral::sim::MultiresNest::seeds.

Referenced by bicameral::sim::ApplyLabCommands(), bicameral::sim::FoldQuietPages(), and bicameral::sim::PlaceRootBlock().

Here is the caller graph for this function:

◆ PopPage()

uint32_t bicameral::sim::nest_detail::PopPage ( MultiresNest & nest)
inline

Definition at line 52 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::counters, and FreePageAt().

Referenced by ExpandWantedPages(), and bicameral::sim::PlaceRootBlock().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RecordWaitResults()

void bicameral::sim::nest_detail::RecordWaitResults ( MultiresNest & nest,
std::span< const BlockStepResult > results,
uint64_t tick )

Definition at line 340 of file multires_nest.cpp.

References bicameral::sim::MultiresNest::blocks, bicameral::sim::nest_detail::BlockStepResult::changed, bicameral::sim::nest_detail::BlockStepResult::evaluated, bicameral::sim::nest_detail::BlockStepResult::expanded, and bicameral::sim::nest_detail::BlockStepResult::wakeTick.

Referenced by bicameral::sim::StepActive(), and bicameral::sim::StepNest().

Here is the caller graph for this function:

◆ ResolvePokes()

void bicameral::sim::nest_detail::ResolvePokes ( MultiresNest & nest,
uint64_t tick )

Definition at line 329 of file multires_nest.cpp.

References bicameral::sim::MultiresNest::blocks.

Referenced by StepBlocks().

Here is the caller graph for this function:

◆ SetFraction()

void bicameral::sim::nest_detail::SetFraction ( MultiresNest & nest,
uint32_t fractionSlot,
uint32_t index,
const multires::MrFraction & fraction )
inline

Definition at line 66 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::fractions.

Referenced by bicameral::sim::anonymous_namespace{multires_conduction.cpp}::AllocateConductionFractions(), and ApplyEnergyDelta().

Here is the caller graph for this function:

◆ StepBlocks()

std::vector< BlockStepResult > bicameral::sim::nest_detail::StepBlocks ( MultiresNest & nest,
const ReactionTableView & view,
std::span< uint8_t > stepped,
uint64_t worldSeed,
uint64_t tick,
const MultiresStepOptions & options,
uint32_t wakeMark )

Definition at line 279 of file multires_nest.cpp.

References bicameral::sim::MultiresNest::blocks, bicameral::sim::nest_detail::BlockStepResult::changed, bicameral::sim::MultiresStepOptions::conduction, bicameral::sim::nest_detail::BlockStepResult::expanded, ExpandForStep(), ResolvePokes(), StepConduction(), and UniformAt().

Referenced by bicameral::sim::StepActive(), and bicameral::sim::StepNest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StepConduction()

std::vector< multires::MrEnergyDelta > bicameral::sim::nest_detail::StepConduction ( MultiresNest & nest,
const ReactionTableView & view,
std::span< uint8_t > stepped,
const MultiresStepOptions & options,
uint32_t wakeMark,
std::span< BlockStepResult > results )

Definition at line 310 of file multires_conduction.cpp.

References AddImplicitConduction(), bicameral::sim::MultiresNest::blocks, bicameral::sim::MultiresNest::cells, ComputeConduction(), ExpandForStep(), bicameral::sim::MultiresStepOptions::implicitConduction, MarkConductionWants(), MarkImplicitBlocks(), bicameral::sim::MultiresStepOptions::maxSubcycleGap, and bicameral::sim::MULTIRES_MAX_SUBCYCLE_GAP.

Referenced by StepBlocks().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ UniformAt() [1/2]

const reaction::RxCell & bicameral::sim::nest_detail::UniformAt ( const MultiresNest & nest,
uint32_t slot )
inline

Definition at line 31 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::cells.

◆ UniformAt() [2/2]

reaction::RxCell & bicameral::sim::nest_detail::UniformAt ( MultiresNest & nest,
uint32_t slot )
inline

Definition at line 27 of file multires_nest_internal.h.

References bicameral::sim::MultiresNest::cells.

Referenced by ExpandWantedPages(), and StepBlocks().

Here is the caller graph for this function:

◆ WakeAround()

void bicameral::sim::nest_detail::WakeAround ( MultiresNest & nest,
uint32_t slot,
uint32_t mark )

Definition at line 184 of file multires_activity.cpp.

References bicameral::sim::MultiresNest::blocks, bicameral::sim::MultiresNest::capacity, and bicameral::sim::MultiresCapacity::rootLevel.

Referenced by bicameral::sim::StepActive(), and bicameral::sim::anonymous_namespace{multires_conduction.cpp}::WakeChangedBlocks().

Here is the caller graph for this function: