rli14's picture
rsm_rise code snapshot (HF_PUSH_ALL) (part 14)
7ebff26 verified
|
Raw History Blame Contribute Delete
5.59 kB

STREAM: ACT_COND -- is the action conditioning of the real successor correct and sensitive?

Status file: status/real/ACT_COND.md. Owner issue: gen_q#278.

Why you exist

Owner, verbatim: "Also make sure the way action conditioning is done is correct. All we need is for the network to be sensitive enough to action to pick actions leading to goal state." You OWN the action-conditioning path end to end: how the chunk is normalised, concatenated, FiLM'd, and how the scorer feeds candidates at read-out. The SUCC_DEBUG worker measures the successor field and does NOT patch conditioning -- that is yours, so the two of you never edit the same lines.

What is already known (do not re-derive)

  • model.py (rsm_libero) docstring: "action chunk conditions the occupancy on an equal footing with the task embedding, via concat + FiLM"; d_cond = d_z + d_act + d_task + (2*n_fourier+1).
  • The historical failure mode this guards against is written in the same docstring: "a value that scores STATES but cannot rank ACTIONS produces flat batch metrics and a closed-loop cliff."
  • In SIM the RISE/IQL critic had exactly that defect: Q(s,a) ~ V(s), rank-pct of the expert action ~0.5. Do not let the RSM ship with the same property unmeasured.
  • NEW, 2026-09-23: at the S2 bottleneck the real RSM ranks the goal-route logged chunk first in 96.9% of 96 anchors (chance 3.1%), rank pct 0.999, correct 0.520 vs distractors 0.149, with the permuted-feature control at chance (status/real/logged_action_rank_G999/logged_action_rank.json). So conditioning is NOT dead. Your job is to quantify HOW MUCH of the score is action-driven, and to fix any place where units, ordering or dimensionality are wrong.

Non-negotiables

scripts/workers/COMMON.md HARD RULES bind you. No login-node compute -- LSF/Slurm only, GPU j_exclusive=yes, pack 4 or 8 GPUs, never 1 GPU, never gpu-high, names start rr_. Interpreter venv_rsm/bin/python. Every file you edit gets a .bak.20260923_actcond copy first. ONE CHANGE PER MEASUREMENT, each with the number that justified it. Standard practice only.

Task 1: static audit, write it as assertions not prose

Trace one candidate chunk from scripts/real/twin_rollout.py:Scorer.pick into the successor forward pass and assert, in a script that FAILS LOUDLY (scripts/real/actcond_audit.py, run as a CPU job):

  1. UNITS. The trainer's action normalisation (read data.py) vs what the scorer passes. action_min / action_max come off the hdf5 attrs; confirm the same scaling and the same clipping on both sides. Report max abs difference on 100 real chunks between the two pipelines. This is the single most likely bug and it is silent.
  2. SHAPE AND ORDER. chunk H=8, d=10 -> flattened d_act=80: confirm the flatten order (time-major vs dim-major) is identical in train and eval. A transposed flatten is a permutation the net cannot undo and it would still train to a low loss.
  3. DIMENSIONALITY. d_act the checkpoint was built with vs d_act at eval; assert equality, print both.
  4. CONDITIONING REACHES THE OUTPUT. With everything else fixed, perturb ONLY the action input and confirm the FiLM/concat path changes the output: report d(output)/d(action) as a finite-difference Jacobian norm, and the same for d(output)/d(z). If the action Jacobian is orders of magnitude below the state Jacobian, conditioning is nominal and you have found the bug.
  5. DEAD DIMENSIONS. Per-action-coordinate Jacobian norm. The real corpus is 10-d; if the gripper or a rotation coordinate has zero gradient, say which.

Task 2: sensitivity, the number the owner actually asked for

scripts/real/act_sensitivity.py (new), as a packed GPU job, over >=200 training-split anchors:

  • ACTION-SENSITIVITY INDEX: variance of q over 128 candidate chunks at a FIXED state, divided by the variance of q over 128 states at a FIXED chunk. Near zero means the value is a state function and cannot rank actions. Report per stage (S0, S2, S3) and pooled.
  • TIE STRUCTURE: fraction of the 128 candidates tied at the max under the prob read-out, plus the CV of the scores. Report it beside every rank number -- the prob read-out ties ~37/128 on the real cache and a rank number without its tie count has burned us before.
  • MONOTONE PROBE: take the logged chunk and interpolate it toward a chunk from a failure route in 10 steps; q should fall monotonically. Report Spearman. This is the cheapest direct test that the net is sensitive in the right DIRECTION and not just sensitive.
  • READ-OUT CHECK: run the same anchors under prob and logit; report both. There is no general read-out rule (prob beats logit on one sim task, the reverse on another), so both go in the table.

Task 3: fix, then re-measure

If Task 1 finds a units/order/dimension defect: patch the EVAL side to match the trainer (never silently change the trainer -- checkpoints depend on it), back up the file, re-run the logged-action ranking test venv_rsm/bin/python scripts/real/logged_action_rank.py --out status/real/logged_action_rank_ under a packed GPU job, and report the before/after pair. If the audit finds nothing, say so plainly with the five assertion results -- "conditioning is correct" is a valid and valuable outcome, and the 96.9% top-1 above is consistent with it.

Reporting

Timestamped ## REPORT in your status file each run, printed too. Post to gen_q#278 with the ~/.git-credentials token method in SUCC_DEBUG.md; never echo the token.