Skip to content

CLI: trace

kairos trace provides a comprehensive set of trace management commands for exporting, comparing, inspecting, and packaging simulation traces.

SubcommandDescription
exportExport a trace from a scenario simulation
diffDiff two trace files
inspectInspect a trace file and print summary
baselineGenerate baseline traces for one or more scenarios
hashCompute SHA-256 hash of a file
bundleBatch export traces with manifest
manifestOutput the embedded scenario manifest
trendPer-step trend metrics for a trace
reportGenerate a formatted trace report
suiteTrace suite operations (create, compare, lint, validate, pack)

Export a trace from a scenario simulation.

Terminal window
kairos trace export \
--scenario standard \
--steps 200 \
[--seed 1207] \
[--output trace.json] \
[--format json] \
[--manifest manifest.json] \
[--events events.json] \
[--pretty]
FlagDefaultDescription
--scenarioRequiredScenario ID to simulate
--steps200Number of simulation steps
--seedFrom scenarioOverride the scenario seed
--output / -ostdoutOutput file path
--formatjsonOutput format: json or table
--manifestEmbeddedPath to a custom scenario manifest
--eventsNonePath to an EDMS event script
--prettyOffPretty-print JSON output

Compare two trace files for differences.

Terminal window
kairos trace diff expected.json actual.json [--epsilon 1e-6] [--format json]
FlagDefaultDescription
--epsilon1e-6Epsilon for floating-point comparison
--formatjsonOutput format

Trace diff is the primary tool for verifying determinism. Two traces from the same seed, config, and move sequence should have zero diffs at ϵ=106\epsilon = 10^{-6}.


Inspect a trace file and print summary.

Terminal window
kairos trace inspect trace.json [--summary] [--format json]
FlagDescription
--summaryPrint a compact summary instead of full details
--formatOutput format: json or table

Generate baseline traces for one or more scenarios.

Terminal window
# Specific scenarios
kairos trace baseline --scenarios standard,axelrod-tournament --steps 200 --output-dir baselines/
# All scenarios
kairos trace baseline --all --steps 200 --output-dir baselines/
FlagDefaultDescription
--scenariosNoneComma-separated scenario IDs
--allOffGenerate baselines for all scenarios
--steps200Number of simulation steps
--output-dir.Output directory for baseline files
--manifestEmbeddedPath to a custom scenario manifest

Compute the SHA-256 hash of a file.

Terminal window
kairos trace hash trace.json

Batch export traces with a manifest.

Terminal window
kairos trace bundle --scenarios standard,axelrod --steps 200 --output-dir bundle/
kairos trace bundle --all --steps 200 --output-dir bundle/
FlagDefaultDescription
--scenariosNoneComma-separated scenario IDs
--allOffBundle all scenarios
--steps200Number of simulation steps
--output-dir.Output directory
--manifestEmbeddedPath to a custom scenario manifest

Output the embedded or custom scenario manifest.

Terminal window
kairos trace manifest [--manifest custom.json] [--format json]

Compute per-step trend metrics for a trace.

Terminal window
kairos trace trend trace.json [--format json]

Generate a formatted trace report.

Terminal window
kairos trace report trace.json [--format json]

Suite operations manage collections of traces for regression testing.

Create a baseline suite.

Terminal window
kairos trace suite create --steps 200 --output-dir suite/

Compare current traces against a baseline suite.

Terminal window
kairos trace suite compare --baseline-dir suite/ --steps 200 [--epsilon 1e-3]
FlagDefaultDescription
--baseline-dirRequiredDirectory containing baseline traces
--steps200Number of simulation steps
--epsilon1e-3Epsilon for floating-point comparison
--manifestEmbeddedPath to a custom scenario manifest

Lint suite structure for errors.

Terminal window
kairos trace suite lint suite/

Validate suite contents.

Terminal window
kairos trace suite validate suite/

Pack operations for suite archives.

Terminal window
# Create archive
kairos trace suite pack create suite/ --output suite.tar
# Validate archive
kairos trace suite pack validate suite.tar
# Diff two archives
kairos trace suite pack diff a.tar b.tar