Skip to content

feat: warn when reward_scale changes mid-block in the backfill - #219

Draft
tabedzki wants to merge 1 commit into
masterfrom
tabedzki/feat/warn-mid-block-reward-scale
Draft

tabedzki wants to merge 1 commit into
masterfrom
tabedzki/feat/warn-mid-block-reward-scale

Conversation

@tabedzki

Copy link
Copy Markdown
Contributor

🤖 AI text below 🤖

Problem

behavior.TowersBlock.reward_scale holds only the scale of the block's first trial (TowersBlock.m: block.trial(1).rewardScale), but ViRMEn can change the scale mid-block, and the database has no per-trial column. For example, one 217-trial block starts at 1.5 and runs at 3.0 from trial 91. The backfill stores 1.5, following the same rule, and nothing told the user.

Change

scripts/backfill_reward_scale.py now lists the blocks whose scale changes mid-block at the end of the run, and the help text says what the stored value means. It doesn't change what gets written.

--- WARNING: reward scale changes mid-block in 8 block(s), 7 of them with verdict ok ---
  reward_scale stores only the first trial's value, so it does not describe the later trials of these blocks.
  <subject> 2021-10-19 #0 block 1 (217 trials): first trial 1.5, then 1.7 at trial 90, 3 at trial 91

The helpers are read_trial_scales and scale_changes in u19_pipeline/utils/reward_scale_backfill.py.

Evidence

Merge Danger

Door: two-way

Blast Radius: low. Only the output of an audit/backfill script run by hand changes. Independent of #218, but #218 should go in before the script is run with an account that can create tables.

Assisted-by: ClaudeCode:claude-opus-5-5

TowersBlock.reward_scale holds only the first trial's scale, but ViRMEn can
change the scale mid-block, so the stored value doesn't describe every trial.
Count and list those blocks at the end of the run, and say so in the help text.

Assisted-by: ClaudeCode:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant