TorchLean API

NN.Runtime.RL.Numerics.Float32.Returns

Checked Float32 Discounted Returns #

This module contains the value-learning recurrences that need explicit finite-intermediate checks: discounted backups and fixed-horizon discounted returns. The public names stay in Runtime.RL.Numerics.Float32; this file only separates the implementation so the runtime tree is easier to audit.

Reference: Sutton and Barto, Reinforcement Learning: An Introduction.

Checked RL core transforms (configured binary32) #

Checked configured binary32 primitives #

The checked RL helpers below are intentionally written in terms of a few small “checked primitive” combinators (checkedAdd, checkedMul, …). Larger routines (GAE, PPO objectives, …) remain readable while still producing precise error locations when non-finite values occur.

Exponential uses FloatLib's configured deterministic approximation. Its check rejects nonfinite results; it does not certify correct rounding or a real-error bound.

Checked preconditions → proof hypotheses #

The NN/Proofs/RL/Floats/* bridge theorems for Binary 8 23 are usually stated with explicit isFinite … = true hypotheses for each intermediate.

The lemma below is the glue between runtime safety checks and those proof hypotheses:

If the checked routine returns .ok, then all the finiteness side-conditions needed by the semantic bridge theorems hold automatically.