Skip to content

Layer 4 — rSkill (S1)

Part of the OpenRAL public-symbol inventory. Hand-curated; (LNN) markers are refreshed by tools/refresh_methods_linenos.py.

python/rskill/src/openral_rskill/base.py

rSkillBase — abstract base class with lifecycle state machine.

  • const _TRANSITIONS: dict[RSkillState, frozenset[RSkillState]] = {...} — Legal lifecycle edges keyed by current state; _require_transition checks membership. (L59)
  • class rSkillBase(abc.ABC) — Abstract base class for all OpenRAL skills (rSkill is the official package-format name). (L68)
  • __init__(name, *, version='0.1.0', role='s1', embodiment_tags=None, latency_budget_ms=None) — Init only; does not configure or load weights. (L98)
  • info -> RSkillInfo [@property] (L122)
  • name -> str [@property] (L130)
  • state -> RSkillState [@property] (L135)
  • configure() -> None — unconfigured → inactive. (L142)
  • activate() -> None — inactive → active. (L167)
  • deactivate() -> None — active → inactive. (L189)
  • shutdown() -> None — Any state → finalized. (L209)
  • step(world_state) -> Action — One inference step (hot path). (L233)
  • on_load_weights() -> None — Hook: load weights. (L279)
  • on_unload_weights() -> None — Hook: release weights, called by shutdown() (VRAM eviction). (L286)
  • on_quantize() -> None — Hook: apply quantization. (L296)
  • on_warmup() -> None — Hook: dummy forward pass, called by activate() before _activate_impl; default no-op. The deploy path implements it in the runner's policy shim (rskill_runner_node.py on_warmup), which runs adapter.step on a synthetic observation and swallows+logs failures as rskill_runner.warmup_failed. (L303)
  • _configure_impl/_activate_impl/_deactivate_impl/_shutdown_impl/_step_impl() [@abstractmethod] (L313)
  • private: _transition, _update, _require_transition, _enter_error

python/rskill/src/openral_rskill/runtime.py

Runtime Protocol and NullRuntime — inference backend contract.

  • class Runtime(Protocol) — Structural protocol for skill inference backends. (L24)
  • is_loaded -> bool [@property] (L40)
  • device -> str [@property] (L45)
  • load(path) -> None (L49)
  • infer(inputs) -> dict[str, Any] (L61)
  • quantize(config: QuantizationConfig) -> None (L76)
  • warmup(inputs) -> None (L88)
  • unload() -> None (L96)
  • class NullRuntime — No-op backend for testing; same surface as Runtime, every method a no-op. (L101)
  • __init__(device='cpu') (L123)
  • is_loaded -> bool [@property] (L133)
  • device -> str [@property] (L138)
  • load(path) -> None (L142)
  • infer(inputs) -> dict[str, Any] (L150)
  • quantize(config) -> None (L161)
  • warmup(inputs) -> None (L168)
  • unload() -> None (L175)

python/rskill/src/openral_rskill/runtime_pytorch.py

  • const _ALLOW_UNSAFE_PICKLE_ENV = "OPENRAL_ALLOW_UNSAFE_PICKLE" — Env var gating load()'s pickle deserialization (C2). (L38)
  • class PyTorchRuntime — torch-backed Runtime. (L41)
  • __init__(device='cpu') (L70)
  • is_loaded -> bool [@property] (L81)
  • device -> str [@property] (L86)
  • load(path) -> None — Unpickles a full module — gated behind _ALLOW_UNSAFE_PICKLE_ENV, C2. (L90)
  • load_safetensors(path, *, model, strict=True) -> None — Safe: loads a state_dict into a caller-supplied module, no code execution — preferred for new skills. (L146)
  • infer(inputs) -> dict[str, Any] (L202)
  • quantize(config) -> None — Dynamic INT8 on Linear. (L229)
  • warmup(inputs) -> None (L261)
  • unload() -> None — Frees CUDA cache. (L273)

python/rskill/src/openral_rskill/runtime_onnx.py

  • const _CUDA_PROVIDERS = ["CUDAExecutionProvider", "CPUExecutionProvider"] (L30)
  • const _CPU_PROVIDERS = ["CPUExecutionProvider"] (L31)
  • class ONNXRuntime — onnxruntime-backed Runtime. (L52)
  • __init__(device='cpu') (L80)
  • is_loaded -> bool [@property] (L100)
  • device -> str [@property] (L105)
  • load(path) -> None (L109)
  • infer(inputs) -> dict[str, Any] (L132)
  • quantize(config) -> None — Always raises — ONNX quantization is pre-applied. (L157)
  • warmup(inputs) -> None (L173)
  • unload() -> None (L186)

python/rskill/src/openral_rskill/backend_registry.py

Extraction seam: entry-point-based runtime-backend + policy-attach-hook registry.

  • const _RUNTIME_BACKENDS_GROUP = "openral.runtime_backends" (L46)
  • const _POLICY_ATTACH_HOOKS_GROUP = "openral.policy_attach_hooks" (L47)
  • const _PRO_MODULES_GROUP = "openral.pro_modules" (L48)
  • const _BUILTIN_RUNTIME_BACKENDS: dict[str, str] = {...} — Built-in kind → runtime-class-name map (pytorch/onnx/null). (L54)
  • resolve_runtime_backend(kind: str) -> type[Runtime] — built-in dict (pytorch→PyTorchRuntime, onnx→ONNXRuntime, null→NullRuntime) first, else looked up via the openral.runtime_backends entry-point group (e.g. openral-pro-trt registering tensorrt). Miss → ROSConfigError naming openral-pro-trt. (L61)
  • maybe_attach_pro_hooks(policy_name: str, skill, **kwargs) -> bool — Generic policy-attach-hook lookup via the openral.policy_attach_hooks entry-point group (name = policy_name). No hook installed → debug log + False, never a silent skip; hook found → invoked as hook(skill, **kwargs). (L112)
  • resolve_pro_module(name: str) -> ModuleType | None — Logical name → privately installed helper module via the openral.pro_modules entry-point group (entry values are bare module paths, e.g. nvbufsurface = openral_pro_trt.nvbufsurface). Absent → debug log + None; an ImportError inside the module propagates; a non-module target → ROSConfigError. The only way open code reaches a Pro module (tools/check_no_pro_imports.py refuses direct imports). (L168)

Moved to OpenRAL Pro: runtime_tensorrt.py (TensorRTRuntime), smolvla_export.py, smolvla_trt.py, and act_trt.py now live in the private openral-pro-trt package as openral_pro_trt.*, plugging in via the openral.runtime_backends / openral.policy_attach_hooks / openral.pro_modules entry-point groups above.

python/rskill/src/openral_rskill/quantization_gate.py

ADR-0123: open runs fp32 / fp16 / bf16; every format of 8 bits or fewer needs the OpenRAL Pro quantization package, registered as openral.pro_modules: quantization. Each check raises ROSConfigError naming the dtype, the caller and OpenRAL Pro, and never falls back to a wider dtype.

  • const PRO_QUANTIZATION_MODULE = "quantization" — the Pro module's logical name in openral.pro_modules. (L41)
  • const SUB_16_BIT_DTYPES: frozenset[str] — every spelling of an 8-bit-or-fewer format (int8, fp8, int4, nf4, 4bit, 8bit, fp4, nvfp4, fp4_nvfp4). (L45)
  • is_sub_16_bit(dtype: object) -> bool — whether a token or QuantizationDtype is 8 bits or fewer; None → False. (L50)
  • pro_quantization_installed() -> bool — resolve_pro_module(PRO_QUANTIZATION_MODULE) is not None. (L62)
  • require_pro_for_dtype(dtype: object, *, what: str) -> None — the dtype check, called by openral_sim._quantization.resolve_quant_plan on the resolved token and by tools/quantize_rskill.py on --scheme. (L81)
  • require_pro_for_manifest(manifest: RSkillManifest) -> None — the declared-dtype check for loaders that bypass the policy resolver: build_manifest_detector, build_topreward_monitor, build_reward_monitor (Robometer), build_scene_vlm. Also runs require_pro_for_checkpoint on the selected weights_uri (else source_repo) so a bf16 manifest over an upstream-quantized checkpoint is refused too; a local:// source has no config to read and passes. (L164)
  • pro_quantization(*, what: str) -> ModuleType — the OpenRAL Pro quantization module (openral.pro_modules: quantization), which carries the bitsandbytes NF4 / LLM.int8 rewrites, the pre-quantized pack loaders and the GR00T NF4 scope; open adapters and tools/quantize_rskill.py call them through it (ADR-0123 step 3). Raises the typed ROSConfigError naming OpenRAL Pro when it is absent. (L103)
  • sidecar_quantization_args(dtype: str | None, *, what: str, rewrites: bool = False) -> list[str] — ["--quantization-config", <json>] for a sub-16-bit sidecar load (nf4, int8, prequantized_nf4), from Pro's hf_quantization_kwargs; [] for fp16 / bf16 / fp32. Every sidecar launcher (XR-1, InternVLA-N1, RLDX, LocateAnything, Qwen VLM, LingBot; the BEHAVIOR GR00T adapter) passes it to a server in a venv without Pro. The server builds BitsAndBytesConfig(**kwargs) where it quantizes at load, and refuses any sub-16-bit load without it, so open sidecars run 16/32-bit only (ADR-0123 step 3). rewrites=True also appends ["--pro-quant-module", <path>] (Pro's sidecar_module_path()) for the LingBot and BEHAVIOR GR00T sidecars, which rewrite their own Linears with that file. (L125)
  • require_pro_for_checkpoint(source: str, *, what: str) -> None — refuses a checkpoint whose config.json carries a quantization_config (local dir, local://, hf://org/repo[@rev] or org/repo); returns at once when Pro is installed; an unreadable config (offline, private, missing) logs quantization.checkpoint_unchecked and passes, since the load that follows fails the same way. Called by resolve_quant_plan on spec.weights_uri. (L218)

python/rskill/src/openral_rskill/loader.py

rSkill loader — HF Hub download, manifest validation, license guard, local registry.

  • const _DATA_HOME = Path(os.environ.get("OPENRAL_DATA_HOME", ...)) — Base dir for the local rSkill registry. (L70)
  • const _CACHE_HOME = Path(...) — Base dir HF Hub downloads land under. (L71)
  • const DEFAULT_REGISTRY_PATH: Path = _DATA_HOME / "rskills.json" — Default JSON registry file written by rSkill.from_pretrained. (L75)
  • const _RSKILL_MANIFEST_CACHE: dict[str, RSkillManifest] = {} — In-process memoisation for load_rskill_manifest. (L80)
  • const _ALLOW_NONCOMMERCIAL_ENV = "OPENRAL_ALLOW_NONCOMMERCIAL" — Env var gating noncommercial-weight loads (CLAUDE.md §1.9). (L84)
  • const _REQUIRE_SIGNED_ENV = "OPENRAL_REQUIRE_SIGNED_SKILLS" — Env var that fails closed when provenance signing is unverified. (L89)
  • const _EMBODIMENT_ANY_TAG: str = "any" — Sentinel embodiment tag matching every robot. (L97)
  • class InstalledRSkillEntry(BaseModel) — One row in the local registry. (L145) fields: repo_id, version, revision, local_dir, manifest_path, license, role, embodiment_tags, installed_at
  • class rSkill — Packaged, capability-tagged robot skill; provenance signing is not yet enforced. (L189)
  • __init__(manifest, local_dir) (L213)
  • from_pretrained(cls, repo_id, *, revision=None, cache_dir=None, force_download=False, commercial_use=True, registry_path=None) -> rSkill [@classmethod] — fetch_manifest + license guard + install_snapshot. (L226)
  • install_snapshot(cls, repo_id, manifest, manifest_path, *, revision=None, cache_dir=None, force_download=False, registry_path=None) -> rSkill [@classmethod] — The second half of from_pretrained for a caller that gated the manifest itself (the runner's ManifestSkillResolver): unknown-benchmark warning, provenance guard, snapshot download pinned to the commit manifest_path was fetched at (snapshots/<sha>/rskill.yaml, else the requested revision), registry entry. (L291)
  • fetch_manifest(repo_id, *, revision=None, cache_dir=None, force_download=False) -> tuple[RSkillManifest, Path] [@staticmethod] — Download and validate only rskill.yaml (never weights), so a caller can gate a Hub skill before the snapshot download; from_pretrained starts here and ManifestSkillResolver.manifest uses it for Hub ids. ROSConfigError on a missing huggingface_hub, a failed or gated download, or an invalid manifest. (L385)
  • from_yaml(cls, path, *, local_dir=None) -> rSkill [@classmethod] — Load locally without network; an invalid manifest is a ROSConfigError (via _parse_manifest). (L438)
  • list_installed(registry_path=None) -> list[InstalledRSkillEntry] [@staticmethod] (L473)
  • uninstall(repo_id, registry_path=None) -> bool [@staticmethod] — Remove from registry only. (L504)
  • check_dispatchable(manifest) -> None [@staticmethod] — Refuse (ROSCapabilityMismatch, logged rskill.dispatch_refused) a manifest whose kind is not in EXECUTE_RSKILL_KINDS, or an actuating kind declaring the "any" embodiment wildcard (it would pass check_embodiment_tags on every robot; the palette never offers it). First of openral_rskill_ros.check_manifest_gates; re-run by ManifestSkillResolver.build. (L534)
  • check_embodiment_tags(manifest, robot_capabilities) -> None [@staticmethod] — Verify embodiment tag intersection (raises on disjoint sets). Exempt for perception kinds (detector/segmenter/vlm, _EMBODIMENT_AGNOSTIC_KINDS): they are camera-in → detections/text-out with no action contract, so they match any robot regardless of tags. (L586)
  • check_capability_flags(manifest, robot_capabilities) -> None [@staticmethod] — Verify every manifest.capabilities_required flag against RobotCapabilities. (L614)
  • check_runtime(manifest, robot_capabilities) -> None [@staticmethod] — Verify manifest.runtime ∈ gpu_supported_runtimes; skipped when the legacy capability field is missing or empty (the GPU support fields moved to ComputeSpec, so missing means "unknown" for now). (L646)
  • check_quantization_dtype(manifest, robot_capabilities) -> None [@staticmethod] — Verify manifest.quantization.dtype ∈ gpu_supported_dtypes; skipped when the legacy capability field is missing or empty. (L675)
  • check_capabilities(manifest, robot_capabilities) -> None [@staticmethod] — Composition of the four narrower checks; raises on first failure. (L703)
  • check_sensors(manifest, robot_sensors) -> None [@staticmethod] — Verify the robot exposes every SensorRequirement the manifest declares: a vla_feature_key requirement resolves to exactly one matching robot sensor, otherwise the robot must expose count sensors of the requested modality meeting any resolution minimum. ROSCapabilityMismatch on any unmet requirement; a missing key names the image_preprocessing.aliases fix. The one sensor rule for openral sim run, openral detect and the deploy runner (_build_runtime_skill_from_manifest calls it before any weights are loaded into memory — a Hub skill's snapshot is already downloaded by then), so a required camera the robot cannot serve is refused instead of masked: the restock π0.5 (revision 3599235f, requiring context where the OpenArm's head slot is top) ran every real goal with a masked head view. (L741)
  • check_compatibility(manifest, robot, *, scene_gripper_convention=None) -> None [@staticmethod] — Umbrella entry point combining check_capabilities (embodiment tags + capability flags, with compute=robot.compute_edge or robot.compute_local), check_sensors against robot.sensors, and check_gripper_conventions. (L782)
  • check_gripper_conventions(manifest, robot, *, scene_gripper_convention=None) -> None [@staticmethod] — Refuse (ROSCapabilityMismatch) a skill whose GRIPPER_* encoding (its gripper actuator's gripper_convention) differs from what the addressed end effector — or, with scene_gripper_convention, the simulated scene's environment — consumes; targets come from explicit gripper slots or slots expanded from action_contract.representation; an undeclared encoding on either side is a mismatch. Called by the runner when it resolves a skill and by openral sim run. (L822)
  • _check_license(manifest, *, commercial_use) -> None [@staticmethod] — Enforce license guards for the manifest's declared posture. (L1022)
  • _validate_eval_jsons(skill_dir) -> None [@staticmethod] — Validate every <skill_dir>/eval/*.json against RSkillEvalResult. (L1122)
  • _register(entry, registry_path) -> None [@staticmethod] (L1148)
  • __repr__() -> str (L1172)
  • resolve_rskill_local_dir(uri) -> Path | None — Return the absolute on-disk directory of an in-tree rSkill from a bare skill ref (name, rskills/<name>, or a Hub repo id — matched by the in-tree manifest's name, as load_rskill_manifest does), or None for Hub-only refs. Used by openral benchmark run to write eval results and update rskill.yaml regardless of cwd. (L1184)
  • parse_rskill_manifest(path, *, source=None) -> RSkillManifest — The loader's one uncached manifest parse (fetch_manifest / from_yaml / load_rskill_manifest / the runner's ManifestSkillResolver.resolve): a pydantic.ValidationError or invalid YAML becomes a ROSConfigError (CLAUDE.md §5) whose message names every failing field (loc: msg); logged at DEBUG as rskill.manifest_refused (CLI commands print JSON on stdout). Direct RSkillManifest.from_yaml callers keep the schema-layer ValidationError. (L104)
  • manifest_paths_by_name(roots) -> dict[str, Path] — {name: path} over <root>/*/rskill.yaml, first match in root order (the reasoner palette seed's precedence). Reads only each file's top-level name: line (~ms per tree, no validation), so an invalid manifest is still found and its typed parse reports the fault instead of the id looking unknown. Used by ManifestSkillResolver.resolve and _intree_manifest_path_by_name. (L1302)
  • _candidate_local_paths(uri) -> list[Path] — Enumerate on-disk candidates (cwd-relative + repo-root anchored) for a skill reference. Also unwraps HF Hub form <org>/rskill-<name> to in-tree rskills/<name>. (L1211)
  • discover_intree_rskills() -> list[tuple[str, RSkillManifest]] — Walk <repo>/rskills/*/rskill.yaml and return (name, manifest) pairs. Malformed entries are skipped with a stderr warning. (L1243)
  • find_repo_root_from(start) -> Path | None — Walk up from start for the first ancestor containing both pyproject.toml and rskills/. Public, re-exported from openral_rskill.__init__; used across the package boundary by openral_sim.cli, openral_cli.main, and the deploy_e2e launch file. (L1352)
  • REPO_ROOT_ENV: str = "OPENRAL_REPO_ROOT" (L1274) — Env var naming the checkout whose robots/ + rskills/ trees to use.
  • repo_root_override() -> Path | None (L1278) — The $OPENRAL_REPO_ROOT checkout when it holds both robots/ and rskills/, else None. The one validity rule shared by openral_cli.deploy_sim._repo_root_from (which refuses an invalid override), deploy_e2e.launch.py's skill tree and the in-tree resolution here.
  • intree_repo_root() -> Path | None (L1294) — The checkout in-tree rSkills resolve from: repo_root_override(), else find_repo_root_from this package. Used by _candidate_local_paths, discover_intree_rskills, intree_embodiment_tags and the name index.
  • SKILL_ONLY_EMBODIMENT_TAGS: frozenset[str] — {"any", "custom", "multi"}: embodiment tags valid on an rSkill manifest that no robot declares. (L1365)
  • intree_embodiment_tags() -> frozenset[str] — SKILL_ONLY_EMBODIMENT_TAGS plus every capabilities.embodiment_tags of the checkout's robots/*/robot.yaml; the typo guard for the open EmbodimentTag id (scaffolders + CI). Public, re-exported. (L1370)
  • known_benchmark_ids() -> frozenset[str] | None — benchmarks/*.yaml ∪ scenes/benchmark/*.yaml stems of the checkout, or None without one; the membership set for the open BenchmarkName id (writeback, benchmark scene guard, CI). Public, re-exported. (L1387)
  • _warn_unknown_benchmarks(manifest, *, source) -> None — rskill.unknown_benchmarks warning (never a failure) when a Hub manifest cites a benchmark the checkout lacks; called by rSkill.from_pretrained. (L1403)
  • validate_skill_ref(raw) -> str — Validate and return a bare rSkill reference unchanged (bare name, rskills/<name> path, or HF repo id); rejects a known URI scheme (hf://, local://, file://, http(s)://). Public, re-exported from openral_rskill.__init__. (L1415)
  • gated_repo_error(repo_id, exc) -> ROSConfigError | None — Map a Hub download failure on a gated repo (GatedRepoError, or 401/403 where model_info reports gated) to the actionable "OpenRAL Pro rSkill … is gated — request access at …" error; None for private/missing repos and other errors. Used by rSkill.from_pretrained, load_rskill_manifest and openral rskill install. Re-exported from openral_rskill.__init__. (L1455)
  • load_rskill_manifest(uri) -> RSkillManifest — Resolve a bare skill reference to a parsed manifest. Tries local path → in-tree manifest whose name is the <org>/rskill-<name> repo id (_intree_manifest_path_by_name: reads only each name:, skips malformed files silently, logs rskill.manifest_resolved_in_tree at DEBUG) → HF Hub download. In-process memoised. (L1495)
  • resolve_rskill_to_hf(uri) -> str — Resolve a skill reference to either the underlying HF Hub repo id (hf://...) or an absolute local path (local://...); both forms are accepted by from_pretrained helpers. (L1584)
  • resolve_rskill_to_hf_with_revision(uri) -> tuple[str, str | None] — Like resolve_rskill_to_hf but splits the optional @<branch-or-sha> pin off an hf:// weights_uri into a separate revision, since HF drops a pin glued onto the repo id. A directory that already holds model.safetensors (or a sharded model.safetensors.index.json + shards) next to its rskill.yaml — the snapshot rSkill.from_pretrained leaves in ~/.cache/openral/rskills — resolves to itself rather than following its hf:// pointer, which otherwise re-resolved a just-downloaded repo through the default HF cache (second fetch online, hard failure offline). In-tree rskills/<name>/ dirs ship no weights and are unaffected. Runs rSkill._check_provenance on every call (cached or not), so OPENRAL_REQUIRE_SIGNED_SKILLS=1 fails closed for the adapters that bypass from_pretrained (sim policies, behavior serve). (L1618)

python/rskill/src/openral_rskill/depth_estimator.py

The one rule for which kind: depth_estimator rSkill a depth provider may run, shared by openral deploy (before launch), deploy_e2e.launch.py and depth_provider_node (at configure).

  • depth_rskill_manifest(ref, rskills_dir) -> Path (L21) — The absolute rskill.yaml a depth-skill reference names: a directory under rskills_dir, or a path to an rskill.yaml (a relative one resolves against rskills_dir's parent, the same root). ROSConfigError when no manifest is there. openral deploy forwards the result as estimated_depth_rskill:=; the launch's _depth_rskill_manifest wraps it.
  • depth_skill(manifest_path, *, metric) -> tuple[DepthEstimatorContract, str] (L50) — The contract and model repo (weights_uri minus hf:// and revision, which every sidecar reply must name), loaded through rSkill.from_yaml (schema + license gate: Depth Pro 2's apple-amlr needs OPENRAL_ALLOW_NONCOMMERCIAL=1). ROSConfigError for a non-depth skill, a relative skill in metric mode, or one without predicts_intrinsics in the SLAM mode.

python/rskill/src/openral_rskill/hub_search.py

Free-text + facet search over an HF Hub org's rSkills — backs openral rskill search.

  • class HubRSkillCard(BaseModel) [frozen] — Catalog summary of a gated repo read from its public model card (reserved rskill-kind:/rskill-role:/embodiment:/rskill-license: tags + the openral: block). (L47)
  • HubRSkillCard.from_card(tags, card_data) -> HubRSkillCard | None — Build from Hub tags + cardData; None when the card lacks the contract. (L91)
  • class HubRSkillHit(BaseModel) [frozen] — One matching Hub repo. (L128) fields: repo_id, manifest: RSkillManifest | None, card: HubRSkillCard | None, local: Literal["in-tree","installed"] | None, hub_tags: tuple[str, ...]. local == "in-tree" compares the Hub repo_id against the name declared by a real rskills/<dir>/rskill.yaml — never against the fetched (possibly stale) remote manifest's own name field.
  • class HubRSkillSearchResult(BaseModel) — Search result: hits (sorted by repo_id), skipped_repo_ids — the explicit record of dropped repos, since this module never logs a skip itself — and inspected. (L172)
  • search_hub_rskills(query='', *, kind='', role='', embodiment='', license='', family='', org='OpenRAL', limit=None, max_workers=8) -> HubRSkillSearchResult — Lists every repo the org tagged rskill in one Hub call, fetches each candidate's rskill.yaml concurrently, then matches query locally (case-insensitive, every token substring-matched against id/name/description/tags) and applies the facet filters. A gated repo whose manifest is unreadable is matched from its card (hit.card). limit caps hits after sorting by repo_id. (L316)
  • _manifest_haystack(repo_id, manifest, hub_tags) -> str — Build the lower-cased blob _matches_query searches. (L203)
  • _matches_query(query, haystack) -> bool — Every whitespace-split token must substring-match. (L220)
  • _matches_facets(m, *, kind, role, embodiment, license_, family) -> bool — Whether a manifest passes every non-empty facet filter. (L226)
  • _fetch_one(model) -> tuple[str, RSkillManifest | None, tuple[str, ...], str] — Worker-thread fetch + validate of one repo's rskill.yaml; narrow-catches expected errors so one bad repo never fails the whole search. The skip reason isn't logged (would corrupt --json | jq output) — only the repo id surfaces, via HubRSkillSearchResult.skipped_repo_ids. (L247)
  • _local_markers() -> tuple[frozenset[str], frozenset[str]] — (in_tree_names, installed_repo_ids) for the local marker. A corrupt registry or an invalid row is treated as no installed entries, with log.warning("rskill.hub_search.registry_unreadable", ...) — never silently swallowed. (L291)

python/rskill/src/openral_rskill/gpu_passthrough.py

GpuPassthroughSkill — minimal rSkill whose per-step image processing provably runs on GPU (M8 PR I/10).

  • _REDUCTION_SIZE: int = 64 — module constant; reduction-target size used to bound GPU latency. (L48)
  • _RGB_CHANNELS: int = 3 — module constant; channel count for the GPU mean-reduction read-back. (L52)
  • class GpuPassthroughSkill(rSkillBase) — Uploads each SensorFrame to torch.cuda, runs per-channel mean reduction (with explicit torch.cuda.synchronize), emits result as Action.confidence. Refuses silent CPU fallback. (L55)
  • __init__(sensor_id='wrist_rgb', n_joints=6, horizon=1, device='cuda', latency_budget_ms=None) (L76)
  • step_count -> int [@property] (L104)
  • on_load_weights() -> None — no-op (skill is weight-less). (L110)
  • on_quantize() -> None — no-op (skill is weight-less). (L114)
  • on_warmup() -> None — Allocate the GPU input buffer + launch a kernel so the first step doesn't pay cudaMalloc latency. (L118)
  • _configure_impl() — Lazy-import torch, resolve device, raise if cuda requested and torch.cuda.is_available() is False. (L144)
  • _activate_impl/_deactivate_impl/_shutdown_impl (L169)
  • _step_impl(world_state) -> Action — Pull frame → CPU→GPU upload → GPU reduction → action with confidence. (L185)
  • private: _extract_latest_image(world_state) -> NDArray[np.uint8], _gpu_reduce(frame, *, torch) -> (float, float, float). (L227 / L260)
  • _channels(encoding: FrameEncoding) -> int — Per-pixel channel count for a FrameEncoding; MONO8 → 1, BGR8/RGB8 → 3, everything else falls through to a defensive BGR default of 3. (L297)
  • _zero_frame() -> NDArray[np.uint8] — Resilient placeholder when no sensor frame is available yet. (L310)

python/rskill/src/openral_rskill/_diagnostics.py

Shared load-phase instrumentation seam — generalises the inline _heartbeat originally inside openral_sim.policies.pi05 so every VLA adapter's _build_* factory uses the same <prefix>_<name>_{start,heartbeat,done} event shape (CLAUDE.md §1.13 — single seam, no duplicates).

  • const _PAGE_SIZE = os.sysconf("SC_PAGE_SIZE") if hasattr(os, "sysconf") else 4096 — Page size in bytes, for converting /proc/self/statm's page count into rss_mb. (L46)
  • phase_timer(name, *, prefix="phase", interval_s=15.0, log=None, gpu_mb=False, **fields) -> Iterator[None] [@contextmanager] — Emits <prefix>_<name>_start/heartbeat/done events with elapsed_s, rss_mb, and major_faults so a slow-but-idle load is attributable to page reclaim. gpu_mb=True also attaches CUDA memory to the heartbeat; torch import is lazy so CPU-only hosts still work. (L136)
  • gpu_allocated_mb(*, no_import=False) -> float | None — Current CUDA allocator usage in MB (memory_allocated, not memory_reserved), or None if unavailable — the single GPU-memory probe eviction accounting and phase-timer heartbeats both read. no_import=True consults only an already-imported torch. Public, re-exported from openral_rskill.__init__. (L49)
  • _rss_majflt() -> tuple[float, int] | None — Process RSS (MB) + lifetime major-fault count from /proc/self/{statm,stat}; None off Linux. (L82)
  • const _PAGE_SIZE: int = os.sysconf("SC_PAGE_SIZE") if hasattr(os, "sysconf") else 4096 — Page size in bytes used to convert /proc/self/statm's page count into rss_mb. (L46)

python/rskill/src/openral_rskill/executor.py

Action-chunk executor shared by every chunked VLA family. Also the home of Real-Time Chunking (RTC): with an enabled lerobot RTCConfig the buffer becomes an ActionQueue whose tail a landing prefetch replaces.

  • const _CHUNK_TENSOR_RANK = 3 — Expected (batch, chunk, action_dim) tensor rank for a chunk producer's output. (L98)
  • _check_boundary_blend(steps, dims, *, chunk_size, prefetch_at, rtc_enabled, steps_name, dims_name) -> tuple[int, tuple[int, ...] | None] — Single source of the boundary-blend rules, shared by ChunkedExecutor.__init__ and build_chunk_executor (labels via steps_name / dims_name). steps an int >= 0, not with RTC, and < the shortest chunk that can enter behind a previous one: chunk_size, or with prefetch_at >= 1 the chunk_size - prefetch_at - 1 rows a merged chunk keeps (back to chunk_size when that is 0, since every merge is then fully stale); dims given only with steps >= 1, a non-empty list of distinct non-negative ints. ROSConfigError otherwise. (L101)
  • _check_rtc_relative(policy, *, rtc_enabled, rtc_prefix_fn, has_postprocess, name) -> None — Single source of the relative-action RTC guard, shared by ChunkedExecutor.__init__ and build_chunk_executor (which runs it before init_rtc_processor). With RTC enabled: ROSConfigError when policy.config.use_relative_actions is set and no rtc_prefix_fn re-anchors the prefix (the raw leftover is relative to the previous chunk's state, openral/openral#378), or when rtc_prefix_fn is given without postprocess_action (it reads the postprocessed, absolute rows). (L180)
  • _copy_action(action) -> Any — Independent copy of a NumPy / torch action (clone() / np.array(copy=True)); the stored boundary-blend tail. (L228)
  • _host_norm(value) -> float — L2 norm of a NumPy / torch action for any float dtype (torch reduces via .float(), so bfloat16 works; NumPy in float64); the DEBUG jump_norm. (L233)
  • class ChunkedExecutor — Owns the per-step action buffer for every chunked VLA family, optionally overlapping chunk N+1 inference with execution via a background thread; calls predict_action_chunk directly rather than resetting lerobot's shared queue. Default producer is policy.predict_action_chunk, or a custom chunk_fn; prefetch_at=0 is synchronous. postprocess_action finishes each chunk where it is produced: one host copy of the whole chunk (any non-CPU device — CUDA, MPS, XPU), then the per-action postprocessor on every row, in the producing (prefetch) thread, so pops never touch the GPU and lerobot's AbsoluteActionsProcessorStep adds the state cached for that chunk's own inference; under RTC it runs at merge time into the ActionQueue's processed copy, which pops serve as NumPy, while the raw rows stay for the guidance blend. Without RTC a pre-fetched chunk is appended behind the tail minus its leading actions that are already in the past (_merge_prefetched): it was planned from the observation of the step that launched it (action i targets that step + i), and the tail served those steps meanwhile; a fully stale chunk is discarded and the step replans synchronously. RTC mode (an enabled lerobot RTCConfig) swaps the buffer for an ActionQueue and replaces its tail on each prefetch landing instead of appending, requiring prefetch_at >= 1 for real overlap. The guidance prefix is the raw leftover rows (truncated to execution_horizon) — or, with rtc_prefix_fn (relative-action policies, see relative_rtc_prefix_fn), the postprocessed absolute leftover re-anchored (in the prefetch thread, so a failure surfaces through the background-error path) to the state of the batch the prefetch was built from; a use_relative_actions policy without it is refused (_check_rtc_relative). Every merge logs chunked_executor.rtc_merge at DEBUG with chunk_index, merge_tick (served actions before the merge; action merge_tick + 1 is the first from the new chunk) and the measured rtc_delay. Boundary blend (opt-in boundary_blend_steps K, non-RTC only, openral/openral#378): when a chunk enters behind a previous one (prefetch merge after the stale-row drop, or a synchronous re-plan), delta = last_served - new[0] is added to its first K rows with weight 1 - (i+1)/(K+1) on blend_dims (default all), so the boundary step is 1/(K+1) of the raw jump and row K onward is the policy's own (K must leave row K inside the entering chunk); runs on the robot-facing actions (NumPy or torch, any float dtype incl. bfloat16), stitches to a copy of the last served action (callers may mutate what they get), leaves dims outside blend_dims as produced (non-finite values included, never turned into NaN), never blends the first chunk after construction/reset(), and is refused together with RTC. (L244)
  • __init__(policy=None, *, chunk_fn=None, chunk_size=None, prefetch_at=20, rtc_config=None, postprocess_action=None, boundary_blend_steps=0, blend_dims=None, rtc_prefix_fn=None) — Takes policy OR chunk_fn+chunk_size (ValueError otherwise). Negative prefetch_at raises ROSConfigError; it's clamped to chunk_size - 1 at construction. An enabled rtc_config requires a clamped prefetch_at >= 1 (ROSConfigError otherwise); a lead shorter than execution_horizon warns rather than errors. boundary_blend_steps / blend_dims are checked by _check_boundary_blend: steps an int >= 0 and < chunk_size, and with a pre-fetch also < chunk_size - prefetch_at - 1 (the rows a merged chunk keeps after its stale-row drop; when that is 0 every boundary is a synchronous re-plan and the bound is chunk_size); blend_dims a non-empty list of distinct non-negative ints given only with steps >= 1; blending + RTC raises ROSConfigError. A blend_dims index past the action width raises ROSConfigError when the first chunk lands, before any action is served (the robot-facing width is only known after postprocessing). (L247)
  • start() -> None — Mark as running (call after policy is on-device). (L441)
  • stop() -> None — Signal background thread, join. (L445)
  • reset() -> None — Clear buffer/bg state, the boundary-blend tail, and the RTC queue + last delay; policy.reset() when a policy was given. (L452)
  • select_action(batch_or_fn) -> Any — Next action; cold-start foreground inference / buffer pop / wait-on-prefetch. Delegates to _select_action_rtc in RTC mode. (L472)
  • needs_observation_next() -> bool — Whether the next select_action may read its observation (cold start / empty buffer, a pre-fetch launch at the next pop, or RTC); False only for a sure buffered pop, so a simulator can skip rendering that observation (openral_sim.policy.policy_needs_observation_next). (L525)
  • private: _pop_and_maybe_prefetch(batch) (every pop routes through it so the trigger is branch-independent), _produce(payload, chunk_index, kind, rtc_kwargs=None) (passes synchronize=True on the prefetch path only), _materialize, _extend_buffer, _launch_prefetch(batch), _blend_boundary(actions) (every entering chunk passes through it: checks action type and blend_dims width, then fades the new chunk's offset from the last served action over its first K rows; DEBUG chunked_executor.boundary_blend with jump_norm and steps)
  • private (RTC): _select_action_rtc(batch) — serve from the ActionQueue, re-checking after the prefetch wait so a landed chunk isn't discarded. _rtc_merge(chunk, *, idx_before, served_before) — replace the tail; real_delay is the index delta the queue advanced during inference, and the logged merge_tick is served_before (served count at launch) + real_delay, and the producer's batch dim must be 1. _raise_bg_error_if_any() — re-raise a latched background error on the foreground thread. The prefetch path truncates the leftover tail to execution_horizon rows so tail length doesn't depend on how early prefetch_at fires.

python/rskill/src/openral_rskill/execution_budget.py

Execution budgets measured on the graph clock (sim seconds under use_sim_time) with wall-clock backstops, shared by the rSkill runner's goal budget and ROSActionRskill's result wait. Without a graph clock the budget is time.monotonic() exactly as before — never the NTP-stepped ROS system clock. Adapted from DsslRobot/openral.

  • const DEFAULT_WALL_CAP_FACTOR = 20.0 — a graph-clock budget may stretch to at most this many times its value in wall seconds: intact down to 0.05x real time (the slowest measured rendering graph, 0.09x, needs 11.1x). (L68)
  • const DECLARATION_EXPIRY_MARGIN_S = 2.0 — seconds before a grasp declaration's expiry at which declaration_expiry_miss ends the goal (a tick plus the HAL's queued action; calibration point). (L247)
  • const DEFAULT_CLOCK_STALL_S = 10.0 — wall seconds the graph clock may stand still before the goal is failed. (L71)
  • const PARAM_WALL_CAP_FACTOR = "execution_wall_cap_factor" — ROS parameter name a host node declares to override DEFAULT_WALL_CAP_FACTOR; read by node_execution_budget. (L75)
  • const PARAM_CLOCK_STALL_S = "graph_clock_stall_s" — ROS parameter name a host node declares to override DEFAULT_CLOCK_STALL_S; read by node_execution_budget. (L76)
  • class BudgetMiss(BaseModel) — Frozen Pydantic record of why a budget lapsed: kind ("deadline_exceeded" | "clock_stalled", the failure_reason prefix), elapsed_s on the budget's clock, and a detail string. (L79)
  • class ExecutionBudget — One goal's execution budget; starts at construction. (L99)
  • __init__(budget_s, *, graph_now=None, wall_cap_factor=DEFAULT_WALL_CAP_FACTOR, stall_s=DEFAULT_CLOCK_STALL_S, wall_now=time.monotonic) — graph_now is a graph-clock seconds callable (see graph_clock_fn) or None for wall time; budget_s <= 0 disables every check. Raises ROSConfigError on a non-finite budget_s (a NaN would never lapse) and, on a graph-clock budget, on a non-positive / non-finite backstop — the backstops cannot be disabled (deadline fallback is mandatory). (L119)
  • on_graph_clock -> bool [@property] (L152)
  • wall_bound_s -> float [@property] (L157) — Wall seconds after which check() has lapsed at the latest: the budget on the wall clock, wall_cap_factor × budget_s on the graph clock, 0 when disabled. The runner announces it for a result-only goal (ResultOnlyGoal).
  • elapsed_s() -> float — Seconds on the budget's clock; 0 while a sim node has not yet received its first /clock (the budget anchors on the first non-zero reading, so that message is never a jump that lapses it). A backward /clock jump (sim reset) banks the elapsed so far and re-anchors, so elapsed neither freezes nor rewinds. (L191)
  • progress() -> float — elapsed / budget clamped to [0, 1]. (L199)
  • check() -> BudgetMiss | None — deadline_exceeded when elapsed > budget (either clock) or wall elapsed > wall_cap_factor x budget; clock_stalled when the graph clock has not advanced (or never started) for stall_s of wall time. (L203)
  • declaration_expiry_miss(*, target_id, stamp_ns, timeout_s, now_ns, margin_s=DECLARATION_EXPIRY_MARGIN_S) -> BudgetMiss | None — A deadline_exceeded miss once a grasp declaration armed at stamp_ns is within margin_s (2 s, calibration point) of its timeout_s expiry on the same clock; None with time left or timeout_s <= 0. A stamp of 0 ages like any other and a stamp ahead of now_ns (a sim reset) is already a miss, matching the kernel's own expiry test. The rSkill runner ends the goal on it, so a goal never runs past the kernel dropping its contact exemption (pro#51). (L250)
  • graph_clock_fn(node) -> Callable[[], float] | None — The rclpy node's clock as a seconds callable when its use_sim_time parameter is true at call time, else None (also for node=None or an undeclared parameter); re-read per call so a node switched off sim time goes back to time.monotonic(). (L305)
  • node_execution_budget(node, budget_s, *, graph_clock=True) -> ExecutionBudget — An ExecutionBudget on node's clock (graph clock when graph_clock and the node is on sim time now), with the backstops taken from the node's execution_wall_cap_factor / graph_clock_stall_s parameters when declared, else the defaults — the one builder the rSkill runner and ROSActionRskill share. (L328)

python/rskill/src/openral_rskill/ros_action_rskill.py

ROS-wrapping rSkill adapter — bridges arbitrary ROS 2 action / service servers (MoveIt, Nav2, …) into the rSkillBase lifecycle. Selected by make_default_skill_resolver when manifest.kind in {"ros_action", "ros_service"}.

  • const _RESULT_DEADLINE_MULTIPLIER = 5.0 (L87)
  • const _MIN_RESULT_DEADLINE_S = 2.0 (L92)
  • const _FUTURE_POLL_INTERVAL_S = 0.02 (L96)
  • const _FINAL_WAYPOINT_TOL_RAD = 0.05 — worst per-joint error at which the trajectory replay counts the final waypoint as reached (justification in the source comment). (L124)
  • const _REPLAY_SETTLE_TIMEOUT_S = 10.0 — bound past the plan's last time_from_start for the measured joints to reach the final waypoint before ROSDeadlineMissed. (L129)
  • const _WAIT_FOR_SERVER_TIMEOUT_S = 15.0 (L137)
  • const _GOAL_STATUS_LABELS: dict[int, str] = {...} — Human-readable labels for action_msgs/GoalStatus codes, used in error/log messages. (L146)
  • build_joint_permutation_from_names(*, source_names, target_names) -> list[int] — Build the permutation that reorders a wrapped server's JointTrajectory.positions into the host RobotDescription.joints order. Raises ROSConfigError on set-inequality so a joint mismatch surfaces loudly instead of silently swapping bytes. (L311)
  • clamped_start_state(desc, measured) -> dict | None — A MoveGroup request.start_state (is_diff) clamping each non-gripper joint measured past its manifest position_limits back into them; None when all are in bounds. MoveIt's CheckStartStateBounds refuses any out-of-bounds start (a lift resting at -1e-6 m), and fix_start_state only wraps continuous joints. ROSActionRskill adds it to a MoveGroup goal from the snapshot it captures before dispatch. (L241)
  • const CUMOTION_PIPELINE_ID = "isaac_ros_cumotion" — the cuMotion MoveIt planning-pipeline id. (L280)
  • maybe_inject_cumotion_pipeline(goal_dict, *, interface_type, capabilities) -> dict — On a host clearing the cuMotion GPU floor, sets request.pipeline_id = CUMOTION_PIPELINE_ID on a MoveGroup goal so MoveIt plans with cuMotion; no-op for non-MoveGroup actions, low-VRAM hosts, an already-set pipeline_id, or a goal with no request block. Pure — never mutates the input. (L283)
  • class ROSActionRskill(rSkillBase) — rSkillBase shim wrapping a ROS 2 ActionClient (or service client), in two modes selected by manifest.ros_integration.result_trajectory_field: trajectory mode replays one waypoint per step(), paced by the plan's time_from_start on the host node's clock but never more than one waypoint past the last one the measured joints reached (a kernel hold pauses the replay instead of letting it lead further; the settle bound restarts whenever a new waypoint is reached), and raises ROSRskillGoalSatisfied only once the measured joints reach the last waypoint (ROSDeadlineMissed if they do not settle in time); result-only mode awaits the wrapped result and raises ROSRskillGoalSatisfied carrying _summarize_wrapped_outcome(status, result, goal) — one line (≤400 chars) of the terminal status, the result's scalar fields (error_code, error_msg, a .val wrapper unwrapped) and the goal sent (dotted leaves, e.g. pose.header.frame_id=map pose.pose.position.x=4); a non-SUCCEEDED status raises ROSRuntimeError with the same line. The runner forwards the success text as ExecuteRskill.Result.outcome_summary, which the reasoner renders on its ## EXECUTION [ok] line. ROS imports are deferred to _configure_impl so the module imports cleanly without ROS sourced. _configure_impl refuses a MoveGroup replay goal whose merged goal (incl. goal_params_json) does not keep planning_options.plan_only: true. (L439)
  • attr stop_check: Callable[[], str | None] | None — set by rskill_runner_node per goal; returns why the enclosing ExecuteRskill goal ended (cancel, execution budget) or None, and raises ROSEStopRequested for a latched safety stop. _poll_future polls it on the result wait and raises (ROSDeadlineMissed, or the stop itself) after cancelling the wrapped goal and confirming it ended; a stop whose cancel fails stays ROSEStopRequested. The runner ends a stopped goal as FAILURE_SAFETY_ESTOP, a cancelled one as cancelled, not aborted.
  • result_only -> bool [@property] (L1174) — True when there is no result_trajectory_field (Nav2): the wrapped server moves the robot and no chunks are published, so the runner announces the goal to the deadman watchdog (ResultOnlyGoal).
  • attr unterminated_result_future: Any — the result future of a wrapped goal whose cancel the server rejected or never confirmed (it may still be running); rskill_runner_node rejects new goals until it completes.
  • __init__(*, manifest, ros_node, robot_description, prompt, prompt_metadata_json) (L472)
  • _configure_impl() — Lazy-import IDL, build ActionClient/service client, parse default_goal_json. (L571)
  • _activate_impl() — no-op; the wrapped action dispatches on first step(). (L686)
  • _deactivate_impl() / _shutdown_impl() — Release the wrapped client. (L689)
  • _step_impl(world_state) -> Action — First call sends goal and caches result; subsequent calls emit the waypoint due by time_from_start (timed on node_execution_budget(self._node, planned + _REPLAY_SETTLE_TIMEOUT_S)), holding the last until world_state.joint_state is within _FINAL_WAYPOINT_TOL_RAD. Unmoved-joint padding is read from joint_state by name into robot order; a malformed snapshot (name/position length mismatch, repeated name) or a plan that holds a joint the snapshot does not measure raises ROSPerceptionStale. (L706)
  • _final_waypoint_error(world_state) -> float | None — worst |measured - final| over the planned joints, by name; None (never "reached") when unmeasurable. (L823)
  • _poll_future(future, *, deadline_s, what, graph_clock=True, stoppable=True) — Polls a wrapped future under node_execution_budget(self._node, …): on the graph clock when graph_clock and the host node runs on sim time, else on time.monotonic(). Raises the typed ROSDeadlineMissed (FAILURE_DEADLINE_MISSED) naming deadline_exceeded / clock_stalled; a non-positive deadline_s lapses at once (fail closed). Only the result-only result wait (Nav2: the server moves the robot) uses the graph clock — goal acceptance, service responses and a MoveIt plan result are compute/IPC and pass graph_clock=False; a lapsed result wait cancels the wrapped goal before re-raising. With stoppable (all but goal acceptance) a non-None stop_check() also raises ROSDeadlineMissed. (L1296)
  • _rejection_reason() -> str (L1213) — Appended to the ROSRuntimeError of a rejected goal: finds the node serving the action (the name resolved like the ActionClient's, Node.resolve_topic_name: namespace and remaps) and reads its lifecycle state via get_state (_poll_future, _REJECTION_PROBE_TIMEOUT_S = 1 s per wait). Reports a state other than active (retrying can succeed if the stack comes up; changing the goal will not), an active server (check the goal), a node the graph lists no get_state for (not a lifecycle node), or a get_state that did not answer in time (state unknown); "" when no node serves the action.

python/rskill/src/openral_rskill/moveit_goal.py

The one MoveIt rSkill's goal (rskills/rskill-moveit, goal_builder: "moveit"), lowered per robot: target named_pose / joints / pose / look_at in the robot's own names, onto the joint / pose / look-at adapters in a group of its generated MoveIt model.

  • lower_moveit_goal(goal, desc) -> tuple[Builder, dict] (L175) — The adapter and its goal block + request.group_name (openral_home, openral_all, the end effector's or camera's name); ROSConfigError for a goal the robot cannot mean.

python/rskill/src/openral_rskill/look_at_rskill.py

Camera-aiming MoveGroup skill. Selected by make_default_skill_resolver when manifest.ros_integration.goal_builder == "look_at" (new RosIntegration.goal_builder field; RSkillAction gains LOOK = "look").

  • const _DEFAULT_CAMERA = "wrist" (L46)
  • const _DEFAULT_POSITION_TOLERANCE_M = 0.02 (L50)
  • const _DEFAULT_ORIENTATION_TOLERANCE_RAD = 0.15 (L51)
  • const _TF_LOOKUP_TIMEOUT_S = 5.0 (L52)
  • const _XYZ_LEN = 3 (L53)
  • const _MIN_DIRECTION_NORM = 1e-9 (L54)
  • resolve_camera_sensor(description, camera) -> SensorSpec — Find the named camera in RobotDescription.sensors; ROSConfigError listing the available sensor names on a miss (explicit beats implicit — default camera is "wrist"). (L57)
  • build_look_at_constraints(*, camera_goal: Pose6D, link_name, link_t_cam=None, position_tolerance_m=0.02, orientation_tolerance_rad=0.15) -> dict — Lower a camera gaze pose into one MoveGroup goal_constraints entry by delegating to pose_goal_rskill.build_pose_constraints with the optical (z) axis tolerance set to π (roll free). With link_t_cam the goal is re-expressed for the mount link; without it the camera frame is the constrained link. (L103)
  • class LookAtRskill(ROSActionRskill) — Consumes the merged goal's look_at block (target_xyz required, plus frame_id/camera/standoff_m/tolerances) instead of raw constraints, lowering it lazily on the first step() via compute_gaze_pose → build_pose_constraints. The manifest ships plan_only: true so MoveIt-side execution never bypasses the safety kernel. (L135)

python/rskill/src/openral_rskill/pose_goal_rskill.py

Generic Cartesian end-effector pose MoveGroup skill. Selected by make_default_skill_resolver when ros_integration.goal_builder == "pose". Home of the shared pose→constraints lowering LookAtRskill reuses.

  • const _SOLID_PRIMITIVE_SPHERE = 2 — shape_msgs/SolidPrimitive.SPHERE. (L40)
  • const _DEFAULT_POSITION_TOLERANCE_M = 0.01 (L41)
  • const _DEFAULT_ORIENTATION_TOLERANCE_RAD = 0.05 (L42)
  • const _XYZ_LEN = 3 (L43)
  • const _QUAT_LEN = 4 (L44)
  • const _QUATERNION_ORDERS = ("xyzw", "wxyz") (L45)
  • const _TF_LOOKUP_TIMEOUT_S = 5.0 (L46)
  • build_pose_constraints(*, pose: Pose6D, link_name, link_t_target=None, position_tolerance_m=0.01, orientation_axis_tolerances_rad=(0.05, 0.05, 0.05)) -> dict — Lower a target pose into one MoveGroup goal_constraints entry (sphere position region + per-axis orientation constraint); link_t_target re-expresses the goal for the constrained link. The one place pose→MoveGroup-constraint math lives — do not re-implement. (L49)
  • pose_from_block(block) -> tuple[Pose6D, str, float, float] — Parse a pose goal block → (pose, link_name, pos_tol, orient_tol). Orientation is a 4-float quaternion array; component order from block["quaternion_order"] ("xyzw" default / "wxyz"). ROSConfigError on missing/ill-typed fields or an unknown order. (L141)
  • class PoseGoalRskill(ROSActionRskill) — Consumes the merged goal's pose block; lowers it via build_pose_constraints (full orientation) on the first step(), then dispatches/replays like the parent. link_t_target is identity in v1 (the RobotDescription tool-frame offset is a later phase). (L198)

python/rskill/src/openral_rskill/joint_goal_rskill.py

Joint-space MoveGroup skill. Selected when ros_integration.goal_builder == "joint". The LLM-facing replacement for hand-written joint_constraints JSON.

  • const _DEFAULT_JOINT_TOLERANCE_RAD = 0.001 (L23)
  • const _JOINT_WEIGHT = 1.0 (L24)
  • joint_constraints_from_block(block) -> dict — Lower a joint block (joint_names, positions, optional position_tolerance_rad) into one goal_constraints entry ({"joint_constraints": [{joint_name, position, tolerance_above, tolerance_below, weight}, …]}). ROSConfigError on missing/ill-typed fields or a name/position length mismatch. (L27)
  • class JointGoalRskill(ROSActionRskill) — Consumes the merged goal's joint block; lowers it into a joint_constraints goal at _configure_impl, then dispatches/replays like the parent. (L69)
  • _configure_impl() -> None (L77)

python/rskill/src/openral_rskill/_vla_core.py

Shared helpers for VLA adapters (Layer 3); internal — no public re-export.

  • InferenceKind — Re-export of openral_observability.InferenceKind (Literal["foreground", "prefetch", "single"]), the closed value set for the inference.kind label — a timing axis, deliberately without a "chunk" value since chunk shape rides inference.chunk_size/chunk_index instead. (L47)
  • resolve_device(spec: VLASpec) -> str — "auto" → "cuda:0" / "mps" / "cpu" against real torch. (L50)
  • resolve_rskill_repo_id(weights_uri: str, *, adapter_name: str) -> str — Validate skill reference and resolve to bare HF repo id; adapter_name is used in the ROSConfigError message. (L75)
  • resolve_rskill_repo_revision(weights_uri: str, *, adapter_name: str) -> tuple[str, str | None] — Like resolve_rskill_repo_id but also returns the optional @<sha> revision pin, threaded into from_pretrained/snapshot_download by the sim adapters, and warns rskill.unpinned_weights when an hf:// skill is unpinned. (L106)
  • resolve_image_preprocessing(manifest, spec_extra) -> ImagePreprocessing — Build the ImagePreprocessing block an adapter applies, by strict precedence: spec_extra YAML override → manifest.image_preprocessing per-checkpoint contract → schema defaults. No auto-derivation from policy.config.input_features — missing hints surface as the schema default rather than a guessed heuristic. Raises ROSConfigError when a manifest alias key is not a slot declared by sensors_required[].vla_feature_key. (L149)
  • resolve_state_dim(manifest, spec_extra) -> int | None — Per-checkpoint proprio state dimension: spec_extra["state_dim"] override → manifest.state_contract.dim → None (adapter falls back to the policy's own preprocessor width). (L254)
  • resolve_camera_keys(manifest, spec_extra, *, scene_cameras=None, default=("camera1", "camera2")) -> tuple[str, ...] — Resolve which scene camera keys an adapter pulls from the observation: spec_extra["camera_keys"] override → scene_cameras (the SimEnvironment YAML's scene.cameras) → default. (L275)
  • manifest_camera_slots(manifest) -> tuple[str, ...] — The RGB VLA slots an rSkill declares, in sensors_required order (vla_feature_key suffix). The resolve_camera_keys default for adapters whose cameras are the manifest's slots (openvla, rldx, lingbot, diffusion). (L307)
  • checkpoint_image_keys(image_preprocessing, camera_keys) -> tuple[str, ...] — The one slot→checkpoint rename: input_template.format(cam=aliases.get(slot, slot)) per slot. Used by the xvla / gr00t / diffusion / lingbot / molmoact2 adapters so manifest aliases is the only rename mechanism. (L328)
  • resolve_n_action_steps(manifest, extra, *, default, chunk_size=None) -> int — The one chunk-slicing rule every policy adapter calls (xr1, xvla, gr00t, lingbot_vla/vla2, rldx, molmoact2, openvla, and via apply_chunk_replay smolvla/pi05/act): extra["n_action_steps"] (--n-action-steps) > manifest.n_action_steps > deprecated extra["replan_steps"] (warns vla.deprecated_replan_steps) > default; bounded by chunk_size (else manifest.chunk_size, logs vla.n_action_steps_clamped); ValueError below 1. (L356)
  • apply_chunk_replay(policy, spec_extra, *, manifest=None, default_n_action_steps=None) -> int — Set policy.config.n_action_steps via resolve_n_action_steps, defaulting to and bounded by the policy's own config.chunk_size; used by the lerobot-style adapters (smolvla, act, pi05, xvla). (L407)
  • _CUDAGRAPH_COMPILE_MODES — frozenset({"reduce-overhead", "max-autotune"}); the torch.compile modes that may capture CUDA graphs and therefore require output cloning (static replay buffers would otherwise be overwritten under lerobot's queued action views / ChunkedExecutor pre-fetch). (L462)
  • _has_bnb_quantized_modules(policy) -> bool — True when any submodule's class comes from bitsandbytes (Linear4bit / Linear8bitLt rewrites from openral_sim._quantization). Class-module-path check; never imports bnb. (L474)
  • _clone_chunk_output(out, torch) -> Any — Recursively .clone() every tensor in a chunk forward's output (tensor / tuple / list / dict; non-tensor leaves pass through) so downstream holders own their storage, detached from CUDA-graph static buffers. (L488)
  • maybe_compile_chunk_forward(policy, spec_extra, device, torch, *, method_name="_get_action_chunk") -> bool — Best-effort torch.compile of the chunk forward with a runtime fallback that latches into eager mode on backend errors; skipped on CPU or when vla.extra.compile is false; a non-bool compile (e.g. YAML string "false") raises ROSConfigError. Never compiles bitsandbytes-quantized policies (dtype-mismatch under mixed nf4/bf16), and routes cudagraph-mode output through _clone_chunk_output on both branches. (L506)
  • class CudaGraphChunkForward — Replays a chunk forward as one captured CUDA graph (policy_extras.cuda_graph; π0.5 today). The first plain call copies the batch into static inputs, warms up on a side stream and captures (capture_error_mode="thread_local", capture_ctx around warm-up + capture only); later calls copy into the static inputs, replay and return _clone_chunk_output of the static output, so held chunks are never overwritten. Default-generator noise is fresh per replay. Eager for a keyword call (RTC); a changed tensor layout latches eager and logs vla.cuda_graph_disabled; a failed capture raises ROSRuntimeError and latches it, so every later call (keyword calls too) re-raises instead of running eager (an aborted capture leaves the CUDA generator unusable for eager too; the runner's best-effort warm-up logs it and the first real chunk fails loudly). Optional device (the adapter's): warm-up, capture and replay run under torch.cuda.device(device). Properties captured, disabled_reason. Logs vla.cuda_graph_captured with the capture time. (L616)
  • __init__(forward, *, torch, name, capture_ctx=None, warmup_runs=2) -> None — No capture yet; forward must run its own no_grad / autocast with cache_enabled=False. (L674)
  • captured -> bool [property] — A graph is captured and replay is live. (L700)
  • disabled_reason -> str | None [property] — Why replay latched off (input_layout_changed, capture_failed), else None. (L705)
  • run_inference(policy, batch, *, chunk_index=None, kind="single", chunk_size=None, engine=None, call=None, call_kwargs=None, synchronize=False) -> Tensor — Single seam wrapping a policy inference call in inference_span + torch.no_grad() — the only place inference.kind/chunk_index/chunk_size/inference.engine attributes are emitted. call replaces the default policy.select_action(batch) for custom chunk producers; ChunkedExecutor passes synchronize=True on its prefetch so the span times compute, not just kernel launch. Must stay torch.no_grad(), never torch.inference_mode() — RTC's guidance calls autograd.grad, which raises under inference mode. (L800)
  • resolve_inference_engine(owner, declared=None) -> str — Resolve the backend actually executing after optional runtime attachment: explicit _openral_inference_engine marker wins, then the openral-pro-trt module, then the manifest name (normalized pytorch→torch/tensorrt→trt). Keeps the dashboard from reporting a stale pre-attachment runtime. (L889)
  • _RTC_ADAPTERS — frozenset({"smolvla", "pi05"}); the flow-matching adapters whose lerobot policies carry an rtc_config. molmoact2 / pi0_fast support RTC upstream but are out of scope — extend this set and the adapter's chunk_fn kwargs pass-through together. (L929)
  • const _RTC_KEYS — frozenset({"enabled", "execution_horizon", "max_guidance_weight", "prefix_attention_schedule", "debug"}); the closed key set _parse_rtc_config accepts in a policy_extras.rtc block. (L936)
  • _parse_rtc_config(spec_extra, *, adapter_name, default_horizon=10) -> RTCConfig | None — Parse the manifest's policy_extras.rtc block into a lerobot RTCConfig, or None if absent. ROSConfigError on a non-mapping block, an unknown key or schedule, a non-positive horizon, RTCConfig rejection, or an adapter outside _RTC_ADAPTERS; lerobot imports are deferred. (L941)
  • rtc_enabled_in_extra(spec_extra, *, adapter_name) -> bool — True only for a present, well-formed, enabled rtc block — keyed on the parsed enabled flag, not just presence, so rtc: {enabled: false} still compiles. Lets a factory (e.g. smolvla skipping maybe_compile_chunk_forward) decide before the executor exists. (L1011)
  • const _CHUNK_BOUNDARY_BLEND_KEYS — frozenset({"steps", "dims"}); the closed key set of a policy_extras.chunk_boundary_blend block.
  • _parse_chunk_boundary_blend(spec_extra, *, adapter_name) -> tuple[int, tuple[int, ...] | None] — Parse the YAML shape of policy_extras.chunk_boundary_blend: {steps: K, dims: [...]} into (steps, dims); (0, None) without a block. ROSConfigError on a non-mapping block, unknown keys, steps not an int >= 1, or dims missing or not a list (no all-dims default in a manifest: a binarized gripper or delta-action dim must not be faded). The rules themselves are executor._check_boundary_blend's, applied by build_chunk_executor under this block's key.
  • build_chunk_executor(spec_extra, *, policy=None, chunk_fn=None, chunk_size=None, adapter_name="policy", postprocess_action=None, rtc_prefix_fn=None) -> ChunkedExecutor | None — Shared executor construction: chunk_prefetch enables overlap, chunk_prefetch_at calibrates the lead (default 20, clamped to the chunk). An enabled policy_extras.rtc block sets policy.config.rtc_config and calls init_rtc_processor() before building the executor; a block without execution_horizon gets the clamped chunk_prefetch_at (guidance over the whole overlap); RTC is refused with ROSConfigError (never a silent downgrade) on chunk size 1, chunk_prefetch: false, a policy without init_rtc_processor, bitsandbytes-quantized weights, or a use_relative_actions policy without rtc_prefix_fn (checked before the policy is mutated). With no rtc block, construction and served actions are byte-identical to before. A policy_extras.chunk_boundary_blend block is checked with executor._check_boundary_blend (before any RTC policy mutation) and handed to the executor as boundary_blend_steps / blend_dims; it is refused with ROSConfigError on chunk size 1, a steps not below the chunk size (or, with chunk_prefetch, below n - chunk_prefetch_at - 1), or alongside an enabled rtc block. (L1090)
  • relative_rtc_prefix_fn(preprocessor, *, device) -> Callable[[Tensor], Tensor] | None — The rtc_prefix_fn for a relative-action checkpoint (an enabled RelativeActionsProcessorStep in its preprocessor), else None. Mirrors lerobot 0.6.0's RTC rollout: absolute leftover rows → lerobot.policies.rtc.reanchor_relative_rtc_prefix against the relative step's cached state (the latest preprocessor call) → the preprocessor's normalizer, on device. The hook raises ROSRuntimeError when no state is cached, where lerobot would silently keep the stale rows; building it raises ROSConfigError when no normalizer carries action stats (the prefix would reach the model in raw units). pi05 and SmolVLA pass it to build_chunk_executor. (L1273)
  • image_to_chw_tensor(img, *, torch, device) -> Tensor — HWC uint8 frame → (3, H, W) float32 in [0, 1], uploaded as uint8 and converted on the device; the one per-tick image conversion every VLA adapter (ACT, Diffusion, π0.5, SmolVLA, GR00T, X-VLA) uses — a host-side float32 build cost ~10 ms/frame/tick. (L1344)
  • to_numpy_action(action_tensor) -> NDArray[np.float32] — (1, A) torch tensor → 1-D float32 NumPy. (L1363)
  • release_torch_modules(owner, *attrs, device="", torch=None) -> None — Drop an adapter's references to its loaded torch modules, then gc.collect() and (on CUDA) torch.cuda.empty_cache() — order matters: empty_cache() only returns already-free blocks, so it must run after the reference is dropped, and gc.collect() is needed since a policy is typically part of a reference cycle. Best-effort; called from close() in every sim VLA adapter. (L1925)
  • split_repo_revision(ref: str) -> tuple[str, str | None] — owner/repo@<rev> → (repo_id, revision) for revision= kwargs (HF rejects @ in a repo id); an existing local path is returned whole; re-exported from openral_rskill. Used by the OmDet / SAM 2.1 / TOPReward / 3DDA / MolmoAct2 loaders. (L1496)
  • parse_hf_file_uri(uri: str) -> tuple[str, str | None, str] — Splits hf://owner/repo[@rev]/path/to/file.ext into (repo_id, revision, filename) for per-file hf_hub_download calls. Rejects bare-repo URIs with a typed ROSConfigError. (L1516)
  • materialize_processor_dir(manifest: RSkillManifest) -> str — Downloads the manifest's per-file processors artefacts via hf_hub_download and symlinks them under lerobot-canonical filenames in a fresh temp directory, also fetching each processor JSON's sibling state_file so PolicyProcessorPipeline.from_pretrained resolves every step locally. Used by the SmolVLA and modern-ACT adapters; raises ROSConfigError if manifest.processors is None or a processor JSON fails validate_processor_steps. (L1624)
  • validate_processor_steps(json_path: str) -> list[str] — Vets a lerobot policy_{pre,post}processor.json before lerobot instantiates it: every step must name a registry_name (a bare class path would make lerobot import and call an arbitrary symbol) and every state_file must be a plain file name (no path traversal). Returns the state_file names in order; raises ROSConfigError. Called by materialize_processor_dir and, on a local pretrained_path, by call_make_processors_cached_first. (L1566)
  • hf_download_cached_first(hf_hub_download, local_not_found_exc, *, repo_id, filename, revision=None, **extra) -> str — Cache-first wrapper around huggingface_hub.hf_hub_download: tries local_files_only=True first, falling back to a normal call on LocalEntryNotFoundError. Avoids the per-file HEAD validation that turns a cached load into seconds of latency on a cold connection; HF_HUB_OFFLINE=1 extends the skip to inner lerobot/transformers calls this helper doesn't wrap. Public, re-exported from openral_rskill.__init__. (L1379)
  • local_snapshot_dir(repo_id, *, revision=None, ignore_patterns=("*.md",), **extra) -> str (L1442) — The resolved checkpoint as a local directory: a directory (an installed rSkill snapshot, which resolve_rskill_to_hf_with_revision returns for a snapshot holding model.safetensors or a sharded index) is returned as is, a Hub repo id is snapshot_downloaded with ignore_patterns / extra forwarded. snapshot_download rejects a filesystem path as a repo id, so ACT, Diffusion, GR00T and the processor-sidecar fallback all broke on an installed skill until they routed through this (2026-09-23). Public, re-exported from openral_rskill.__init__.
  • stage_safetensors_on_host() -> Iterator[None] (L2103) [@contextmanager] — lerobot's PreTrainedPolicy.from_pretrained reads model.safetensors through host memory (load_model(..., device="cpu"), then policy.to(device) as before) instead of per-tensor mmap-to-GPU copies, which run at ~190 MB/s on the GB10: SmolVLA load 8.5 s -> 2.0 s, identical weights. Process-global patch of lerobot.policies.pretrained, restored on exit; a no-op without lerobot.
  • suppress_hf_weight_init() -> Iterator[None] [@contextmanager] — Context manager that patches transformers.PreTrainedModel._init_weights to a no-op and enters transformers.initialization.no_init_weights (no-ops the torch.nn.init functions nn.Linear/nn.Embedding constructors call), skipping SmolVLA's full random backbone init when the checkpoint sets load_vlm_weights=False (SO-101 eraser-place from_pretrained 6.7 s → 4.3 s, bit-identical weights). Only sound when the checkpoint covers every parameter: while active, a lerobot load_model_as_safetensor call reporting a missing key raises ROSConfigError (private _refuse_missing_checkpoint_keys); pair with assert_all_parameters_finite. Process-global while active; the skill runner serialises loads behind its resident-skill lock. (L1980)
  • assert_all_parameters_finite(policy, *, repo_id) -> None — Raises ROSConfigError if any floating-point parameter is NaN/Inf — the guard that makes suppress_hf_weight_init safe, since uninitialised memory read as float is overwhelmingly non-finite. (L2147)
  • call_make_processors_cached_first(make_pre_post_processors, policy_config, *, pretrained_path, **kwargs) -> tuple[Any, Any] — Wraps lerobot's make_pre_post_processors so the tokenizer's AutoTokenizer.from_pretrained call skips its HF HEAD revalidation when that tokenizer is already cached, by flipping HF_HUB_OFFLINE for the inner call. Passthrough on a cold cache (the vocabulary file, not only tokenizer_config.json, must be cached) or for adapters with no tokenizer step (ACT, Diffusion Policy). Every result goes through check_preprocessor_tokenizer; processor JSONs under pretrained_path go through validate_processor_steps first. (L1777)
  • check_preprocessor_tokenizer(preprocessor) -> None — Raises ROSConfigError when a preprocessor's tokenizer step encodes a fixed English instruction to no word tokens or half or more <unk> (a cache with configs but no vocabulary, loaded offline). Steps without input_tokenizer pass. (L1864)
  • private: _read_tokenizer_repo_from_preprocessor(pretrained_path) -> str | None — Parses <pretrained_path>/policy_preprocessor.json for the tokenizer_processor step's config.tokenizer_name. Returns None on missing/malformed JSON or absent step (ACT / Diffusion Policy). Used by call_make_processors_cached_first.
  • private: _hf_tokenizer_is_cached(repo_id) -> bool — Probes huggingface_hub.try_to_load_from_cache(repo_id, "tokenizer_config.json") and returns True only when the result is a real cached path (str), not None or the _CACHED_NO_EXIST sentinel. Returns False on any import error so callers fall back to a normal online load.

python/rskill/src/openral_rskill/_policy_io.py

The one policy <-> robot I/O codec (joint order, deg<->rad, gripper scale, clamp), applied on every deploy dispatch path; internal — no public re-export.

  • class PolicyIOCodec(BaseModel) — Frozen codec built once per skill from the manifest's action_contract (joint_units, joint_names, gripper_scale, joint_calibration, legacy policy_extras.gripper_scale with a deprecation warning) + the RobotDescription. State: permute robot→policy order, then scale * value + offset for a calibrated channel (calibration, per policy channel), else gripper * gripper_scale / degrees(joint). Action: (value - offset) / scale, else gripper / gripper_scale / radians(joint) back in robot order; on the slot path the same per-channel conversion in policy order per slot (JOINT_POSITION/JOINT_VELOCITY + GRIPPER_POSITION), no permutation, and JOINT_POSITION slot channels clamped by the same _CLAMP_EPS as clamp — keyed by the slot's joint_names, or RobotDescription.joints order when it declares none (this replaced the runner's own _clamp_joint_position_slice, which skipped unnamed slots); a GRIPPER_POSITION slot's channel clamped strictly inside its ee's kernel bound (gripper_ranges, from EndEffectorSpec.resolved_command_range), a move wider than the epsilon logged once per end effector (policy_io.gripper_command_clamped). (L199)
  • from_manifest(manifest, description, *, adapter=None) -> PolicyIOCodec — When slot_state_joint_names yields a strict subset of the robot's joints (an OpenArm skill on the OpenAMRobot v2), the codec gathers them: state_index set, policy_is_gripper / policy_joint_names per gathered channel, logged policy_io.slot_state_subset; otherwise joint order: action_contract.joint_names (robot names in policy order; unknown name → ROSConfigError) > the adapter's policy.config.action_feature_names (.pos/_joint_ normalised; mismatch → identity + policy_io.feature_names_unmatched) > identity. ROSConfigError for a joint-position contract without joint_units, a legacy extras scale contradicting the contract, or a joint_calibration naming a joint the robot lacks / declared without a description to resolve it; a declared calibration is logged once (policy_io.joint_calibration). (L254)
  • is_identity -> bool [@property] — True when the codec changes nothing (radians, gripper_scale == 1, robot joint order, no state_index gather); openral_sim.sim_runner refuses a non-identity codec on a scene without converts_policy_units. (L448)
  • to_policy_state(robot_state) -> NDArray — Robot-order radians → policy order + units; with state_index the slot-named joints are gathered first (ROSConfigError on a state too short for them). (L472)
  • to_robot_action(policy_action, *, slots=None) -> NDArray — Policy action → robot units (+ robot order without slots; + JOINT_POSITION limit clamp with slots). (L501)
  • clamp(robot_action) -> NDArray — Pull each joint strictly (1e-3) inside RobotDescription position limits; no-op on a width mismatch. (L591)
  • slot_state_joint_names(manifest, description) -> list[str] | None — The robot joints a slot contract's policy state reads, in slot range order: each JOINT_* slot's joint_names, each one-channel GRIPPER_* slot the joint its ee drives (the joint of that name, else an end effector's name resolves to the robot's single gripper joint; private _ee_joint). None when the contract does not determine the state (no slots / description, a jointless / discard / unnamed slot, an ee that is no joint, a state_contract.dim that is unset or other than the count). ROSConfigError for a JOINT_* slot joint the robot lacks. Shared by PolicyIOCodec.from_manifest, the reasoner's state-contract palette filter and rskill_runner_node.expand_starting_pose. (L126)
  • private: _effective_perm(robot_to_policy, n) -> list[int] — Identity unless a valid length-n permutation, so unit conversion runs on the no-reorder path too. (L68)

python/rskill/src/openral_rskill/testing.py

Test helpers for skill latency-budget enforcement (CLAUDE.md §2).

  • class LatencyBudgetExceededError(AssertionError) — Raised by assert_within_budget on overrun; a plain AssertionError subclass (not ROSRuntimeError) so pytest reports a crisp failure with the budget delta rather than the operational exception the safety supervisor would catch. (L42)
  • __init__(*, stage, measured_ms, budget_ms, rskill_id=None) — Builds the failure message and stores stage/measured_ms/budget_ms/rskill_id on the instance. (L56)
  • assert_within_budget(*, measured_ms, budget: RSkillLatencyBudget, stage="per_chunk", rskill_id=None, tolerance_pct=0.0) -> None — Assert measured_ms does not exceed budget's field for stage (per_chunk_ms/warmup_ms/load_ms), with an optional percent tolerance. Unset optional budget stages (warmup_ms/load_ms are None) pass silently — enforcement is opt-in per manifest. Raises LatencyBudgetExceededError on overrun, ValueError on a negative input. (L78)

python/rskill/src/openral_rskill/_lerobot_compat.py

Compatibility helpers for checkpoints saved by a different lerobot version.

  • strip_unknown_config_keys(config_cls, cfg_path) -> list[str] — Rewrites a checkpoint config.json without the keys the installed lerobot config dataclass does not declare (keeps type); draccus rejects unknown keys before from_pretrained builds the policy. Returns the dropped keys; idempotent. Shared by sanitize_smolvla_config and ACT's _sanitize_act_config_json. (L22)
  • sanitize_smolvla_config(repo_id, *, revision=None) -> None — Strip config keys lerobot's SmolVLAConfig rejects (via strip_unknown_config_keys) from a checkpoint's config.json, in place, before SmolVLAPolicy.from_pretrained. Idempotent; no-op when the config is already clean or lerobot/the config are unavailable. (L65)