sim

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 28 Imported by: 0 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 sim is the deterministic simulator that gates spec 0004 (spec 0005). It runs the real Fold, Next, records, memory adapter and supervisor inside one synctest bubble, letting one parked call proceed at a time by seed, and checks 0004 D10's invariants after every step.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Seed        uint64
	Shape       memory.Shape
	Supervisors int
	Unmatched   model.UnmatchedPolicy
	Steps       int
	// Quiet bounds the liveness phase (spec 0005 D7's K).
	Quiet int
	// StopAt ends a replay at this step, with the trace and a dump of the record and ground truth
	// as they stand (spec 0005 D10); zero runs to the end.
	StopAt int
	// contains filtered or unexported fields
}

Config is what one seed runs.

type Result

type Result struct {
	Config  Config
	Failure string
	Steps   int
	Trace   []string
	Counts  map[string]int
}

Result is one seed's outcome.

func Run

func Run(cfg Config) Result

Run runs one seed. It must be called inside a synctest bubble.

func (Result) Summary

func (r Result) Summary() string

Summary is a one-line description of a result.

Directories

Path Synopsis
Package crashfs is the simulator's crash-model filesystem (spec 0005 D3): an afero.Fs over afero's in-memory filesystem that refuses what POSIX refuses, makes file data and directory entries durable only when they are synced, and models a process crash and a power cut.
Package crashfs is the simulator's crash-model filesystem (spec 0005 D3): an afero.Fs over afero's in-memory filesystem that refuses what POSIX refuses, makes file data and directory entries durable only when they are synced, and models a process crash and a power cut.
Package lint checks the mechanical rules of spec 0005 D2 over the code on the simulated path: rule 1 (no goroutines started), rule 3 (no global random source, no package-level channel or WaitGroup), rule 4 (map ranges sorted or annotated) and rule 6's clauses on context.Background and context.WithoutCancel.
Package lint checks the mechanical rules of spec 0005 D2 over the code on the simulated path: rule 1 (no goroutines started), rule 3 (no global random source, no package-level channel or WaitGroup), rule 4 (map ranges sorted or annotated) and rule 6's clauses on context.Background and context.WithoutCancel.
Package locktable is the simulator's lock table (spec 0005 D3): the file store's Locker, with one view per simulated process, so that the simulator decides whose locks a crash releases, can grant owner.lock to several supervisors at once, and can revoke it from a live holder.
Package locktable is the simulator's lock table (spec 0005 D3): the file store's Locker, with one view per simulated process, so that the simulator decides whose locks a crash releases, can grant owner.lock to several supervisors at once, and can revoke it from a live holder.

Jump to

Keyboard shortcuts

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