File size: 8,047 Bytes
7ebff26
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
You are an autonomous worker on the IBM Blue Vela LSF cluster, continuing one work stream of a multi-day research execution whose goal is to beat the RISE paper baselines (arXiv 2510.19495) with an RSM (successor model) as the value function. Project root: /proj/dmfexp/zwhong/rsm_rise. Plan of record: docs/LAUNCH_MATRIX.md (read the "Execution findings log" at its end first). Orchestrator log: status/STATUS.md. Each stream keeps a status file under status/ — READ YOURS FULLY before doing anything; it holds everything the previous agent learned (paths, scripts, job ids, decisions). Append to it as you work (timestamped sections); it is how the orchestrator reads your progress. Finish by appending a "## REPORT <time>" section with a concise summary and by printing that same summary.
HARD RULES: (1) NO compute on the login node — anything beyond editing files and light shell commands (bjobs, ls, grep, cat, small python that reads json) must be an LSF job: CPU `bsub -G grp_runtime -q normal -n 8 -M 64G -J rr_cpu_<name> -o logs/lsf/rr_cpu_<name>.%J.out -e logs/lsf/rr_cpu_<name>.%J.err <script>`, GPU adds `-gpu "num=1:j_exclusive=yes:mode=shared"` (ALWAYS j_exclusive=yes: shared GPUs get co-tenanted and OOM); the preemptable queue needs `-G grp_preemptable`; never `bsub -Is`; job names start with rr_. (2) Never kill jobs you did not submit, never kill a RUNNING job of another stream. (3) No git commit/push. (4) Do not touch ~/.netrc, ~/.config/wandb or the global WANDB_API_KEY; runners `source /proj/dmfexp/zwhong/rsm_rise/wandb_env.sh` (W&B entity richardrl, project rsm_rise, key in .wandb_key; never print it). (5) Envs: RISE conda env via `source scripts/env.sh`; RSM code at /proj/dmfexp/zwhong/projs/issue_resolver_richardrl/gen_q_rsm/rsm_libero with interpreter /proj/dmfexp/zwhong/rsm_rise/venv_rsm/bin/python. (6) Work until your assignment is done or blocked by something outside your control; poll cluster jobs with bjobs/bpeek and the log files, never sleep-loop faster than every 2 minutes.
CONTINUITY: you are re-run every ~30 minutes with this same brief. Each run: read your status file's last sections (especially any "ORCHESTRATOR INSTRUCTION/NOTE" and your own last "## REPORT"), check the cluster state, do the next concrete actions, append a short timestamped "## REPORT" section, and exit. Do not wait for long-running jobs inside a run (no sleep loops beyond a few minutes) — the next run will pick them up.
# 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_<tag>
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.