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
分支
768
PR 合併指標
30 天內沒有已合併 PR

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  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 摘要。