Skip to main content

Module solve

Module solve 

Source
Expand description

The solve pass as a session the host drives frame by frame: per-region tracking (odometry, anchor re-acquisition, drift control, relocalization, fragments), keyframes and revisits, fragment attachment, the pose graph’s nodes and edges, displacement-spread consistency voting, and each frame’s placements.

The session keeps what the TypeScript pass kept in memory: per-region state, the previous frame’s pixels, analysis gray and features, the previous plan’s placements, the attachments, the canvases it created, the pose graph, the keyframe index’s postings and the voting ring. Keyframes themselves are rows the host stores (keyframe/<id>) and reads back: a revisit search is declare-then-provide (Poll::NeedKeyframes → SolveSession::provide_keyframes).

One frame:

  1. SolveSession::begin_frame with the frame’s scan record. A duplicate frame whose previous plan can be replayed is finished right there (Begin::Duplicate); otherwise the session asks for the pixels.
  2. The host writes the RGBA frame into SolveSession::frame_mut and calls SolveSession::run_frame with the analysis gray it computed (WebGPU) or None, and the frame’s stored features or None.
  3. While the result is Poll::NeedKeyframes, the host loads those rows and calls SolveSession::provide_keyframes.
  4. Poll::Done carries the placements and finalised voting records. Before each poll result, and after an error, the host takes the frame’s Effects (SolveSession::take_effects) and applies them in order: they are the rows and diagnostics the pass produced, in the order it produced them.

After the last frame the host drains the voting ring (SolveSession::drain_voting) and relaxes the pose graph (SolveSession::graph_mut), a few sweeps per step.

Structs§

CanvasMeta
One canvas/<id> row as the solve pass writes it; every count the render pass fills in starts at zero.
FrameDone
A solved frame.
KeyPatch
Native luma texture sampled around a keyframe feature.
Keyframe
One keyframe/<id> row.
Placement
One region’s observation in a frame (a placement of plan/<frame>).
Plane
A row-major 8-bit plane.
ScanFields
The scan record fields the pass reads.
SolveConfig
SolveRegion
One non-ignored region the pass tracks.
SolveSession
VotingRecord
One finalised frame of the voting ring (a consistency/<frame> row when it has verdicts).
VotingVerdict
One region slot’s finalised voting verdict: the analysis box it covers and its two LSB-first bitsets.

Enums§

Begin
The outcome of SolveSession::begin_frame.
Effect
Something the pass did that the host must carry out, in order.
Poll
SolveError

Constants§

FALLBACK_FEATURES
Features extracted from a frame whose stored features are missing.
PATCH_COUNT
Native patches a moving region’s keyframe keeps, and their side.
PATCH_SIZE
POSE_BOUND
How far a pose may reach: the compositor’s addressable range less a margin larger than any frame.
VOTING_RING_BYTES
Bytes of analysis frames the consistency voting ring keeps (docs/ARCHITECTURE.md §七).

Functions§

is_valid_pose
Whether (x, y) is a pose the pass may write: finite and inside POSE_BOUND.

Type Aliases§

FragmentScale
The cause a new fragment’s diagnostic names: a magnification change (scale, error), or none.