Files
TeslaRel410/restoration/source410/BT/HEAT.NOTES.md
T
CydandClaude Fable 5 57507cb15c BT410 Phase 5.3.10: power/heat wave -- the thermal + electrical economy is LIVE
Weapons dump firing heat into their own sinks, sinks conduct through the
Condenser bank into the central HeatSink, temperatures drive the degradation/
failure alarms, and every powered subsystem tracks its generator through the
electrical state machine. Verified: the authentic fire-discipline game -- a PPC
spikes 77->709K per shot, relaxes to 441K across its 5s reload, and sustained
fire climbs 441->674->838->960K, brushing the authored 1000K degradation
threshold. All calibration values match the BT411 audit exactly (central bank
1.39e6, PPC sink 174000, thresholds 77/1000/2000).

- HEAT: HeatSinkSimulation (@004ad924 absorb->T->load->conduct->alarm),
  ConductHeat/ComputeHeatFlow (@004ad8ac/@004ad9ec two-body equilibrium
  relaxation; flow==0 exactly at uniform T), UpdateHeatLoad (15-sample filter);
  heat-state enum + accessors; installed by the HeatSink ctor.
- WIRE-VERIFIED: HeatSink resource gains linkedSinkIndex -- THE missing
  ancestry int that shifted every descendant block +1 (voltageSourceIndex had
  been reading the linked-sink index: "power sources" appeared to be
  Condensers). Conduction topology wired from it at construction:
  weapons->Condensers1-6->central; Generators->Condensers; Reservoir->central.
- MECHWEAP resource: authentic pip tail (pipPosition int + pipColor 3 floats +
  pipExtendedRange int) per the BT411 verified overlay; with linkedSinkIndex
  this closes the whole +3 alignment mystery (ProjectileWeapon pad deleted).
  True bhk1 reads: PPC recharge 5.0s (not 1.0), discharge 0.99s, range 900.
- POWERSUB: ctor resolves voltageSourceIndex -> GeneratorA-D (wire-verified),
  taps via Generator::TapVoltageSource (-1 when full); PoweredSubsystemSimulation
  (@004b0bd0) electrical FSM (Starting/NoVoltage/Shorted/GeneratorOff/Ready);
  GeneratorSimulation partial (start/short-recovery timers).
- Weapons: power step at sim head; Loading recharge gated on electrical Ready
  (authentic @4bbdf5); FireWeapon dumps firing heat. HEAT UNITS: the chain is
  1e7-native with TWO authoring conventions -- energy weapons store small
  (PPC=11, x1e7 from the energy algebra), ballistics store native (SRM6=5.06e7,
  dumped raw; double-scaling it was the bring-up runaway-temperature bug).
- SENSOR: authentic gating (@004b1c4c) -- power step, electrical-Ready gate,
  heat-state switch (Degradation x0.5 / Failure 0). Verified Ready + 100%.

Deferred: coolant depletion/venting, the novice HeatModelOff gate, the charge
model (TrackSeekVoltage/voltage sag/I2R), weapon gate 1 + jam roll, the central
sink's forward-linked drain. Zero Fail across fire + neutral runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 23:55:48 -05:00

4.9 KiB
Raw Blame History

HEAT.CPP / POWERSUB.CPP — the power/heat wave (Phase 5.3.10, 2026-07-21)

The mech's thermal + electrical economy is LIVE: weapons dump firing heat into their own sinks, the sinks conduct through the Condenser bank into the central HeatSink, temperatures drive the degradation/failure alarms, and every powered subsystem tracks its generator through the electrical state machine.

The heat topology (wire-verified on TEST.EGG)

linkedSinkIndex (the previously-missing HeatSink resource int — see below) wires the authored conduction graph at construction:

weapons / equipment  ->  Condenser1..6 (slots 4-9)  ->  central HeatSink (slot 2)
GeneratorA..D (10-13) ->  Condensers
Reservoir (3)         ->  central HeatSink

Authored values match the BT411 calibration audit EXACTLY: central bank mass 1.39e6, PPC's own sink 174000, thresholds 77 start / 1000 degradation / 2000 failure, PPC conductance 86800. (The central sink's own linkedSinkIdx=5 is a FORWARD reference — Condenser2 isn't constructed yet at slot 2's ctor — so its drain is unwired; a post-walk fixup is a small future item. Everything drains INTO it fine.)

Reconstructed

  • HeatSink::HeatSinkSimulation (@004ad924): absorb pendingHeat → T = E/mass → UpdateHeatLoad (15-sample filter) → ConductHeat → alarm thresholds. Installed by the HeatSink ctor (derived classes override and chain it).
  • ConductHeat / ComputeHeatFlow (@004ad8ac/@004ad9ec): the two-body equilibrium relaxation — (T·massScale (E_other+pending+E_own)/denom)·tau· (1exp(dt·conductance·(coolant/capacity)·flowScale/denom)). Verified: flow == 0 exactly at uniform temperature; a fired PPC bleeds ~170K units/step into Condenser4.
  • PoweredSubsystem ctor + PoweredSubsystemSimulation (@004b0f74/@004b0bd0): resolves voltageSourceIndex from the roster (GeneratorA-D — wire-verified), attaches the tap (Generator::TapVoltageSource, 1 when full), and runs the electrical FSM (Starting=0 / NoVoltage=1 / Shorted=2 / GeneratorOff=3 / Ready=4) watching the generator state. Deferred: the AutoConnect replacement-generator hunt (needs the status flags / damage wave).
  • Generator::GeneratorSimulation (PARTIAL): heat step + start/short-recovery timers; the load model (voltage sag, I²R self-heat feeding the charge integration) joins the electrical-charge wave (TrackSeekVoltage).
  • Sensor::SensorSimulation upgraded to the authentic gating (@004b1c4c): power step first, radar = 1 damage, electrical-Ready gate (badVoltage), heat-state switch (Degradation ×0.5, Failure → 0). Verified: voltState=4, radar 100% on the healthy mech.
  • Weapons: Emitter/Projectile sims run the power step at their head; the Loading recharge is gated on electrical Ready (authentic @4bbdf5); FireWeapon dumps the firing heat.

Heat units (1e7-native) — TWO authoring conventions

The heat chain is 1e7-unit-native (BT411 audit). The stream stores heatCostToFire in TWO conventions:

  • Energy weapons: small units (PPC = 11) — the ×1e7 comes from the energy closed form ((1dF)·E ≈ heatCost·1e7 at full charge). Our partial multiplies by 1e7 pending the charge model.
  • Ballistics: native units (SRM6 = 5.06e7) — dumped RAW. (Double-scaling this to 5e14 was the runaway-temperature bug during bring-up.) Both land ~+640K on the weapon's own sink — the consistent design magnitude.

The resource-alignment resolution (wire-verified, closes the +3 mystery)

The raw-stream dumps pinned the FULL ancestry alignment:

  • HeatSink__SubsystemResource.linkedSinkIndex — THE missing int that shifted every descendant block +1 (PoweredSubsystem's voltageSourceIndex previously read the linked-sink index — hence "power sources" appearing to be Condensers).
  • The MechWeapon pip tail is pipPosition(int) + pipColor(3 floats) + pipExtendedRange(int) (+2) — matches BT411's verified overlay exactly.
  • +1 +2 = the +3 the interim ProjectileWeapon pad compensated; the pad is gone.
  • True bhk1 reads: PPC recharge 5.0 s (not the misaligned 1.0), discharge 0.99 s, range 900, damage 12, heatCost 11, pipColor (0,0,1); SRM6 recharge 5 s, range 800, salvo damage 35, missileCount 6.

VERIFIED (BT_FORCE_FIRE + BT_POWER_LOG)

PPC: 77° → fires → ~709° → relaxes to 441° across its 5 s reload → sustained fire climbs the residual 441 → 674 → 838 → 960 — brushing the 1000° degradation threshold: the authentic fire-discipline game. SRM salvos spike +641K and cross degradation after three. Condensers absorb and pass to the central bank. Neutral run: sensor Ready/100%, mech holds, zero Fail.

Still deferred

UpdateCoolant / BalanceCoolant (coolant depletion + venting), the HeatModelOff experience gate (novice mode), the electrical charge model (TrackSeekVoltage / voltage sag / I²R), gate 1 + the heat-scaled jam roll in the weapon FSMs, the central sink's forward-linked drain, Condenser MoveValve handling.