Sequencer C++ API

The native Projector integrates coordinated Strips into retained Sequence order and materializes their visible Projection. This reference is generated from the Doxygen documentation maintained beside every implementation unit in src/c++ and uses the concepts defined by src/VOCAB.md.

API reference

namespace sequencer

Functions

inline std::uint32_t acknowledge_projection(const std::uint32_t projection_id) noexcept
inline void clear_footage_span_buffer() noexcept
inline void clear_projection(const std::uint32_t projection_id) noexcept
inline void clear_projection_buffer() noexcept
inline void clear_sequence_point_buffer() noexcept
inline std::uint32_t compact_projection(const std::uint32_t projection_id, const std::uint32_t hard = 0, const std::uint32_t actor_count = 0) noexcept

Collect acknowledged instructions and their eligible applied fragments.

inline std::uint32_t *get_acknowledgement_sequence_point_buffer_pointer() noexcept
inline std::uint32_t get_footage_frame_index(const std::uint32_t projection_id, const std::uint32_t projection_frame_index) noexcept
inline std::uint32_t get_footage_span_buffer_count() noexcept
inline std::uint32_t *get_footage_span_buffer_pointer() noexcept
inline std::uint32_t *get_projection_buffer_pointer() noexcept
inline std::uint32_t get_projection_buffer_word_count() noexcept
inline std::uint32_t get_projection_frame_count(const std::uint32_t projection_id) noexcept
inline std::uint32_t *get_strip_buffer_pointer() noexcept
inline std::uint32_t initialize_projection() noexcept
inline std::uint32_t issue_strip(Projector &projector, const std::uint8_t strip_type, const std::uint32_t strip_length, const SequencePoint previous_strip_end, const std::uint32_t footage_frame_index = u32_max) noexcept
inline std::uint32_t merge_projection(const std::uint32_t projection_id, std::uint32_t footage_frame_index, const std::uint32_t footage_length = u32_max) noexcept

Consume remote Strips and return the earliest changed visible index.

inline std::uint32_t *prepare_compaction_sequence_point_buffer(const std::uint32_t frontier_count) noexcept
inline std::uint32_t *prepare_projection_buffer(const std::uint32_t strip_count) noexcept
inline void release_mask_footage(const std::uint32_t id, const std::uint32_t crypto, const std::uint32_t unix_bits, const std::uint32_t counter) noexcept

Mark locally released applied content without changing its identities.

inline std::unordered_map<std::uint64_t, std::uint32_t> select_compaction_frontiers(const std::span<const std::uint32_t> words, const std::uint32_t actor_count) noexcept

Match all actor frontiers in expected O(total input words) time.

Each actor is encoded as a three-word header (point count, 0, 0), then triples. actor_count zero accepts the already-selected flat native frontier format.

inline void snapshot_projection(const std::uint32_t projection_id) noexcept
inline std::uint32_t update_projection(const std::uint32_t projection_id, const std::uint32_t operation_index, const std::uint8_t operation_type, const std::uint32_t operation_length, const std::uint32_t footage_frame_index = u32_max) noexcept

Issue and apply a local operation at a visible Frame.

Pre:

A nonempty Projection supplies a valid visible operation_index. Birth uses index zero and an insert type. A local Mask is bounded to the remainder of its containing Strip and returns its retained Footage span.

inline std::uint32_t write_projection_footage_spans_to_buffer(const std::uint32_t projection_id, const std::uint32_t start_index, const std::uint32_t end_index) noexcept
inline std::uint32_t write_recovery_footage_spans_to_buffer(const std::uint32_t projection_id) noexcept

Variables

std::vector<std::uint32_t> available_projection_ids

Cleared registry identifiers available for immediate reuse.

FootageSpanBuffer footage_span_buffer

Shared result buffer for ordered or released Footage spans.

const std::uint32_t insert_realm_crypto_random_bits
const std::uint32_t mask_realm_crypto_random_bits
ProjectionBuffer projection_buffer

Shared dense snapshot in resolved projection order.

std::vector<std::optional<Projector>> projectors

Registry slots containing the Projector of each active Replica.

SequencePointBuffer sequence_point_buffer

Shared variable-width transfer buffer for one Frontier.

const std::uint32_t shared_realm_unix_lower_bits
namespace std

STL namespace.

file acknowledge.hpp
#include “./runtime.hpp
file buffers.hpp
#include “./runtime.hpp
file compact.hpp
#include “./runtime.hpp
#include <algorithm>
#include <cmath>
#include <span>
#include <unordered_map>
file initialize.hpp
#include “../.declarations/projector/index.hpp”
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdint>
#include <span>

Functions

inline void initialize_projector(Projector &projector, const std::span<const std::array<std::uint32_t, 12>> projection, const std::uint32_t insert_realm_crypto_random_bits, const std::uint32_t mask_realm_crypto_random_bits, const std::uint32_t shared_realm_unix_lower_bits) noexcept

Reconstruct a fresh Projector from a trusted, ordered snapshot.

Pre:

The Projector is empty and the snapshot has a materialized prefix followed by its pending suffix. Counter spans and encoded links are valid.

file issue.hpp
#include “./runtime.hpp
#include “../.auxiliary/stage_strip/index.hpp”
file lifecycle.hpp
#include “./runtime.hpp
#include “./initialize.hpp
file merge.hpp
#include “./runtime.hpp
#include “./read.hpp
#include “../.auxiliary/stage_strip/index.hpp”
#include <algorithm>
#include <unordered_map>
file read.hpp
#include “./runtime.hpp
#include <algorithm>
file runtime.hpp
#include “../.buffers/footage_span_buffer/index.hpp”
#include “../.buffers/projection_buffer/index.hpp”
#include “../.buffers/sequence_point_buffer/index.hpp”
#include “../.declarations/projector/index.hpp”
#include <chrono>
#include <cstdint>
#include <optional>
#include <random>
#include <vector>
file snapshot.hpp
#include “./runtime.hpp
file update.hpp
#include “./runtime.hpp
#include “./issue.hpp
#include <algorithm>
file index.hpp
#include “../../../.auxiliary/insert_between/index.hpp”
#include “../../../.auxiliary/split_strip/index.hpp”
#include “../../../.declarations/projector/index.hpp”
#include <cstdint>
#include <utility>

Materializes one staged Strip in deterministic Structural Order.

Functions

inline std::pair<std::int32_t, std::int32_t> insert_after(Projector &projector, const std::uint32_t containing_strip_index, const std::uint32_t incoming_strip_index, const std::uint32_t offset) noexcept

Materialize one fully resolved insert or Mask Strip.

Note

An anchor remains to the left of the incoming Strip. If it still owns content, split out that content and retain the larger-split continuation. For a Mask, offset is the boundary after its addressed content span.

Parameters:
  • projector – Owning Projector.

  • containing_strip_index – Strip containing the dependency.

  • incoming_strip_index – Strip Index of the staged Strip.

  • offset – Dependency point offset; zero identifies the logical anchor.

Returns:

Projection Frame count and materialized Strip count differences.

file index.hpp
#include “../../../.auxiliary/insert_between/index.hpp”
#include “../../../.auxiliary/split_strip/index.hpp”
#include “../../../.declarations/projector/index.hpp”
#include <cstdint>
#include <utility>

Materializes one staged Strip in deterministic Structural Order.

Functions

inline std::pair<std::int32_t, std::int32_t> insert_before(Projector &projector, const std::uint32_t containing_strip_index, const std::uint32_t incoming_strip_index, const std::uint32_t offset) noexcept

Materialize one fully resolved visible Strip.

Note

Retain or create a contentless causal placeholder at the dependency.

Parameters:
  • projector – Owning Projector.

  • containing_strip_index – Strip containing the dependency.

  • incoming_strip_index – Strip Index of the staged Strip.

  • offset – Number of source Frames preceding the insertion boundary.

Pre:

offset <= fragment_length_of[containing_strip_index].

Returns:

Projection Frame count and materialized Strip count differences.

file index.hpp
#include “../../../.auxiliary/insert_between/index.hpp”
#include <cstdint>
#include <utility>

Functions

inline std::pair<std::int32_t, std::int32_t> insert_birth(Projector &projector, const std::uint32_t incoming_strip_index) noexcept

Materialize an insert with no parent, ordered among root siblings.

Pre:

The incoming insert is staged and nonempty. Detached pending Strips may already occupy storage and remain detached.

Returns:

Projection Frame count and materialized Strip count differences.

file index.hpp
#include “./birth/index.hpp
#include “./before/index.hpp
#include “./after/index.hpp
#include <array>

Functions

inline std::pair<std::int32_t, std::int32_t> apply_insert(Projector &projector, const std::uint32_t containing_strip_index, const std::uint32_t incoming_strip_index, const std::uint32_t offset, std::uint32_t *const first_change = nullptr) noexcept

Apply an instruction to source fragments, keeping its identity intact.

Pre:

The incoming Strip is staged and its dependency is resolved.

file index.hpp
#include “../../.auxiliary/absolute_distance/index.hpp”
#include “../../.declarations/projector/index.hpp”
#include <cmath>
#include <cstdint>

Positions a Projector Gate through Strip-local Projection jumps.

Functions

inline void find_strip_index_of(Projector &projector, const std::uint32_t &projection_frame_index) noexcept
file index.hpp
#include “../../.declarations/projector/index.hpp”
#include <cmath>
#include <cstdint>

Functions

inline std::uint32_t find_projection_frame_index_of(Projector &projector, const std::uint32_t &strip_index, const std::int32_t frame_count_diff, const std::int32_t strip_count_diff) noexcept
file main.cpp
#include “./algorithms/read.hpp
#include “./algorithms/update.hpp
#include “./algorithms/merge.hpp
#include “./algorithms/compact.hpp
#include “./algorithms/buffers.hpp

Defines

EMSCRIPTEN_KEEPALIVE

Functions

std::uint32_t acknowledge_projection(const std::uint32_t projection_id) noexcept
void clear_footage_span_buffer() noexcept
void clear_projection(const std::uint32_t projection_id) noexcept
void clear_projection_buffer() noexcept
void clear_sequence_point_buffer() noexcept
std::uint32_t compact_projection(const std::uint32_t projection_id, const std::uint32_t hard, const std::uint32_t actor_count) noexcept
std::uint32_t *get_acknowledgement_sequence_point_buffer_pointer() noexcept
std::uint32_t get_footage_frame_index(const std::uint32_t projection_id, const std::uint32_t projection_frame_index) noexcept
std::uint32_t get_footage_span_buffer_count() noexcept
std::uint32_t *get_footage_span_buffer_pointer() noexcept
std::uint32_t *get_projection_buffer_pointer() noexcept
std::uint32_t get_projection_buffer_word_count() noexcept
std::uint32_t get_projection_frame_count(const std::uint32_t projection_id) noexcept
std::uint32_t *get_strip_buffer_pointer() noexcept
std::uint32_t initialize_projection() noexcept
std::uint32_t merge_projection(const std::uint32_t projection_id, const std::uint32_t footage_frame_index, const std::uint32_t footage_length) noexcept
std::uint32_t *prepare_compaction_sequence_point_buffer(const std::uint32_t frontier_count) noexcept
std::uint32_t *prepare_projection_buffer(const std::uint32_t strip_count) noexcept
void release_mask_footage(const std::uint32_t id, const std::uint32_t crypto, const std::uint32_t unix_bits, const std::uint32_t counter) noexcept
void snapshot_projection(const std::uint32_t projection_id) noexcept
std::uint32_t update_projection(const std::uint32_t projection_id, const std::uint32_t operation_index, const std::uint8_t operation_type, const std::uint32_t operation_length, const std::uint32_t footage_frame_index = u32_max) noexcept
std::uint32_t write_projection_footage_spans_to_buffer(const std::uint32_t projection_id, const std::uint32_t start_index, const std::uint32_t end_index) noexcept
std::uint32_t write_recovery_footage_spans_to_buffer(const std::uint32_t projection_id) noexcept
dir apply/insert/after
dir algorithms
dir apply
dir apply/insert/before
dir apply/insert/birth
dir find/containing_strip_index
dir find
dir apply/insert
dir find/projection_frame_index