STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
feedtwin.session.watch Namespace Reference

Classes

class  Flag
class  _Seen
class  Watcher

Functions

list[str]|None _path_to_air (object net, str start, frozenset[str] shut, set[str] vessels)

Variables

float SEALED_GAIN_KG = 1.0e-9
float HELD_DP = 1.0 * PSI
float STILL_FLOW = 1.0e-5
float HELD_FOR_S = 2.0
float AIR_BAND = 0.2 * PSI
float LIQUID_IN_MIN = 1.0e-4
int UNCONVERGED_TICKS = 3
float EDGE_SHARE = 0.5
float EDGE_FOR_S = 5.0
float UNEXPLAINED_KG = 1.0e-6
float UNEXPLAINED_SHARE = 1.0e-6
float CLOSE_AFTER_S = 1.0
int FLAGS_KEPT = 200
dict TITLES

Detailed Description

The watcher: laws a correct stand cannot break, checked every tick.

The solver tab says whether the arithmetic closed. This says whether the answer
it closed on is one the world allows -- conservation and equilibrium, not the
sim checked against itself (docs/PHYSICS-BENCHMARK.md). Each check is a thing a
bug has done here:

* **Gas made in a sealed tank.** A tank with no open path to the air gained
  gas from its ullage floor (``TankSim.floored_kg``). The ullage floor did it as a sealed fuel tank
  drained (2026-10-11).
* **A line that never moved.** A converged solve left a branch at the solve's
  starting flow (:data:`feedtwin.solve.steady.INITIAL_FLOW`) to the gram:
  Newton took no step there. A 0.45 psi drain beside a 6,000 psi bottle did.
* **Pressure held against an open path.** A vessel more than a psi off
  atmosphere, with a path to the air that every valve on the drawing leaves
  open, and nothing flowing for two seconds.
* **Liquid from nowhere.** The network delivering liquid to a tank's outlet
  that no tank feeding it sent (``TankSim.refused_kg``): the chamber pushing
  back, or air drawn in through an open main, which one fluid per line cannot
  carry.
* **Not converging**, three ticks running; **at the edge of tolerance**, five
  seconds running above half of it.
* **Mass not accounted for**: what the vessels hold against what crossed the
  boundary, less what the clamps booked.

A flag opens when its condition holds (for as long as the check asks) and
closes when it stops; one flag per episode, not one per tick. Read-only:
nothing here changes a step, and a check that raises is reported as a flag,
never as a stopped stand.

Function Documentation

◆ _path_to_air()

list[str] | None feedtwin.session.watch._path_to_air ( object net,
str start,
frozenset[str] shut,
set[str] vessels )
protected
The branches of a path from ``start`` to the air (a fixed node at
atmosphere that is not a vessel), avoiding ``shut`` -- or None.

Definition at line 287 of file watch.py.

References path.append().

Referenced by feedtwin.session.watch.Watcher._checks().

Variable Documentation

◆ AIR_BAND

float feedtwin.session.watch.AIR_BAND = 0.2 * PSI

Definition at line 54 of file watch.py.

◆ CLOSE_AFTER_S

float feedtwin.session.watch.CLOSE_AFTER_S = 1.0

Definition at line 67 of file watch.py.

◆ EDGE_FOR_S

float feedtwin.session.watch.EDGE_FOR_S = 5.0

Definition at line 61 of file watch.py.

◆ EDGE_SHARE

float feedtwin.session.watch.EDGE_SHARE = 0.5

Definition at line 60 of file watch.py.

◆ FLAGS_KEPT

int feedtwin.session.watch.FLAGS_KEPT = 200

Definition at line 69 of file watch.py.

◆ HELD_DP

float feedtwin.session.watch.HELD_DP = 1.0 * PSI

Definition at line 48 of file watch.py.

◆ HELD_FOR_S

float feedtwin.session.watch.HELD_FOR_S = 2.0

Definition at line 52 of file watch.py.

◆ LIQUID_IN_MIN

float feedtwin.session.watch.LIQUID_IN_MIN = 1.0e-4

Definition at line 56 of file watch.py.

◆ SEALED_GAIN_KG

float feedtwin.session.watch.SEALED_GAIN_KG = 1.0e-9

Definition at line 46 of file watch.py.

◆ STILL_FLOW

float feedtwin.session.watch.STILL_FLOW = 1.0e-5

Definition at line 50 of file watch.py.

◆ TITLES

dict feedtwin.session.watch.TITLES
Initial value:
1= {
2 "sealed_gain": "Gas made in a sealed tank",
3 "stuck_guess": "A line never left the solver's starting guess",
4 "held_open": "Pressure held against an open path",
5 "liquid_from_nowhere": "Liquid from nowhere",
6 "unconverged": "Not converging",
7 "edge": "At the edge of the solver's tolerance",
8 "unexplained": "Mass not accounted for",
9 "watcher": "The watcher itself failed",
10}

Definition at line 72 of file watch.py.

◆ UNCONVERGED_TICKS

int feedtwin.session.watch.UNCONVERGED_TICKS = 3

Definition at line 58 of file watch.py.

◆ UNEXPLAINED_KG

float feedtwin.session.watch.UNEXPLAINED_KG = 1.0e-6

Definition at line 63 of file watch.py.

◆ UNEXPLAINED_SHARE

float feedtwin.session.watch.UNEXPLAINED_SHARE = 1.0e-6

Definition at line 64 of file watch.py.