Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Initial observation padding changes when source arrays are reused

未关闭 适合新手
#559 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
85/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
numpy, python

调研方向

从 dm_control/composer/observation/obs_buffer.py 和 Buffer 的 padding 路径开始;先运行 issue 的 NumPy reproduction。检查现有对常规插入 observation 的处理,以及报告中描述的 updater 路径,然后验证 source array 或 simulation state 发生变化后 initial padding 仍保持不变,同时 ordering、zero padding、sizes 和后续 observations 仍保持完整。

由索引模型根据 Issue 内容生成。

描述

Reproduction

Initial-value observation padding retains a reference to the caller's array. Reusing that array changes the apparent initial observations, although normally inserted observations are copied.

import numpy as np
from dm_control.composer.observation.obs_buffer import Buffer

source = np.array([3., 7.])
buffer = Buffer(3, source.shape, source.dtype, pad_with_initial_value=True)
buffer.insert(timestamp=0, delay=0, value=source)
source[:] = -1
print(buffer.read(0))
# [[-1., -1.], [-1., -1.], [3., 7.]]
# Expected three copies of [3., 7.].

With a delayed first sample, all padding entries can change before that sample arrives. The same behavior occurs through the actual observation Updater when a Generic observable exposes physics.data.qpos: advancing MuJoCo rewrites padding intended to represent the initial state, including when mean aggregation is used.

Expected behavior

Snapshot the initial value before using it to fill the padding entries, consistently with regular inserted observations. Preserve arrival ordering, zero padding, buffer sizes, source data and subsequent observations.

Reproduced on main at a04e3e4cf56c12117d2294bb090f9acec21e5c67. The regression uses real buffer/updater code and a minimal native MuJoCo simulation, without rendering or trained agents.

主要语言
Python
星标
4.7k
派生
765
PR 合并指标
30 天内没有已合并 PR

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google-deepmind/dm_control 的其他 Issue

查看 google-deepmind/dm_control 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。