nemo_rl.experience.route_plan#

Strict metadata contract for deferred routed-expert assembly.

Module Contents#

Classes#

RouteSpan

One root-first route contribution to a canonical rollout row.

RouteAssemblyPlan

How a policy worker reconstructs routes from staged fragments.

Functions#

_require_exact_keys

_require_int

_require_nonnegative_int

_require_string

_validate_plan

validate_route_plan

Validate a plan without encoding it (direct mode never serializes).

encode_route_plan

Encode a validated plan into primitive KVBatchMeta.tags data.

decode_route_plan

Strictly decode a plan without defaults or compatibility guesses.

encoded_route_plan_size_bytes

Return the compact UTF-8 encoded size used for observability.

Data#

API#

nemo_rl.experience.route_plan.ROUTE_PLAN_SCHEMA_VERSION#

2

nemo_rl.experience.route_plan._EXTRAS_DIGEST_VERSION#

1

nemo_rl.experience.route_plan._SHA256_HEX_LENGTH#

64

class nemo_rl.experience.route_plan.RouteSpan[source]#

One root-first route contribution to a canonical rollout row.

How a span contributes (full/tail/sentinel) is Gym’s decision table — nemo_gym.token_id_capture.staging.routes.classify_route_span — applied by the shared plan executor; this module carries metadata only.

staging_key: str#

None

carry_len: int#

None

generation_len: int#

None

staged_route_len: int#

None

extras_digest_version: int#

None

extras_digest: str#

None

class nemo_rl.experience.route_plan.RouteAssemblyPlan[source]#

How a policy worker reconstructs routes from staged fragments.

schema_version: int#

None

staging_partition: str#

None

spans: tuple[nemo_rl.experience.route_plan.RouteSpan, ...]#

None

cleanup_staging_keys: tuple[str, ...]#

None

expected_token_length: int#

None

nemo_rl.experience.route_plan._require_exact_keys(
value: dict[str, Any],
expected: set[str],
*,
where: str,
) None[source]#
nemo_rl.experience.route_plan._require_int(value: Any, *, where: str) int[source]#
nemo_rl.experience.route_plan._require_nonnegative_int(value: Any, *, where: str) int[source]#
nemo_rl.experience.route_plan._require_string(value: Any, *, where: str) str[source]#
nemo_rl.experience.route_plan._validate_plan(
plan: nemo_rl.experience.route_plan.RouteAssemblyPlan,
) None[source]#
nemo_rl.experience.route_plan.validate_route_plan(
plan: nemo_rl.experience.route_plan.RouteAssemblyPlan,
) None[source]#

Validate a plan without encoding it (direct mode never serializes).

nemo_rl.experience.route_plan.encode_route_plan(
plan: nemo_rl.experience.route_plan.RouteAssemblyPlan,
) dict[str, Any][source]#

Encode a validated plan into primitive KVBatchMeta.tags data.

nemo_rl.experience.route_plan.decode_route_plan(
value: Any,
) nemo_rl.experience.route_plan.RouteAssemblyPlan[source]#

Strictly decode a plan without defaults or compatibility guesses.

nemo_rl.experience.route_plan.encoded_route_plan_size_bytes(
plan: nemo_rl.experience.route_plan.RouteAssemblyPlan,
) int[source]#

Return the compact UTF-8 encoded size used for observability.