multimodel

package
v0.4.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package multimodel persists multimodelv1's cross-restart residual/ z-score warm-up snapshot into prefetch.db, one row per mint -- see schema.sql's doc comment for why one row/message per mint, not one big batch. This package never decodes the *residual* data inside a payload; it only reads the fixed-offset mint field needed to key each row, via mintFromPayload -- see that function's doc comment for the exact wire layout it depends on (must stay in sync with catscope-rust-bot's src/trader/residual_snapshot.rs).

Index

Constants

This section is empty.

Variables

View Source
var Schema string

Functions

func LoadResidualSnapshots

func LoadResidualSnapshots(db *sql.DB) ([][]byte, error)

LoadResidualSnapshots returns every persisted mint's own payload, or (nil, nil) if nothing has ever been saved. Each returned payload is exactly what a prior process's SaveResidualSnapshot call received for that mint -- ready to send back out as-is, one per KeyFlagReplayResidualSnapshot message (see cmd/multimodel.go's boot-time push -- one message per mint, same reasoning as the send side, so no single reply message can ever approach the real transport size cap regardless of how many mints are persisted).

func SaveResidualSnapshot

func SaveResidualSnapshot(db *sql.DB, payload []byte) error

SaveResidualSnapshot upserts payload's real residual data as its own mint's row -- overwrites that mint's previous entry, never accumulates history (only the latest per mint is ever useful; the Rust side itself discards anything too old on replay, trader::residual_snapshot:: is_fresh). A payload that doesn't look like a real single-mint snapshot is rejected, not silently dropped -- callers should surface this as a real error, not treat it the same as "no data yet."

Types

This section is empty.

Source Files

  • schema.go
  • store.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL