Skip to content

Automation harness

The harness is a small command language that drives the running app: put the observer anywhere, set the time by the Sun's elevation, change any setting or knockout bit, select or fly to satellites, jump to launches and re-entries, storms and fires, then capture screenshots (each with a JSON record of the exact state), record videos, dump the UI layout, sample GPU and CPU timings, render the audio, or play camera paths. Scripts are deterministic: running one twice gives bit-identical images.

It is the way to launch the app during development, for people and agents alike. A harness run exits on its own, runs muted in its own user data folder (it never reads or writes your settings.json and cannot trigger crash recovery on your next launch), and leaves captures, state, layout dumps and timings to check. Use it for anything that needs the real renderer: shader and terrain changes, image A/B comparisons, performance, UI layout, camera shots, launch and debris behaviour. Work that does not need the renderer (photometry, orbits, benchmarks) belongs in SatModelTool, which is faster and runs in CI.

How a change feels (camera motion, input, audio, a menu's ergonomics) is still for a person to judge.

This page explains the harness and summarises its commands by family. docs/HARNESS.md is the complete reference, with every argument and every state field; keep it and kHelp in step with harnessExec().

Launch spacing

Invariant

Never relaunch the app back-to-back. run.py and live.py start wait until 30 s have passed since the last app launch and the last app exit, and until fewer than two app processes are running on the machine (tools/harness/launchgate.py). The gate's state is machine-wide (%LOCALAPPDATA%/SatLightSimHarness), so agents in separate git worktrees share it, and the running count comes from the process list, so a person's own app counts. run.py --cooldown S overrides the spacing and should not be set to 0 by habit; SATLIGHT_HARNESS_MAX_APPS sets the cap. For many small batches, start one app with live.py start and send commands to it rather than looping run.py. Every launch costs startup time and carries some risk to the development machine (docs/FREEZES.md).

tools/run_latest.py starts the existing build/Release executable interactively for a person (no script, the shared user_data/ settings) through the same gate, and records its exit so harness runs space themselves after it.

Quick start

cmake --build build --config Release --target SatLightSim     # Release: PNG encoding in Debug is very slow
python tools/harness/run.py tools/harness/scripts/smoke.satcmd
python tools/harness/run.py -c "observer lat=46.55 lon=7.98 agl=50; time sun 10 rising; camera az=200 el=5; wait settle; capture alps"

run.py prints the run folder, one line per command (ok and a message, or ERR and the reason), the captures written and a status line. It exits non-zero if the app crashed, timed out, or any command failed.

The Python tools that analyse images and audio need a virtual environment once:

py -3 -m venv tools/harness/.venv
tools/harness/.venv/Scripts/python -m pip install -r tools/harness/requirements.txt

run.py, live.py and reports.py themselves use only the standard library.

Ways in

Front end Use How
tools/harness/run.py <script> batch: one script, one process, exits when done -c "cmd; cmd" for inline commands
tools/harness/live.py many small batches against one running app (no startup per batch) start, send "cmds", send -f file, status, stop
the console in the app a person typing the same commands the backtick key toggles it; Enter runs, Up/Down history, Esc closes
executable flags anything else SAT_LIGHT_SIM_V_*.exe --script f.satcmd --out dir

Executable flags: --script <file>, --live <dir>, --out <dir>, --window WxH (default 1600x900), --settings <settings.json> (start from these settings, copied into the run folder), --user-data (use the normal user data folder instead of the run folder), --fixed-dt <s> (default 1/60; 0 = real time), --timeout <s> (watchdog), --stay (keep running after the script), --sound (a real audio device). Unknown flags are an error, so a typo never silently runs the normal app.

run.py adds --exe, --config (default Release), --quiet, --cooldown, --forensics (records GPU and CPU telemetry for freeze investigations), --boot-screen on|off, --boot-capture, --boot-chooser N and --boot-safety-ms MS (the last three are described under The loading screen in a run). It runs the freshest build/<config>/SAT_LIGHT_SIM_V_*.exe; a build in another tree (build-win-release/) is invisible to it unless passed with --exe.

Live mode: live.py start launches the app with --live harness_live/. Each send writes one file to harness_live/inbox/; the app polls the inbox and writes outbox/<same name>.json with one result per command. Captures land in the live run folder that status prints.

The console, used outside a harness run, writes to harness_runs/console_<time>/ next to the executable, runs in real time and never exits by itself.

The run folder

harness_runs/<stamp>_<script>/
  results.jsonl                    one line per command: src (file:line), cmd, ok, error, frames, wall_ms, result{}
  summary.json                     status: ok | errors | timeout | script_error | closed; counts; commit; log path
  captures/<name>.png              + <name>.json sidecar: the command, size and the full state at capture time
  captures/<name>.layout.json      `ui dump`
  captures/<name>.state.json       `state <name>`
  captures/<name>.wav              `audio record`
  captures/boot_NN.png             `run.py --boot-capture`: the loading screen's frames
  videos/<name>.mp4                `video start` / `video stop`, `path play ... video=<name>`
  perf_profiles/profile_log.jsonl  `perf name=...` samples and `sweep` records
  reports/                         issue reports taken with `report shot`
  satlight_log.txt, settings.json, app_stdout.txt, <script>.satcmd (a copy of what ran)

Each run starts from the built-in defaults unless --settings is given. A capture's sidecar state is taken in the frame the capture shows. Captures are the final 8-bit tonemapped image, not HDR buffers.

python tools/harness/gc.py (a dry run unless --apply) deletes run folders older than --keep-days (7) unless they are pinned (gc.py --keep <run> writes a KEEP file), named in CLAUDE.md, docs/, .plans/ or the agent memory folder, or the live app's current folder. --slim thins old recorded frame sequences to every 30th frame.

Script syntax

One command per line or separated by ;. # starts a comment. Arguments are positional words or key=value. Double quotes group words with spaces (select const "Starlink Gen1"). A backslash is an escape, so write paths with forward slashes.

preset High
observer lat=46.55 lon=7.98 agl=50      # Interlaken, 50 m above the ground
time sun -4 setting                      # dusk: the Sun 4 degrees below the horizon, going down
time pause
camera az=280 el=3 fov=60
wait settle                              # let every eased quantity converge
capture dusk
knockout +terrain_march ; wait settle 10 ; capture dusk_noterrain

A failing command is recorded with its reason and the script continues; the run's status is then errors.

Commands by family

Flow and time

Command What it does
wait <frames>, wait seconds <s> wait N frames, or wall-clock seconds
wait settle [frames] (or settle) hold sim time and run 40 (or N) frames at a 0.5 s step, so eased values converge (sky glare, the dark-sky dome, mesh fades, beam-light fades, environment probes); the sky's temporal anti-aliasing restarts with it. Use before every capture that follows a change. From orbit, add wait 90 after it: a settled view from 400 km draws cloud edges blocky until about 90 ordinary frames have passed
wait settle auto [max=160] [min=40] [thr=0.1] [hold=4] [noise=1.5] the same settle, stopped once the image has stopped changing. Every settle frame is copied at a quarter size before the UI and compared with the frames 8 and 32 before it (mean luminance difference, 0-255). A probe counts as settled when its 32-frame difference is under thr, or under noise times its 8-frame difference: a view's own flicker does not grow with the lag, while a slow drift (shadows filling in, a running mean converging) does and is waited out. It ends after hold settled probes in a row and at least min frames, else at max. About 50 frames for a cumulus, overcast or clear view; storm views and views from orbit usually run to max
time set <ISO> e.g. 2036-06-21T04:00:00Z (UTC)
time sun <el> [rising\|setting], time sun noon\|midnight the time nearest now (within 12 h) when the Sun is at <el> degrees for this observer
time add <s>, time j2000 <s> relative, or absolute in seconds since J2000
time pause, time play, time scale <1x\|10x\|1m\|5m\|1h\|1d\|1w\|1mo\|1yr>, time reverse on\|off
log <text>, help, quit help prints the command summary (kHelp)

Observer, camera and places

Command What it does
observer lat= lon= [agl=\|alt=] move the observer, keeping the camera heading; ends follow mode. alt is metres above sea level (the eye sits at max(ground, alt) + 2 m); agl is above the ground, read back from the GPU's detailed terrain (one extra frame). With the depth pass knocked out it falls back to the CPU's coarse DEM, which is off by hundreds of metres on coasts and in valleys
camera az= el= fov=, camera look <sun\|moon\|sel\|planet>, camera track <...\|off> aim (azimuth 0 north, 90 east; field of view 0.5 to 120 degrees), aim once at a target, or re-aim every frame
beams [list], beams go [rank=1] [dist_km=0] [bearing=270] [agl=2\|alt=] [look=site\|up\|none], beams sats [site=] [n=] where the Reflect Orbital beams land now (only satellites above the observer's horizon make beams, so stand in the region first); go puts the observer near the rank-th busiest site; sats lists the beams one by one (satellite, target, aim error, miss distance, intensity, spot). Frame beams this way rather than by a guessed time and place
eclipse <solar\|lunar> the next eclipse after the current time: greatest eclipse, the observer under the Moon or where the shadow axis meets the Earth, aimed at the Moon
aurora, aurora next [<kp>], aurora substorm [min=], aurora kp <v>, aurora auto the aurora's activity, a pure function of sim time; next jumps to the peak of the next storm reaching that Kp. Test from a dark site: a city's skyglow hides the aurora
drift [default] [phase=<rad>] [rate=<rad/s>] the cloud map's drift, the session state a bookmark or snapshot stores; phase= gives that phase at the current sim time (set the time first)
snapshot <profile_log.jsonl> [index=-1] [settings=on\|off] [clamp=on] [drift=intro\|default] reproduce a perf snapshot (Snapshots and issue reports)
report list\|info\|load\|shot\|mark\|export ... issue reports (Issue reports)
refraction [rebuild] the refraction table round the eye: the air's profile, the horizon, the Sun's refraction and visible share, samples (Refraction)
bookmark add [name] [id=] [scale=] [paused=], bookmark go\|update\|delete <n>, bookmark rename <n> <name>, bookmark restore, bookmark list the Bookmarks window's actions, numbered from 1. wait 3 after add or update for the thumbnail. id= replaces a bookmark with that id; scale= and paused= store the clock a Go sets. A run's list starts as the shipped defaults

Satellites and selection

Command What it does
select sat <index>, select const "<name>" [n=<k>], select planet <name>, select none by roster index, or a constellation's member highest in the sky (or its k-th member). A satellite destroyed or re-entered by now is an error
select at <x> <y> the click pick at a frame pixel: a drawn mesh's bounding circle first, else the nearest sprite
const list, const "<name>"\|all on\|off [highlight=on\|off] constellation visibility
roster list, roster remove "<name>", roster add "<name>" change the roster at runtime (Architecture). Satellite indices move, so the selection, follow, track and viewer are dropped
follow [sat=<i>] [offset=along,cross,radial] [fly=on], follow off [fly=on] ride with a satellite (types with a geometry model); fly=on uses the UI's animated Go to and its return
follow log on, follow log off [name=followlog] [top=12] record Go to's camera against the object every frame (offset, view and camera in the object's along / cross / radial frame, distance, the frame's axis); off writes captures/<name>.followlog.json and ranks the largest per-frame jumps of each with the object kind before and after. A smooth follow through a mission changes the view by under about 0.1 deg a frame; a handover snap or a frame flip reads degrees
follow stay, follow return the follow HUD's Stay here (a free observer where the camera is) and Return (back to the default offset; when not following, follow the last object again)
follow toward=observer\|sun [dist=300] [side=0] [lift=0] [look=observer], follow aim=sat place the following camera on the satellite's line to the ground observer or to the Sun, aimed at it (the side and flare the observer sees)
track [on\|off] the selection panel's Track lock; released by select none, select planet, follow and any explicit aim
cluster [sat=<i>] a formation cluster's members' offsets from a satellite and their centroid, for framing a ring
flares "<constellation>" [window=600] ... the CPU photometry over every member in the next window: the brightest flare peaks with time, magnitude, direction and contrast, for framing a flare
joints [sat=<i>] [minutes=200] [step=20] each child attitude group's joint angle over time (a flip shows as about 180 deg in one step)
viewer [aim=free\|observer\|toward\|sun] [light=live\|studio] [glare=on\|off] [shadows=on\|off] [dist=<radii>] the satellite 3D view's controls, for a ui open viewer or ui open info capture

Launches, missions and the deployment era

These drive the systems on Launches, Rocket flight and Crew flights. The jumps set the clock to a moment, place the observer, and leave time running at 1x; a later launch select kind=rocket|booster|upper takes that launch's stage, drawn or not.

Command What it does
launch [state] planes, batches, rockets drawn, train and retiree satellites up, plume Gaussians, upper stages' timelines, boosters and ships, engine lights, ground clouds, the launches CPU bucket by part (cpu_split_ms)
launch list [hours=48], launch why [hours=720], launch padstats [hours=168] lift-offs ahead; cached batches by program and reason; launches sharing a pad within 90 min
launch next [when=any\|twilight\|day\|night] [vehicle=] [pad_dist_m=] [lead=30] [side=1] 30 s before the next lift-off, the observer 60 km behind the pad; pad_dist_m= instead on the ground beside the pad (the ground cloud, the low trail)
launch deploy [filter=], launch fairing [filter=], launch deorbit, launch reentry, launch vent, launch ship the next sunlit deployment, fairing separation, upper-stage deorbit turn, retiree re-entry, propellant vent, or returning ship's entry glow (day=1 by day); min_members= skips small launches. launch state -> entry_plasma[] lists the entry emitters, state -> observer.follow.cam_along_motion_m / default_side_dot where the follow camera sits against the motion
launch landing [booster=1\|droneship=1] [lead=90] [dist_m=2500] [day=1], launch droneship [vehicle=] [day=1\|night=1], launch ships tower catches and landings at sea; the ships at sea
launch crew [station=] [craft=] [event=dock] [lead=60] [follow=1] an event of the next crew or cargo flight (separation, phasing, approach holds, docking, undocking, entry, splashdown)
launch pads, launch pad <site> [dist_m=600] [az=200] [h=2] launch sites and their pad kind at this date; stand by a pad looking at its tower
launch look [stage=0\|1], launch select [kind=...] [nearest=1] [member=<i>] aim at a flying stage; select a train member, retiree, rocket, booster, upper stage, ship, fairing half, crew vehicle or re-entry (the selection is a transient: state reports selection.transient)
launch trace [from=] [days=400] [vehicle=] [program=], launch trace key=, launch formation key=, launch goto key= [t=] [ground=1] the mission-operations traces (below)
launch check, launch jitter [batches=6], launch legacy on\|off self-tests: phasing, release and arrival errors, nose turn rates, step continuity through burns and entry, landings, crew flights; how far a raising train member's record jumps at each rewrite
missions [state], missions launch <i\|twilight\|crew\|fury>, missions catch, missions go <i\|twilight\|crew\|fury\|fury_night> [watch=1], missions ongoing <row> [go=1], missions tab upcoming\|ongoing\|kessler, missions watch <k> the Missions window's rows and buttons (Missions): launch is a row's Watch, catch the Launches tab's Watch a Starship catch, go the plain jumps; tab kessler opens the Kessler tracker and watch <k> is its k-th latest breakup's Watch (0 the newest). state also reports each crewed station's fate and, under tracker, the tracker's numbers (they publish over about half a second of frames: wait 60 after opening the tab)
missions milestone [list\|next\|prev\|<i>] [row=] the mission timeline of Go to's object or the selection, and the milestone jumps (the keys ] and [)
deploy [state], deploy stats [from=] [to=] [step=30] the deployment era: each cohort's satellites deployed and launch rate now; launch counts per program and year from the schedule alone

set launches.deployment_era false shows the final roster at every date, the A/B for anything the era changes.

The Sun's Fury

Command What it does
kessler [state] counts now and at the worker's frontier, pieces by class, the dust clouds drawn, re-entries now and ahead
kessler wait [days=<d>] [done] hold the script until the background worker has simulated that far past the storm (sim time holds at the frontier, so do this before a time set past it)
kessler breakup <sat\|sel> [kind=explosion\|asat], kessler collide <a> <b> a player breakup or collision at the current time; asat exists only for testing
kessler select [k=], kessler select dead [k=] [formation=1] a piece of the newest player breakup; a satellite dead now
kessler reentry [watch=1] the Launches tab's Watch the next re-entry
kessler poscheck [n=6] [ev=] for the latest breakups that made records, the recorded place against where their pieces are: a check that a breakup's dust, tracker marker and Watch sit on its debris

See The Sun's Fury.

Weather, storms and fires

Storms, tropical cyclones, tornadoes, haboobs and wildfires are pure functions of sim time (Weather), so these commands find an event and set the clock to it.

Command What it does
weather [state] the Weather window's rows: the featured events, the storms near the observer (near_slots) and worldwide, with each row's milestones (tornado_in_min, passage_in_min)
weather events, weather event <tornado\|hurricane\|haboob\|supercell\|line\|waterspout\|wildfire> [act=0-3] run the featured-event search to its end; act on one card (act 0 is its Watch, the others the alternative framings)
weather watch <k>, weather go <k> [list=near\|world], weather tornado\|passage [k] [list=world] a storm row's Watch (the event already happening, at 1x, in frame); the plain placement; the moment of its tornado or of a line's passage over the observer
weather radar [range=50\|150\|400] [clouds=] [labels=] [loop=], weather tab radar\|storms\|cyclones\|controls open the window on the radar and report the last radar frame read back
weather cyclones [basin=0-5], weather cyclone <name\|id\|k\|strongest> [go=near\|orbit\|eye\|landfall] [watch=1] [milestone=] the named tropical cyclones: the active ones, a basin's season, the next genesis per basin; framings of one, or a jump to one of its milestones
storms [state], storms list [kind=] [n=] the storm objects alive now: kind, place, age, life, towers
storms go storm=<id>\|kind=squall\|mcs\|super [day=1], storms go cyclone=<name\|id\|strongest> [dist_km=] [alt=] stand by a storm or a cyclone (day=1: the Sun above 20 deg there)
storms cyclones, storms season basin=<0-5> year=<y> [track=1] the cyclones now; a season's systems, with their tracks every 6 h
storms tornado [spout=1] [dist_km=] [alt=] [el=] [az_from=] [draw=0\|1] the next daylit tornado (or waterspout) among the storms alive over the next 12 h, the clock set into it, the observer on its inflow side; draw=0 hides the funnels for an A/B of what shows through them
haboob [aloft=1] the Weather window's Haboob card: its search, then its Watch (aloft=1 stands 2 km up)
fires [world=1], fires go [k] [view=side\|under\|orbit] [dist_km=] [alt=] ..., fires look [k] [what=head\|plume] [age_h=] the wildfires in reach (points, flames, smoke, the ground snap); stand by the k-th nearest; aim at its head or its smoke (run look a frame after go)
biome [<lat> <lon>] [export=<name>] the land-cover map at a place (biome, fuel, dust, the season's dryness); export= writes the map as a PNG

state reports the weather under weather: the storms alive and the towers, shields and index bins uploaded (with cpu_ms and its split), tornado_list (each funnel's cloud base and the light it is lit with), the weather cube's re-bake schedule and GPU time (cube: rebakes, all_six_bakes, face_lag_s, tick_s, bake_ms, bake_faces, rect_bake, rect_bakes, env_job_ms), the storm surge at the eye, and gpu_hash / env_hash: a checksum of everything the storm buffer gives the GPU, for checking that a change to the catalog or its indices leaves it unchanged. clouds_v2.weather_one_face (no UI) restores the one-face-a-frame bake schedule as an A/B.

Settings and rendering

Command What it does
get [section[.key]] any persisted setting; get alone lists them all (the keys are settings.json's)
set <section.key> <value> (or several key=value) change settings through the same code path settings.json loads through (Controls and settings); unknown keys and wrong types are errors; the preset label is unchanged
expect <key\|cine.<path>\|state.<path>> <value> [tol=1e-4] fail unless a setting, the open cinematic's JSON or the state JSON matches
preset <Planetarium\|Low\|Medium\|High\|Ultra\|Potato\|Custom> apply a graphics preset (overwrites knockouts and quality sliders)
knockout none\|<mask>\|+key\|-key\|key ..., knockout list knockout bits by stable key (Profiling), plus potato_sky and lite_sky; sets the preset to Custom
debugview <name\|off> replace terrain, sea or cloud-composite pixels with a debug channel (below)
probe <x> <y> what the terrain march does for one pixel's ray: the seed, the seeded march and a march from the eye, the heights at the hit, a 64-sample profile along the ray
lightning, lightning spawn kind=cg\|ic\|spider\|sprite dist_km= az= ... the flashes in progress and the thunder sources (distance, extent, arrives_in_s, heard); place a flash by hand through the same channel, glow and thunder code
shaders reload [march=] [resolve=] [lightning=] [composite=] [sky=] [sky_taa=] [weather=] [wg=<X>x<Y>] rebuild the cloud pipelines (and with sky= / sky_taa= the sky pass, with weather= the weather bake) from SPIR-V on disk and report the driver's register count, binary size and spill memory (stats, and sky_stats for the sky); a bare reload after an override goes back to the shipped SPIR-V (Profiling)

Debug views (debugview): normals, detail, steps (march steps, blue few to red the budget), albedo, shadow, rough, elevzebra and distzebra (stripes every 25 m of elevation and 100 m of distance: broken stripes mean height or convergence jitter), erosion; the terrain lighting term by term (terms, direct, skyamb, night, moon, aurora, gates, factors, skyambraw, suntint, aofactors, day, nightmap, geodot, sunvis, nightsky, citylights), solar (solar parks), pads (launch pads: ground cover, city exclusion, lamps); the sea (oceanrefl, oceanfresnel, oceanstate, oceansurf, oceannormal, oceanshore, oceanshadow); and the cloud composite (cloudairsplit, cloudtrans, cloudrad, cloudalpha). They are not persisted. The lighting term views write linear radiance (x100) straight into the frame, bypassing exposure and tonemapping, so tools/harness/lightscan.py can decode a pixel back to a number and a hue.

Captures, state and timing

Command What it does
capture <name> [ui=on] [crop=x,y,w,h] [scale=s] [wait=1] PNG of the frame (no UI unless ui=on), cropped then scaled: scale<1 box-filters down, scale>1 enlarges with nearest neighbour for pixel inspection. Writes the state sidecar. The command is done once the frame is read back; the PNG encodes on its thread while the script goes on (the next capture waits for it), and wait=1 waits for the encode too. The player's screenshot settings do not affect it
video start [name] [fps=] [scale=] [ui=on] [encoder=auto\|mf\|ffmpeg] [bitrate=<Mbps>], video stop, video state record the frames as shown into videos/<name>.mp4 (H.264). fps defaults to the run's fixed step (60), so each app frame is one video frame of sim-real time however slowly the app renders; scale of the window; no UI unless ui=on. Nothing waits: a frame with no free readback buffer is dropped and the next one repeated. stop reports frames, drops, repeats, the encode cost and the file size (Architecture)
photo <name> [scale=1-4] [frames=N] the HQ photo: rendered at scale x the window offscreen, clouds at full rate, time paused, settled over frames frames; no UI, no sidecar
state [name] [sun_volume=1] the full state as the result, and a file if named: time, observer and follow, camera, selection (with the CPU photometry by lobe, the formation's combined magnitude, the mesh glare data, and gpu_record: the GPU's display flare, sprite size, glare flare and raw flux), clouds (with pass_ms and eval_count, Profiling), satellites, the Moon (with its libration, pole position angle and sub-lunar point), aurora, weather, the light-pollution dome, exposure and point adaptation, refraction, launches, Kessler, ambience. sun_volume=1 adds the clouds' Sun transmittance volume, a readback after a drain that costs about half a second and is left out of every other state and of the capture sidecars
perf [frames=60] [name=] average raw GPU timestamp buckets and CPU buckets over N frames, with GPU total and wall frame-time distributions and the frames_in_flight block (uploads, drains, descriptor writes per frame); name= also appends to the run's perf log
hitches [top=8] [list=25] [bysum=1], hitches clear, hitches threshold <ms> the frame-time distribution since the last clear and every frame over the threshold with its largest main-thread sections (Profiling); frame times are net of the harness's own work (the harnessTick section), so a command's result write never reads as a hitch
sweep the automated knockout sweep (about 15 s); returns the whole record

UI and input

Command What it does
ui show\|hide, ui scale <0.75-2> [auto=0\|1], ui reset <window\|all> HUD visibility and the UI scale setting (auto= the window-height factor; state -> render.ui_scale is the effective value); ui reset forgets a window's position and size, so it opens next at its default for the current window size
ui open <settings [tab=Name]\|viewcontrols\|trace\|info\|viewer\|bookmarks\|cine\|reports\|missions [tab=]\|weather [tab=]\|console>, ui close <name\|all> windows (info, viewer and trace need a selected satellite); an advanced tab turns on advanced settings; close all includes the Issue reports and Missions windows
ui click <ElementId>[:index] [fx=0.5] [fy=0.5] [to_fx= to_fy=] [hold=N] move a scripted pointer onto the element (last frame's layout) and click through the real hover and click path; with to_fx/to_fy it is a drag. A UI-kit element is Key:index. The click can also reach the sky picker: re-select before opening a window that needs the selection
ui hover <ElementId>[:index] [fx=] [fy=], ui hover off rest the scripted pointer over an element without pressing, until ui hover off or the next ui click: tooltips show in a capture
ui type <text>, ui key <enter\|esc\|tab\|backspace\|delete\|left\|right\|up\|down\|home\|end\|w\|]\|[\|f7\|f8\|f9\|f10\|f12> keyboard input into the focused text field, else the game; the F-keys take a player's shot (screenshot, screenshot with UI, issue shots, HQ photo)
ui dump [name] every drawn rectangle, text and image with its box and element id, plus checks for clipped, off-window and overlapping text
pad <a\|b\|x\|y\|lb\|rb\|start\|view\|ls\|rs\|up\|down\|left\|right> a gamepad press without a controller, through the context meaning first, else the binding
tutorial start [step] [pad=1], tutorial step <n\|name>, tutorial next\|back\|skip\|pick\|return\|state the first-run tutorial (never started on its own in a run). Steps by number or name: look, move, altitude, boost, select, info, goto, trace, time, capture, missions, ongoing, settings, graphics. pick is a card's Pick one for me, return its Back to the moment before the Missions step's jump. Its action steps finish on real input, so next moves past them
window <W>x<H> resize the window and wait for the new swapchain
overlay text <id> "<text>" ..., overlay label <id> "<text>" target=<sel\|sun\|moon\|planet>, overlay clear [id] screen text, drawn even with the HUD hidden

Camera paths and cinematics

Command What it does
path clear, path key <t> [lat= lon= alt= az= el= fov= sim=<ISO>\|simadd=<s>] keyframes at path time t (seconds); channels left out inherit from the previous key
path goto <t> jump to the path's pose at t
path play [fps=30] [record=<name>] [frames=i,j,...] [ui=on] [scale=s] [video=<name>] [vscale=s] play the path at a fixed frame rate; record captures every frame as a PNG (frames= only those frames; the others render at full speed); video writes every frame into videos/<name>.mp4, lossless, with no PNGs (a 2.5-s 1080p60 path in about 4 s, against 30 to 40 s with record). The result carries gpu_ms_mean (the cost while moving), gpu_total_ms_p90, gpu_total_ms_max and the worst frame's buckets
cine new\|name\|shot\|key\|play\|export\|save\|load\|state\|stop ... the cinematic: shots, keys, looks, follow shots, playback and preview or HQ export

The harness's camera path is the current cinematic shot, so a path authored in a script appears in the in-app Cinematics window and the reverse. Between keys each channel (latitude, longitude, azimuth, elevation, log altitude, log field of view) follows a cubic Hermite spline with Catmull-Rom tangents; azimuth and longitude are unwrapped so the path turns the short way. Playback is offline: every frame is exactly 1/fps of path time and of frame time whatever the real frame rate, and a recording renders exactly one app frame per recorded frame, so a recording shows the temporal behaviour a player sees. With time paused, path play holds sim time too: time play first to measure a sky that moves. path play ... video=<name> writes the path straight into an .mp4, and video start / video stop record whatever the script does between them (a long wait in a storm, a time warp); ffmpeg -i videos/<name>.mp4 -vf "select=eq(n\,120)" -vframes 1 f.png pulls one frame out to inspect. tools/harness/frames2video.py <dir>/<name> -o out.mp4 --fps 30 assembles record= frames with ffmpeg.

cine subcommands: new [name], name <n>; shot add [name], shot del, shot <n>, shot look [clear], shot follow <sel|index|off>, shot ease <0-1>, shot simrate <x>, shot simnow; key [t=]; play [shot]; export preview|hq [fps=] [scale=] [frames=] [blur=] [shot]; save [file], load <file>; state, stop. A cut to the next shot resets the sky's and the clouds' temporal history. tools/harness/scripts/tour.satcmd is the worked example.

Sound

Command What it does
audio [state [name]] every ambience driver and layer gain, the audible layers, the tonality
audio record <name> [seconds=8] [bus=ambience\|music\|sfx\|all\|music+ambience] [solo=<layer>] render the mix offline to a WAV; needs the default muted run
audio expect <layer,...> [absent=<layer,...>] [min=0.05] fail unless the listed layers are audible and the absent ones are not
audio force <layer> <gain\|off>, audio force off pin a layer's gain
audio music [next\|prev\|pause\|play\|end\|state] the music player; end ends the track so the gap is reachable offline
audio tonality [wait] the key the ambience is in; wait holds until every track is analysed

A muted run has an audio engine with no device; see Ambience. audio record carries the thunder's sound shells on its own clock, so a thunder test is audio force thunder 1, lightning spawn ..., wait 3, then audio record <name> seconds=<arrival + roll> solo=thunder, with time add 200 between tests to retire the previous source.

Determinism

What makes two runs identical:

  • A fixed frame step. The sim receives --fixed-dt (1/60 s) each frame, not wall time. At a time warp the sim time per frame is therefore the real one at 60 fps.
  • wait settle before a capture. Many values ease toward their targets over seconds; a settle holds sim time and steps 0.5 s per frame (wait settle auto stops as soon as the image is still). The HUD's frame rate during a settle is meaningless.
  • An explicit preset. A fresh run folder seeds the preset from the device; put preset <name> first.
  • time pause unless the script is about motion.
  • The same window size and the same build.

time sun is relative to the current clock: each one moves to the nearest matching moment within 12 hours, so splitting, reordering or inserting views silently moves the later ones in time, sometimes to another date (a different Moon). For an A/B across two runs keep the command sequence identical, and check that the sidecars agree on state.time.utc.

The cloud map drifts with sim time, so a cloudy place is tied to a moment: tools/harness/find_cloud_spots.py <ISO time> lists cloudy benchmark locations for one. Weather-dependent views (the shipped storm bookmarks among them) also depend on the cloud defaults: a change of coverage, flow, weather evolution or storm shape can move or dissolve the storm a view frames. After such a change, re-check each default bookmark (bookmark go N; wait settle; wait 30; capture) and re-frame from scripts/default_bookmarks.satcmd.

Snapshots and issue reports

A player hands a problem over as an issue report: F7 starts an issue, F9 adds a shot. Each shot holds the view, the settings, the timings and the frame the player saw. Issue reports describes the format and the triage loop; report load "<issue dir>" shot=N stands in a shot's view.

Every shot also appends a record to perf_profiles/profile_log.jsonl. snapshot <file> [index=-1] restores such a record: its settings, sim time (paused), the exact observer direction and height, the camera and the cloud map's drift phase (session state that latitude, longitude and time alone do not reproduce: the same place and time would frame other clouds). index counts snapshot records only, from the end when negative. Records without settings or a drift phase need --settings set to the user's settings.json; drift=intro (the default) reconstructs the phase as a session that played the intro, drift=default uses the compiled default. Both snapshot and report load apply the settings as saved, past the load-time range guards; clamp=on restores them.

Analysis tools

tools/harness/imgtools.py (Pillow and numpy) prints JSON first, so numbers can be checked before looking at pictures:

Subcommand
sheet <pngs or run dir> -o out.png [--cols 3] [--width 480] a labelled contact sheet of many variants
diff a.png b.png [-o heat.png] mean, max and RMS difference, PSNR, changed fraction and its bounding box, an amplified heat map
stats a.png luminance percentiles, clipped fractions, a 4 x 4 grid of mean luminance
crop a.png x y w h --scale 4 -o out.png pixel-exact enlargement
seams a.png rows and columns whose mean luminance jumps against their neighbours (bands, tile seams)
audio a.wav [b.wav ...] [-o spec.png] levels, ungated LUFS, bands, correlation, transients and a spectrogram per WAV

A model looking at a large image sees it downscaled, so a one-pixel feature can vanish: use capture ... crop=... scale=4 or imgtools crop for small things, and sheet to compare variants.

Motion and consistency tools, each with gen (write a script), a run with run.py, then score or compare:

Tool Measures
tools/harness/tstab.py temporal stability: how far the image seen while moving is from the image the same view settles to (ghosting, smears, blocks, grain). It generates player-speed scenarios from a snapshot's height above the ground (walk, boost, strafe, pan90, pan240, walkpan, rise, boostrise, pitch, boostpan, flick, chaos, 2.5 s each at 60 fps), records each, revisits five poses and settles them for reference, and reports mean, p95 and p99 luminance difference and the share past 16 levels, per scenario and per horizontal band. A floor scenario gives the noise floor. Yaw-only pans hide row-aligned errors; pitch catches them. Run it over clouds, and only the scenarios that isolate the question (--only rise,boostrise). Only the five scored frames per scenario are written, and references settle with wait settle auto (--settle N for a fixed settle, --video for an .mp4 of each path)
tools/harness/matrix_suite.py the matrix suite: altitude rows (on the ground, 100 m, 1 km at the cloud base, 3 and 15 km, 100, 500, 1000 and 5000 km over one flat, cloudy place) and context rows (a storm from the ground and from 15 km, the sea, a night city, Reflect beams from beside and under a site, the aurora from the ground and from orbit, the ISS and a Starmind formation in follow mode, a launch, an eclipse), crossed with motion columns at the player's speeds for that height (still with perf, noise and live flicker over 16 frames paused and at 1x, walk, strafe, fast, look, rise, descend). Each motion cell is the difference from a settled reference after a 3x3 median (point sources removed; raw_* keep them), as mean / share past 16 levels / signed mean (negative: content lost in motion; positive: blur or lag). gen [--quick] [--only ...] [--fragment], score [--sheet N], compare (exit 1 on a regression). Every cell starts from an absolute state and the settings it changes are restored at the end. About 13 min with --quick, 22 full. Run it first for anything that moves or changes with altitude
tools/harness/cloud_suite.py the cloud regression suite: eleven daytime cloud scenes at ordinary angles (cumulus from the ground, 3 km and cloud height, broken and overcast decks, the sea, tropical towers, cumulus shadows on land), each settled with perf, paused for 600 frames (drift of the mean: anything that changes while nothing moves), at 1x, and along five motion paths. gen, score, compare; about 25 min
tools/harness/frame_bench.py wall-clock frame time with uncapped present in the matrix scenes: a still, time at 1x / 1 min/s / 1 h/s, the follow cells and every motion path. gen, compare <base runs> <new runs> (several runs a side; it flags a row outside both spreads). The benchmark for how CPU and GPU overlap (Profiling)
tools/harness/flicker.py still-view flicker: per-pixel temporal statistics of a recorded still sequence (mean and p99 per-pixel standard deviation, the share of pixels past 8 levels, an optional heat map)
tools/harness/climb.py climb consistency: climbs straight up from a snapshot through 15 altitudes (8 to 2500 km) and correlates the cloud detail of each frame, reprojected and filtered, with the next and with fixed references. Every level of detail should be a filtered version of the one below it, not a different placement

Sample before committing to a benchmark: one launch that loads each candidate view, captures it still and records a few seconds of the motion in question, then keep only the candidates where the problem is on screen. The harness is bit-deterministic run to run, so one scored run per build is enough.

tools/harness/ui_lowres.py run [--sizes 1024x768,...] is the low-resolution UI check: one app, window WxH per size, every window opened alone at its default (ui reset all), then ui dump and a capture. It fails when a window leaves the screen or covers too much of it, when text is cut sideways, off screen or overlapping, or when the HUD's panels and chips overlap. check <run dir> re-checks a finished run, sheets <run dir> makes contact sheets per size.

tools/harness/glare_track.py <captures dir> <prefix> [--plot out.png] follows a mesh glare over a sequence of captures and compares it with where the CPU puts the Sun's image in the selected satellite's mirror (from the sidecars' selection.glints and selection.mesh.sprite_px). tools/harness/lightscan.py decodes the terrain lighting debug views. tools/perf_analysis/live_perf_table.py tabulates perf name= results.

Launch and mission checks

tools/harness/mission_ops.py run [--captures] [--vehicle ...] [--epochs ...] traces the next launch of every (vehicle, program) pair in data/launches.json at three epochs (the default start, a date in the deployment era's build-out and an early one) through its phases: pad, climb, max-Q, staging, booster recovery, fairing, insertion, coast, deployment, raising, arrival, retirees, the upper stage's deorbit and entry, the ship's catch, docking. It uses launch trace (no frames are rendered for the numbers), judges each phase against one threshold table (THRESHOLDS: PASS, FAIL, WARN for a part another owner's physics governs, INFO, SKIP, N/A, NOT FOUND), checks the formation trains' ring shape with launch formation, judges every cached crew and cargo flight with launch check (VISIT_THRESHOLDS), and writes report.json, .md and .html under harness_runs/mission_ops/<stamp>/. With --captures it adds a contact sheet per pair (a tile per milestone). mission_ops.py report <run> re-judges stored traces without the app; selftest.py -k mission_ops runs the numeric half.

The visit checks include when a crew or cargo flight reaches its station: docking.hours_after_launch must fall between 2 and 120 hours after lift-off (phasing takes hours to days, and a berthed cargo ship such as HTV-X is captured by the station's arm about four days after launch).

tools/harness/launch_bench.py run | compare <a.json> <b.json> times fixed launch scenes (the Twilight Starship Launch bookmark at 1x, 1 h/s and 1 d/s, a busy deployment-era day, a night launch followed from close, a droneship landing), each with launches on and off, so the difference is the system's cost. compare flags a metric more than 10% and 0.25 ms slower. Make your own baseline on your own machine.

Worked recipes

Performance, no images:

preset Medium
observer lat=61.2 lon=-149.9 agl=10      # Anchorage, a beam-heavy view
time sun -12
camera az=0 el=20 fov=80
wait settle
perf frames=120 name=anchorage_medium
sweep

Hitches across time rates: tools/harness/scripts/hitch_ladder.satcmd steps through every time rate from 1x to 1 yr/s right after load, time scale X; hitches clear; wait 180; hitches per rate. python tools/harness/hitch_check.py runs that ladder in four scenarios (after load, with a user's settings, in 2031, after the Sun's Fury) and fails when a rate's p99 or max, the first frame or the boot time exceeds tools/harness/hitch_thresholds.json; it waits to have the GPU to itself and reports CONTENDED (exit code 3) when another app shared it (Profiling).

Shader A/B at fixed views: capture a baseline, change the code or a setting, capture again, then imgtools.py diff before.png after.png -o heat.png. Within one run, toggle with set or knockout and wait settle between captures. A set that touches the clouds resets the cloud history, so knock the volumetric clouds out first when A/B testing something else in one launch.

Debugging a rendering artefact: capture it at a fixed view; make a sheet with each feature toggled to see which removes it; debugview the suspect channel; probe a pixel on the artefact and one beside it; rerun with the validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, messages in app_stdout.txt) for a crash or device loss; perf with features toggled to attribute cost.

A launch: launch next when=twilight, wait 60, launch select kind=upper, follow offset=0,-300,50, capture stage. Scripts in tools/harness/scripts/ cover the main scenes: pad_smoke, fairing_sep, starmind_deploy, deploy_jitter, droneship, crew_rendezvous, visiting_vehicles, station_loss, mission_milestones, era_build_up, engine_light_adapt, follow_visuals.

UI check: ui scale 2.0; ui open settings tab=Controls; wait 3; ui dump controls; capture controls ui=on, then read the dump's text-overlap checks before the picture. tools/harness/scripts/ui_windows.satcmd walks the info, trace and Bookmarks windows and the HUD's typed fields this way, checking each result with expect state..

Rebuilding the shipped bookmarks: the bookmarks that ship with the sim (data/bookmarks/, copied next to the executable as default_bookmarks/) are produced by tools/harness/scripts/default_bookmarks.satcmd. Each view is set up, settled and added with bookmark add <name> id=<fixed id> scale= paused=, which replaces the shipped bookmark of that id; storm views set the cloud map with drift phase= rate= first, the rest use drift default. Run it with --out harness_runs/default_bookmarks, then copy that run's bookmarks/ folder over data/bookmarks/. Adding launch sites or vehicles reshuffles every launch's pad, so the launch bookmarks need re-shooting then too.

Gotchas

  • Build Release. A Debug build takes tens of seconds to encode each 1600 x 900 PNG.
  • The first launch after a shader change is slower while the driver compiles pipelines; do not read timings from it.
  • The window must stay visible (not minimised), or the swapchain stops presenting. It opens without taking focus.
  • get returns floats (0.2 reads back as 0.20000000298); a later preset overwrites set sliders.
  • ambience.json, samples and other runtime files reach the executable only through a build.
  • The commit stamp in the log's first line is written at configure time, not per build.
  • report load pauses time; with time paused path play holds sim time.
  • report load and snapshot restore only the keys the record saved: a setting set earlier in the run that the record predates stays as set, so A/B variants after one should run in separate launches or in a fixed order.
  • Time anything only with the GPU to yourself, and not in the first 150 or so frames after a shaders reload, a report load or a time jump, while the clouds' caches refill (Profiling).
  • Jumps past the Sun's Fury find no launches: launches stand down after it by default.

The loading screen in a run

Every launch, harness runs included, shows the loading screen. Its frames all come before init() returns, before the script's first command, so scripts are unaffected. run.py --boot-capture writes each loading frame to captures/boot_NN.png, --boot-screen off launches without it, and satlight_log.txt has a boot: <step> (<ms since launch>) line per step.

The startup graphics chooser (described on Controls and settings) is skipped in a harness run, because a run never waits for input. run.py --boot-chooser N shows it scripted (it sets SATLIGHTSIM_BOOT_CHOOSER=pick=N): two frames on the pre-selected option, two on option N (0 Full, 1 Planetarium, 2 Potato), then it starts. state reports the pick and whether the full sky pipelines were deferred (render.boot_choice, full_sky_deferred, full_sky_pipeline, ask_graphics_mode); tools/harness/scripts/boot_chooser.satcmd checks them.

The boot safety net (one tier down when the first frames after loading take over 250 ms each) is off in a harness run. run.py --boot-safety-ms MS arms it at that threshold (tools/harness/scripts/boot_safety.satcmd).

Architecture

The harness has two halves:

Half Files Role
app-independent src/Harness.h/.cpp command-line options, the statement parser, the Runner (one command at a time across frames, results.jsonl, summary.json, the live inbox, the status file), the watchdog
the commands src/simulations/SatelliteSimHarness.cpp harnessExec() (what each command does), harnessStateJson() (the capture sidecar), the console's key handling

Where it runs. harnessTick() is called near the top of buildUI(), after the CPU frame timing starts and before the camera and recordCompute(). A command's effect is therefore in the frame it ran in, and a capture after it records that frame. Time, observer and follow commands also re-run updatePositions() at once, so a state or sidecar in the same frame is not one frame stale.

Commands across frames. harnessExec() returns Status::Done, Status::Error (through fail()) or Status::Pending; a pending command is called again next frame, with a.frame counting its calls and a.scratch holding its state. Results go into a.result, whose "message" is the one-line summary.

Hooks it uses:

  • Simulation::frameDt(): the fixed step (0.5 s during wait settle, which also holds sim time; a cinematic export or path play sets its own).
  • Simulation::wantsQuit(): leave the main loop when the script ends.
  • onChar() and capturesKeyboard(): the console.
  • Paths::setUserDataDirOverride(): main.cpp points the user data folder at the run folder before the log starts.
  • wantsCleanScreenshot() honouring ui=on, the crop and scale in finalizeScreenshot(), and UIRenderer::requestLayoutDump().
  • wantsPreUiCopy(): the quarter-size copy of every frame of a wait settle auto, and a video without the UI.
  • Settings go through applySettingsJson() and buildSettingsJson(), so every persisted setting is scriptable with no per-setting code.

Outside a harness run (and before the console's first use) the runner is null and every hook is a no-op. In a run, the startup graphics chooser, the boot safety net, the intro, the first-run tutorial, first-run notices and the preset seed notice are suppressed (the first two can be switched back on from run.py), the music is started on a device-less engine, and the soundtrack analysis runs synchronously.

Adding a command: match on c.name in harnessExec(), read c.pos and c.kv (c.num(), c.flag(), c.str()), put results in a.result, fail() on bad input. Update kHelp, docs/HARNESS.md and this page's tables together.

Testing the harness: python tools/harness/selftest.py runs real scripts and checks capture sizes and sidecars, bit-identical determinism, knockouts changing and restoring the image, settings round trips, error reporting, parse errors, wait settle holding time, time sun accuracy, perf and sweep numbers, selection, follow and ui dump, probe, debugview, a recorded camera path, Track, the watchdog and live mode. Run it after changing src/Harness.* or SatelliteSimHarness.cpp; it launches the app many times, so it takes several minutes with launch spacing. -k <name> runs one test.

Where in the code

File What
src/Harness.h/.cpp options, parser, Runner, live inbox, watchdog
src/simulations/SatelliteSimHarness.cpp harnessInit(), harnessTick(), harnessExec(), harnessStateJson(), kHelp
tools/harness/run.py, live.py, launchgate.py drivers and launch spacing
tools/harness/imgtools.py, tstab.py, flicker.py, climb.py, glare_track.py, lightscan.py, frames2video.py, gc.py, selftest.py analysis and maintenance
tools/harness/matrix_suite.py, cloud_suite.py, frame_bench.py the matrix, cloud and frame-time benchmarks
src/simulations/SatelliteSimVideo.cpp, src/VideoRecorder.* video, path play video=, the probe behind wait settle auto
tools/harness/mission_ops.py, launch_bench.py launch and mission checks, launch cost benchmark
tools/harness/hitch_check.py, hitch_thresholds.json the hitch regression check
tools/harness/reports.py issue report triage (Issue reports)
tools/harness/scripts/ worked scripts (smoke, determinism, terrain_views, ambience_tour, tour, track, text_fields, ui_windows, tutorial, boot_chooser, boot_safety, low_tiers, default_bookmarks, hitch_ladder (and _2031, _cme), the launch scripts above, ...)
docs/HARNESS.md the complete command reference