benchutil

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package benchutil contains measurement helpers, never product behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Counts

func Counts(ctx context.Context, d *sql.DB) map[string]int64

func Dist

func Dist(v []float64) map[string]any

func FileSHA

func FileSHA(path string) string

func JSON

func JSON(path string, v any) error

func Manifest

func Manifest() map[string]any

func NewDir

func NewDir(path string) error

func RequireCopy

func RequireCopy(path string) error

func SHA

func SHA(b []byte) string

func SnapshotCheckpointedIndex

func SnapshotCheckpointedIndex(ctx context.Context, d *sql.DB, src, dst string) error

SnapshotCheckpointedIndex copies only a disposable, quiescent fixture DB.

func WriteMechanismCases

func WriteMechanismCases(path string, cases []MechanismCase) error

Types

type MechanismCandidate

type MechanismCandidate struct {
	Hit    model.SearchResult           `json:"hit"`
	Chunk  string                       `json:"chunk"`
	Window []contextpack.EvidenceRecord `json:"window"`
}

type MechanismCase

type MechanismCase struct {
	ID         string               `json:"id"`
	Query      string               `json:"query"`
	Owner      string               `json:"owner"`
	Device     string               `json:"device"`
	Index      string               `json:"index"`
	Request    contextpack.Request  `json:"request"`
	ModelMin   float64              `json:"model_min"`
	Baseline   *contextpack.Pack    `json:"baseline"`
	Candidates []MechanismCandidate `json:"candidates"`
}

MechanismCase contains only selector inputs, never expected answers or types. Keep these exports private: they contain source text and local index paths.

func MakeMechanismCase

func MakeMechanismCase(ctx context.Context, d *sql.DB, id, owner, device, index string, req contextpack.Request, modelMin float64, baseline *contextpack.Pack, hits []model.SearchResult) (MechanismCase, error)

Jump to

Keyboard shortcuts

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