Skip to content

Releases: neox5/simv

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 26 Jan 12:02

Full Changelog: v0.4.0...v0.5.0

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 26 Jan 10:06

Release v0.4.0

This release improves seed management for better reproducibility and observability.

Changes

Seed Package:

  • Deterministic stream allocation: same master seed now produces identical RNG sequences
  • Added seed.Current() to expose active seed state for logging and debugging
  • Improved reproducibility: Init(12345) guarantees consistent source behavior across runs

Installation

go get github.com/neox5/simv@v0.4.0

Usage Example

import "github.com/neox5/simv/seed"

// Set seed for reproducibility
seed.Init(12345)

// Log current seed state
master, stream, auto := seed.Current()
log.Printf("Seed: master=%d stream=%d auto=%v", master, stream, auto)

v0.3.0

Choose a tag to compare

@github-actions github-actions released this 26 Jan 09:08

Release v0.3.0

This release focuses on observability improvements, deterministic simulation support, and bug fixes.

Features

Seed Package:

  • New seed registry for deterministic simulations
  • seed.Init(masterSeed) for repeatable value sequences
  • Auto-initialization with time-based seed when not explicitly set
  • All random sources now use the global seed registry

Observability:

  • Added Stats() methods to Clock, Source, and Value interfaces
  • Clock metrics: tick count, running state, interval
  • Source metrics: generation count, subscriber count
  • Value metrics: update count, current value, transform count
  • Enables integration with Prometheus/OTEL without side effects

Value Package:

  • Simplified value implementation
  • Improved lifecycle management

Bug Fixes

  • Fixed race condition in PeriodicClock during shutdown
  • Fixed validation issues in value benchmark tests
  • Added comprehensive race condition tests for Value

Installation

go get github.com/neox5/simv@v0.3.0

Usage Example - Deterministic Simulation

import "github.com/neox5/simv/seed"

// Repeatable simulations
seed.Init(12345)

clk := clock.NewPeriodicClock(100 * time.Millisecond)
src := source.NewRandomIntSource(clk, 1, 10)
val := value.New(src).
    AddTransform(transform.NewAccumulate[int]()).
    Start()

// Access metrics
stats := val.Stats()
fmt.Printf("Updates: %d, Current: %d\n",
    stats.UpdateCount,
    stats.CurrentValue)

v0.2.0

Choose a tag to compare

@neox5 neox5 released this 14 Jan 10:51

Release v0.2.0

Minor API release introducing an extension to the Value interface.

Changes

Value Package:

  • Added WithTransforms to the Value interface
    • Exposes the transform chain associated with a value
    • Enables inspection, tooling, and advanced composition

Compatibility

  • Minor API change due to interface extension
  • Downstream implementations must add the new method

Installation

go get github.com/neox5/simv@v0.2.0

V0.1.0

Choose a tag to compare

@neox5 neox5 released this 12 Jan 14:03

Release v0.1.0

First stable release of simv - a Go library for simulating time-varying values in testing environments.

Features

Core Architecture:

  • Clock-driven value generation with subscription model
  • Generic type support for all value types
  • Thread-safe concurrent access patterns
  • Automatic goroutine lifecycle management

Clock Package:

  • PeriodicClock - fixed-interval tick generation
  • Clean start/stop lifecycle

Source Package:

  • ConstSource - constant value generation
  • RandomIntSource - random integers in range [min, max]
  • Channel-based subscription distribution

Transform Package:

  • Accumulate - running totals for numeric types
  • Stateful transform pattern with read-only state access

Value Package:

  • SimpleValue - standard source + transforms pipeline
  • ResetOnRead - value wrapper that resets on each read
  • UpdateHook interface for observability
  • TraceHook with event capture and console formatting

Example:

  • Complete working demonstration in cmd/example/main.go
  • Shows clock → source → transform → value → trace pipeline

Requirements

  • Go 1.25+
  • Standard library only (no external dependencies)

Installation

go get github.com/neox5/simv@v0.1.0

Usage

clk := clock.NewPeriodicClock(100 * time.Millisecond)
src := source.NewRandomIntSource(clk, 1, 10)
val := value.New(src, transform.NewAccumulate[int]())
resetVal := value.NewResetOnRead(val.Clone(), 0)
resetVal.SetUpdateHook(value.NewDefaultTraceHook[int]())

clk.Start()
defer clk.Stop()

current := resetVal.Value()

Documentation

See README.md for complete documentation and usage examples.